Learn R Programming

trajeR (version 1.0)

AvePP: Average Posterior Probability of Assignment

Description

The Average Posterior Probability (AvePP) measures the classification quality. For each group, it is the average of the highest posterior probabilities for all individuals assigned to that group. A value close to 1 indicates a clear classification.

Usage

AvePP(sol, Y, A, X = NULL)

Value

A named numeric vector of the same length as the number of groups, containing the AvePP for each group.

Arguments

sol

A trajectory object returned by the trajeR function.

Y

The response variable matrix, as used in the `trajeR` call.

A

The time variable matrix, as used in the `trajeR` call.

X

Optional. A matrix of covariates that modify the group membership probability, if they were used in the model.

Examples

Run this code
data <- read.csv(system.file("extdata", "CNORM2gr.csv", package = "trajeR"))
data <- as.matrix(data)
# Use drop=FALSE for single-column matrices to preserve dimensions
sol <- trajeR(Y = data[, 2:6], A = data[, 7:11], Risk = data[, 12, drop = FALSE],
              degre = c(2, 2), Model = "CNORM", Method = "EM")
AvePP(sol, Y = data[, 2:6], A = data[, 7:11])

Run the code above in your browser using DataLab