Is it appropriate to calculate odds ratios from random effects glmm output?
about the data:
grown (binary): whether flower grows over a certain height (TRUE/FALSE)
fertilizer(factor): whether fertilizer was used (yes, no, unknown)
flowertype (factor): 5 types of flowers
Here’s my code:
model <- glmmTMB(grown ~ fertilizer+ (1 + fertilizer | flowertype), data = flower_data, family = "binomial")
random_effects <- as.data.frame(ranef(model))
flower_types <- unique(random_effects$grp)
parameter_type <- unique(random_effects$term)
odds_ratios <- data.frame(flowertype = flower_types,
ParameterType = parameter_type,
`OddsRatio = exp(random_effects$condval))“`
My code works, I just want to make sure that I’m doing the right thing
dasyer5 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.