Learn R Programming

⚠️There's a newer version (1.6.1) of this package.Take me there.

latrend (version 1.1.0)

A Framework for Clustering Longitudinal Data

Description

A framework for clustering longitudinal datasets in a standardized way. Provides an interface to existing R packages for clustering longitudinal univariate trajectories, facilitating reproducible and transparent analyses. Additionally, standard tools are provided to support cluster analyses, including repeated estimation, model validation, and model assessment. The interface enables users to compare results between methods, and to implement and evaluate new methods with ease.

Copy Link

Version

Install

install.packages('latrend')

Monthly Downloads

421

Version

1.1.0

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Niek Den Teuling

Last Published

March 5th, 2021

Functions in latrend (1.1.0)

as.data.frame.lcModels

Generate a data.frame containing the argument values per method per row
as.lcMethods

Convert a list of lcMethod objects to a lcMethods list
clusterNames<-

Update the cluster names
clusterNames

Get the cluster names
interface-custom

custom interface
clusterTrajectories

Extract the cluster trajectories
externalMetric,lcModel,lcModel-method

Compute external model metric(s)
confusionMatrix

Compute the posterior confusion matrix
converged

Check model convergence
getInternalMetricDefinition

Get the internal metric definition
getInternalMetricNames

Get the names of the available internal metrics
interface-funFEM

funFEM interface
fitted.lcModel

Extract lcModel fitted values
coef.lcModel

Coefficients of a lcModel
lcApproxModel-class

lcApproxModel class
interface-mixAK

mixAK interface
interface-mclust

mclust interface
interface-kml

kml interface
interface-dtwclust

dtwclust interface
latrend-assert

latrend-specific assertions
formula.lcMethod

Extract formula
lcMethodKML

Specify a longitudinal k-means (KML) method
lcMethodLMKM

Two-step clustering through linear regression modeling and k-means
lcMatrixMethod-class

lcMatrixMethod
lcMethodMixtoolsGMM

Specify mixed mixture regression model using mixtools
formula.lcModel

Extract the formula of a lcModel
lcMethodDtwclust

Specify time series clustering via dtwclust
lcMethod

Create a lcMethod object of the specified type and arguments
lcMethod-class

lcMethod class
lcMethodFeature

Feature-based clustering
lcMethodRandom

Specify a random-partitioning method
getExternalMetricNames

Get the names of the available external metrics
getExternalMetricDefinition

Get the external metric definition
interface-crimCV

crimCV interface
$,lcMethod-method

Retrieve and evaluate a lcMethod argument by name
lcMethodStratify

Specify a stratification method
lcModelCustom

Specify a model based on a pre-computed result.
lcModelPartition

Create a lcModel with pre-defined partitioning
interface-akmedoids

akmedoids interface
model.frame.lcModel

Extract model training data
interface-mixtools

mixtools interface
interface-mixtvem

mixtvem interface
as.lcModels

Convert a list of lcModels to a lcModels list
logLik.lcModel

Extract the log-likelihood of a lcModel
lcMethodMixtoolsNPRM

Specify non-parametric estimation for independent repeated measures
match.call.all

Argument matching with defaults and parent ellipsis expansion
lcModel-make

Cluster-handling functions for lcModel implementations.
lcModel-data-filters

Data filters for lcModel
model.data

Extract the model training data
as.data.frame.lcMethods

Convert a list of lcMethod objects to a data.frame
as.data.frame.lcMethod

Convert lcMethod arguments to a list of atomic types
model.data.lcModel

Extract the model data that was used for fitting
postprobFromAssignments

Create a posterior probability matrix from a vector of cluster assignments.
nClusters

Number of clusters
plot,lcModel,ANY-method

Plot a lcModel
plotClusterTrajectories

Plot cluster trajectories
as.list.lcMethod

Extract the method arguments as a list
nIds

Number of strata
predict.lcModel

lcModel predictions
nobs.lcModel

Extract the number of observations from a lcModel
sigma.lcModel

Extract residual standard deviation from a lcModel
strip

Strip a lcModel for serialization
residuals.lcModel

Extract lcModel residuals
createTestDataFolds

Create all k test folds from the training data
createTestDataFold

Create the test fold data for validation
defineExternalMetric

