1

I asked this question earlier this week but I hadn't really done my research yet or inquired into my error. So my data is heteroscedastic which has necessitated computation of robust standard errors to account for the violation. This is what my model looks like (as implemented in R)

TD_PE_analysis1_v2 <- lmer(PE ~ learn_prof * trial * condition + (1|subject) + (1|image), data = td_pref_all)

I then used clubSandwich to generate my new robust standard errors but it became clear to me that my random effects structure was incompatible with clubSandwich. I found a stack overflow thread below that seems to suggest that it's either impossible altogether or not possible with clubSandwich in R to compute robust SEs for models with non-nested random effects. I guess my question is whether there is a statistical methodology to get robust SEs with a model with crossed or non-nested random effects? Could this be some idiosyncrasy just with the clubSandwich package in R and statistically this can be done by some other method? I can't seem to find a clear suggestion for how to approach this problem.

https://stackoverflow.com/questions/72971844/cluster-robust-standard-errors-for-lmer-and-glmer-in-stargazer-lme4-package

  • May I suggest you consider using nlme::lme and modelling heterogeneity using a variance structure (which that package supports)? Specification of crossed random effects is a bit challenging with the nlme package but it is possible. – Roland Dec 05 '23 at 11:26
  • I agree with @Roland but I would suggest using the mmrm or glmmTMB packages which support covariance structures such as AR(1), Toeplitz and unstructured. These packages are much easier to use than nlme, (they use the same syntax as lme4) and they support crossed random effects "out of the box". – Robert Long Dec 05 '23 at 20:35

0 Answers0