I have generated a random set of data here, as I cannot post my own. It's not great data but it should illustrate what I'm trying to do.
Specifically, I have three treatments, the effects of which are being measured each year. Each treatment is replicated 6 times each year.
I want to plot the effect of treatment on the Dependent variable (DV) with year (i.e. over the course of the study) using ggplot2
I have tried:
ggplot(test, aes(x = factor(Year), y = DV, fill = factor(Grp))) +
geom_boxplot()
Which works well for this random data I have generated, but for my actual data the size of the boxes are much more variable and the graph is very difficult to interpret. What I wanted to do to simplify things, was to instead plot the treatment means with year (rather than using the boxes), and add standard errors to these treatment means. I also want to join up these treatment means with a straight line between each treatment's mean in each year. Does anyone know of a way to do this?
Thanks in advance!