I am trying to create a model to determine the effects of Stations and Circuits (and any interaction) on students scores in an OSCE exam, using the lmer function in R.
I have 3 factors: circuit $\beta$ (fixed), station $\gamma$ (fixed) and studentID $\rho$ (random) related as follows:
- Students are assigned to one circuit
- Within each circuit, there are 14 stations
- Students performance are measured at each of the 14 stations
Based on this, I concluded that:
- Students are nested within circuit
- Circuit and Station are crossed
- Student and station are crossed
The model I have designed is: $y_{ijk} = \mu + \beta_j + \gamma_k + (\beta \gamma)_{jk} + \rho_{i(j)} + (\gamma \rho)_{i(j)k} + \epsilon_{ijk} $
where the effects of Circuit, Station are fixed, the effect of StudentID nested within Circuit is random and the effect of StudentID nested in Circuit crossed with Station is random.
The two models I came up with in r are :
m1 <- lmer(Percentage ~ Circuit*Station + (1| Circuit:StudentID) + (1: Circuit:StudentID:Station), REML= FALSE, data=statper2024)
m12024 <- lmer(Percentage ~ Circuit*Station + (1| Circuit:StudentID), REML= FALSE, data=statper2024)
Both of the models reported the same AIC statics. I understand that m2 does not include an interaction term for Station and StudentID. However, I am unsure of how to code this interaction.
My questions are:
- Can I really say StudentID is nested within Circuit? I read that there must be a certain number of high-level units and since Circuit does not satisfy that, it should just be treated as a normal fixed predictor?
- How do I model the Station and StudentID interaction?
- I suspect that the variation amongst station scores will differ within Circuits. Is this variation included in my model? Or do I need to add a term as follows
(0+Station|Circuit)
. However, will this clash with the fact that I already specified fixed effects for Station and Circuit? - Should I include a term for students variation over station?
(Station|Student)
I am extremely conflicted regarding the terms to include in my model to consider all the possible interactions, crossed and nested effects.
For some insight into how my data is structured, see below: