class_sizes: Class sizes and item-response probabilities of the...

class_sizesR Documentation

Class sizes and item-response probabilities of the measurement model

Description

class_sizes() returns the estimated class proportions and item_probs() the class-conditional item-response probabilities of the Step-1 measurement model underlying any fitted tseLCA object.

Usage

class_sizes(object, ...)

## S3 method for class 'tseLCA'
class_sizes(object, se = FALSE, ...)

item_probs(object, ...)

## S3 method for class 'tseLCA'
item_probs(object, se = FALSE, ...)

Arguments

object

A fitted tseLCA object.

...

Further arguments (currently unused).

se

Logical. If TRUE, also return standard errors.

Details

With se = TRUE, their standard errors are returned as well. They are obtained by the delta method from the variance of the measurement model's log-ratio parameters (vcov() of the measurement model): class sizes are the softmax of \log(\pi_t / \pi_1), and the response probabilities of an item in class t the softmax of \log(P(Y = k \mid X = t) / P(Y = 0 \mid X = t)). Parameters on the boundary of the parameter space are treated as fixed and get a standard error of zero.

Value

class_sizes(): a named numeric vector of length T summing to one. item_probs(): a matrix with one row per item (binary items: P(Y = 1 \mid X = t)) or per item category (polytomous items: P(Y = k \mid X = t)) and one column per class. With se = TRUE, a list with elements estimate and se of that form.

Examples

d <- generate_data(200, "high", "covariate", seed = 1)
m <- tse_lca(cbind(Y1, Y2, Y3, Y4, Y5, Y6) ~ 1, data = d, nclass = 3)
class_sizes(m)
item_probs(m)
item_probs(m, se = TRUE)$se

tseLCA documentation built on Nov. 11, 2026, 9:07 a.m.