kollerma / robustlmm

This is an R-package for fitting linear mixed effects models in a robust manner. The method is based on the robustification of the scoring equations and an application of the Design Adaptive Scale approach.
28 stars 9 forks source link

rlmer() failing #13

Closed mlsethi closed 3 years ago

mlsethi commented 3 years ago

Hi, thanks so much for all you do! I would be much obliged for any help with the following:

I'm trying to estimate robust standard errors for a GLMM that I know has heteroscedastic residuals.

This is the model structure I want to use, which works with lmer() in lme4:


robust <- rlmer(outcome ~ fixed1*fixed2*fixed3 + fixed4 + (fixed2|random1),
                       data = mydf)

And this is the message I get when I try to run it (the function fails, in that it doesn't produce an object).

boundary (singular) fit: see ?isSingular
Error in calcTau.nondiag(lobj, ghZ, ghw, .S(lobj), kappas, max.iter, rel.tol = rel.tol,  : 
  yes, do as promised
In addition: Warning messages:
1: In .rlmerInit(lcall, pf, formula, data, method, rho.e, rho.b, rho.sigma.e,  :
  Method 'DAStau' does not support blocks of size larger than 2. Falling back to method 'DASvar'.
2: In calcTau.nondiag(lobj, ghZ, ghw, .S(lobj), kappas, max.iter, rel.tol = rel.tol,  :
  DAStau for blocks of dimension > 2 not defined, falling back to DASvar

Warning messages aside, can you help me understand the error that's causing the whole shebang to fail?

Thanks again!

kollerma commented 3 years ago

Dear Meera Lee Sethi

As the warning states, you cannot use method = "DAStau" for such a complex model. The fallback isn't actually implemented. You can get around that by specifying method = "DASvar" in the call.

Even though there are not a lot of details in your query, it appears that rlmer is not the right tool for the job in this case. rlmer is for continuous outcomes that don't need a link function. The method is robust against deviations from the central model. The central model is assumed to follow the regular classic linear mixed effects model assumptions. A GLMM in general is a different model, governed by different assumptions.

Best, Manuel

mlsethi commented 3 years ago

Hi Manuel Koller,

Thank you for the note about the fallback not being implemented, and for the caution! I find the acronyms for these models pretty confusing, so I may have misspoken; my outcome is actually continuous and I'm not using a link function, even though I've been fitting it with lme4. Anyway, I've probably got a bit more work to do to make sure I'm making the right decisions, so thanks again for the help.

Cheers, m