W7: Intro LMM Flashcards
What is the assumption that can be relaxed when using linear mixed models instead of linear regression models?
The assumption of independent observations and residual errors
What are 2 examples of non-independent observations used by LMMs?
- Repeated measures (e.g longitudinal studies)
- Individuals as clusters / groups (e.g people within families / schools = cluster within higher order unit)
In an intercept only model, what does the intercept represent?
Unconditional (not conditioned on predictors) expectation of y
Same as the mean of y
What are the predictors in this equation:
lm( hp ~ 1 + mpg, data = mtcars) )
1 (the intercept) and mpg (explanatory variable)
What does inclusion of fixed intercept assume for the mean of residuals?
Mean of residuals will be 0
What are 2 reasons we fit a constant (fixed intercept) in models?
- Errors will be unbiased
- Regression line will be fit to find its own intercept in a way that minimizes the mean squared error (i.e distance between regression line and all data points)
What happens if we make the constant 0?
lm ( hp ~ 0 + mpg, data = mtcars)
There would be no intercept, leads to biases
What format do we want our LMM data to be?
Long format
1 ID have multiple rows
IDs can have different number of rows
What are 3 conditions of RM data to be met in order to use RM ANOVA to analyze them?
- Discrete time points (E.g T1, T2, T3)
- Everyone has the same number of time points
- Outcome is continuous, normally distributed data
What are 4 things RM ANOVA can’t handle?
- Continuous time (if 1 person completes day 0, 13, 22 and another 0, 1, 20)
- Continuous predictors (e.g age in years)
- Missing data on any time points (completely excluded unless imputation)
- Non-linear outcomes
What are 2 variations linear regression can’t capture for non-independent data?
- Different intercepts (mean) by ID (between person variation)
- Different slopes (r-ship between predictor + outcome) by ID (within person variation)
Linear regression has 1 fixed intercept and 1 fixed slope which violates what assumption if it’s used to analyze RM data? This also means it can’t capture what kind of effect?
Violates assumption of independence
Can’t capture random effects (different regression coefficient across people)
Coefficient includes intercept and slope
What are 2 other names for LMMs?
- Multilevel models (MLMs)
- Hierarchical linear models (HLMs)
Why are LMMs called mixed?
Includes both
Fixed effects (reg coeffs identical for everyone) +
Random effects (reg coeffs vary randomly for each ppt)
When do you use H (hierarchical) LMs?
When you have multiple hierarchical levels (different levels of nesting, e.g kids nested within classroom / obsv nested within ppl)
All HLMs are LMMs.
Are all LMMs HLMs?
No
In an intercept only linear regression model, what is the intercept (mean) assumed to be for all IDs?
Identical (fixed)
What is the equation for linear regression, intercept only model?
yi = b0 * 1 + ei
What is the value of M and SD for fixed effects?
M = estimated mean
SD = 0 (no variation in everybody’s intercept, identical)
What is the value of M and SD for random effects?
M = estimated mean
SD = estimated SD (SD is free to vary, can be > 0, individual variations in intercept/mean)
With mixed models, the total variance is composed of 2 variabilities:
Between (intercept) +
Within (slope) person variations.
The ratio of between variance to total variance is captured by what?
Intraclass correlation coefficient (ICC)
Varies from 0 to 1