anova.cvam | R Documentation |
Compares the fit of two or more cvam
objects
## S3 method for class 'cvam' anova(object, ..., method = c("lrt", "logP", "AIC", "BIC"), pval = FALSE, pvalDigits = 4L, showRank=NULL )
object |
an object produced by |
... |
additional |
method |
criterion for model comparison: |
pval |
if |
pvalDigits |
digits for rounding of p-values |
showRank |
if |
The p-values reported for the "lrt"
and "logP"
methods use
a standard chi-squared approximation, with degrees of freedom equal
to the difference in the number of parameters for the models being
compared. This approximation is valid only if the models being
compared are properly nested and ordered, with the simplest model
appearing first in the argument list. The chi-squared approximation
can be poor if the degrees of freedom for the comparison is large,
and if the model corresponding to the null hypothesis (i.e., the
smaller one) has fitted cell means that are too small. The
chi-squared approximation is not appropriate for comparing
latent-class models with a different number of latent classes.
The likelihood function used in "lrt"
and "logP"
is
based on a Poisson model for the cell means in the
complete-data table. The Poisson model is an appropriate surrogate for
a multinomial model. It is also an appropriate surrogate for a product
multinomial if the model includes all possible associations among
variables regarded as fixed.
The residual degrees of freedom are the difference between the number of free parameters in a saturated Poisson model minus the number of free parameters in the current Poisson model. The saturated model estimates one parameter for every cell in the complete-data table, excluding dimensions for latent factors, and excluding structural-zero cells. No adjustments are made for estimates on a boundary of the parameter space.
For "BIC"
, the sample size is taken to be the total number of
observations or total frequency in the data supplied by the user to
fit the model, which does not include a flattening constant or any
nuggets from a prior distribution created by
cvamPrior
. No adjustments are made for missing or
coarsened values.
an object of class c("anova","data.frame")
Joe Schafer Joseph.L.Schafer@census.gov
For more information, refer to the package vignette Log-Linear Modeling with Missing and Coarsened Values Using the cvam Package.
cvam
M0 <- cvam( ~ V1 + V2, data=crime, freq=n ) M1 <- cvam( ~ V1 * V2, data=crime, freq=n ) anova(M0, M1, pval=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.