W8: LMM Part 1 Flashcards
What do you use egltabe( c (“loneliness”, “sex”), data =d, strict = FALSE) for?
To get summary descriptive statistics
When using egltable() and plot(testDistribution) for BETWEEN variables, there is a problem of weighted means. How do you solve that?
Remove duplicate IDs
* egltable(c(“loneliness”, “sex”), data =
dm[!duplicated( ID ) ] )
* plot(testDistribution(
dm [!duplicated( ID )]$loneliness) )
When getting descriptives for continuous RM (within) variables, there is an issue of including total variance (between and within). How do you only calculate the mean of individual means (between units only)?
Create between and within variables using meanDeviations()
m[, c(“Bstress”, “Wstress”) := meanDeviations(dStress), by = ID]
then calculate as usual:
egltable(c(“Bstress”), data = dm[!duplicated(ID)])
If we want descriptives of mean for all observations (regardless of between or within), do we use dstress or bstress?
egltable(c(“dStress”), data = dm)
includes both between + within variance (possible unequal weights participants)
What are 2 ways to group calculation of between unit variance for continuous RM variables
Group by days
egltable(c(“dStress”), g = “SurveyDay”, data = dm)
* or indicate individual timepoints
egltable(c(“dStress”), data = dm[SurveyDay == 1])
For descriptives of categorical (within) RM variables, what are they normally reported as?
Frequencies (N) or percentages (%)
e.g using overall variable: egltable(“Int_Fri”, data = dm, strict = FALSE)
What are the 2 common estimators used with LMMs?
- Maximum Likelihood (ML): population variance
REML = FALSE - Restricted Maximum Likelihood (REML): population variance from sample, less biased
REML = TRUE
What is ML used for?
Model comparisons
What are 2 main uses of random intercept models?
- Model comparison (how much better complex model fits)
- Calculate ICC
“scaled Pearson residuals” from lmer() output is useful to identify what?
Outliers based on “Min” (lowest residual) and “Max” (maximum residual)
Std. Dev of “random intercept” from lmer() output represents what for a random intercept only model?
The average difference between individual’s average score and population average score of variable
Std. Dev of “random residuals” from lmer() output represents what?
Average difference between individual score and predicted score of variable
How do you calculate confidence intervals for random effects?
Using profile likelihood confidence intervals
confint(x, method = “profile”, oldNames = FALSE)
Do we need to check if linear association between predictor and outcome is appropriate for intercept only models?
No
When interpreting that there are individual differences, do we refer to standard deviation of random intercept or random residuals?
SD of random intercept