Closed NivethaSridharan closed 3 weeks ago
Hi,
the hlme function doesn't support hierarchical random effects. You can only have one grouping variable, and you specify it in the "subject" argument. If you neglect the leson id, the correct syntax would be :
model <- hlme(
fixed = lktrans ~ days,
random = ~ days,
subject = "ID",
data = data,
ng = 2,
idiag = TRUE,
mixture = ~ 1 )
Best,
Viviane
Hi,
My data set has the following variables:
My objective of my study is to identify the latent classes in the data and find it's impact on survival. I tried fitting a model model <- hlme( fixed = lktrans ~ days,
random = ~ days | ID + lesid,
subject = "ID",
data = data,
ng = 2,
idiag = TRUE,
mixture = ~ 1 | ID )
This throws an error "Error in hlme(fixed = lktrans ~ days, random = ~days | ID + lesid, subject = "ID", : The covariates in mixture should also be included in the argument fixed".
I would like to know if I am approaching the problem correctly, also how to include more than one random effects in the model . Please could you help me with resolving this error ?
Thanks in advance