One-sided and two-sided p-values after seeing the data
A researcher observes 218 successes in 400 independent Bernoulli trials. Before data collection, the alternative was H1: p>0.5, with α=0.05. The sample proportion is 0.545. The researcher computes z=1.80 and a one-sided p-value of 0.036, declares significance, and submits a claim that the success rate exceeds 0.5. A regulator's template, however, requires a two-sided test for any claim of a difference from 0.5, and reports a p-value of 0.072. The researcher argues that because the direction was pre-specified, the one-sided p-value is the only valid one; the regulator argues that the same data would not support a two-sided difference at 5%. They ask for a reconciliation, the correct 95% confidence interval, and whether changing the test after seeing the data is acceptable.
1. Verify the one-sided and two-sided p-values and compute a 95% two-sided confidence interval for p.
Read the worked answer
Under H0, p=0.5, so se₀=√(0.5·0.5/400)=0.025. The observed p̂=218/400=0.545 gives z=(0.545−0.5)/0.025=1.80. The one-sided p-value for p>0.5 is P(Z≥1.80)=0.0359. The two-sided p-value is 2·0.0359=0.0719. For the two-sided 95% interval use the estimated se: se=√(0.545·0.455/400)=0.0249. Then 0.545±1.96·0.0249 gives (0.4962, 0.5938). This interval contains 0.5, consistent with the two-sided p-value above 0.05.
2. State the decision under each testing framework and explain whether the researcher may switch to the one-sided test after seeing the data.
Read the worked answer
Under the pre-specified one-sided test H1:p>0.5 at α=0.05, p=0.036<0.05, so reject H0. Under the regulator's two-sided test, p=0.072>0.05, so do not reject. Both can be correct for their own questions. The problem is switching tests after seeing the data: choosing one-sided versus two-sided based on which gives significance inflates the type I error and invalidates the reported p-value. If the directional claim was genuinely pre-registered, the one-sided test is defensible; if the claim is a general difference, the two-sided test is required.
3. What one-sided 95% lower confidence bound corresponds to the pre-specified directional claim? Does it support p>0.5?
Read the worked answer
The one-sided 95% lower bound corresponding to H1:p>0.5 is p̂−z₀.₉₅·se = 0.545−1.645·0.0249=0.5040. Since 0.504>0.5, the directional claim is supported at the 5% level by the one-sided procedure. But the margin is small, and the two-sided interval includes 0.5. The report should state the pre-specified direction and not present the one-sided result as if it were a two-sided difference.