My question is:
Is there a way to either force Anova()
to somehow analyze gls
objects (which internally are almost identical to lme
objects), or force Anova()
to honor the test.statistics='F'
argument, or at least do a valid type-II sum of squares by hand on an lme
and a gls
object?
Why:
I'm trying to get Anova output in the same format for an lm
or aov
or gls
object and an lme
object that uses the same fixed effects formula but in addition has random effects. If I use Anova()
from the car
package, I get F-statistics for aov
and lm
objects but Chi-square statistics for lme
objects, and it doesn't work at all for gls
objects [1].
If I use anova.gls()
and anova.lme()
then they do both return F-statistics, but they use type-III or type-I sum of squares and I'm trying to use type-II.
[1]: Gives error Error in eval(expr, envir, enclos) : object 'y' not found
where y is the response variable... this can be traced to the attribute for model.matrix()
for gls
objects failing to have an assign
attribute.
gls
fitted models: stats.stackexchange.com/a/53041/8402 $\endgroup$