Define an external metric for lcModels
defineInternalMetric

Define an internal metric for lcModels
generateLongData

Generate longitudinal test data
getCall.lcModel

Get the model call
subset.lcModels

Subsetting a lcModels list based on method arguments
responseVariable

Extract the response variable
interface-featureBased

featureBased interface
summary.lcModel

Summarize a lcModel
dcastRepeatedMeasures

Cast a longitudinal data.frame to a matrix
getLcMethod

Get the method specification of a lcModel
createTrainDataFolds

Create the training data for each of the k models in k-fold cross validation evaluation
estimationTime

Get the model estimation time
evaluate.lcMethod

Substitute the call arguments for their evaluated values
transformFitted

Helper function for ensuring the right fitted() output
clusterProportions

Proportional size of each cluster
clusterSizes

Number of strata per cluster
idVariable

Extract the trajectory identifier variable
latrend

Cluster longitudinal data
transformLatrendData

Transform latrend input data into the right format
ids

Get the unique ids included in this model
df.residual.lcModel

Extract the residual degrees of freedom from a lcModel
interface-longclust

longclust interface
deviance.lcModel

lcModel deviance
[[,lcMethod-method

Retrieve and evaluate a lcMethod argument by name
getName,lcMethodLcmmGMM-method

lcmm interface
latrendBatch

Cluster longitudinal data for a list of model specifications
lcMethod.call

Create a lcMethod object from a call
latrend-is

Check if object is of Class
lcMethodFlexmix

Method interface to flexmix()
lcMethodLcmmGBTM

Specify GBTM method
lcMethodAkmedoids

Specify AKMedoids method
lcMethodFlexmixGBTM

Group-based trajectory modeling using flexmix
lcMethodLcmmGMM

Specify GMM method using lcmm
metric

Compute internal model metric(s)
interface-flexmix

flexmix interface
isArgDefined

Check whether the argument of a lcMethod has a defined value.
latrendData

Synthetic longitudinal dataset comprising three classes
lcMethodCrimCV

Specify a zero-inflated repeated-measures GBTM method
latrendRep

Cluster longitudinal data repeatedly
latrend-package

latrend: A Framework for Clustering Longitudinal Data
postprob

Posterior probability per fitted id
latrend-generics

Method- and model-specific generics defined by the latrend package
min.lcModels

Select the lcModel with the lowest metric value
print.lcModels

Print lcModels list concisely
lcMethodCustom

Specify a custom method based on a model function
postProbFromObs

Compute the id-specific postprob matrix from a given observation-level postprob matrix
transformPredict

Helper function that matches the output to the specified newdata
lcMethods

Generate a list of lcMethod objects
lcMethodLongclust

Specify Longclust method
lcMethodMclustLLPA

Longitudinal latent profile analysis
qqPlot

Quantile-quantile plot
update.lcModel

Update a lcModel
weighted.meanNA

Weighted arithmetic mean ignoring NAs
which.weight

Sample an index of a vector weighted by the elements
latrendBoot

Cluster longitudinal data using bootstrapping
trajectories

Extract the fitted trajectories for all strata
predictAssignments

Predict the cluster assignments for new trajectories
lcModel-class

lcModel class
predictForCluster

lcModel prediction for a specific cluster
latrendCV

Cluster longitudinal data over k folds
lcMethodFunFEM

Specify a FunFEM method
update.lcMethod

Update a method specification
trajectoryAssignments

Get the cluster membership of each trajectory
lcMethodGCKM

Two-step clustering through linear mixed modeling and k-means
lcMethodMixAK_GLMM

Specify a GLMM iwht a normal mixture in the random effects
lcModelWeightedPartition

Create a lcModel with pre-defined weighted partitioning
lcMethodMixTVEM

Specify a MixTVEM
lcModels

Construct a flat (named) list of lcModel objects
max.lcModels

Select the lcModel with the highest metric value
meltRepeatedMeasures

Convert a repeated measures data matrix to a data.frame
plotMetric

Plot one or more internal metrics for all lcModels
predictPostprob

lcModel posterior probability prediction
plotTrajectories

Plot trajectories
print.lcMethod

Print the arguments of an lcMethod object
time.lcModel

Sampling times of a lcModel
timeVariable

Extract the time variable