方法1: 算好方差,通过箭头模拟方差区间:
数据:PhD_fig22D.csv,内容如下:
group,CSpluslatency,CSminuslatency,CSplusSEM,CSminusSEM
sham,3.884335347,4.212530713,0.224840383,0.259312234
ACCX,4.672486108,3.61943375,0.347628945,0.490227261
fig22d
"D:/path/to/PhD_fig22D.csv",
header=TRUE, sep=",", na.strings="NA", dec=".", strip.white=TRUE
) #数据导入(后两列是你要画的方差值)
attach(fig22d)
superpose.eb
arrows(x, y + ebu, x, y - ebl, angle = 90, code = 3,
length = length, ...) # 函数:画方差箭头
# our data begin as:
# group CSpluslatency CSminuslatency CSplusSEM CSminusSEM
# 1 sham 3.884335 4.212531 0.2248404 0.2593122
# 2 ACCX 4.672486 3.619434 0.3476289 0.4902273
#
# step 1: reorganize
latencies = t(matrix( c(CSpluslatency, CSminu