Extracts P(class | response vector) for each individual from an explicitly fitted person/item model.
posterior_class_probs(object)data.frame with columns P_gg, P_gk, P_kk (rows = individuals)
sim <- simulate_lca(n = 100, gk = 0.30, seed = 123, return_classes = TRUE)
fit <- person_item_lca_fit(sim$pre, sim$post)
posteriors <- posterior_class_probs(fit)
head(posteriors)
#> P_gg P_gk P_kk
#> 1 1.00000000 0.0000000 0.0000000
#> 2 0.12903223 0.8709678 0.0000000
#> 3 0.01731601 0.1168831 0.8658009
#> 4 0.01731601 0.1168831 0.8658009
#> 5 0.12903223 0.8709678 0.0000000
#> 6 0.01731601 0.1168831 0.8658009