[英]Plotting p-value in normal distribution (in R)?
i am a beginner when it comes to statistics.我是统计学的初学者。 I am trying to display p-value in a plot, or rather, to add an abline to display it on the plot of normal distribution.
我试图在 plot 中显示 p 值,或者更确切地说,添加一个 abline 以在正态分布的 plot 上显示它。 Currently I am doing it like this.
目前我正在这样做。
pVal = 0.04
abline(v=qnorm(pVal/2))
I am however not sure if this is correct.但是,我不确定这是否正确。 I would like to visualize whether p-value is above/below alpha (in this case lets say alpha=0.05).
我想可视化 p 值是否高于/低于 alpha(在这种情况下让我们说 alpha=0.05)。
You really need to spend some time with a basic R tutorial.您确实需要花一些时间学习基本的 R 教程。 I'm not sure what you want, but maybe this is close:
我不确定你想要什么,但也许这很接近:
x <- seq(-3, 3, length.out=100)
plot(x, dnorm(x), typ="l")
alpha <- .05
a <- c(-1, 1) * qnorm(alpha/2)
pVal <- 0.04
v <- c(-1, 1) * qnorm(pVal/2)
abline(v=a)
abline(v=v, lty=2)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.