Skip to content
Prev 5168 / 5636 Next

[R-meta] Calculation of p values in selmodel

Please always respond to the list, not just the individual that replied to you.

Halving the p-value from two-sided tests is not the right way to compute one-sided p-values.

Say you do an independent samples t-test with H1: mu1 > mu2 versus H0: mu1 <= mu2. Then:

pt(2.34, df=20, lower.tail=FALSE)

and

pt(-2.34, df=20, lower.tail=FALSE)

will give you the correct one-sided p-values, depending on whether mean1 > mean2 (in the first case) or mean1 < mean2 (in the second case).

In a two-sided test (i.e., H1: mu1 != mu2 versus H0: mu1 = mu2), we would compute the p-value with:

2*pt(abs(2.34), df=20, lower.tail=FALSE)
2*pt(abs(-2.34), df=20, lower.tail=FALSE)

for these two cases, but dividing these by 2 does not work in the second case.

If you use selmodel(..., alternative="greater"), then you really should also pass one-sided p-values to the function, where the p-values are computed for an alternative hypothesis with the appropriate directionality.

Best,
Wolfgang