Bland–Altman 图的R及MedCalc实现
1 25 54
2 24 42
3 27 64
4 21 33
5 50 53
6 71 61
7 54 55
8 62 35
9 30 46
******
data<-read.csv(“ba.csv”,header=TRUE)
data
attach(data)
bland_altman_plot <- function(test1,test2,xlab=”Average testresult”, ylab=”Deviation of experimental test”)
{
d <- ((test1 + test2)/2)
diff <- test1 – test2
plot(diff ~ d,pch=16,ylim=c(-60,60),xlab=xlab,ylab=ylab)
abline(h=mean(diff)-c(-1.96,0,1.96)*sd(diff),lty=2)
}
bland_altman_plot(test1,test2,xlab=”Test 1″,ylab=”Difference Test1 and Test2″)
******
******
MedCalc结果
转载请注明:数据分析 » Bland–Altman 图的R及MedCalc实现_medcalc bland altman