C2_clcm: C2 Fit Statistic

View source: R/C2_clcm.R

C2_clcmR Documentation

C2 Fit Statistic

Description

Compute C2 Test Statistic for the CLCM

Usage

C2_clcm(mod, verbose = T)

Arguments

mod

estimated model object from clcm() function

verbose

logical; print the C2 statistic and associated p-value? Default is TRUE, set to FALSE for simulations.

Value

Returns the C2 fit statistic, associated p-value (test of exact fit, where null hypothesis is the model fits the data exactly), RMSEA value, sample size N, degrees of freedom, observed probabilities, and model-implied probabilities. The latter two can be used to assess the fit visually.

Examples

## Not run: 
set.seed(3112021)
sim.dat <- simulate_clcm(N=200,
                          number.timepoints = 1,
                          item.type = rep('Ordinal', 5),
                          categories.j = rep(4, 5),
                          lc.prop = list('Time_1' = c(0.5, 0.5)) )

mod <- clcm(dat = sim.dat$dat,
            item.type = sim.dat$item.type,
            item.names = sim.dat$item.names,
            Q = sim.dat$Q)

mod.fit <- C2_clcm(mod)

 
## End(Not run)

CJangelo/CLCM documentation built on May 22, 2022, 9:27 a.m.