Learn R Programming

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

latrend (version 1.2.1)

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

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Niek Den Teuling

Last Published

January 6th, 2022

Functions in latrend (1.2.1)

OSA.adherence

Biweekly Mean Treatment Adherence of OSA Patients over 1 Year
as.lcMethods

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

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

Average posterior probability of assignment (APPA)
as.data.frame.lcModels

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

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

Convert lcMethod arguments to a list of atomic types
OCC

Odds of correct classification (OCC)
as.lcModels

Convert a list of lcModels to a lcModels list
latrend-assert

latrend-specific assertions
converged

Check model convergence
clusterTrajectories

Extract the cluster trajectories
createTrainDataFolds

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

Create all k test folds from the training data
compose

lcMethod fit process: compose an lcMethod object
confusionMatrix

Compute the posterior confusion matrix
defineInternalMetric

Define an internal metric for lcModels
coef.lcModel

Extract lcModel coefficients
deviance.lcModel

lcModel deviance
estimationTime

Get the model estimation time
evaluate.lcMethod

Substitute the call arguments for their evaluated values
createTestDataFold

Create the test fold data for validation
fit

lcMethod fit process: logic for fitting the method to the processed data
externalMetric,lcModel,lcModel-method

Compute external model metric(s)
clusterNames<-

Update the cluster names
clusterNames

Get the cluster names
getExternalMetricNames

Get the names of the available external metrics
generateLongData

Generate longitudinal test data
getArgumentDefaults

Default argument values for lcMethod subclass
getExternalMetricDefinition

Get the external metric definition
defineExternalMetric

Define an external metric for lcModels
dcastRepeatedMeasures

Cast a longitudinal data.frame to a matrix
idVariable

Extract the trajectory identifier variable
getName

Get the (short) name of the lcMethod or Model
fitted.lcModel

Extract lcModel fitted values
interface-crimCV

crimCV interface
interface-mixtvem

mixtvem interface
interface-flexmix

flexmix interface
interface-funFEM

funFEM interface
interface-custom

custom interface
latrend-is

Check if object is of Class
formula.lcMethod

Extract formula
ids

Get the trajectory ids on which the model was fitted
formula.lcModel

