I currently have the following dataset. I have two sets of means, each with their 2*standard errors:
dd <- data.frame(m1 = c(3,7,5,4), m2 = c(5,3,6,1), se1 = c(1.1,1.3,1.1,1.9), se2 = c(1.2,1.22,1.54,1.7))
ggplot(dd, aes(x = m1, y = m2, ymin = m2-se2, ymax = m2+se2, xmin = m1-se1, xmax = m1+se2))+
geom_errorbar(aes(color = m1), width = 0.2)
> dd
m1 m2 se1 se2
1 3 5 1.1 1.20
2 7 3 1.3 1.22
3 5 6 1.1 1.54
4 4 1 1.9 1.70
This is the plot I get:
This only shows the confidence intervals for m2, using se2. Is there a way to show the confidence intervals for m1 too? I.e., I used line creation to get:
ggplot(dd, aes(x = m1, y = m2, ymin = m2-se2, ymax = m2+se2, xmin = m1-se1, xmax = m1+se2))+
geom_segment(aes(x=m1-se1,y=m2,xend=m1+se1,yend=m2))+
geom_errorbar(aes(color = m1), width = 0.2)
but am wondering if there is a way to do this with ggplot2 in order to get the interval ends as well.


