fit_model: Goodness of fit statistics for transition matrix data

View source: R/fit_unified.R

fit_modelR Documentation

Goodness of fit statistics for transition matrix data

Description

Chi-square goodness of fit between true and model based multivariate distribution. Handles both data with and without don't know responses automatically.

Usage

fit_model(pre_test, pst_test, g, est.param, force9 = FALSE)

fit_dk(pre_test, pst_test, g, est.param, force9 = FALSE)

fit_nodk(pre_test, pst_test, g, est.param)

Arguments

pre_test

data.frame carrying pre_test items

pst_test

data.frame carrying pst_test items

g

estimates of gamma produced from lca_cor

est.param

estimated parameters produced from lca_cor

force9

Optional. Force 9-column format even if no DK responses. Default is FALSE.

Details

Unified Goodness of Fit Statistics

Value

matrix with two rows: top row carrying chi-square value, bottom row p-values

Examples

## Not run: 
# Fit model first
transmatrix <- multi_transmat(pre_test, pst_test)
res <- lca_cor(transmatrix)

# Calculate goodness of fit
fit_stats <- fit_model(pre_test, pst_test, res$param.lca[nrow(res$param.lca), ], 
                       res$param.lca[-nrow(res$param.lca), ])

## End(Not run)

guess documentation built on Dec. 16, 2025, 1:07 a.m.