CecileProust-Lima / lcmm

R package lcmm
https://CecileProust-Lima.github.io/lcmm/
48 stars 13 forks source link

Regarding classmb, covariate is longitudinal data over time, #254

Open leslieyoungwei opened 2 months ago

leslieyoungwei commented 2 months ago

Dear Mr.VivianePhilipps, I'm a Masters of Medicine student. I'd like to ask some questions. Regarding classmb, if my covariate is not age as such, but in the form of longitudinal data, again over time, can this approach be used as classmb, as I have previously read in one of the literature that longitudinal data can be included as a covariate, but I am not sure how to go about interpreting the results of classmb, can you please explain this. For example, I would like to carve out the trajectory of haemoglobin over time, and also include erythrocyte pressure, etc., which are examined together with the change over time, as covariates, but the results show that there is only one coef value for each indicator, so how should I interpret this. fit <- lcmm(fixed = hb~1+ time+I(time^2),mixture =~time, random =~time,c1assmb=~Fibrinogen+ HCT, ng = 2,nWg = TRUE, B=fit1, link='linear' , subject ="ID", data = data) data: Fixed effects in the class-membership model:(the class of reference is the last class) coef intercept class1 9.41792 Fibrinogen class1 0.00558 HCT class1 0.75077

About 2 weeks,I would like to add that after using longitudinal data in classmb, the code can actually only utilize the first of the longitudinal data information and not apply it to the others, so if I want to apply all of the information, how should I make changes in the model?

there are some other parameters and my data doesn't have se wald p etc.,and I don't know why best wish!

CecileProust-Lima commented 1 month ago

Dear Leslie, classmb is a multinomial model for the class membership. Neither the dependent variable (the class) nor the covariates are longitudinal. To ease the implementation, we rely on the same dataset in longitudinal format but you should be careful with the covariates you put in classmb. Time-dependent covariates can be included but only in the mixed model (fixed=) part. Cécile

leslieyoungwei commented 1 month ago

Dear Leslie, classmb is a multinomial model for the class membership. Neither the dependent variable (the class) nor the covariates are longitudinal. To ease the implementation, we rely on the same dataset in longitudinal format but you should be careful with the covariates you put in classmb. Time-dependent covariates can be included but only in the mixed model (fixed=) part. Cécile

Dear CecileProust Lima, Thank you very much for your answer, am I understanding correctly that classmb only plays a role in the multinomial model when the categories are later grouped, and the time-dependent covariates are the covariates used to construct the trajectory model? And how can I write the code, is this? fit <- lcmm(fixed = hb ~ time + HCT, mixture =~time, random =~time,c1assmb=~age, ng = 2,nWg = TRUE, B=fit1, link='linear' , subject ="ID", data = data)

best wish! Leslie

CecileProust-Lima commented 1 month ago

Regarding your question "am I understanding correctly that classmb only plays a role in the multinomial model when the categories are later grouped, and the time-dependent covariates are the covariates used to construct the trajectory model?". Yes this is correct. I can't help you with the call as I don't know your data. You should find the information in the vignettes on the website. Cécile

leslieyoungwei commented 1 month ago

Regarding your question "am I understanding correctly that classmb only plays a role in the multinomial model when the categories are later grouped, and the time-dependent covariates are the covariates used to construct the trajectory model?". Yes this is correct. I can't help you with the call as I don't know your data. You should find the information in the vignettes on the website. Cécile

Ok, I know. Thanks for your explanation!