CecileProust-Lima / lcmm

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

Impossible to specify multivariate LCGA? #239

Closed 1151k closed 7 months ago

1151k commented 7 months ago

Hi,

As per #44 , I attempted to implement an LCGA multivariate model with multlcmm() using the following code:

m1 <- lcmm::multlcmm(
    y1 + y2 + y3 ~ age + I(age^2),
    random=~-1,
    subject = "ID",
    ng = 1,
    link = "thresholds",
    data = dt,
)

m2 <- lcmm::multlcmm(
    y1 + y2 + y3 ~ age + I(age^2),
    random=~-1,
    mixture = ~ age + I(age^2),
    subject = "ID",
    ng = 2,
    link = "thresholds",
    data = dt,
    B = m1
)

I get the error:

At least one random effect is required

Is there anything incorrect in the implementation, or is LCGA not supported for multivariate (binary) models?

Thanks, Daniil

VivianePhilipps commented 7 months ago

Hi,

the use of multlcmm without random effects is not possible. Our parameterization requires at least one random effect (whose variance is fixed to 1) for identifiability purposes.

Best,

Viviane

CecileProust-Lima commented 7 months ago

To complete the response of Viviane, I think what you intend to do is a mpjlcmm, that is a multivariate latent class mixed model that will model separately several markers over time considering they all come from the same latent class structure. Please refer to the vignette for details. Cécile