Hypothesis Testing for a proportion Calculator

Enter x (# of successes) Enter n (sample size) Enter H0 Enter α
p

100 randomly selected items were tested. It was found that 40 of the items tested positive.
Test the hypothesis that exactly 50% of the items tested positive at α = 0.05

State the null and alternative hypothesis:
H0: p = 0.5
HA: p ≠ 0.5

Compute
p^ =x
n

p^ =40
100

p^ = 0.4

Calculate our test statistic z:
z =p^ - p
p(1 - p)/n

z =0.4 - 0.5
0.5(1 - 0.5)/100

z =-0.1
0.5(0.5)/100

z =-0.1
0.0025

z =-0.1
0.05

z = -2

Checking our table of z-scores for α = 0.05%, we get:
Z = 1.6449

Our rejection region is Z > 1.6449
Since our test statistic of -2 is less than our Z-value of 1.6449, it is not in the rejection region, so we accept H0