To Documents
Testing for a Proportion
Averages of Random Variables
- The expected value of the average of n outcomes of
a random variable:
E(x) =
E[(x1 + ... + xn) / n] =
E[x1 / n + ... + xn / n]
=
E(x1 / n) + ... + E(xn / n) =
E(x1) / n + ... + E(xn) / n
= nE(x1) / n = E(x1)
- The variance of the average of n independent outcomes of a
random variable:
Var(x) =
Var[(x1 + ... + xn) / n] =
Var[x1 / n + ... + xn / n]
=
Var(x1 / n) + ... + Var(xn / n) =
Var(x1) / n2 + ... +
Var(xn) / n2
=
= nVar(x) / n2 = Var(x1) / n
- The standard deviation of the average of n independent outcomes of a
random variable:
σx =
√[Var(x)] =
√[Var(x1) / n] =
σx / √n
- Recall that E(x) = E(x1). How does
σx compare to
σx?
- For a Bernoulli random variable x, the average of n outcomes
x = S / n of x is
the proportion of successes. Recall that S is the number of successes and n is
the number of trials.
Tests of Hypotheses for Proportions
- A test of hypothesis can be used to determine if a coin or die is fair.
- For testing if a coin is fair, we test the null hypothesis
H0: p = 0.5 against the alternative hypothesis
H1: p ≠ 0.5.
- Here are the four steps for testing if the probability of success p for a Bernoulli
random variable is equal to p0:
- Write down the null and alternative hypothesis:
H0: p = p0
H1: p ≠ p0.
- Write down the test statistic, assuming the null hypothesis:
z = (p^ - p) / σphat
- Write down a 95% confidence interval for z:
I = [-1.96, 1.96]
- If z ∉ I, reject H0; if z ∈ I, accept H1.
- Example 1: Flip a coin 100 times and obtain 43 heads. Is the coin fair?
- H0: p = 0.5;
H1: p ≠ 0.5
- phat = S / n = 43/100 = 0.43, and σphat = √[np(1-p)]
= √[(0.5)(1-0.5)/100] = 0.05,
so
z = (phat - p) / σphat = (0.43 - 0.5) / 0.05 = -1.4
- A 95% confidence interval for z is [-1.96, 1.96].
- -1.4 ∈ [-1.96, 1.96], so accept the null hypothesis. Not enough evidence to conclude that the
coin is not fair.
- Example 2: To test if a four-faced die
(shape of a tetrahedron) is fair,
such a die is rolled 1600 times. 421 aces are obtained. Perform a test
of hypothesis to test whether the die is fair.