I'd like to plot two confidence intervals with geom_ribbon in PSO
and PSOA
. My dataset is given by
id Meta prob mean lowerci upperci
1 PSO 0.1 6705423.00 9913.939 151671.3
2 PSO 0.2 6705423.00 24352.031 393418.7
3 PSO 0.3 6705423.00 64719.335 444035.0
4 PSO 0.4 6705423.00 85058.168 600026.5
5 PSO 0.5 6705423.00 140437.916 756819.1
6 PSO 0.6 6705423.00 179236.196 952494.7
7 PSO 0.7 6705423.00 211278.350 773605.9
8 PSO 0.8 6705423.00 169915.851 1078624.1
9 PSO 0.9 6705423.00 263216.389 936007.2
10 PSO 1.0 6705423.00 266200.032 1061063.0
11 PSOA 0.1 52460.43 9913.939 151671.3
12 PSOA 0.2 202813.18 24352.031 393418.7
13 PSOA 0.3 252836.56 64719.335 444035.0
14 PSOA 0.4 329661.97 85058.168 600026.5
15 PSOA 0.5 450833.52 140437.916 756819.1
16 PSOA 0.6 424932.84 179236.196 952494.7
17 PSOA 0.7 486794.40 211278.350 773605.9
18 PSOA 0.8 634493.58 169915.851 1078624.1
19 PSOA 0.9 521509.18 263216.389 936007.2
20 PSOA 1.0 648183.78 266200.032 1061063.0
I tried to use the code above, but I could not plot the geom_ribbon
in PSO ("HERE" in figure).
p <- ggplot(data=dat2, aes(x=prob, y=mean, colour=Meta)) + geom_point() + geom_line()
p <- p + geom_ribbon(aes(ymin=dat2$lowerci, ymax=dat2$upperci), linetype=2, alpha=0.1)
PSOA
group. Thus, it looks like you aren't plotting thePSO
group but it is being plotted. It just is being covered by thePSOA
group – Mike H.ymax = mean + upperci
andymin = mean - lowerci
? – Mike H.PSO
is equal, but the limits of confidence intervals are different. In addition, I'd likeymax = upperci
,ymax = mean + upperci
is very greaterymax = upperci
. – Wagner JorgePSO
group. However, theupperci
andlowerci
are identical across thePSO
andPSOA
group causingPSO
to be covered up – Mike H.CIs
dont really make sense for thePSO
group because the mean is not even close to contained within them – Mike H.