Generation

generate functionTue, 18 Apr 2023

dependent variable: 'direction' has three levels: morning, noon, night. There is no reference level for 'direction' > table(indvar_FODs_new$direction) morning noon night 1683 1432 206 fixed factor/independent variable: 'Cond' has four levels: Ay, Bi, Ci, Di. There is no reference level for 'Cond' > table(indvar_FODs$Cond) Ay Bi Ci Di 880 880 880 880 random factor: 'colours' has two levels: blue and pink. > table(indvar_FODs_new$colours) blue pink 2720 800 Response is categorical Using 'lme4' package logistic regression, please test if 'Cond' (categorical data) and 'colours' (categorical data), and the interaction effect between 'Cond' and 'colours' has an effect on the 'direction' which is the dependent variable (categorical data).

indvar_FODs_new <- indvar_FODs %>% filter(direction %in% c("morning", "noon", "night")) glmer(direction ~ Cond + colours + Cond:colours + (1|colours) + (1|Cond), data = indvar_FODs_new, family = "binomial")

Questions about programming?Chat with your personal AI assistant