CecileProust-Lima / lcmm

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

Binary multivariate analysis with multlcmm() #236

Closed 1151k closed 4 months ago

1151k commented 5 months ago

First, thank you very much for this fantastic package! I've had much benefit from it.

I wonder, however, how does one use multlcmm() for multivariate binary outcome data? On this page it is stated that multlcmm() supports binary data, but on the documentation page for the function, only ordinal (and continuous) data is mentioned. Is binary data in fact supported? And if so, which link value is suitable for this type of data? Finally, how does one plot such data (I get an error that plot() with which="fit" is not applicable...)

Best regards, Daniil

CecileProust-Lima commented 5 months ago

Dear Daniil, thank you for your positive feedback :). multlcmm handles binary data, considering these data are 2-level ordinal data. So the link would be "thresholds". Best, Cécile

1151k commented 5 months ago

Dear @CecileProust-Lima ,

Thank you very much for the confirmation!

Now, I attempted again with the "thresholds" link value, and it works indeed. However, when later trying to plot the different indicator variables with the following piece of code:

plot(m2, outcome="asthma_medication")

I get the following error message: "Residual and prediction plots are not available yet for threshold mixed models"

Is there any workaround I can use at the moment? I assume it may take a while for the functionality to be added to the package (?)

Best regards, Daniil

CecileProust-Lima commented 4 months ago

Sorry for this. Indeed, we have not worked around these plots. If you want to have the predicted trajectories, I recommend in general to use predictY function. The plot is only meant to check the goodness-of-fit, not presenting results. Cécile