Recent from talks
Contribute something
Nothing was collected or created yet.
Random effects model
View on Wikipedia| Part of a series on |
| Regression analysis |
|---|
| Models |
| Estimation |
| Background |
In econometrics, a random effects model, also called a variance components model, is a statistical model where the model effects are random variables. It is a kind of hierarchical linear model, which assumes that the data being analysed are drawn from a hierarchy of different populations whose differences relate to that hierarchy. A random effects model is a special case of a mixed model.
Contrast this to the biostatistics definitions,[1][2][3][4][5] as biostatisticians use "fixed" and "random" effects to respectively refer to the population-average and subject-specific effects (and where the latter are generally assumed to be unknown, latent variables).
Qualitative description
[edit]Random effect models assist in controlling for unobserved heterogeneity when the heterogeneity is constant over time and not correlated with independent variables. This constant can be removed from longitudinal data through differencing, since taking a first difference will remove any time invariant components of the model.[6]
Two common assumptions can be made about the individual specific effect: the random effects assumption and the fixed effects assumption. The random effects assumption is that the individual unobserved heterogeneity is uncorrelated with the independent variables. The fixed effect assumption is that the individual specific effect is correlated with the independent variables.[6]
If the random effects assumption holds, the random effects estimator is more efficient than the fixed effects model.
Simple example
[edit]Suppose large elementary schools are chosen randomly from among thousands in a large country. Suppose also that pupils of the same age are chosen randomly at each selected school. Their scores on a standard aptitude test are ascertained. Let be the score of the -th pupil at the -th school.
A simple way to model this variable is
where is the average test score for the entire population.
In this model is the school-specific random effect: it measures the difference between the average score at school and the average score in the entire country. The term is the individual-specific random effect, i.e., it's the deviation of the -th pupil's score from the average for the -th school.
The model can be augmented by including additional explanatory variables, which would capture differences in scores among different groups. For example:
where is a binary dummy variable and records, say, the average education level of a child's parents. This is a mixed model, not a purely random effects model, as it introduces fixed-effects terms for Sex and Parents' Education.
Variance components
[edit]The variance of is the sum of the variances and of and respectively.
Let
be the average, not of all scores at the -th school, but of those at the -th school that are included in the random sample. Let
be the grand average.
Let
be respectively the sum of squares due to differences within groups and the sum of squares due to difference between groups. Then it can be shown [citation needed] that
and
These "expected mean squares" can be used as the basis for estimation of the "variance components" and .
The parameter is also called the intraclass correlation coefficient.
Marginal likelihood
[edit]This article may require cleanup to meet Wikipedia's quality standards. The specific problem is: need to show formulas. (April 2024) |
For random effects models the marginal likelihoods are important.[7]
Applications
[edit]Random effects models used in practice include the Bühlmann model of insurance contracts and the Fay-Herriot model used for small area estimation.
See also
[edit]Further reading
[edit]- Baltagi, Badi H. (2008). Econometric Analysis of Panel Data (4th ed.). New York, NY: Wiley. pp. 17–22. ISBN 978-0-470-51886-1.
- Hsiao, Cheng (2003). Analysis of Panel Data (2nd ed.). New York, NY: Cambridge University Press. pp. 73–92. ISBN 0-521-52271-4.
- Wooldridge, Jeffrey M. (2002). Econometric Analysis of Cross Section and Panel Data. Cambridge, MA: MIT Press. pp. 257–265. ISBN 0-262-23219-7.
- Gomes, Dylan G.E. (20 January 2022). "Should I use fixed effects or random effects when I have fewer than five levels of a grouping factor in a mixed-effects model?". PeerJ. 10 e12794. doi:10.7717/peerj.12794. PMC 8784019. PMID 35116198.
References
[edit]- ^ Diggle, Peter J.; Heagerty, Patrick; Liang, Kung-Yee; Zeger, Scott L. (2002). Analysis of Longitudinal Data (2nd ed.). Oxford University Press. pp. 169–171. ISBN 0-19-852484-6.
- ^ Fitzmaurice, Garrett M.; Laird, Nan M.; Ware, James H. (2004). Applied Longitudinal Analysis. Hoboken: John Wiley & Sons. pp. 326–328. ISBN 0-471-21487-6.
- ^ Laird, Nan M.; Ware, James H. (1982). "Random-Effects Models for Longitudinal Data". Biometrics. 38 (4): 963–974. doi:10.2307/2529876. JSTOR 2529876. PMID 7168798.
- ^ Gardiner, Joseph C.; Luo, Zhehui; Roman, Lee Anne (2009). "Fixed effects, random effects and GEE: What are the differences?". Statistics in Medicine. 28 (2): 221–239. doi:10.1002/sim.3478. PMID 19012297.
- ^ Gomes, Dylan G.E. (20 January 2022). "Should I use fixed effects or random effects when I have fewer than five levels of a grouping factor in a mixed-effects model?". PeerJ. 10 e12794. doi:10.7717/peerj.12794. PMC 8784019. PMID 35116198.
- ^ a b Wooldridge, Jeffrey (2010). Econometric analysis of cross section and panel data (2nd ed.). Cambridge, Mass.: MIT Press. p. 252. ISBN 978-0-262-23258-6. OCLC 627701062.
- ^ Hedeker, D., Gibbons, R. D. (2006). Longitudinal Data Analysis. Deutschland: Wiley. Page 163 https://books.google.com/books?id=f9p9iIgzQSQC&pg=PA163
External links
[edit]Random effects model
View on GrokipediaFundamentals
Definition and Qualitative Description
A random effects model is a statistical framework in which certain model parameters, such as intercepts or slopes, are treated as random variables drawn from a specified probability distribution, enabling the incorporation of unobserved heterogeneity or variation across groups, individuals, or units in the data.[5] This approach allows the model to account for clustering or correlation in observations that arise from shared unmeasured factors, such as repeated measures on the same subject, rather than assuming all observations are independent.[6] Qualitatively, random effects models provide an intuitive way to model data where the levels of a factor are viewed as a random sample from a broader population, rather than fixed and exhaustive categories of interest. For instance, in studying treatment effects across multiple schools, a random effects model treats school-specific deviations as draws from a distribution, capturing natural variation due to unmeasured school characteristics like culture or resources, which induces correlation among students within the same school. In contrast, fixed effects would assume uniform parameters across all units, ignoring such group-level variability. This perspective shifts the focus from estimating specific effects for each level to estimating the overall variance in those effects, facilitating generalizations beyond the observed sample.[5] Key assumptions underlying random effects models include that the random effects follow a normal distribution with mean zero and constant variance, reflecting their role as deviations from the population mean without systematic bias. In models including fixed effects and covariates, the random effects are assumed to be independent of the covariates, ensuring that unobserved heterogeneity does not correlate with observed predictors and supporting unbiased estimation of fixed effects.[5] The origins of random effects models trace back to the development of variance components analysis in the 1940s and 1950s, building on R.A. Fisher's foundational work in the 1920s on analysis of variance for agricultural experiments at Rothamsted Experimental Station, where he introduced methods to partition variance into components attributable to different sources. Frank Yates, collaborating with Fisher, extended these ideas in the 1930s through studies on sampling designs and yield estimation, laying groundwork for handling random variation in experimental data. This evolved into modern mixed-effects models through seminal contributions like the 1982 framework by Laird and Ware, which formalized random effects for longitudinal data analysis.[7][8]Comparison with Fixed Effects Models
Random effects models differ from fixed effects models primarily in the scope of inference and the treatment of factors. In fixed effects models, the levels of a factor are considered fixed and of specific interest to the researcher, with inferences limited to those levels; hypotheses typically test the equality of means across levels (e.g., ). Random effects models, however, treat the levels as a random sample from a larger population, allowing inferences about the population variance of effects (e.g., ) and enabling generalization beyond the observed levels.[5] This distinction is particularly relevant in hierarchical or clustered data, where random effects account for correlation within groups, adjusting estimates and standard errors accordingly. In applications like panel data analysis in econometrics, fixed effects can control for unobserved time-invariant heterogeneity that may correlate with covariates, while random effects assume exogeneity (no such correlation) for efficiency and the ability to estimate time-invariant effects; the Hausman test can help select between them. However, in general statistical contexts such as ANOVA or linear mixed models, the focus remains on the inferential scope rather than bias correction.[9][10]Mathematical Formulation
Basic Model Structure
The random effects model, also known as a linear mixed-effects model, is formulated as a hierarchical linear regression that incorporates both fixed and random effects to account for variation across groups or clusters in the data. In its basic scalar form for the -th observation within the -th group, the model is expressed as where is the response variable, represents the fixed effects contribution with as the vector of fixed-effect parameters, captures the random effects for group with denoting the random effects vector assumed to follow a multivariate normal distribution with mean zero and covariance matrix , and is the residual error term with covariance matrix .[8] This structure allows the model to handle clustered data by treating group-specific deviations as random draws from a population distribution, thereby generalizing fixed effects approaches to induce dependence within groups.[8] The model adopts a two-stage hierarchical interpretation. In the first stage, the conditional distribution of the response given the random effects is specified as , modeling the within-group variability around the group-specific mean. The second stage then specifies the distribution of the random effects themselves as , which introduces between-group variability and ensures that observations within the same group are correlated through the shared term, with the covariance between and (for ) arising from .[8] This hierarchical setup facilitates inference about the fixed effects while borrowing strength across groups via the random effects distribution.[8] In matrix notation, the full model for the stacked response vector across all groups is where is the response vector, is the fixed-effects design matrix, is the random-effects design matrix, is the stacked random effects vector with covariance for groups, and with .[8] The resulting marginal covariance structure of is , which captures the total variability as a combination of random effects and residual components, leading to a marginal normal distribution .[8] Key assumptions underlying this model include the normality of both the random effects and the residuals , independence between and , and, under the common conditional independence assumption, homoscedasticity within groups such that (implying equal residual variances and no additional autocorrelation beyond that induced by the random effects).[8] These assumptions ensure that the induced correlations are solely attributable to the shared random effects within groups, enabling valid likelihood-based inference.[8]Variance Components
In the random effects model, the total variance of the observed response variable is decomposed into two primary components: the between-group variance attributable to the random effects, denoted , and the within-group residual variance, denoted . This partitioning is expressed as where represents the marginal variance of . This decomposition highlights how unobserved heterogeneity across groups contributes to the overall variability in the data, separate from measurement error or other residuals. A key metric derived from this decomposition is the intraclass correlation coefficient (ICC), defined as The ICC quantifies the proportion of total variance explained by the random effects or grouping structure, ranging from 0 (no clustering) to 1 (complete clustering). Values of close to 0 suggest that observations within groups are nearly independent, while higher values indicate stronger dependence due to shared random effects. Conceptually, variance components are estimated by partitioning the total sum of squares into between-group and within-group portions, akin to analysis of variance (ANOVA) procedures, where expected mean squares inform the components under normality assumptions. This approach provides a foundation for interpreting heterogeneity, though detailed estimation techniques are addressed elsewhere. A large relative to signals substantial unobserved heterogeneity among groups, justifying the inclusion of random effects to account for clustering. In balanced designs with equal group sizes, components are readily identifiable from the ANOVA table; however, unbalanced designs introduce complexities, as varying group sizes affect the orthogonality of sums of squares and can complicate the separation of variance sources.Estimation and Inference
Maximum Likelihood Methods
In random effects models, maximum likelihood estimation (MLE) involves maximizing the likelihood function with respect to the fixed effects parameters and the variance-covariance parameters , treating the random effects as nuisance parameters. To obtain a tractable form, the marginal likelihood is constructed by integrating out the random effects , yielding , where is the conditional likelihood of the observed data given , , and , and is the density of the random effects.[11][12] Under normality assumptions for both the random effects and residuals, this integration results in a multivariate normal marginal distribution for the data: , where incorporates the variance components from the random effects design matrix , covariance matrix , and residual covariance .[11] The log-likelihood function is then , where is the sample size. Computing this requires evaluating the determinant and inverse of , which poses numerical challenges for large datasets due to the high dimensionality and potential ill-conditioning of .[11][13] Optimization proceeds iteratively, often using the expectation-maximization (EM) algorithm to handle the integration implicitly. The EM algorithm alternates between an expectation step, computing expected values of the random effects given current parameter estimates, and a maximization step, updating via the generalized least squares estimator and profiling the likelihood for to obtain variance component estimates.[14][12] Under correct model specification and suitable regularity conditions, such as increasing sample size with fixed dimensionality of random effects, the MLEs are consistent and asymptotically normal, with and similar results for . However, in small samples, the MLE tends to underestimate variance components due to the incidental parameters problem.[11]Restricted Maximum Likelihood (REML)
Restricted maximum likelihood (REML) is an estimation method for variance components in random effects models that maximizes the likelihood of a transformed set of contrasts in the data, which are orthogonal to the fixed effects. This approach focuses on the residuals after accounting for fixed effects, providing an unbiased estimate of the variance parameters by effectively removing the influence of the fixed effect estimators from the likelihood function. Introduced by Patterson and Thompson in 1971, REML is particularly valuable in balanced designs where it yields estimators equivalent to those from analysis of variance for variance components. The REML likelihood can be expressed in relation to the maximum likelihood (MLE) aswhere is the number of fixed effects, is the design matrix for fixed effects, and is the variance-covariance matrix depending on the variance components. This adjustment penalizes the likelihood for the degrees of freedom lost in estimating the fixed effects , ensuring that the variance estimates, such as , are unbiased even in small samples.[15] Compared to MLE, REML offers key advantages by reducing downward bias in variance component estimates; for instance, the expected value of the MLE for is , whereas REML corrects this to match the unbiased sample variance in simple cases. This bias correction makes REML the preferred method for hypothesis testing on variance components, as it provides more reliable standard errors and confidence intervals for random effects variances.[16] The estimation procedure for REML mirrors that of MLE, involving iterative optimization techniques such as expectation-maximization (EM) or Newton-Raphson algorithms to maximize the adjusted log-likelihood, often using transformed data contrasts where spans the null space of . In practice, software implements this by profiling out the fixed effects and optimizing over variance parameters alone. For large samples, REML estimators are asymptotically equivalent to MLE, converging to the same values as the number of observations increases.[15] Despite its benefits, REML has limitations, including a lack of invariance to reparameterization of the model, which can affect the bias properties of estimates under different formulations. Additionally, it can be computationally more intensive than MLE in unbalanced designs due to the need to handle the projection matrix explicitly during iterations.[17]
Examples and Applications
Simple Example
To illustrate the random effects model, consider a simulated dataset consisting of test scores for 3 students in each of 5 classrooms, where scores are clustered by classroom.Mixed-Effects Models in S and S-PLUS (Pinheiro and Bates, 2000) The data are generated to reflect a scenario with an overall average performance level and variation both within and between classrooms, as follows:| Classroom | Student 1 | Student 2 | Student 3 | Group Mean |
|---|---|---|---|---|
| 1 | 66 | 68 | 70 | 68 |
| 2 | 68 | 70 | 72 | 70 |
| 3 | 67 | 69 | 71 | 69 |
| 4 | 71 | 73 | 75 | 73 |
| 5 | 68 | 70 | 72 | 70 |
| Overall Mean | 70 |
| Classroom | Fixed Effect Estimate (Group Mean) | Random Effect BLUP (Predicted Intercept) |
|---|---|---|
| 1 | 68 | 68.8 |
| 2 | 70 | 70.0 |
| 3 | 69 | 69.6 |
| 4 | 73 | 71.9 |
| 5 | 70 | 70.0 |
