Entering edit mode

18 days ago

leranwangcs
▴
120

Hi,

I'm trying to fit a CCA model with random effect, the formula should look like this:

~ A + B + C + (1|patient_ID)

But I cannot find any package support this. So far I have tried CCA(), capscale(), but it neither of the seems recognizing the formula with random effect.

So anyone knows what how to do this?

Thanks!

You may get (more) answers by positing on https://stats.stackexchange.com/. If you do make sure you mention here and there that you are cross-posting. Also, a bit of background of what you are trying to do would probably help.

What is a CCA model with random effects?

for example, without a random effect, the formula for a cca (Constrained Correspondence Analysis) model could be:

cca(y ~ x + z + k, data = df),

but if some samples are provided by same patients, I want to use the patient ID as the random effect to adjust for the grouped samples.

cca(y ~ x + z + k + (1|patient_ID), data = df)

In other models like mixed linear model, it allows for adding this random effect, but it seems cca() doesn't allow this.

If anyone knows any packages allows doing cca model with a random effect that would be great.