2

my question relates to this post: Extracting slopes for cases from a mixed effects model (lme4)

with Sven Hohenstein's great explanation. My question is: how do I extract/interpret individual coefs if I have an additional 2nd level predictor? My random slope model with cross-level-interaction:

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-5.3837 -0.4603 -0.0878  0.3895  5.1209

Random effects: Groups Name Variance Std.Dev. Corr CODE (Intercept) 0.28950 0.5381
MZP.log 0.04025 0.2006 -0.38 Residual 0.09409 0.3067
Number of obs: 13866, groups: CODE, 3917

Fixed effects: Estimate Std. Error df t value Pr(>|t|)
(Intercept) 9.925e-01 9.822e-03 3.936e+03 101.055 < 2e-16 *** MZP.log -1.771e-01 5.634e-03 4.615e+03 -31.432 < 2e-16 *** ABS002P1.cgm 5.658e-03 5.767e-04 3.884e+03 9.811 < 2e-16 *** MZP.log:ABS002P1.cgm 1.192e-03 3.235e-04 3.709e+03 3.686 0.000231 ***

Correlation of Fixed Effects: (Intr) MZP.lg ABS002 MZP.log -0.510
ABS002P1.cg -0.009 0.041
MZP.:ABS002 0.045 -0.223 -0.502

I get individual coefs using coef(RS.L2)$CODE which gives:

                          (Intercept)    MZP.log   ABS002P1.cgm  MZP.log:ABS002P1.cgm
==AM0MDMx0CM4ETM0ITZmV2a   1.4243088 -0.1719496549   0.00565832          0.001192448
==AM0UDMx0SO5cDM4EDajVma   1.9458975 -0.0529674147   0.00565832          0.001192448
==AM1cDMx0SN1ATM1ITdnlGZ   0.8161014 -0.1141229315   0.00565832          0.001192448
==AM1ITM0AzV               0.4187989 -0.0886104357   0.00565832          0.001192448
==AM2ADMx0iN5kDMxEjcmVGa   1.1081334 -0.2264506549   0.00565832          0.001192448
==AM2gDMzAjR               0.8997179 -0.2053793890   0.00565832          0.001192448
==AM2IDM0AjQ               0.6851151 -0.2432147380   0.00565832          0.001192448
==AM2kDMwMDajxWZ           0.9268792 -0.0418086190   0.00565832          0.001192448
==AM2UDM3ATYtVGb           0.8382071 -0.1377587548   0.00565832          0.001192448
...

what I don't understand: are the first two columns (Intercept and MZP.Log) a combination of fixed and random effects? I assume yes, but to what part in the final equation

Yti = Beta00 + Beta10 * MZP.Log-ti + Beta01 * ABS002P1.cgm-i + Beta11 * MZP.Log-ti * ABS002P1.cgm-i + r1-i * MZP.Log-ti + r0-i + e-ti

do they refer? Would (Intercept) = Beta00 + r0-i and MZP.Log = Beta10 + r1-i? My aim is to illustrate an individual equation for a specific person (CODE).

I am deeply grateful for any help!

1 Answers1

4

The thing you are missing here is the output of ranef(RS.L2).

This should give you 2 columns of numbers that are the individual random effects for each level of CODE for the intercept and MZP.log

For example, for the first level of CODE (==AM0MDMx0CM4ETM0ITZmV2a) the random effect for the intercept should be be 1.4243088 - 9.925e-01 = 0.4318088

That is the individual intercept for a particular level of CODE is equal to the global intercept plus the random effect for that level of CODE. Likewise for MZP.log

Robert Long
  • 60,630