Fits one latent transition class per person across repeated items. Class proportions are shared across items, while guessing probabilities are item-specific. Parameters are estimated jointly by expectation-maximization. This is a package-specific joint extension of the item-level response model, not the item-wise estimator developed by Cor and Sood (2016).
Data frame containing one binary pre-test item per column.
Data frame containing the corresponding binary post-test items. Items are paired by name, not position.
Must be empty. Its presence requires optional arguments to be named.
How to handle structural missingness: `"omit"` excludes incomplete pairs and `"error"` rejects them.
Optional named list with `class_priors` (named `gg`, `gk`, `kk`) and item-named `gamma`. When `NULL`, [fit_item_lca()] supplies a deterministic item-level initialization.
Maximum EM iterations before an error is raised.
Strictly positive finite convergence tolerance for the maximum absolute parameter change.
An object of class `guess_person_fit` containing shared class proportions, item-specific guessing probabilities, person-level posterior probabilities, log-likelihood, and convergence information. `n_obs` is the number of observed item-response pairs.
The model accepts binary responses and structural missingness only. It assumes each person has one `gg`, `gk`, or `kk` trajectory across all items and that observed item pairs are conditionally independent given that trajectory.
Cor, M. K., and Sood, G. (2016). Guessing and Forgetting: A Latent Class Model for Measuring Learning. *Political Analysis*, 24(2), 226–242.
Dempster, A. P., Laird, N. M., and Rubin, D. B. (1977). Maximum Likelihood from Incomplete Data via the EM Algorithm. *Journal of the Royal Statistical Society: Series B*, 39(1), 1–38.
sim <- simulate_lca(n = 500, n_items = 4, seed = 123)
fit <- fit_person_lca(sim$pre, sim$post)
fit$class_priors
#> gg gk kk
#> 0.3613498 0.2857225 0.3529276
head(fit$posterior)
#> P_gg P_gk P_kk
#> 1 1.000000e+00 0.000000000 0.0000000
#> 2 4.702054e-03 0.995297946 0.0000000
#> 3 1.424383e-05 0.003015035 0.9969707
#> 4 4.702054e-03 0.995297946 0.0000000
#> 5 4.702054e-03 0.995297946 0.0000000
#> 6 1.000000e+00 0.000000000 0.0000000