propAssign: Proportion of Individuals Assigned to Each Group

View source: R/model_adequacy.R

propAssignR Documentation

Proportion of Individuals Assigned to Each Group

Description

Calculate the proportion of individuals in a given group. That is the ratio of the number of individuals in one group and all the individuals.

Usage

propAssign(sol, Y, A)

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.

Value

A named numeric vector containing the proportion of individuals assigned to each group.

Examples

data <- read.csv(system.file("extdata", "CNORM2gr.csv", package = "trajeR"))
data <- as.matrix(data)
sol <- trajeR(Y = data[, 2:6], A = data[, 7:11], Risk = data[, 12, drop = FALSE],
              degre = c(2, 2), Model = "CNORM", Method = "EM")
propAssign(sol, Y = data[, 2:6], A = data[, 7:11])

trajeR documentation built on Aug. 4, 2026, 1:09 a.m.