比较不同技术之间的相关性
Compare the correlation between differents techniques
1/ 鉴于以下小标题,我测试了三种不同的技术(PCR、TECH_A 和 TECH_B)。这个想法是看看 TECH_A 和 TECH_B 在检测特定基因方面与 PCR 相比如何。我的意思是如果他们同意的话。
N 等同于“-”(表示否定)。例如,第一行表示 PCR 为阴性 TECH_a 并且 tech_A 为阴性,因此它们 return 相同的结果为阴性。
> dat
# A tibble: 5 x 4
# Groups: PCR [2]
PCR TECH_A TECH_B CASES
<chr> <chr> <chr> <int>
1 N - - 1
2 N - + 23
3 N + + 8
4 P - + 2
5 P + + 4
这是数据:
dat <-
structure(list(PCR = c("N", "N", "N", "P", "P"), TECH_A = c("-",
"-", "+", "-", "+"), TECH_B = c("-", "+", "+", "+", "+"), CASES = c(1L,
23L, 8L, 2L, 4L)), row.names = c(NA, -5L), class = c("grouped_df",
"tbl_df", "tbl", "data.frame"), na.action = structure(c(`2` = 2L,
`6` = 6L, `8` = 8L, `10` = 10L, `12` = 12L, `15` = 15L, `18` = 18L,
`20` = 20L, `22` = 22L, `24` = 24L, `26` = 26L, `28` = 28L, `30` = 30L,
`31` = 31L, `34` = 34L, `35` = 35L, `38` = 38L, `39` = 39L, `42` = 42L,
`44` = 44L, `46` = 46L, `48` = 48L, `50` = 50L, `52` = 52L, `54` = 54L,
`56` = 56L, `58` = 58L, `60` = 60L, `62` = 62L, `64` = 64L, `67` = 67L,
`69` = 69L, `71` = 71L), class = "omit"), groups = structure(list(
PCR = c("N", "P"), .rows = list(1:3, 4:5)), row.names = c(NA,
-2L), class = c("tbl_df", "tbl", "data.frame"), .drop = TRUE))
知道如何将最后两种技术与 PCR 进行比较,看看它们是否相关吗??
两个二进制值之间的相关性就像我猜的准确性(有多少人同意)。除此之外,您还可以查看误报率、漏报率等,以对您的情况更重要的为准。
下面我做了PCR和Tech A/Tech B的对比,使用混淆矩阵基本上整理了每个技术的统计数据,你可以看到Tech A同意PCR..
第 TECH_A 个:
cm = table(rep(dat$PCR,dat$CASES),rep(dat$TECH_A,dat$CASES))
# rename for convenience
rownames(cm) = c("-","+")
Accuracy : 0.7368
95% CI : (0.569, 0.866)
No Information Rate : 0.6842
P-Value [Acc > NIR] : 0.3062
Kappa : 0.2963
Mcnemar's Test P-Value : 0.1138
Sensitivity : 0.9231
Specificity : 0.3333
Pos Pred Value : 0.7500
Neg Pred Value : 0.6667
Prevalence : 0.6842
Detection Rate : 0.6316
Detection Prevalence : 0.8421
Balanced Accuracy : 0.6282
然后对于 B:
cm = table(rep(dat$PCR,dat$CASES),rep(dat$TECH_B,dat$CASES))
rownames(cm) = c("-","+")
Confusion Matrix and Statistics
- +
- 1 31
+ 0 6
Accuracy : 0.1842
95% CI : (0.0774, 0.3433)
No Information Rate : 0.9737
P-Value [Acc > NIR] : 1
Kappa : 0.0101
Mcnemar's Test P-Value : 7.118e-08
Sensitivity : 1.00000
Specificity : 0.16216
Pos Pred Value : 0.03125
Neg Pred Value : 1.00000
Prevalence : 0.02632
Detection Rate : 0.02632
Detection Prevalence : 0.84211
Balanced Accuracy : 0.58108
'Positive' Class : -
1/ 鉴于以下小标题,我测试了三种不同的技术(PCR、TECH_A 和 TECH_B)。这个想法是看看 TECH_A 和 TECH_B 在检测特定基因方面与 PCR 相比如何。我的意思是如果他们同意的话。
N 等同于“-”(表示否定)。例如,第一行表示 PCR 为阴性 TECH_a 并且 tech_A 为阴性,因此它们 return 相同的结果为阴性。
> dat
# A tibble: 5 x 4
# Groups: PCR [2]
PCR TECH_A TECH_B CASES
<chr> <chr> <chr> <int>
1 N - - 1
2 N - + 23
3 N + + 8
4 P - + 2
5 P + + 4
这是数据:
dat <-
structure(list(PCR = c("N", "N", "N", "P", "P"), TECH_A = c("-",
"-", "+", "-", "+"), TECH_B = c("-", "+", "+", "+", "+"), CASES = c(1L,
23L, 8L, 2L, 4L)), row.names = c(NA, -5L), class = c("grouped_df",
"tbl_df", "tbl", "data.frame"), na.action = structure(c(`2` = 2L,
`6` = 6L, `8` = 8L, `10` = 10L, `12` = 12L, `15` = 15L, `18` = 18L,
`20` = 20L, `22` = 22L, `24` = 24L, `26` = 26L, `28` = 28L, `30` = 30L,
`31` = 31L, `34` = 34L, `35` = 35L, `38` = 38L, `39` = 39L, `42` = 42L,
`44` = 44L, `46` = 46L, `48` = 48L, `50` = 50L, `52` = 52L, `54` = 54L,
`56` = 56L, `58` = 58L, `60` = 60L, `62` = 62L, `64` = 64L, `67` = 67L,
`69` = 69L, `71` = 71L), class = "omit"), groups = structure(list(
PCR = c("N", "P"), .rows = list(1:3, 4:5)), row.names = c(NA,
-2L), class = c("tbl_df", "tbl", "data.frame"), .drop = TRUE))
知道如何将最后两种技术与 PCR 进行比较,看看它们是否相关吗??
两个二进制值之间的相关性就像我猜的准确性(有多少人同意)。除此之外,您还可以查看误报率、漏报率等,以对您的情况更重要的为准。
下面我做了PCR和Tech A/Tech B的对比,使用混淆矩阵基本上整理了每个技术的统计数据,你可以看到Tech A同意PCR..
第 TECH_A 个:
cm = table(rep(dat$PCR,dat$CASES),rep(dat$TECH_A,dat$CASES))
# rename for convenience
rownames(cm) = c("-","+")
Accuracy : 0.7368
95% CI : (0.569, 0.866)
No Information Rate : 0.6842
P-Value [Acc > NIR] : 0.3062
Kappa : 0.2963
Mcnemar's Test P-Value : 0.1138
Sensitivity : 0.9231
Specificity : 0.3333
Pos Pred Value : 0.7500
Neg Pred Value : 0.6667
Prevalence : 0.6842
Detection Rate : 0.6316
Detection Prevalence : 0.8421
Balanced Accuracy : 0.6282
然后对于 B:
cm = table(rep(dat$PCR,dat$CASES),rep(dat$TECH_B,dat$CASES))
rownames(cm) = c("-","+")
Confusion Matrix and Statistics
- +
- 1 31
+ 0 6
Accuracy : 0.1842
95% CI : (0.0774, 0.3433)
No Information Rate : 0.9737
P-Value [Acc > NIR] : 1
Kappa : 0.0101
Mcnemar's Test P-Value : 7.118e-08
Sensitivity : 1.00000
Specificity : 0.16216
Pos Pred Value : 0.03125
Neg Pred Value : 1.00000
Prevalence : 0.02632
Detection Rate : 0.02632
Detection Prevalence : 0.84211
Balanced Accuracy : 0.58108
'Positive' Class : -