I have a question about how to analyze the results of a study I conducted. The study occurred on a remote island with a very small, unique population and in children. In order to be minimally invasive, the groups were not determined randomly and were instead assigned by school (only 2 schools on this island):
School 1: Control Group (no intervention)
School 2: Intervention Group
I took baseline measures on week 1, then post-intervention measures on week 2.
I ran repeated measures ANOVAs for each outcome, with group and time as the two factors, but believe this is insufficient because the participants were not randomized and clearly have different baseline measurements and slopes over time. I believe the best way to account for this would be to run linear mixed models, however, I'm having trouble in R. Most of the time when I run models I get the following error:
"Error: number of observations (=104) <= number of random effects (=112) for term (Timepoint | id); the random-effects parameters and the residual variance (or scale parameter) are probably unidentifiable"
Where "id" refers to the individual subject id.
However, I'm not 100% I'm running the correct code for what I'm trying to do. This is what I've been running:
model <- lmer(Outcome ~ Timepoint + Group + (Timepoint | id), dataSet)
I'm assuming time and group are fixed effects, but I need to also account for individual subject (id) differences in intercept and slope, and I'm not sure how to correctly integrate this into the model while avoiding the above message. An example of the code for the correct model would be much appreciated.