dimanche 19 juillet 2020

Ordinal logistic regression with random variable and quantitative predictor variable

I want to use an ordinal logistic regression (my response variable is ordinal) that works with 2 random variables and for quantitative predictor variable with interaction (my formula is: ordinal_variabel~ quantitative_variabel:habitat + (1|community) + (1|species).

I was analyzing my data with clmm (see the script below) and got the results I expected, however I noticed that clmm was designed to be used when response and predictor variables are factorial.

model1 <- clmm(as.factor(ordinal_variabel)~ quantitative_variabel:habitat + (1|community) + (1|species), data=baseline)
summary(model1)```

I then tried the polmer (see the script below), but I did not get any answers. 

```library(MPDiR)
library(lme4)
model2 <- polmer(as.factor(ordinal_variabel) ~ quantitative_variabel:habitat + (community - 1 | Obs) + (species - 1 | Obs),           data=baseline)
summary(model2)```

Would someone have any suggestions on how to analyze this data?



Aucun commentaire:

Enregistrer un commentaire