Compare Likelihoods of Fitted Objects
Usage
anova(object, ..., test, verbose)
Arguments
object
|
a fitted model object inheriting from class lme or
class gls .
|
...
|
other optional fitted model objects inheriting from
classes gls , lm , lme , or lmList .
|
test
|
an optional logical value controlling whether likelihood
ratio tests should be used to compare the fitted models represented
by object and the objects in ... . Defaults to
TRUE .
|
verbose
|
an optional logical value. If TRUE , the calling
sequences for each fitted model object are printed with the rest of
the output, being omitted if verbose = FALSE . Defaults to
FALSE .
|
Description
When only one fitted model object is present, a data frame with the
estimated values, the approximate standard errors, the z-ratios, and the
p-values for the fixed effects is returned. Otherwise, when multiple
fitted objects are being compared, a data frame with
the degrees of freedom, the (restricted) log-likelihood, the
Akaike Information Criterion (AIC), and the Bayesian Information
Criterion (BIC) of each object is returned. If test=TRUE
,
whenever two consecutive objects have different number of degrees of
freedom, a likelihood ratio statistic, with the associated p-value is
included in the returned data frame.Value
a data frame inheriting from class anova.lme
.Note
Likelihood comparisons are not meaningful for objects fit using
restricted maximum likelihood and with different fixed effects.Author(s)
Jose Pinheiro and Douglas BatesSee Also
gls
, lme
, AIC
,
BIC
, print.anova.lme
Examples
library(lme)
data(Orthodont)
fm1 <- lme(distance ~ age, Orthodont, random = ~ age | Subject)
fm2 <- update(fm1, distance ~ age * Sex)
anova(fm1, fm2)