Splits respondents into `k` folds, fits each model on the remaining respondents, and scores the held-out respondents. Each fold must fit and converge; a failed fold stops with its fold number rather than silently changing the estimand by omitting its held-out responses.

cv_individual_lca(
  pre_test,
  post_test,
  ...,
  k = 5L,
  seed = NULL,
  start = NULL,
  control = list(),
  na_as = c("dk", "missing"),
  missing_action = c("omit", "error")
)

Arguments

pre_test

Data frame containing one pre-test item per column.

post_test

Data frame containing the corresponding post-test items.

...

Must be empty.

k

Number of folds; an integer from 2 through the number of rows.

seed

Optional integer seed used only to assign folds. It does not alter the caller's random-number-generator state.

start

Optional named feasible starting vector passed to [fit_item_lca_counts()].

control

List passed to the `control` argument of [fit_item_lca_counts()].

na_as

Classification of `NA` responses: `"dk"` treats them as observed don't-know responses and `"missing"` treats them as structural missingness.

missing_action

How to handle structural missingness: `"omit"` excludes incomplete pairs and `"error"` rejects them.

Value

A `guess_cv` object. `fold_results` records every fold and `fold_id` maps each input row to its held-out fold. Aggregate likelihood and perplexity are weighted by held-out observed item pairs. No standard error is reported because fold scores are dependent training-set refits, not independent replicate estimates.