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.
@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