Get the number of trajectories (strata) that were used for fitting the given lcModel object. The number of trajectories is determined from the number of unique identifiers in the training data. In case the trajectory ids were supplied using a factor column, the number of trajectories is determined by the number of levels instead.

nIds(object)

Arguments

object

The lcModel object.

Value

An integer with the number of trajectories on which the lcModel was fitted.

Examples

data(latrendData)
method <- lcMethodRandom("Y", id = "Id", time = "Time")
model <- latrend(method, latrendData)
nIds(model)
#> [1] 200