alrtest {chantrics}  R Documentation 
Adjusted Likelihood Ratio Test of Nested Models
Description
alrtest
is a helper function to simulate the functions lmtest::waldtest()
and lmtest::lrtest()
for adjusted chantrics
objects. The method can be
employed to compare nested models (see details).
Usage
alrtest(object, ...)
Arguments
object 
a 
... 
further object specifications (see details), as well as named
parameters that will be passed to 
Details
This function is a helper function that creates an interface to
anova.chantrics()
that is similar to lmtest::waldtest()
and
lmtest::lrtest()
.
The standard method is to compare the fitted model object object
with the
models in ...
. Instead of passing the fitted models into ...
, other
specifications are possible. Note that the types of specifications cannot be
mixed, except between numerics/characters. The type of the second object
supplied determines the algorithm used.

"chantrics"
objects: When supplying two or more"chantrics"
objects, they will be sorted as inanova.chantrics()
. Then, the ALRTS will be computed consecutively between the two neighbouring models. Note that all models must be nested. For details refer toanova.chantrics()
. 
"numeric"
: If the second object is"numeric"
or"character"
, then"numeric"
objects corresponding element inattr(terms(object1), "term.labels")
will be turned into their corresponding"character"
element and will be handled as in"character"
below. 
"character"
: If the second object is"numeric"
or"character"
, then the"character"
objects are consecutively included in an update formula likeupdate(object1, . ~ .  object2)

"formula"
: If the second object is a"formula"
, then the second model will be computed asupdate(object1, object2)
.
Then, the adjusted likelihood ratio test statistic (ALRTS), as described in
Section 3.5 of Chandler and Bate
(2007), is computed by
anova.chantrics()
.
If a single unnamed object is passed in ...
, sequential ANOVA is
performed on object
.
Value
An object of class "anova"
inheriting from class "data.frame"
.
The columns are as follows:
Resid.df 
The residual number of degrees of freedom in the model. 
df 
The increase in residual degrees of freedom with respect to the model in the row above. 
ALRTS 
The adjusted likelihood ratio statistic. 
Pr(>ALRTS) 
The pvalue of the test that the model above is a "significantly better" model as the one in the current row. 
References
R. E. Chandler and S. Bate, Inference for clustered data using the independence loglikelihood, Biometrika, 94 (2007), pp. 167–183. doi: 10.1093/biomet/asm015.
See Also
anova.chantrics()
for the implementation of the computations of
the test statistics.
lmtest::waldtest()
and lmtest::lrtest()
for syntax.