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 Using 'lme4' package please test if 'Cond' (categorical data) and 'colours' (categorical data), and the interaction effect between 'Cond' and 'colours' has an effect on the 'direction' (categorical data).
library(lme4) # create a dataframe that only needs the columns of interest indvar_FODs_new <- indvar_FODs[,c("direction","Cond","colours")] # run the mixed model mixed_model <- lmer(direction ~ Cond * colours + (1|colours), data = indvar_FODs_new)