Learn R Programming

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

latrend (version 1.3.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.3.0

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Niek Den Teuling

Last Published

May 26th, 2022

Functions in latrend (1.3.0)

[[,lcMethod-method

Retrieve and evaluate a lcMethod argument by name
as.lcMethods

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

Convert a list of lcModels to a lcModels list
getInternalMetricNames

Get the names of the available internal metrics
converged

Check model convergence
externalMetric,lcModel,lcModel-method

Compute external model metric(s)
createTestDataFold

Create the test fold data for validation
.defineInternalDistanceMetrics

Define the distance metrics for multiple types at once
lcMethodMixTVEM

Specify a MixTVEM
estimationTime

Get the model estimation time
lcMethodMixAK_GLMM

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

lcModel posterior probability prediction
getExternalMetricDefinition

Get the external metric definition
fit

lcMethod fit process: logic for fitting the method to the processed data
evaluate.lcMethod

Substitute the call arguments for their evaluated values
meanNA

Mean ignoring NAs
getLcMethod

Get the method specification of a lcModel
fitted.lcModel

Extract lcModel fitted values
getName

Get the (short) name of the lcMethod or Model
getArgumentDefaults,lcMethodLcmmGMM-method

lcmm interface
clusterNames<-

Update the cluster names
latrend-assert

latrend-specific assertions
interface-mixtvem

mixtvem interface
createTestDataFolds

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

mclust interface
getCall.lcModel

Get the model call
APPA

Average posterior probability of assignment (APPA)
latrend-is

Check if object is of Class
lcMethodLcmmGBTM

Specify GBTM method
OSA.adherence

Biweekly Mean Treatment Adherence of OSA Patients over 1 Year
lcMethodLcmmGMM

Specify GMM method using lcmm
OCC

Odds of correct classification (OCC)
confusionMatrix

Compute the posterior confusion matrix
as.data.frame.lcMethod

Convert lcMethod arguments to a list of atomic types
lcMethodMixtoolsGMM

Specify mixed mixture regression model using mixtools
as.list.lcMethod

Extract the method arguments as a list
df.residual.lcModel

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

lcModel deviance
defineInternalMetric

Define an internal metric for lcModels
lcMethodMixtoolsNPRM

Specify non-parametric estimation for independent repeated measures
defineExternalMetric

Define an external metric for lcModels
compose

lcMethod fit process: compose an lcMethod object
getLabel

Extract the method label.
model.frame.lcModel

Extract model training data
interface-custom

custom interface
getArgumentDefaults

Default argument values for lcMethod subclass
generateLongData

Generate longitudinal test data
formula.lcModel

Extract the formula of a lcModel
lcApproxModel-class

lcApproxModel class
latrend-package

latrend: A Framework for Clustering Longitudinal Data
lcMethodRandom

Specify a random-partitioning method
lcModelPartition

Create a lcModel with pre-defined partitioning
latrend-parallel

Parallel computing using latrend
interface-dtwclust

dtwclust interface
min.lcModels

Select the lcModel with the lowest metric value
lcModelWeightedPartition

Create a lcModel with pre-defined weighted partitioning
model.data

Extract the model training data
transformPredict

Helper function for custom lcModel classes implementing predict.lcModel()
getArgumentExclusions

Arguments to be excluded for lcMethod subclass
idVariable

Extract the trajectory identifier variable
ids

Get the trajectory ids on which the model was fitted
interface-akmedoids

akmedoids interface
latrendBoot

Cluster longitudinal data using bootstrapping
preFit

lcMethod fit process: method preparation logic
predict.lcModel

lcModel predictions
max.lcModels

Select the lcModel with the highest metric value
predictAssignments

Predict the cluster assignments for new trajectories
clusterNames

Get the cluster names
interface-kml

kml interface
latrendBatch

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

mixAK interface
lcMatrixMethod-class

lcMatrixMethod
interface-crimCV

crimCV interface
interface-funFEM

funFEM interface
latrend

Cluster longitudinal data
initialize,lcMethod-method

lcMethod initialization
latrendData

Artificial longitudinal dataset comprising three classes
predictForCluster

lcModel prediction conditional on a cluster
summary.lcModel

Summarize a lcModel
lcMethodKML

Specify a longitudinal k-means (KML) method
lcMethod-class

lcMethod class
as.data.frame.lcMethods

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

Proportional size of each cluster
nClusters

Number of clusters
test

Test a condition
lcMethodLMKM

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

Cluster longitudinal data repeatedly
lcMethods

Generate a list of lcMethod objects
logLik.lcModel

Extract the log-likelihood of a lcModel
lcModels

Construct a flat (named) list of lcModel objects
postprob

Posterior probability per fitted trajectory
lcMethodStratify

Specify a stratification method
postprobFromAssignments

Create a posterior probability matrix from a vector of cluster assignments.
match.call.all

Argument matching with defaults and parent ellipsis expansion
interface-featureBased

featureBased interface
print.lcModels

Print lcModels list concisely
nobs.lcModel

Number of observations used for the lcModel fit
responseVariable

Extract the response variable
createTrainDataFolds

Create the training data for each of the k models in k-fold cross validation evaluation
sigma.lcModel

Extract residual standard deviation from a lcModel
lcMethodFeature

Feature-based clustering
lcMethodDtwclust

Specify time series clustering via dtwclust
tsmatrix

Convert a longitudinal data.frame to a matrix
update.lcMethod

Update a method specification
clusterTrajectories

Extract the cluster trajectories
plotFittedTrajectories

Plot fitted trajectories of a lcModel
latrendCV

Cluster longitudinal data over k folds
coef.lcModel

Extract lcModel coefficients
interface-mixtools

mixtools interface
lcMethodGCKM

Two-step clustering through latent growth curve modeling and k-means
lcMethodMclustLLPA

Longitudinal latent profile analysis
isArgDefined

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

Quantile-quantile plot
timeVariable

Extract the time variable
model.data.lcModel

Extract the model data that was used for fitting
postFit

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

Specify a FunFEM method
strip

Reduce the lcModel memory footprint for serialization
validate

lcMethod fit process: method argument validation logic
latrend-generics

Method- and model-specific generics defined by the latrend package
plot-lcModel-method

Plot a lcModel
lcModel-class

lcModel class
metric

Compute internal model metric(s)
interface-flexmix

flexmix interface
plot-lcModels-method

Grid plot for a list of models
lcMethodCrimCV

Specify a zero-inflated repeated-measures GBTM method
nIds

Number of trajectories
plotClusterTrajectories

Plot cluster trajectories
weighted.meanNA

Weighted arithmetic mean ignoring NAs
prepareData

lcMethod fit process: logic for preparing the training data
postProbFromObs

Compute the id-specific postprob matrix from a given observation-level postprob matrix
residuals.lcModel

Extract lcModel residuals
lcMethodCustom

Specify a custom method based on a model function
subset.lcModels

Subsetting a lcModels list based on method arguments
tsframe

Convert a multiple time series matrix to a data.frame
trajectories

Extract the trajectories
which.weight

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

Update a lcModel
test.latrend

Test the implementation of an lcMethod and associated lcModel subclasses
lcModel-data-filters

Data filters for lcModel
lcModel-make

Cluster-handling functions for lcModel implementations.
lcModelCustom

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

Plot one or more internal metrics for all lcModels
time.lcModel

Sampling times of a lcModel
fittedTrajectories

Extract the fitted trajectories for all strata
plotTrajectories

Plot the data trajectories
as.data.frame.lcModels

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

Get the internal metric definition
clusterSizes

Number of trajectories per cluster
lcMethodFlexmixGBTM

Group-based trajectory modeling using flexmix
formula.lcMethod

Extract formula
names,lcMethod-method

lcMethod argument names
getExternalMetricNames

Get the names of the available external metrics
print.lcMethod

Print the arguments of an lcMethod object
lcMethodFlexmix

Method interface to flexmix()
lcMethodAkmedoids

Specify AKMedoids method
trajectoryAssignments

Get the cluster membership of each trajectory
transformFitted

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