Extract the formula of a lcModel
[[,lcMethod-method

Retrieve and evaluate a lcMethod argument by name
interface-dtwclust

dtwclust interface
clusterProportions

Proportional size of each cluster
latrend-generics

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

Specify a FunFEM method
lcApproxModel-class

lcApproxModel class
isArgDefined

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

Extract the method label.
df.residual.lcModel

Extract the residual degrees of freedom from a lcModel
getArgumentExclusions

Arguments to be excluded for lcMethod subclass
clusterSizes

Number of trajectories per cluster
.defineInternalDistanceMetrics

Define the distance metrics for multiple types at once
lcMethodGCKM

Two-step clustering through latent growth curve modeling and k-means
getCall.lcModel

Get the model call
latrendRep

Cluster longitudinal data repeatedly
lcMethodMixAK_GLMM

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

Artificial longitudinal dataset comprising three classes
lcMethodMixTVEM

Specify a MixTVEM
lcMethodFlexmix

Method interface to flexmix()
lcMatrixMethod-class

lcMatrixMethod
latrend-parallel

Parallel computing using latrend
lcMethodAkmedoids

Specify AKMedoids method
interface-akmedoids

akmedoids interface
getLcMethod

Get the method specification of a lcModel
lcMethod-class

lcMethod class
initialize,lcMethod-method

lcMethod initialization
lcMethodCrimCV

Specify a zero-inflated repeated-measures GBTM method
latrend-package

latrend: A Framework for Clustering Longitudinal Data
lcMethodFlexmixGBTM

Group-based trajectory modeling using flexmix
fittedTrajectories

Extract the fitted trajectories for all strata
lcMethods

Generate a list of lcMethod objects
max.lcModels

Select the lcModel with the highest metric value
lcModel-class

lcModel class
meanNA

Mean ignoring NAs
plotClusterTrajectories

Plot cluster trajectories
lcMethodCustom

Specify a custom method based on a model function
lcModel-data-filters

Data filters for lcModel
lcModel-make

Cluster-handling functions for lcModel implementations.
plot-lcModels-method

Grid plot for a list of models
plot-lcModel-method

Plot a lcModel
lcMethodRandom

Specify a random-partitioning method
interface-featureBased

featureBased interface
lcMethodStratify

Specify a stratification method
getInternalMetricDefinition

Get the internal metric definition
lcMethodMixtoolsGMM

Specify mixed mixture regression model using mixtools
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
model.data.lcModel

Extract the model data that was used for fitting
latrendBatch

Cluster longitudinal data for a list of method specifications
interface-mixAK

mixAK interface
interface-mixtools

mixtools interface
latrend

Cluster longitudinal data
preFit

lcMethod fit process: method preparation logic
lcMethodLcmmGBTM

Specify GBTM method
lcMethodLMKM

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

Specify a longitudinal k-means (KML) method
lcMethodLcmmGMM

Specify GMM method using lcmm
predict.lcModel

lcModel predictions
plotFittedTrajectories

Plot fitted trajectories of a lcModel
postprob

Posterior probability per fitted trajectory
interface-kml

kml interface
getInternalMetricNames

Get the names of the available internal metrics
getArgumentDefaults,lcMethodLcmmGMM-method

lcmm interface
strip

Reduce the lcModel memory footprint for serialization
lcModels

Construct a flat (named) list of lcModel objects
lcModelWeightedPartition

Create a lcModel with pre-defined weighted partitioning
meltRepeatedMeasures

Convert a repeated measures data matrix to a data.frame
subset.lcModels

Subsetting a lcModels list based on method arguments
timeVariable

Extract the time variable
postprobFromAssignments

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

Extract the trajectories
interface-mclust

mclust interface
latrendBoot

Cluster longitudinal data using bootstrapping
postFit

lcMethod fit process: logic for post-processing the fitted lcModel
metric

Compute internal model metric(s)
interface-longclust

longclust interface
predictAssignments

Predict the cluster assignments for new trajectories
predictForCluster

lcModel prediction conditional on a cluster
postProbFromObs

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

Cluster longitudinal data over k folds
min.lcModels

Select the lcModel with the lowest metric value
plotMetric

Plot one or more internal metrics for all lcModels
model.data

Extract the model training data
lcMethodDtwclust

Specify time series clustering via dtwclust
update.lcMethod

Update a method specification
transformPredict

Helper function for custom lcModel classes implementing predict.lcModel()
model.frame.lcModel

Extract model training data
qqPlot

Quantile-quantile plot
plotTrajectories

Plot the data trajectories
lcMethodFeature

Feature-based clustering
lcMethodLongclust

Specify Longclust method
lcMethodMclustLLPA

Longitudinal latent profile analysis
trajectoryAssignments

Get the cluster membership of each trajectory
transformFitted

Helper function for custom lcModel classes implementing fitted.lcModel()
lcModelPartition

Create a lcModel with pre-defined partitioning
nClusters

Number of clusters
lcModelCustom

Specify a model based on a pre-computed result.
nobs.lcModel

Extract the number of observations from a lcModel
names,lcMethod-method

lcMethod argument names
nIds

Number of trajectories
print.lcMethod

Print the arguments of an lcMethod object
print.lcModels

Print lcModels list concisely
predictPostprob

lcModel posterior probability prediction
prepareData

lcMethod fit process: logic for preparing the training data
time.lcModel

Sampling times of a lcModel
update.lcModel

Update a lcModel
summary.lcModel

Summarize a lcModel
validate

lcMethod fit process: method argument validation logic
which.weight

Sample an index of a vector weighted by the elements
sigma.lcModel

Extract residual standard deviation from a lcModel
weighted.meanNA

Weighted arithmetic mean ignoring NAs
responseVariable

Extract the response variable
residuals.lcModel

Extract lcModel residuals