在组之间绘制p值/意义符号

发布于 2025-01-31 06:23:50 字数 2494 浏览 2 评论 0 原文

除了我从一般方差分析中获得的P值(p = 0.034*),这在我的条形图中很重要且手动注释。我还想在每个独立的时间点(0、0.5、8、24、48)的因素(“正常”和“高光+冰”)中找到并包括p值/重要性符号(“正常”和“高光+冰”)。 br> 但是,似乎所有这些都不显着,如所附图像所示。
我可以知道我做错了哪一步?
PS我所需的p-value/意义绘图的示例

http://www.sthda.com/english/sthda-upload/figures/ggpubr/010-add-p-values-to-ggplots-compare- Means-Interaction-3.png ) ( http://www.sthda.com/english/sthda-upload/figures/ggpubr/010-Add-p--values-to-ggplots-to-ggplots-compare-compare-compare-compare-means-ingeration-interaction-ingeraction-2.png

“我的绘图”

我的数据框架:

Exp1_fv<-summarySE(data=Exp1, measurevar="fv", groupvars=c("growth_condition","time"))

data.frame(Exp1_fv)

growth_condition time N        fv          sd          se         ci 
Normal           0.0 3 0.8066667 0.005773503 0.003333333 0.01434218             
Normal           0.5 3 0.8033333 0.011547005 0.006666667 0.02868435
Normal           8.0 3 0.8100000 0.010000000 0.005773503 0.02484138
Normal          24.0 3 0.8166667 0.005773503 0.003333333 0.01434218
Normal          48.0 3 0.8100000 0.010000000 0.005773503 0.02484138
High light+Chilled  0.0 3 0.8133333 0.005773503 0.003333333 0.01434218
High light+Chilled  0.5 3 0.6766667 0.068068593 0.039299420 0.16909176
High light+Chilled  8.0 3 0.4433333 0.095043850 0.054873592 0.23610201
High light+Chilled 24.0 3 0.3900000 0.045825757 0.026457513 0.11383749
High light+Chilled 48.0 3 0.6966667 0.035118846 0.020275875 0.08724005

我的脚本:

ggplot(data=Exp1_fv, mapping = aes(x = factor(time), y = fv, fill= growth_condition))+

  geom_bar(stat = "identity", position = "dodge")+

  labs(title="Fv/Fm", x= "Time (hours)",  y="Fv/Fm", fill= "Growth condition")+

  ylim(0,1.2)+

  geom_errorbar(aes(ymin=fv-se, ymax=fv+se), width=.2, position=position_dodge(width= 0.9))+

  annotate(geom="text", x=1, y=1.1, label="p=0.034")+

  annotate(geom="text", x=1, y=1.0, label="n=3")+

  stat_compare_means(aes(group=growth_condition), label="p.signif")

Apart from the p-value that I got from running general ANOVA (p=0.034*), which is significant and manually annotated in my bar chart. I would also like to find and include the p-values/ significance symbols within the factors ("Normal" and "High light+Chilled" from growth_condition) at each independent time points (0, 0.5, 8, 24, 48).
However it appeared that all of them were non-significant as shown in the attached image.
May I know which step have I done wrongly?
p.s. examples of my desired p-value/significance plotting

(http://www.sthda.com/english/sthda-upload/figures/ggpubr/010-add-p-values-to-ggplots-compare-means-interaction-3.png)
(http://www.sthda.com/english/sthda-upload/figures/ggpubr/010-add-p-values-to-ggplots-compare-means-interaction-2.png)

My plot

My data frame:

Exp1_fv<-summarySE(data=Exp1, measurevar="fv", groupvars=c("growth_condition","time"))

data.frame(Exp1_fv)

growth_condition time N        fv          sd          se         ci 
Normal           0.0 3 0.8066667 0.005773503 0.003333333 0.01434218             
Normal           0.5 3 0.8033333 0.011547005 0.006666667 0.02868435
Normal           8.0 3 0.8100000 0.010000000 0.005773503 0.02484138
Normal          24.0 3 0.8166667 0.005773503 0.003333333 0.01434218
Normal          48.0 3 0.8100000 0.010000000 0.005773503 0.02484138
High light+Chilled  0.0 3 0.8133333 0.005773503 0.003333333 0.01434218
High light+Chilled  0.5 3 0.6766667 0.068068593 0.039299420 0.16909176
High light+Chilled  8.0 3 0.4433333 0.095043850 0.054873592 0.23610201
High light+Chilled 24.0 3 0.3900000 0.045825757 0.026457513 0.11383749
High light+Chilled 48.0 3 0.6966667 0.035118846 0.020275875 0.08724005

My scripts:

ggplot(data=Exp1_fv, mapping = aes(x = factor(time), y = fv, fill= growth_condition))+

  geom_bar(stat = "identity", position = "dodge")+

  labs(title="Fv/Fm", x= "Time (hours)",  y="Fv/Fm", fill= "Growth condition")+

  ylim(0,1.2)+

  geom_errorbar(aes(ymin=fv-se, ymax=fv+se), width=.2, position=position_dodge(width= 0.9))+

  annotate(geom="text", x=1, y=1.1, label="p=0.034")+

  annotate(geom="text", x=1, y=1.0, label="n=3")+

  stat_compare_means(aes(group=growth_condition), label="p.signif")

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

人间不值得 2025-02-07 06:23:50

显然,“ stat_compare_means”将需要分组的完整数据,以提供任何有意义的统计测试(借助Adam Quek以获取建议)。因此,我将不得不在“ stat_compare_means”函数中引用我的原始数据(注释为“ EXP1”),而不是使用摘要数据(注释为“ EXP1_FV”,我从“ summarysese”函数中获得的“ EXP1_FV”)。

修改后的脚本:
stat_compare_means(data = exp1,label =“ p.Signif”,label.y = 0.85,method =“ anova”)

修改的图像

Apparently, "stat_compare_means" will require the full data of the groupings in order to provide any meaningful statistical test (credit to Adam Quek for the advice). Hence, I will have to refer my raw data (annotated as "Exp1") in the "stat_compare_means" function, rather than using the summarized data (annotated as "Exp1_fv" which I got from the "summarySE" function).

Modified script:
stat_compare_means(data=Exp1, label="p.signif", label.y= 0.85, method="anova")

Modified image

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文