reorder.glca: Reorders the estimated parameters of glca model

Description Usage Arguments Details Examples

View source: R/reorder.glca.R

Description

Function for reordering the estimated parameters for glca model.

Usage

1
2
## 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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 Nov. 3, 2021, 1:09 a.m.