Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

poLCA.predcell

Predicted cell percentages in a latent class model


Description

Calculates the predicted cell percentages from a latent class model, for specified values of the manifest variables.

Usage

poLCA.predcell(lc,y)

Arguments

lc

A model object estimated using the poLCA function.

y

A vector or matrix containing series of responses on the manifest variables in lc.

Details

The parameters estimated by a latent class model can be used to produce a density estimate of the underlying probability mass function across the cells in the multi-way table of manifest variables. This function calculates cell percentages for that density estimate, corresponding to selected sets of responses on the manifest variables, y.

Value

A vector containing cell percentages corresponding to the specified sets of responses y, based on the estimated latent class model lc.

See Also

Examples

data(carcinoma)
f <- cbind(A,B,C,D,E,F,G)~1
lca3 <- poLCA(f,carcinoma,nclass=3) # log-likelihood: -293.705

# Only 20 out of 32 possible response patterns are observed
lca3$predcell

# Produce cell probabilities for one sequence of responses
poLCA.predcell(lc=lca3,y=c(1,1,1,1,1,1,1))

# Estimated probabilities for a cell with zero observations
poLCA.predcell(lc=lca3,y=c(1,1,1,1,1,1,2))

# Cell probabilities for both cells at once; y entered as a matrix
poLCA.predcell(lc=lca3,y=rbind(c(1,1,1,1,1,1,1),c(1,1,1,1,1,1,2)))

poLCA

Polytomous variable Latent Class Analysis

v1.4.1
GPL (>= 2)
Authors
Drew Linzer <drew@votamatic.org>, Jeffrey Lewis <jblewis@ucla.edu>.
Initial release
2014-01-09

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.