Context:
I am analysing some impact assessment data (measuring invertebrate richness in response to pollution), but they are unbalanced - there are not data for every site at sampling occasion, and there were more datapoints recorded after the impact than before the impact.
I am a new user to R, and have gathered through reading on this site and others that the standard anova packages aov()
and ezAnova()
can't deal with unbalanced designs. I assume I should instead be using a package like lme4
.
However, I am not sure how to structure my data, or program the analysis. One of the problems is that I'm not sure how to incorporate sampling dates as the repeated measures aspect of my design.
My data has 5 columns Site code, Date, BeforeAfter, ControlImpact, Richness.
Questions:
- How should I set up my data for conducting repeated measures analysis with unbalanced data in R?
- Should I use
lme4
or some other package?