Title: | SLTCA: Scalable and Robust Latent Trajectory Class Analysis Using Artificial Likelihood |
---|---|
Description: | Conduct latent trajectory class analysis with longitudinal observations. |
Authors: | Kari Hart, Teng Fei and John Hanfelt |
Maintainer: | Teng Fei <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.1.0 |
Built: | 2024-10-17 03:44:23 UTC |
Source: | https://github.com/tengfei-emory/sltca |
Simulate a dataset with longitudinal observations.
simulation(n)
simulation(n)
n |
Sample size. |
Returns a data frame with 6 longitudinal features y.1 - y.6, including count (y.1 and y.2), binary (y.3 and y.4) and continuous (y.5 and y.6) type. Variable baselinecov is the baseline risk factor of latent classes. Variable latent is the true latent class labels.
Teng Fei. Email: [email protected]
dat <- simulation(500)
dat <- simulation(500)
Conduct latent trajectory class analysis with longitudinal observations.
SLTCA(k = 20, dat, num_class, id, time, num_obs, features, Y_dist, covx, ipw, stop, tol = 0.005, max = 50, varest = T, balanced = T, MSC = "EQIC", verbose = T)
SLTCA(k = 20, dat, num_class, id, time, num_obs, features, Y_dist, covx, ipw, stop, tol = 0.005, max = 50, varest = T, balanced = T, MSC = "EQIC", verbose = T)
k |
Number of random initialization to start the algorithm. |
dat |
Input data matrix. |
num_class |
Number of latent classes in the fitted model. |
id |
Column name in the data matrix 'dat' for the patient id. |
time |
Column name in the data matrix 'dat' for the time of longitudinal observations. |
num_obs |
Column name in the data matrix 'dat' for the number of longitudinal observations (number of visits). |
features |
A vector of column names in the data matrix 'dat' for the longitudinal observations. |
Y_dist |
A vector indicating the type of longitudinal observations. An element of Y_dist can be 'normal','bin', and 'poi' for continuous, binary and count data. |
covx |
A vector of column names in the data matrix 'dat' for baseline latent class risk factors. |
ipw |
Column name in the data matrix 'dat' for the inverse probability weights for missingness. ipw=1 if not specified. |
stop |
Stopping criterion for the algorithm. stop can be either 'tau' based on posterior probabilities or 'par' based on point estimation. |
tol |
A constant such that the algorithm stops if the stopping criterion is below this constant. |
max |
Maximum number of iterations if the algorithm does not converge. |
varest |
True or False: whether conduct variance estimation or not. |
balanced |
True or False: whether the longitudinal observations are equally spaced. |
MSC |
Model selection criteria: 'AQIC','BQIC' or 'EQIC'. |
verbose |
Output progress of fitting the model. |
A list with point estimates (alpha, beta0, beta1, phi, gamma), variance estimates (ASE), posterior membership probabilities (tau) and QICs (qic) of the latent trajectory class model.
Teng Fei. Email: [email protected]
Hart, Fei and Hanfelt (202x), Scalable and Robust Latent Trajectory Class Analysis Using Artificial Likelihood (in press).
dat <- simulation(500) res <- SLTCA(k=1,dat,num_class=2,"id","time","num_obs",paste("y.",1:6,sep=''), Y_dist=c('poi','poi','bin','bin','normal','normal'), "baselinecov",1,stop="tau",tol=0.005,max=50, varest=T,balanced=T,MSC='EQIC',verbose=T)
dat <- simulation(500) res <- SLTCA(k=1,dat,num_class=2,"id","time","num_obs",paste("y.",1:6,sep=''), Y_dist=c('poi','poi','bin','bin','normal','normal'), "baselinecov",1,stop="tau",tol=0.005,max=50, varest=T,balanced=T,MSC='EQIC',verbose=T)