8.4 Extract parameter estimates
Next, in preparation for the power analysis, we extract all the parameter estimates from the model we have fit above. The parameters are:
- The two fixed effects (the \(\beta\) parameters)
- The residuals’ standard deviation
- The standard deviations of the subject intercept and slope adjustments, and the corresponding correlation matrix.
- The standard deviations of the item intercept and slope adjustments, and the corresponding correlation matrix.
The correlation matrices and the subject/item random effects standard deviations are used to assemble the variance covariance matrix; this is done using the sdcor2cov
function from the SIN
package; recall the discussion in chapter 1. For the variance covariance matrix for items random effects, we use an intermediate value of 0.5 for the correlation parameter because the linear mixed model was unable to estimate the parameter.
<- lmer(logrt ~ so +
m 1 + so | subject) +
(1 + so | item),
(data = gg05e1,
## "switch off" warnings:
control = lmerControl(calc.derivs = FALSE)
)
## boundary (singular) fit: see help('isSingular')
## extract parameter estimates:
<- round(summary(m)$coefficients[, 1], 4)
beta <- round(attr(VarCorr(m), "sc"), 2)
sigma_e <- round(attr(VarCorr(m)$subject, "stddev"), 4)
subj_ranefsd <- round(attr(VarCorr(m)$subject, "corr"), 1)
subj_ranefcorr
## assemble variance-covariance matrix for subjects:
<- SIN::sdcor2cov(
Sigma_u stddev = subj_ranefsd,
corr = subj_ranefcorr
)
<- round(attr(VarCorr(m)$item, "stddev"), 4)
item_ranefsd <- round(attr(VarCorr(m)$item, "corr"), 1)
item_ranefcorr
## assemble variance matrix for items:
## choose some intermediate values for correlations:
<- (diag(2) + matrix(rep(1, 4), ncol = 2)) / 2
corr_matrix
<- SIN::sdcor2cov(
Sigma_w stddev = item_ranefsd,
corr = corr_matrix
)