CecileProust-Lima / lcmm

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

B initial values in HLME #221

Closed pitina244 closed 8 months ago

pitina244 commented 8 months ago

Hi

Trying to figure it out

HLMEmodel <- hlme(loglevels~ age + sex + educ + year + TotalYears + baselinelevels, random=~ year, subject='IID', data=mydata) run without any problem!

HLMEmodel2 <- hlme(loglevels~ age + sex + educ + year + TotalYears + baselinelevels, random=~ year, fixed=~ age + sex + educ + year + TotalYears + log10Ab40BA + year*TotalYears, subject='IID', ng=2, data=mydata, B=random(HLMEmodel))

Error in hlme(loglevels~ age + sex + educ + year + TotalYears + log10Ab40BA, : B is not correct

any idea?

CecileProust-Lima commented 8 months ago

Hi, you seem to have duplicated the fixed= part (the first part loglevels ~ .... is a fixed= part). If the second is kept, then the structure is different and B is incorrect. Cécile