compare.fit {lcca}R Documentation

Compare the fit of latent-class models

Description

The generic method compare.fit compares the achieved loglikelihood or pseudo-loglikelihood values of nested models fit by lca, lcacov or lcca.

Usage


compare.fit(obj1, ...)


## Default S3 method:
compare.fit(obj1, ...)


## S3 method for class 'lca'
compare.fit(obj1, obj2, ...)


## S3 method for class 'lcacov'
compare.fit(obj1, obj2, ...)


## S3 method for class 'lcca'
compare.fit(obj1, obj2, ...)

Arguments

obj1

an object of class "lca", "lcacov" or "lcca" containing the results of a latent-class modeling procedure.

obj2

an object of the same class as obj1 containing the results of another call to the same function.

...

additional arguments to be passed to the methods.

Details

The two models represented by obj1 and obj2 must satisfy the following criteria.

If weights are not supplied to the model-fitting procedures, then the models are compared by a likelihood-ratio test. If weights are supplied, the models are compared by the pseudo likelihood-ratio test of Asparouhov and Muthen (2005).

Satisfying all the criteria above does not guarantee that the two models are nested and comparable by a (pseudo) likelihood-ratio test. Models with different sets of covariates on the right-hand sides of their respective formulas are nested only if every covariate in the smaller model is a linear combination of covariates in the larger model. It is ultimately up to the user to determine if the models are comparable.

One of the most common uses of compare.fit is to test for measurement invariance, to see if it is plausible that the item-response probabilities (rho-parameters) are equal across subsets of the population. This is done by calling lca with a groups variable, setting constrain.rhos=TRUE in one model and constrain.rhos=FALSE in the other, and then comparing the results by compare.fit.

Value

A list with three components:

Chi.Sq

test statistic comparing the null (smaller) model to the alternative (larger) model.

df

degrees of freedom for the test, equal to the number of free paramaters in the larger model minus the number of free parameters in the smaller model.

p

significance value for the test, with smaller values indicating greater evidence against the null model in favor of the alternative.

Author(s)

Joe Schafer

Send questions to mchelpdesk@psu.edu

References

Asparouhov, T. and Muthen, B. (2005) Multivariate statistical modeling with survey data. Proceedings of the Federal Committee on Statistical Methodology (FCSM) Research Conference. Washington, DC: Office of Management and Budget.

For more information on using this function and other functions in the LCCA package, see the manual LCCA Package for R, Version 1 in the subdirectory doc.

See Also

lca, lcacov, lcca

Examples

## recode variables in abortion attitudes dataset,
## setting NAP and DK to missing
data(abortion)
abortion$ABANY    <- factor(abortion$ABANY,    levels=c("YES","NO"))
abortion$ABDEFECT <- factor(abortion$ABDEFECT, levels=c("YES","NO"))
abortion$ABHLTH   <- factor(abortion$ABHLTH,   levels=c("YES","NO"))
abortion$ABNOMORE <- factor(abortion$ABNOMORE, levels=c("YES","NO"))
abortion$ABPOOR   <- factor(abortion$ABPOOR,   levels=c("YES","NO"))
abortion$ABRAPE   <- factor(abortion$ABRAPE,   levels=c("YES","NO"))

# fit separate three class models for men and women, using
# sampling weights and a mild flattening constant for rhos
set.seed(123)
fit1 <- lca(
   cbind(ABANY,ABDEFECT,ABHLTH,ABNOMORE,ABPOOR,ABRAPE) ~ 1,
   weights=WTSSNR, flatten.rhos=1,
   data=abortion, nclass=3, groups=SEX)

# test for equality of rho-parameters
set.seed(123)
fit2 <- lca(
   cbind(ABANY,ABDEFECT,ABHLTH,ABNOMORE,ABPOOR,ABRAPE) ~ 1,
   weights=WTSSNR, flatten.rhos=1,
   data=abortion, nclass=3, groups=SEX, constrain.rhos=TRUE)

compare.fit( fit1, fit2 )

[Package lcca version 2.0.0 Index]