Open MichaelChirico opened 4 years ago
Thank you, Ben.
At least this is a very old bug. I've checked a 2005 version of R's nlme...
Further suggestions {what are the correct 'df' ???} are welcome.
Or should we (R-core) just update the documentation with its "suggestion" ?
(In reply to Martin Maechler from comment #1)
Thank you, Ben.
At least this is a *very* old bug. I've checked a 2005 version of R's nlme...
Further suggestions {what are the correct 'df' ???} are welcome.
Or should we (R-core) just update the documentation with its "suggestion" ?
I would think that the correct df.residuals would be a vector, equivalent to whatever would have been estimated for the individual group fits (i.e. nobs per group - npar per group). If having length(df.residuals)>1 would mess things up elsewhere, then intervals.lmList should probably just compute these values itself (rather than expecting it to be in the summary object)
?intervals.lmList suggests that we can get un-pooled confidence intervals on the fly:
However, intervals.lmList doesn't seem to work for unpooled SE estimates, whether the unpooling is specified in the original model or as an override argument.
library(nlme) fm1 <- lmList(heigh∼age|Subject, Oxboys) ## pool=TRUE (default) fm2 <- lmList(heigh∼age|Subject, Oxboys, pool=FALSE) i1 <- intervals(fm1) ## works (uses pooled SE) attr(fm1,"pool") ## TRUE attr(fm2,"pool") ## FALSE
intervals(fm1,pool=FALSE) ## Error in qf(level, 1, smry$df.residual) : ## Non-numeric argument to mathematical function intervals(fm2) ## same error
The proximal problem seems to be that summary.lme gives a NULL df.residual when pool=FALSE ...
summary(fm1)$df.residual ## TRUE summary(fm1, pool=FALSE)$df.residual ## NULL
METADATA