tdcm.compare {TDCM} | R Documentation |
Comparing the fit of two TDCMs
Description
Provides a comparison of two TDCMs. Can be used to compare different measurement models or assess measurement invariance over time or over groups in the multigroup TDCM case. Only accepts two models.
Usage
tdcm.compare(model1, model2)
Arguments
model1 |
|
model2 |
a second |
Value
This function returns a data frame with model fit statistics (AIC/BIC) and results from a likelihood ratio or deviance test.
Note
Currently, this function currently accepts two models for comparison.
Both models must be fit to the same item responses and Q-matrix.
The function will provide results for two non-nested models. Please ensure that models are nested before interpreting the likelihood ratio test for nested models.
The likelihood ratio test is not valid for some model comparisons (e.g., LCDM vs DINA) because of model constraints.
Examples
## Example 1: T = 2, A = 4
data(data.tdcm01, package = "TDCM")
dat1 <- data.tdcm01$data
qmat1 <- data.tdcm01$q.matrix
# estimate TDCM with invariance assumed and full LCDM
m1 <- TDCM::tdcm(dat1, qmat1, num.time.points = 2, invariance = TRUE, rule = "GDINA")
# estimate TDCM with invariance not assumed
m2 <- TDCM::tdcm(dat1, qmat1, num.time.points = 2, invariance = FALSE, rule = "GDINA")
# compare models to assess measurement invariance.
TDCM::tdcm.compare(m1, m2)