Simple yet somehow hard Statistical Hypothesis Testing

73 Views Asked by At

I am trying to understand Statistical Hypothesis Tests.


I have a dice that gives a six with probability 1/6 and I want to see if it really is the case.

$$H_0: \ p=\frac{1}{6} \ \ \ \ \ \ \ \ \ H_1: \ p \neq \frac{1}{6}$$ With $\alpha = 5\%$

The dice is thrown 18 times and we get 6 sixes. Can we reject $H_0$?


First of all, I see that its a two sided interval but I can't use Normal distribution since n<30 so I need to use $t_a(n-1)$ with n=18 and $a/2=0.025$ gives $t_{0.025}(17)=2.11$. I know that the p-value should somehow be 0.1028 with the answer "No we cant reject $H_0$" but I am at a loss of how to get there. How do I solve this?

Source of the problem (in Swedish).

2

There are 2 best solutions below

2
On

As you say, you can't use a normal approximation. In R the procedure binom.test does an exact binomial test of $H_0: p = 1/6$ against $H_a: p\ne 1/6$, as shown below. With $X = 6$ successes in $n=18$ trials, $H_0$ is not rejected at the 5% level of significance.

binom.test(6, 18, p=1/6)

        Exact binomial test

data:  6 and 18
number of successes = 6, number of trials = 18, 
 p-value = 0.1028
alternative hypothesis: 
 true probability of success is not equal to 0.1666667
95 percent confidence interval:
 0.1334274 0.5900748
sample estimates:
probability of success 
             0.3333333 

As @Henry has commented, the P-value is computed under the null distribution $\mathsf{Binom}(n=18,\, p=1/6),$ which has $1 - P(1 \le X \le 5) = 0.1028,$ to four places. (See slide 12 in your link for the method.)

1-sum(dbinom(1:5, 18, 1/6))
[1] 0.1028261

The figure below shows the null distribution $\mathsf{Binom}(n=18,\, p = 1/6);$ the P-value is the total height of the heavy blue bars.

enter image description here

0
On

Let $X \sim \mathsf{Bin}(18, 1/6).$ Then $\mathbf{P}(X \geq 6) = 0.06526505$ (using $\mathtt{R}$). Under your "null hypothesis", your dice has the same distribution as $X$ and the probability of seeing $6$ or more sixes, is about $6.5\%$, which would not be inconsistent with the "null hypothesis" if you want to set the cut-off at $5\%$. Please note that it is not very sensical to exclude zero (I don't know who suggested you to do such thing). In fact, $\mathbf{P}(X = 0) = (\dfrac{5}{6})^{18} = 0.03756104$ which is pretty large.