I'm struggling with computing two-tailed p-values from a Z value:
pvalue = pnorm(zscore, meanIAT2, sdIAT2, lower.tail = FALSE) calculates a one-tailed p-value.
Now, usually you would use 2*pnorm for a two-tailed test. However, if I do that, I get p > 1. What do I do wrong?
The Z scores have mean 0 and SD 1, so that step went correctly.

@Maxprimbs intuitively, you are on the wrong end of the distribution - if the z-val is negative, you'd do $lower.tail = TRUE$ and that should work (?)

@levolz I have a z score of 0.30, a population mean of 0.307, a SD of 0.03, and my p value for lower.tail = False is 1.03.
For my z of 6 it is 0 with false and 2 with true.

This is all very weird.

@Maxprimbs @levolz If you can get something like a 2-sided p-value here like pnorm(.30,.307,.03, lower.tail=T)+pnorm((.307+(.307-.30)), .307, .03) which gives you the symmetrical probability of any value being at least as far removed from the mean as the observed value. Note though, that, because it symmetrical, this is equivalent to just using pnorm(.30, .307, .03, lower.tail=T)*2.

Follow

@julianquandt @Maxprimbs
Thanks for the added context, Julian!

@ max: pnorm(.30, .307, .03, lower.tail=F) is equivalent to pnorm(-.07, 0., .03, F), so you integrate over more than half of the probability distribution - that's why lower.tail = T fixes it here

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.