I would like to conduct a test whether my hypothesised proportion P
(a estimated parameter) is greater or equal to the sample proportion $P_{0}$. The hypothesis is as follows:
\begin{align} H_{0}\!: P \ge P_{0} \\ H_{1}\!: P < P_{0} \end{align}
I believe this is a right-tailed, one-sided hypothesis test, given $H_{0}$. Namely, we are looking whether the result of the test is greater or equal to 95% or 99% ($\alpha = 5\%$ and/or $1\%$).
Let's suppose that my parameter estimate $P$ is 0.15, hence 15% of population fails. The sample has 1000 obs and failures of 16% (160 failures and 840 successes). I could solve it two ways:
Build confidence interval around the predicted value $P$ and test whether the $P_{0} = 16\%$ is above the upper bound CI.
In this case the upper CI is, using R:
qbeta(.95, 0.15*1000, 1000-(0.15*1000)) # [1] 0.1689547
Since 16% < then 16.90% we fail to reject the $H_{0}$ hypothesis.
The second option is using the
pbeta
function:1-pbeta(0.15, 160, 840) # [1] 0.8045226
Here we have the right tail hypothesis test, where 0.15 is the $P$ estimated parameter (our forecast) and
160
is number of observed failures and 840 successes (1000obs - 160 failures).With the result of
80.04%
and fact that80.04%
<95%
we fail to reject the null hypothesis (hence accept $H_{0}$).
Are the formulations and solutions correct?