理学療法士がまとめたノート

統計学備忘録(R言語のメモ)

since2016 ときどきTEXのメモ

RでBland Altman Plotを描く

 

データ
国際医療福祉大学 下井研究室
信頼性の検討方法:相対信頼性と絶対信頼性
例1(http://shimoi.iuhw.ac.jp/reliability_3_systematicbias.html
を使用させていただきました

x1
25.1 23.3 33.2 20.9 22.8 34.9 26.5 26.1 29.4 29.8 29.2 26.5 14.3 14.6 17.3 20.2 17.4 19.6 30.2 30.3 23.1 17.7 18.9 28.0 15.2 16.8 11.7 10.5 25.2 15.9

y1
17.6 21.5 25.6 10.5 16.4 31.2 20.8 27.0 32.8 30.9 22.9 24.0 18.2 14.9 13.2 17.2 19.5 15.8 21.2 26.1 14.1 14.8 12.3 17.6 14.3 8.2 11.3 11.8 23.4 10.6

 

まずはインストールを忘れずに

install.packages("BlandAltmanLeh")
library(BlandAltmanLeh)

 

ba <- bland.altman.stats(x1, y1)  
str(ba)            #データを概観して必要な部分だけ抜き取ります
plot(ba$means, ba$diffs,ylim=c(-8,15))
abline(h=ba$mean.diffs, lty=2, col=2)
abline(h=ba$CI.lines[2], lty=2) #誤差の許容範囲として最もあまい(optimisticな)範囲
abline(h=ba$CI.lines[5], lty=2) #誤差の許容範囲として最もあまい(optimisticな)範囲

f:id:yoshida931:20170509192237p:plain

 

bland.altman.plot(x1,y1)f:id:yoshida931:20170509192812p:plain

bland.altman.plot(x1,y1,conf.int = .95)

f:id:yoshida931:20170509192854p:plain