reorder.glca: Reorders the estimated parameters of glca model

View source: R/reorder.glca.R

reorder.glcaR Documentation

Reorders the estimated parameters of glca model

Description

Function for reordering the estimated parameters for glca model.

Usage

## S3 method for class 'glca'
reorder(x, ..., class.order = NULL, cluster.order = NULL, decreasing = TRUE)

Arguments

x

an object of "glca", usually, a result of a call to glca.

...

further arguments passed to or from other methods.

class.order

a integer vector of length equal to number of latent classes of the glca model, assigning the desired order of the latent classes

cluster.order

a integer vector of length equal to number of latent clusters of the glca model, assigning the desired order of the latent clusters

decreasing

logical, when the class.order or cluster.order are not given, whether to rearrange the latent classes (clusters) by decreasing order of the magnitude of the probability of responding the first-category to the first manifest item (prevalence for the first latent class).

Details

Since the latent classes or clusters can be switched according to the initial value of EM algorithm, the order of estimated parameters can be arbitrary.

Examples

lca = glca(item(DEFECT, HLTH, RAPE, POOR, SINGLE, NOMORE) ~ 1,
            data = gss08, nclass = 3, na.rm = TRUE)
plot(lca)

# Given ordering number
lca321 = reorder(lca, 3:1)
plot(lca321)

# Descending order
dec_lca = reorder(lca, decreasing = TRUE)
plot(dec_lca)

# Ascending order
inc_lca = reorder(lca, decreasing = FALSE)
plot(inc_lca)


glca documentation built on April 26, 2023, 5:12 p.m.