p-value - 将调整后的 p 值添加到 ggplot 箱线图中
问题描述
我知道以前有人问过这个问题,并且我已经查看了解决方案,但它们不适用于我的情况。我有一个小数据集(BCAAparams),其中包含在不同浓度的抑制剂存在下酶的 Km 和 Vmax 值(变量是 Km、Vmax 和 Conc(抑制剂)),每个 n=6。
Km Vmax Conc
0.32761 0.66823 0
0.31735 0.61598 0
0.462 0.722 0
0.31537 0.75304 0
0.28596 0.69695 0
0.25033 0.6482 0
0.24417 0.56245 2
0.25671 0.55012 2
0.24481 0.5027 2
0.2128 0.627 2
0.25104 0.64405 2
0.27557 0.65705 2
0.15244 0.46027 10
0.15438 0.41831 10
0.1457 0.37902 10
0.15884 0.52568 10
0.16006 0.5068 10
0.14318 0.47678 10
0.0879 0.34372 20
0.09132 0.32773 20
0.07899 0.28851 20
0.09257 0.38427 20
0.09333 0.37988 20
0.09315 0.36979 20
我正在寻找分析抑制剂对每个酶参数的影响,例如,
ggplot(BCAAparams, aes(group=Conc, x=Conc, y=Km)) +
geom_boxplot(notch=FALSE) + labs(x="BCAA conc (mM)", y="Km (mM)")
我正在使用 ggpubr,我可以成功比较不同组的平均值(抑制剂的浓度)
compare_means(Km ~ Conc, data = BCAAparams, method = "t.test")
# A tibble: 6 x 8
.y. group1 group2 p p.adj p.format p.signif method
<chr> <chr> <chr> <dbl> <dbl> <chr> <chr> <chr>
1 Km 0 2 0.0432 0.043 0.04317 * T-test
2 Km 0 10 0.00190 0.0038 0.00190 ** T-test
3 Km 0 20 0.000461 0.0014 0.00046 *** T-test
4 Km 2 10 0.0000342 0.000140 3.4e-05 **** T-test
5 Km 2 20 0.00000276 0.000014 2.8e-06 **** T-test
6 Km 10 20 0.0000000135 0.000000081 1.3e-08 **** T-test
问题是我找不到添加 stat_compare_means 命令的方法,该命令会将括号和相关的调整后的 p 值放到我的箱线图中,例如;
my_comparisons <- list(c("0", "2"), c("0", "10"), c("0", "20"),
c("2","10"), c("2", "20"), c("10", "20"))
ggplot(BCAAparams, aes(group=Conc, x=Conc, y=Km)) +
geom_boxplot(notch=FALSE) + stat_compare_means(aes(label = "p.adj"),
comparisons = my_comparisons, method = "t.test") + labs(x="BCAA conc
(mM)", y="Km(mM)")
我收到错误消息“提供给连续刻度的离散值”。我已经尝试将 stat_compare_means 命令移动到代码中的其他“位置”,并且我还尝试了我在其他帖子中看到的回答类似问题的内容,将箱线图设置为对象,然后将 stat_compare_means 添加到它但沿着这些路线没有任何效果。有没有人知道我做错了什么?
解决方案
推荐阅读
- c - 存在链接和符号时的“未定义引用”
- reactjs - react+spring boot 开发设置
- json - 如何使用 f# 反序列化 json 以获得正确的类型
- node.js - 如何使用 Nodejs 对从 mongoDB 获取的数据求和
- c# - 如何将任何类型的值传递给函数
- c - 从比特流中提取 10 位字
- angular - “错误错误:未捕获(承诺中):InvalidValueError:不是 LatLngBounds 或 LatLngBoundsLiteral:不是对象”页面加载时使用
- mysql - MySQL 服务器超载
- c++ - 在 ARM 上混合 uint64_t 和 long 会产生奇怪的结果
- android - 如何使用意图共享多个链接我有一个用于 android playstore 的链接,另一个用于 iOS