Skip to contents

Performs sequential LMR tests to compare models with 1 to K classes. This is integrated into gmm_select but can be called separately.

Usage

lmr_sequential(model_list, adjusted = TRUE)

Arguments

model_list

List of fitted SurveyMixr objects with increasing number of classes

adjusted

Logical; use adjusted LMR?

Value

Data frame with LMR test results for each comparison

Examples

if (FALSE) { # \dontrun{
# Fit models with 1-4 classes (slow - use for actual analysis)
data(mcs_simulated)
models <- lapply(1:4, function(k) {
  gmm_survey(
    data = mcs_simulated,
    id = "id", time = "age", outcome = "selfcontrol",
    n_classes = k, starts = 50
  )
})

# Run LMR tests
lmr_results <- lmr_sequential(models, adjusted = TRUE)
print(lmr_results)
} # }