fitted.lcModel | R Documentation |
Returns the cluster-specific fitted values for the given lcModel
object.
The default implementation calls predict()
with newdata = NULL
.
## S3 method for class 'lcModel'
fitted(object, ..., clusters = trajectoryAssignments(object))
object |
The |
... |
Additional arguments. |
clusters |
Optional cluster assignments per id. If unspecified, a |
A numeric
vector of the fitted values for the respective class, or a matrix
of fitted values for each cluster.
Classes extending lcModel
can override this method to adapt the computation of the predicted values for the training data.
Note that the implementation of this function is only needed when predict()
and predictForCluster()
are not defined for the lcModel
subclass.
fitted.lcModelExt <- function(object, ..., clusters = trajectoryAssignments(object)) { pred = predict(object, newdata = NULL) transformFitted(pred = pred, model = object, clusters = clusters) }
The transformFitted()
function takes care of transforming the prediction input to the right output format.
fittedTrajectories plotFittedTrajectories stats::fitted predict.lcModel trajectoryAssignments transformFitted
Other lcModel functions:
clusterNames()
,
clusterProportions()
,
clusterSizes()
,
clusterTrajectories()
,
coef.lcModel()
,
converged()
,
deviance.lcModel()
,
df.residual.lcModel()
,
estimationTime()
,
externalMetric()
,
fittedTrajectories()
,
getCall.lcModel()
,
getLcMethod()
,
ids()
,
lcModel-class
,
metric()
,
model.frame.lcModel()
,
nClusters()
,
nIds()
,
nobs.lcModel()
,
plot-lcModel-method
,
plotClusterTrajectories()
,
plotFittedTrajectories()
,
postprob()
,
predict.lcModel()
,
predictAssignments()
,
predictForCluster()
,
predictPostprob()
,
qqPlot()
,
residuals.lcModel()
,
sigma.lcModel()
,
strip()
,
time.lcModel()
,
trajectoryAssignments()
data(latrendData)
method <- lcMethodLMKM(Y ~ Time, id = "Id", time = "Time")
model <- latrend(method, latrendData)
fitted(model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.