W10: LMMs - Moderation and Comparisons Flashcards
The “j” subscript on intercept (b0) includes what kind of effects?
yij = b0j + b1 * x1j + eij
- Fixed effect (mean intercept) and
- Random effect (individual unit deviations)
What does the “i” and “j” subscript on the outcome (y) mean?
yij = b0j + b1 * x1j + eij
Outcome varies within and between people
What does regression coefficient (b1) without any subscripts mean:
yij = b0j + b1 * x1j + eij
Fixed effect only
What does the “j” subscript on the predictor (x) mean?
yij = b0j + b1 * x1j + eij
It’s a between person variable/predictor only
What does the “i” and “j” subscript on the predictor (x) mean?
yij = b0j + b1 * x1j + b2 * x2ij + eij
It’s a between and within person variable/predictor
If the predictors (x) has “i” subscript, this means the outcome (y) must..
vary within units/people too
What does the subscript “i” mean?
Smallest unit, ith observation for specific unit
E.g on a certain day
What does the subscript “j” mean?
jth unit, usually means person
What does the “i” and “j” subscript on the residuals (e) mean?
yij = b0j + b1 * x1j + b2 * x2ij + eij
They vary within and between units/persons
A between variable can have what kinds of effect(s)?
Fixed effect only
A within variable can have what kinds of effect(s)?
- Fixed effect only
- Fixed and random effects
The “j” subscript on the regression coefficient (b2) means what for the predictor?
yij = b0j + b1 * x1j + b2j * x2ij + eij
It controls predictor to be a random effect (but also as a fixed effect)
lmer(y ~ x + dstress + (dStress | ID) )
Why does subscript “i” have to come with subscript “j” on PREDICTORS (x)?
Random effects have their own fixed effect/average
What does the following show:
b2 * x2ij
Fixed effect slope for a within person variable
but the variable can have random slope if b2 is b2j
What is the corresponding code for this using lmer():
energy ij = b0j + b1 * loneliness j + eij
lmer(energy ~ loneliness + (1 | ID) )
Will “Bstress” have “i” and/or “j” subscript?
What subscripts can the regression coefficient (b) have for it?
Bstress has j subscript only (between person variable)
No subscripts for b, only fixed effects allowed
Will “Wstress” have “i” and/or “j” subscript?
What subscripts can the regression coefficient (b) have for it?
Wstress have i and j subscripts (within person variable)
b can have no subscript (fixed) or j subscript (fixed and random effect)
What is a cross level interaction?
Interaction of a between and within person variable
E.g b3 * (xj * xij)
How do you interpret the following:
energyij = b0j + b1 * lonelinessj + (b2 + b3 * lonelinessj) * stressij + eij
- Simple effect of stress on energy varies by /depends on loneliness
- Association between DAILY stress (within) and energy on SAME DAY depends on loneliness of participants that SAME DAY
How do you interpret the following:
energyij = b0j + (b1+ b3 * stressij) * lonelinessj + b2 * stressij + eij
- Simple effect of loneliness on energy varies by / depends on stress
- Association between AVERAGE loneliness (fixed) and AVERAGE energy depends on SAME DAY stress
What are between unit interactions?
What subscripts do those variables (x’s) have?
Interactions with between person variables only
x’s only have j subscript
How do you interpret the following:
energyij = b0j + (b1+ b3 * sexj) * lonelinessj + b2 * sexj + eij
- Simple effect of loneliness varies by / depends on sex
- Association between AVERAGE loneliness and AVERAGE energy depends on participant’s sex
What are within unit interactions?
What subscripts do those variables (x’s) have?
- Interactions with within person variables only
- x’s have both i and j subscripts
How do you interpret the following:
energyij = b0j + (b1+ b3 * stressj) * SEij + b2 * stressij + eij
- Simple effects of SE on energy varies by / depends on stress
- Association of DAILY SE and SAME DAY energy depends on how stressed someone is on a given day
What are continuous interactions?
- Interactions with variables that have multiple/repeated observations
- Can have random effects (slopes / intercepts)
What should you do if there is no significant interaction term in your model?
Remove the interaction term, re-run model, analyze main effects on their own
When plotting a continuous interactions model, what does the moderator show as and what the variable being moderated show as?
Moderator is showed as breaks (different regression lines)
Variable being moderated is on the x axis
When putting multiple model results side by side together using list(), what are the 3 things they’re helpful for comparing?
APAStyler(list(
Energy = modelTest(m), 1st model
Mood = modelTest(mtest1) 2nd model
- Compare models with and w/o covariates
- Compare if removing EVs change results substantially
- Compare models with different outcomes (y)