Learn R Programming

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

latrend (version 1.1.2)

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.2

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Niek Den Teuling

Last Published

April 14th, 2021

Functions in latrend (1.1.2)

as.lcMethods

Convert a list of lcMethod objects to a lcMethods list
as.list.lcMethod

Extract the method arguments as a list
as.data.frame.lcMethods

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

Get the cluster names
as.lcModels

Convert a list of lcModels to a lcModels list
clusterNames<-

Update the cluster names
as.data.frame.lcModels

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

Convert lcMethod arguments to a list of atomic types
createTestDataFold

Create the test fold data for validation
latrend-assert

latrend-specific assertions
$,lcMethod-method

Retrieve and evaluate a lcMethod argument by name
createTrainDataFolds

Create the training data for each of the k models in k-fold cross validation evaluation
[[,lcMethod-method

Retrieve and evaluate a lcMethod argument by name
estimationTime

Get the model estimation time
converged

Check model convergence
evaluate.lcMethod

Substitute the call arguments for their evaluated values
confusionMatrix

Compute the posterior confusion matrix
getExternalMetricNames

Get the names of the available external metrics
dcastRepeatedMeasures

Cast a longitudinal data.frame to a matrix
df.residual.lcModel

Extract the residual degrees of freedom from a lcModel
deviance.lcModel

lcModel deviance
getExternalMetricDefinition

Get the external metric definition
formula.lcMethod

Extract formula
ids

Get the unique ids included in this model
interface-custom

custom interface
interface-mixAK

mixAK interface
interface-mclust

mclust interface
interface-dtwclust

dtwclust interface
getInternalMetricDefinition

Get the internal metric definition
createTestDataFolds

Create all k test folds from the training data
interface-flexmix

flexmix interface
latrendCV

Cluster longitudinal data over k folds
clusterTrajectories

Extract the cluster trajectories
fitted.lcModel

Extract lcModel fitted values
coef.lcModel

Coefficients of a lcModel
latrendData

Synthetic longitudinal dataset comprising three classes
externalMetric,lcModel,lcModel-method

Compute external model metric(s)
clusterProportions

Proportional size of each cluster
clusterSizes

Number of strata per cluster
lcMethod-class

lcMethod class
getName,lcMethodLcmmGMM-method

lcmm interface
getInternalMetricNames

Get the names of the available internal metrics
formula.lcModel

Extract the formula of a lcModel
lcMethodFeature

Feature-based clustering
lcMethodFlexmixGBTM

Group-based trajectory modeling using flexmix
defineExternalMetric

Define an external metric for lcModels
defineInternalMetric

Define an internal metric for lcModels
interface-akmedoids

akmedoids interface
lcMethod

Create a lcMethod object of the specified type and arguments
lcMethod.call

Create a lcMethod object from a call
lcMethodGCKM

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

Specify a custom method based on a model function
latrendRep

Cluster longitudinal data repeatedly
isArgDefined

Check whether the argument of a lcMethod has a defined value.
interface-crimCV

crimCV interface
latrend-is

Check if object is of Class
lcMethodMclustLLPA

Longitudinal latent profile analysis
interface-longclust

longclust interface
lcMethodMixTVEM

Specify a MixTVEM
latrend-parallel

Parallel computing using latrend
latrend

Cluster longitudinal data
model.frame.lcModel

Extract model training data
interface-featureBased

featureBased interface
lcMethods

Generate a list of lcMethod objects
lcMethodStratify

Specify a stratification method
lcMethodDtwclust

Specify time series clustering via dtwclust
lcMethodMixtoolsGMM

Specify mixed mixture regression model using mixtools
latrend-generics

Method- and model-specific generics defined by the latrend package
predictAssignments

Predict the cluster assignments for new trajectories
getLcMethod

Get the method specification of a lcModel
model.data

Extract the model training data
lcApproxModel-class

lcApproxModel class
generateLongData

Generate longitudinal test data
interface-funFEM

funFEM interface
latrend-package

latrend: A Framework for Clustering Longitudinal Data
latrendBatch

Cluster longitudinal data for a list of model specifications
idVariable

Extract the trajectory identifier variable
predictForCluster

lcModel prediction for a specific cluster
plotClusterTrajectories

Plot cluster trajectories
lcMethodCrimCV

Specify a zero-inflated repeated-measures GBTM method
latrendBoot

Cluster longitudinal data using bootstrapping
lcMethodLcmmGMM

Specify GMM method using lcmm
logLik.lcModel

Extract the log-likelihood of a lcModel
lcModels

Construct a flat (named) list of lcModel objects
lcMethodLMKM

Two-step clustering through linear regression modeling and k-means
lcMethodLcmmGBTM

Specify GBTM method
lcMethodKML

Specify a longitudinal k-means (KML) method
lcMethodAkmedoids

Specify AKMedoids method
print.lcModels

Print lcModels list concisely
getCall.lcModel

Get the model call
interface-mixtools

mixtools interface
lcMethodFunFEM

Specify a FunFEM method
interface-kml

kml interface
interface-mixtvem

mixtvem interface
lcMethodFlexmix

Method interface to flexmix()
min.lcModels

Select the lcModel with the lowest metric value
lcMethodMixAK_GLMM

Specify a GLMM iwht a normal mixture in the random effects
match.call.all

Argument matching with defaults and parent ellipsis expansion
meltRepeatedMeasures

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

Compute internal model metric(s)
lcModel-class

lcModel class
lcMatrixMethod-class

lcMatrixMethod
summary.lcModel

Summarize a lcModel
update.lcMethod

Update a method specification
nobs.lcModel

Extract the number of observations from a lcModel
nClusters

Number of clusters
lcModelWeightedPartition

Create a lcModel with pre-defined weighted partitioning
lcModelPartition

Create a lcModel with pre-defined partitioning
plotTrajectories

Plot trajectories
plotMetric

Plot one or more internal metrics for all lcModels
plot,lcModel,ANY-method

Plot a lcModel
responseVariable

Extract the response variable
lcModelCustom

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

Specify Longclust method
lcModel-make

Cluster-handling functions for lcModel implementations.
predictPostprob

lcModel posterior probability prediction
strip

Strip a lcModel for serialization
update.lcModel

Update a lcModel
max.lcModels

Select the lcModel with the highest metric value
print.lcMethod

Print the arguments of an lcMethod object
transformFitted

Helper function for ensuring the right fitted() output
trajectoryAssignments

Get the cluster membership of each trajectory
nIds

Number of strata
sigma.lcModel

Extract residual standard deviation from a lcModel
transformLatrendData

Transform latrend input data into the right format
model.data.lcModel

Extract the model data that was used for fitting
postProbFromObs

Compute the id-specific postprob matrix from a given observation-level postprob matrix
subset.lcModels

Subsetting a lcModels list based on method arguments
trajectories

Extract the fitted trajectories for all strata
timeVariable

Extract the time variable
weighted.meanNA

Weighted arithmetic mean ignoring NAs
predict.lcModel

lcModel predictions
which.weight

Sample an index of a vector weighted by the elements
lcMethodRandom

Specify a random-partitioning method
time.lcModel

Sampling times of a lcModel
postprob

Posterior probability per fitted id
lcModel-data-filters

Data filters for lcModel
postprobFromAssignments

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

Quantile-quantile plot
lcMethodMixtoolsNPRM

Specify non-parametric estimation for independent repeated measures
residuals.lcModel

Extract lcModel residuals
transformPredict

Helper function that matches the output to the specified newdata