Tidy tables of a fit from multilpa(family = "restricted_cross_level") or
multilpa(family = "full_cross_level").
Usage
# S3 method for class 'multilpa_cross_level'
get_results(x, what = "profiles", ...)
# S3 method for class 'multilpa_cross_level'
as.data.frame(x, row.names = NULL, optional = FALSE, what = "profiles", ...)
# S3 method for class 'multilpa_cross_level'
print(x, ...)
# S3 method for class 'multilpa_cross_level'
summary(object, ...)
# S3 method for class 'multilpa_cross_level'
logLik(object, ...)
# S3 method for class 'multilpa_cross_level'
nobs(object, ...)Tables
profilesOne row per individual profile and indicator:
level = "individual",profile,indicator,mean,variance; then one row per group class and indicator for the group means:level = "group", the class inprofile, and the class'smeanandvarianceof the group means.group_classesOne row per group class:
weight,count(summed posterior) andn_assigned.compositionOne row per group class and profile: the share of the class's members in each profile. Model-implied for the full family; for the restricted family a posterior-weighted description, since its prevalences do not depend on the class.
groupsOne row per group: size, modal group class, its posterior and every class probability.
assignmentsOne row per data row: its modal
profileand posterior, and its group's modalgroup_class(inherited).fitOne row: family, log likelihood,
n_parameters,aic,bic(by groups),bic_individual(by rows), sizes, convergence andboundary. The likelihood is the working likelihood of the manifest specification (the group means are computed from the same ratings), so it is comparable only between cross-level fits of the same data.startsThe start records (full family) or the two parts' likelihoods (restricted family).
Examples
set.seed(1)
ratings <- data.frame(
team = rep(seq_len(40), each = 6),
climate = rep(rnorm(40, rep(c(-1, 1), each = 20), 0.5), each = 6) +
rnorm(240, sample(c(-1, 1), 240, replace = TRUE), 0.6))
fit <- multilpa(ratings, "climate", "team", n_profiles = 2,
n_group_classes = 2, family = "full_cross_level",
n_starts = 3, seed = 1)
get_results(fit)
#> level profile indicator mean variance
#> 1 individual profile_1 climate -1.0905752 1.3563599
#> 2 individual profile_2 climate 1.0014259 1.1907874
#> 3 group group_class_1 climate -1.0635988 0.1439940
#> 4 group group_class_2 climate 0.9744799 0.3113962
get_results(fit, "composition")
#> group_class profile share
#> 1 group_class_1 profile_1 0.98618573
#> 2 group_class_2 profile_1 0.01363281
#> 3 group_class_1 profile_2 0.01381427
#> 4 group_class_2 profile_2 0.98636719
