# LMM and RM-ANOVA differences. Which one is preferable?

I conducted a four-phases experiment in which data from two groups of subjects are extracted for each time point according to the states of the outcome variable Dur. So, this variable can be basically decomposed into four states. What I would like to see is if the two groups have different values of the dependent variable for each state. The raw data looks like the following table:

I then subsetted the data into four dataframe according to the phase of the experiment, and performed a linear mixed model for the single phases, like this:

1_data <- subset(df2, phase == "1")
2_data <- subset(df2, phase == "2")
3_data <- subset(df2, phase == "3")
4_data <- subset(df2, phase == "4")

model <- lmer(Dur ~ 1 + Group* state + (1|id), data = 1_data )
model <- lmer(Dur ~ 1 + Group* state + (1|id), data = 2_data )
model <- lmer(Dur ~ 1 + Group* state + (1|id), data = 3_data )
model <- lmer(Dur ~ 1 + Group* state + (1|id), data = 4_data )


Subsequently, I looked at the single contrasts, binding all of them in one table and applying the FDR and Bonferroni correction for multiple comparisons.

However, the model gives me the following warning: boundary (singular) fit: see help('isSingular')

I've read other related answers that say that this is occurring because the random effect specification is too complex. Anyway, I cannot simplify further the model.

So, my idea was instead to conduct a RM-ANOVA and then performing a post-hoc test by means of unpaired t-test.

> res.aov <- anova_test(data = baseline_data, dv = dur, wid = id, between = Group, within = state)
> get_anova_table(res.aov)
ANOVA Table (type III tests)

Effect  DFn    DFd     F     p    p<.05     ges
1            Group     1.00  40.00 0.130 0.720       0.000123
2            state     2.87 114.97 5.617 0.001     * 0.119000
3     Subject:state    2.87 114.97 2.956 0.037     * 0.066000


Would that be better? Or, in this case, would be just the same thing as LMM? As I already confronted the results of anova(model) with that res.aov, they are quite similar but not the same.

• 1. I choose to fit separate models instead of including the phase ( it should be model<-lmer( Dur ~ 1 + Group*state*phase +(1|id) , data = data) ??) because I am mainly interested in calculating simple contrasts only for each state between the two groups. Otherwise, I will generate more contrasts than necessary. However, I am not aware of other possible strategies at the moment. 2. Yes, the data contains a lot of zeros. In my case, that would mean that the state is not present. 3. Indeed, the conditional R2 is zero. But the same warning occurs even when I include the phase in the model. Mar 22 at 8:58