Identifying latent classes in longitudinal data

Hi,

My objective is to find latent classes in my longitudinal data. My data has a hierarchical structure. this is the data set description.
ID, lesion ID (each patient can have multiple lesions), days ( baseline, day2, day 14, d21) and the longitudinal outcome. I was initially using LCMM but it doesn’t account for the hierarchical structure in the data. Can I use brms for my problem ? This is my mixed model
model2 ← lmer(lktrans ~ days + (1 | ID) + (1| ID :lesid), data = data).

Please could someone help me with this issue ?

Please share your Stan program and accompanying data if possible.


When including Stan code in your post it really helps if you make it as readable as possible by using Stan code chunks (```stan) with clear spacing and indentation. For example, use

model {
  vector[N] mu = alpha + beta * x;
  y ~ normal(mu, sigma); 
} 

instead of

model{
vector[N] mu = alpha+beta*x;
y~normal(mu,sigma);
}


To include mathematical notation in your post put LaTeX syntax between two $ symbols, e.g.,
p(\theta | y) \propto p(\theta) p(y | \theta).

Don’t forget to add relevant tags to your topic (top right of this form) for application area and/or class of models you work with.

Welcome to the Stan Discourse!

I can’t help too much with brms, but two clarifying questions might help others.

First, are you trying to model a single outcome across time using latent classes where each class implies a specific trajectory across time in that one outcome (e.g. “high stable” vs “start high end low” classes, as in the example below)?

Second, could you say a bit more about what features of a latent class model you’d like to be hierarchical? What parts of the latent class model do you expect to vary by person?

Hi Simon,

Thanks for your response. I apologies for the unclear explanation.

Yes. Here is the structure of the data. I have the biomarker value of 70 patients with 140 lesions (multiple lesions per patient) collected at timepoints (0,2,14,21). My objective is to find if there are any latent classes in my data (different trajectories). The model should account for the clustering of lesions with in the patients. This is not accounted in the LCMM package.

Thank you,
Nivetha

1 Like