postClassProbs: Determines posterior class probabilities for fitted model

View source: R/postClassProbs.R

postClassProbsR Documentation

Determines posterior class probabilities for fitted model

Description

The posterior class probabililities for each observed pattern and class is determined. These are returned as a data frame together with the patterns for each observation. If class = 0 is requested then all classes are returned, otherwise only the selected class.

Usage

postClassProbs(object, class = 0)

Arguments

object

randomLCA object

class

class to be returned. Zero returns all classes.

Details

Extracts the corresponding data from the randomLCA object.

Value

A data frame. The first columns of the data frame correspond to the patterns, followed by the frequency of each pattern, and then the posterior class probabilities for either the selected class or for all classes. The returned result is for the summarised data. If raw data is used, that is no frequencies, and it is required to calculated the posterior class probability for each observation then it is simply required to merge the class probabilities with the raw data, possibly removing any variable "freq" in the raw data.

Author(s)

Ken Beath

Examples


pap.lca2 <- randomLCA(pap[, 1:10], freq = pap$Freq, nclass = 2, cores = 1)
print(postClassProbs(pap.lca2))


randomLCA documentation built on July 9, 2023, 6:09 p.m.