Closed dschlaep closed 4 years ago
Thanks for catching this! I updated glmPQL with the modification you suggested and committed the changes just a second ago. Please let me know if you run into any more issues.
That works beautifully. Thanks for your ultra-fast response and fix!
I have a situation where I programmatically create model formulae with
as.formula
andpaste
(see examples foras.formula
) -- unfortunately, the functionr2beta
(more preciselyglmPQL
) currently fails for such model fits.I installed the latest version of
r2glmm
today from github.Below is an example where I fit a GLM in three ways that all produce the same model fits, but only one works with the current
r2beta
.I suggest to fix this from the function
r2glmm:::glmPQL
by usingwhich returns the evaluated formula (i.e., of class "formula", see
?formula
andstats:::formula.glm
) to replace the current codewhich returns the object passed to
glm
(i.e.,fit0[["call"]][["formula"]]
) which may be unevaluated and not of class "formula".Thanks!
Obviously, I could hack my fit so that
glm
"has" the evaluated formula forr2glmm:::glmPQL
to extract, but it would be nice ifr2beta
would work with normal calls as well!