I would like to plot a figure like the attached one. Consider just one color, let's say, the blue line. The figure shows correlation between twinA and twinB. The line in the figure is the mean of 1000 lines obtained with a permutation. I averaged slope and intercept and got the averaged regression line. So far so good.
Then, I need to plot CIs. I need to use CIs I get from the permutation itself rather than the average CIs. Therefore, I computed the CIs of the correlation coefficients (between twinA and twinB) vector I obtained with the permutations.
Here's comes the issue. With this code I am able to plot the line but I cannot find how to insert CI with abline function:
plot(1, type="n", xlab="", ylab="", xlim=c(0, 10), ylim=c(0, 20))
a=10.09773458
b = 0.183630788
abline(a, b)
CI=0.001940921
Any suggestion? Thank you in advance!