Solved – Repeated measures ANOVA with time series

anovarrepeated measures

I have data from 7 sites, which are under 3 types of AMD impairment (2 impaired, 3 recovered, 2 unimpaired); each site has 3 different treatments (Undisturbed Upstream, Disturbed, Undisturbed Downstream). Sites were sampled right before the treatment (day 0), and then 5, 10, 15, and 30 days after treatment.

I want to see if there are any significant differences in macro measurements (abundance, richness, feeding groups, etc.) over time across the AMD impairment types and the treatments.

My first thought is a repeated-measures ANOVA like:

Macro_abund ~ AMD_Impairment*Treatment*Day + Error(Site/Impairment*Section)

Using function aov in R, I get an error that the model is singular.

I'm beginning to wonder if repeated measures ANOVA is an inappropriate analysis, but I'm not sure what a better alternative would be.

Best Answer

Usually that error means you do not have a independent variable for each dependent variable. Ex: you are missing data somewhere. You can either fill in these missing values, or drop those rows.

If the idea of dropping an observation/row entirely rubs you the wrong way, according to another forum you could look into conducting the analysis as a linear mixed model. I too am having issues determining what goes in the line of code where you have "site."

Macro_abund ~ AMD_Impairment*Treatment*Day + Error(Site/Impairment*Section)

Where you have "site" I have an ID number for each observation per treatment (CODE) per SITE (each row = 1 observation).

My code: x1.aov<-aov(X1 ~ MONTH * SITE * CODE + Error(ID/(SITE * CODE)), data=HNME1)

Someone else also recommended changing your "SITE" or in my case- "ID" to a factor. HNME1$ID <- factor(HNME1$ID) Hope this helps a little bit!