Learn R Programming

latrend (version 1.5.0)

clusterProportions: Proportional size of each cluster

Description

Obtain the proportional size per cluster, with sizes between 0 and 1. By default, the cluster proportions are determined from the cluster-averaged posterior probabilities of the fitted data (as computed by the postprob() function).

Usage

# S4 method for lcModel
clusterProportions(object, ...)

Value

A named numeric vector of length nClusters(object) with the proportional size of each cluster.

Arguments

object

The lcModel to obtain the proportions from.

...

Additional arguments passed to postprob().

Implementation

Classes extending lcModel can override this method to return, for example, the exact estimated mixture proportions based on the model coefficients.


setMethod("clusterProportions", "lcModelExt", function(object, ...) {
  # return cluster proportion vector
})

See Also

clusterSizes postprob

Examples

Run this code
data(latrendData)
method <- lcMethodLMKM(Y ~ Time, id = "Id", time = "Time")
model <- latrend(method, latrendData, nClusters = 2)
clusterProportions(model)

Run the code above in your browser using DataLab