| predictAssignments | R Documentation |
Computes the posterior probability based on the provided (observed) data.
## S4 method for signature 'lcModel' predictAssignments(object, newdata = NULL, strategy = which.max, ...)
object |
The |
newdata |
Optional |
strategy |
A function returning the cluster index based on the given |
... |
Additional arguments. |
The default implementation uses predictPostprob to determine the cluster membership.
A factor of length nrow(newdata) that indicates the assigned cluster per trajectory per observation.
predictPostprob predict.lcModel
Other lcModel functions:
clusterNames(),
clusterProportions(),
clusterSizes(),
clusterTrajectories(),
coef.lcModel(),
converged(),
deviance.lcModel(),
df.residual.lcModel(),
estimationTime(),
externalMetric,lcModel,lcModel-method,
fitted.lcModel(),
fittedTrajectories(),
getCall.lcModel(),
getLcMethod(),
ids(),
lcModel-class,
metric(),
model.frame.lcModel(),
nClusters(),
nIds(),
nobs.lcModel(),
plot-lcModel-method,
plotClusterTrajectories(),
plotFittedTrajectories(),
postprob(),
predict.lcModel(),
predictForCluster(),
predictPostprob(),
qqPlot(),
residuals.lcModel(),
sigma.lcModel(),
strip(),
time.lcModel(),
trajectoryAssignments()
## Not run:
data(latrendData)
if (require("kml")) {
model <- latrend(method = lcMethodKML("Y", id = "Id", time = "Time"), latrendData)
predictAssignments(model, newdata = data.frame(Id = 999, Y = 0, Time = 0))
}
## End(Not run)