Hello,

I hope I posted this message in the right list.

I'm using the package coxme, and I'm wondering why the function anova.coxme() does not work on a single model (so as to get the deviance table).
I'm running R version 3.0.0 with R-Studio version 0.97.336, and the coxme package version 2.2-3 (i.e. all the latest possible versions).
The version of the associated packages, which are mentioned in the help file, are:  "survival" version 2.37.4, "bdsmatrix" version 1.3-1, "Matrix" version 1.0-12.

The errors messages I get:
When I type:                      anova.coxme(model, test="Chisq"), I get                                                                                                             "Error: could not find function "anova.coxme" "
When I type :                     anova(model, test="Chisq"), I get                                                                                                                            "Error in formula.default(object, env = baseenv()) : invalid formula "
When I type:                      coxme:::anova.coxme(model, test="Chisq"), I also get                                                                                 "Error in formula.default(object, env = baseenv()) : invalid formula "
And when I type:             coxme::anova.coxme(model, test="Chisq") (here with two ":" only instead of three), I get                 "Error: 'anova.coxme' is not an exported object from 'namespace:coxme'"

My models are running well, and the results make sense.
So does anybody have an idea, whether these failures could be due to R, or whether these methods are not implemented yet?
Still, when typing:  methods(class=class(model)), I get:
# [1] anova.coxme*   fixef.coxme*   print.coxme*   ranef.coxme*   VarCorr.coxme* vcov.coxme*
# Non-visible functions are asterisked
So I'm really wondering what's going on, since anova.coxme() should be present.


However, anova(model1, model2) works, so I tried to write a function where I sequentially add in turn each term of the model and apply the anova function on both models.
Because this function does not specify the models explicitly, but via an object ("MyFormulas") containing all combinations of the factors :
     MODELa <- coxme(as.formula(MyFormulas[[i]]), data=DATA, na.action=na.exclude)
    MODELb <- coxme(as.formula(MyFormulas [[i+1]]), data=DATA, na.action=na.exclude),
calling anova(MODELa , MODELb) gives an error message:  "In survival:::anova.coxmelist(c(list(object), dotargs), test = test) :   Models with response " MyFormulas [[i + 1]]" removed because response differs from model 1".
I *guess* this is related to the fact that the outputs of MODELa and MODELb indicate:
"Model: MyFormulas [[i]]" INSTEAD OF  Surv(Time1st, Status1st) ~ DevSeeds + AltGroup + ValleyGroup + (1 | BigRegion)
and "Model: MyFormulas [[i + 1]]" instead of Surv(Time1st, Status1st) ~ DevSeeds + AltGroup + ValleyGroup +   AltGroup:ValleyGroup + (1 | BigRegion)
... but I cannot overcome this issue.

If anybody had an idea, I would be very happy...

Regards,
Philippe


###########################
Philippe Matter
Ecosystem Management  - ETH Zürich, Switzerland
http://www.ecology.ethz.ch


	[[alternative HTML version deleted]]

