Bland-AltmanPlots(⼀致性评价)在python中的实现
假设有reader1和reader2,分别对⼀定数量病⼈的某⼀影像指标进⾏评分,现在想看⼀下这两位研究者评分的⼀致性,绘制Bland-Altman图是
⼀种较为直观、简单的⽅式。python代码实现⽅法如下:
⾸先读⼊数据
folderPath="/Urs/.../ICC/features4ICC/"
data1=_excel((folderPath,"reader1_"))
data2=_excel((folderPath,"reader2_"))
(0,"reader",([0]))
(0,"reader",([0])*2)
(0,"target",range([0]))
(0,"target",range([0]))
data=([data1,data2])
print(data)
input_
Method1
importnumpyasnp
importpingouinaspg
ax=_blandaltman(data1['original_shape_Elongation'],data2['original_shape_Elongation'])
method_
Method2
#pipinstallpyCompare#forthefirsttime
importpyCompare
ltman(data1['original_shape_Elongation'],data2['original_shape_Elongation'],
percentage=Fal,
title='Bland-AltmanPlot2',
limitOfAgreement=1.96)
method_
ltman(data1['original_shape_Elongation'],data2['original_shape_Elongation'],
savePath='',
figureFormat='tiff')
Method3
asplt
importnumpyasnp
defbland_altman_plot(data1,data2,*args,**kwargs):
data1=y(data1)
data2=y(data2)
mean=([data1,data2],axis=0)
diff=data1-data2#Differencebetweendata1anddata2
md=(diff)#Meanofthedifference
sd=(diff,axis=0)#Standarddeviationofthedifference
r(mean,diff,*args,**kwargs)
e(md,color='gray',linestyle='-')
e(md+1.96*sd,color='gray',linestyle='--')
e(md-1.96*sd,color='gray',linestyle='--')
importrandom
bland_altman_plot(data1['original_shape_Elongation'],data2['original_shape_Elongation'])
('Bland-AltmanPlot3')
()
method_
参考资料:
Pingouinofficialdocumentation
Why&HowtoutheBland-AltmanplotforA/Btesting|Python+code
Bland-Altmanplotwithconfidenceintervalboundaryinpython
本文发布于:2022-12-26 20:39:24,感谢您对本站的认可!
本文链接:http://www.wtabcd.cn/fanwen/fan/90/35929.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |