I have some environmental monitoring data that I've collected over 4 different years. I'd like to analyses the trend in the condition over this time period.
2010 | 2013 | 2017 | 2022 | |
---|---|---|---|---|
Very good | 37 | 34 | 8 | 29 |
Good | 42 | 43 | 16 | 7 |
Fair | 41 | 44 | 22 | 1 |
Poor | 60 | 26 | 21 | 1 |
- Each plot was assessed in each assessment year (repeated measures?)
- Each plot was given a condition score of very good, good, fair or poor (ordinal categorical variable?)
- I've excluded "unknown" as it's not really ordinal meaning that the number of responses can vary between years as the number of 'unknown' plots changes.
When comparing the two most recent years, I used a Mann-Whitney U test:
result_table <- table(lapply(unstack(data, Condition ~ Year), factor, levels = c("Very good", "Good", "Fair", "Poor")))
df <- as.data.frame.matrix(result_table)
score <- c("Very good", "Good", "Fair", "Poor")
mh_test(as.table(result_table), scores = list(response = 1:length(score)), distribution='exact')
How do I analyse the full data set with all four years?