[R] residual and null deviance of an lme object with correlation structure

Spencer Graves spencer.graves at pdf.com
Mon Dec 19 00:57:31 CET 2005


	  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




More information about the R-help mailing list