# Comparing non-nested GLMMs with AIC

Suppose I want to compare four non-nested models:

m0 = lm(y ~ 1)

m1 = lm(y ~ x)

m2 = lmer(y ~ 1 +(1|A))

m3 = lmer(y ~ x + (1|A))


Can we use AIC to compare models, even across different model types (lm vs. lmer)?

First, note that these models are, in fact, nested. m2 is nested in m3 (the coefficient for x is effectively constrained to be zero in m2. m0 is nested in m1 for the same reason. m1 is nested in m3 (with the random intercept variance for Aset to zero in m1. So they could be compared using a likelihood ratio test (with the mixed models being fitted with REML = FALSE).