新建两个变量s和d:
s
12.00
13.00
12.00
11.00
10.00
12.00
13.00
11.00
12.00
11.00
13.00
11.00
14.00
9.00
10.00
d
9.00
11.00
14.00
13.00
9.00
16.00
14.00
15.00
15.00
13.00
15.00
16.00
14.00
15.00
14.00
再新建一个syntax,直接复制粘贴如下内容,实现对s和d两次测量结果绘制B-A散点图:
COMPUTE diff = s-d .标准差怎么算
COMPUTE mmean = (s + d)/2 .
*步骤2:计算差值diff的均数和标准差.
DESCRIPTIVES VARIABLES=diff.
/STATISTICS =MEAN STDDEV MIN MAX
*步骤3:手动计算“均数+1.96*标准差、均数、均数-1.96*标准差”,在作图时需手动更改Y 轴对应数值.
COMPUTE x1 = -1.9333 + 1.96*2.57645 .
COMPUTE x2 = -1.9333 - 1.96*2.57645 .
*步骤4:以两种方法测量值的均数(X1+X2)/2为X轴,以两种方法测量值的差值(X1-X2)为Y轴做散点图,同时显示四条分界线(Y=均数+1.96*标准差、Y=均数、Y=均数-1.96*标准差、Y=0).
*Chart Builder.
GGRAPH
/GRAPHDATASET NAME="graphdataset" VARIABLES=mmean diff MISSING=LISTWISE REPORTMISSING=NO
/GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
SOURCE: s=userSource(id("graphdataset"))
DATA: mmean=col(source(s), name("mmean"))
DATA: diff=col(source(s), name("diff"))
GUIDE: axis(dim(1), label("mmean"))
GUIDE: axis(dim(2), label("diff"))
GUIDE: form.line(position(*,3.12))
GUIDE: form.line(position(*, -1.9333))
GUIDE: form.line(position(*, -6.89))
GUIDE: form.line(position(*, 0))
ELEMENT: point(position(mmean*diff))
END GPL.
发布评论