Corey Bradshaw
2005-Dec-15 06:09 UTC
[R] residual and null deviance of an lme object with correlation structure
Hello, I am attempting to calculate the residual and null deviance of an lme object that includes a corAR1 correlation structure. I tried deviance(lme.object) and it only returned NULL. Can anyone help? Thank you. Corey Bradshaw
Spencer Graves
2005-Dec-18 23:57 UTC
[R] residual and null deviance of an lme object with correlation structure
To find generic functions with special methods written for objects of class "lme", I used "methods": > library(nlme) > methods(class="lme") [1] ACF.lme* anova.lme augPred.lme* [4] BIC.lme* coef.lme* comparePred.lme* [7] fitted.lme* fixef.lme* formula.lme* [10] getData.lme* getGroups.lme* getGroupsFormula.lme* [13] getResponse.lme* getVarCov.lme* intervals.lme* [16] logLik.lme* pairs.lme* plot.lme [19] predict.lme* print.anova.lme* print.lme* [22] qqnorm.lme* ranef.lme* residuals.lme* [25] simulate.lme summary.lme* update.lme* [28] VarCorr.lme* Variogram.lme* vcov.lme* Non-visible functions are asterisked At least in many contexts, the deviance is (-2)*log(likelihood). If that is what you want, then (-2)*logLik.lme should get that for you, as with the following modification of the example from the documentation for logLik.lme: > fm1 <- lme(distance ~ Sex * age, Orthodont, random = ~ age, method = "ML") > (-2)*logLik(fm1) [1] 427.8060 ... hope this helps, spencer graves Corey Bradshaw wrote:> Hello, > > I am attempting to calculate the residual and null deviance of an lme > object that includes a corAR1 correlation structure. I tried > deviance(lme.object) and it only returned NULL. Can anyone help? Thank > you. > > Corey Bradshaw > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html-- Spencer Graves, PhD Senior Development Engineer PDF Solutions, Inc. 333 West San Carlos Street Suite 700 San Jose, CA 95110, USA spencer.graves at pdf.com www.pdf.com <http://www.pdf.com> Tel: 408-938-4420 Fax: 408-280-7915