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.

m <- lmer(logrt ~ so +
  (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:
beta <- round(summary(m)$coefficients[, 1], 4)
sigma_e <- round(attr(VarCorr(m), "sc"), 2)
subj_ranefsd <- round(attr(VarCorr(m)$subject, "stddev"), 4)
subj_ranefcorr <- round(attr(VarCorr(m)$subject, "corr"), 1)

## assemble variance-covariance matrix for subjects:
Sigma_u <- SIN::sdcor2cov(
  stddev = subj_ranefsd,
  corr = subj_ranefcorr
)

item_ranefsd <- round(attr(VarCorr(m)$item, "stddev"), 4)
item_ranefcorr <- round(attr(VarCorr(m)$item, "corr"), 1)

## assemble variance matrix for items:

## choose some intermediate values for correlations:
corr_matrix <- (diag(2) + matrix(rep(1, 4), ncol = 2)) / 2

Sigma_w <- SIN::sdcor2cov(
  stddev = item_ranefsd,
  corr = corr_matrix
)