Professional Documents
Culture Documents
Hypothesis Testing
Hypothesis Testing
m >3
or
m 5.
Suppose that we want to test the hypothesis that m 5. Then we can think of our
opponent suggesting that m = 5. We call the opponent's hypothesis the null
hypothesis and write:
H0: m=5
H1: m 5
For the null hypothesis we always use equality, since we are comparing m with a
previously determined mean.
4. Collect data.
6. Utilize the table to determine if the z score falls within the acceptance
region.
7. Decide to
b. Fail to reject the null hypothesis and therefore state that there is not
enough evidence to suggest the truth of the alternative hypothesis.
We define a type I error as the event of rejecting the null hypothesis when the null
hypothesis was true. The probability of a type I error (a) is called the significance
level.
We define a type II error (with probability b) as the event of failing to reject the
null hypothesis when the null hypothesis was false.
Example
Suppose that you are a lawyer that is trying to establish that a company has been
unfair to minorities with regard to salary increases. Suppose the mean salary
increase per year is 8%.
H0: m = .08
A. We put sanctions on the company, when they were not being discriminatory.
Suppose we want to show that only children have an average higher cholesterol
level than the national average. It is known that the mean cholesterol level for all
Americans is 190. Construct the relevant hypothesis test:
H0: m = 190
x = 198
s = 15.
Since z is so high, the probability that Ho is true is so small that we decide to reject
H0 and accept H1. Therefore, we can conclude that only children have a higher
cholesterol level on the average then the national average.
Rejection Regions
Suppose that a = .05. We can draw the appropriate picture and find the z score for
-.025 and .025. We call the outside regions the rejection regions.
We call the blue areas the rejection region since if the value of z falls in these
regions, we can say that the null hypothesis is very unlikely so we can reject the
null hypothesis
Example
50 smokers were questioned about the number of hours they sleep each day. We
want to test the hypothesis that the smokers need less sleep than the general public
which needs an average of 7.7 hours of sleep. We follow the steps below.
B. If the sample mean is 7.5 and the population standard deviation is 0.5, what
can you conclude?
Solution
We have
Since -2.83 is to the left of -1.645, it is in the critical region. Hence we reject the
null hypothesis and accept the alternative hypothesis. We can conclude that
smokers need less sleep.
p-values
There is another way to interpret the test statistic. In hypothesis testing, we make a
yes or no decision without discussing borderline cases. For example with a = .06,
a two tailed test will indicate rejection of H0 for a test statistic of z = 2 or for z = 6,
but z = 6 is much stronger evidence than z = 2. To show this difference we write
the p-value which is the lowest significance level such that we will still reject Ho.
For a two tailed test, we use twice the table value to find p, and for a one tailed
test, we use the table value.
drsherwanshal@gmail.comStatitics, Null Hypothesis, z-test, significance
009647504541577
Example:
Suppose that we want to test the hypothesis with a significance level of .05 that the
climate has changed since industrializatoin. Suppose that the mean temperature
throughout history is 50 degrees. During the last 40 years, the mean temperature
has been 51 degrees and suppose the population standard deviation is 2 degrees.
What can we conclude?
We have
H0: m = 50
H1: m 50
so that
p = (1 - .9992)(2) = .002
since
Note that small p-values will result in a rejection of H0 and large p-values will
result in failing to reject H0.
Example
H0: m = 110
This is a one tailed test, so we can go to our t-table with 19 degrees of freedom to
find that
c = 1.73
t
Since
We see that the test statistic does not fall in the critical region. We fail to reject the
null hypothesis and conclude that there is insufficient evidence to suggest that the
temperature required to damage a computer on the average less than 110 degrees.
Example
Suppose that you interview 1000 exiting voters about who they
voted for governor. Of the 1000 voters, 550 reported that they
voted for the democratic candidate. Is there sufficient evidence to suggest that the
democratic candidate will win the election at the .01 level?
H0: p =.5
H1: p >.5
Since it a large sample we can use the central limit theorem to say that the
distribution of proportions is approximately normal. We compute the test statistic:
Notice that in this formula, we have used the hypothesized proportion rather than
the sample proportion. This is because if the null hypothesis is correct, then .5 is
drsherwanshal@gmail.comStatitics, Null Hypothesis, z-test, significance
009647504541577
the true proportion and we are not making any approximations. We compute the
rejection region using the z-table. We find that zc = 2.33.
The picture shows us that 3.16 is in the rejection region. Therefore we reject H0 so
can conclude that the democratic candidate will win with a p-value of .0008.
Example
1500 randomly selected pine trees were tested for traces of the
Bark Beetle infestation. It was found that 153 of the trees
showed such traces. Test the hypothesis that more than 10% of
the Tahoe trees have been infested. (Use a 5% level of
significance)
Solution
The hypothesis is
H0: p = .1
H1: p > .1
We have that
Since we are using a 95% level of significance with a one tailed test, we have zc
= 1.645. The rejection region is shown in the picture. We see that 0.26 does not
lie in the rejection region, hence we fail to reject the null hypothesis. We say that
there is insufficient evidence to make a conclusion about the percentage of infested
pines being greater than 10%.
drsherwanshal@gmail.comStatitics, Null Hypothesis, z-test, significance
009647504541577
Exercises
B. If 10% of California residents are vegetarians, test the hypothesis that people
who gamble are less likely to be vegetarians. If the 120 people polled, 10
claimed to be a vegetarian.
Do employees perform better at work with music playing. The music was turned
on during the working hours of a business with 45 employees. There productivity
level averaged 5.2 with a standard deviation of 2.4. On a different day the music
was turned off and there were 40 workers. The workers' productivity level
averaged 4.8 with a standard deviation of 1.2. What can we conclude at the .05
level?
Solution
H0: m1 - m2 = 0
H1: m1 - m2 > 0
Next we need to find the standard deviation. Recall from before, we had that the
mean of the difference is
mx = m1 - m 2
sx =
We can substitute the sample means and sample standard deviations for a point
estimate of the population means and standard deviations. We have
and
0.4
t = = 0.988
0.405
To calculate the degrees of freedom, we can take the smaller of the two numbers n1
- 1 and n2 - 1. So in this example we use 39 degrees of freedom. The t-table gives
a value of 1.690 for the t.95 value. Notice that 0.988 is still smaller than 1.690 and
the result is the same.
Hypothesis Testing For a Difference Between Means for Small Samples Using
Pooled Standard Deviations (Optional)
Recall that for small samples we need to make the following assumptions:
Putting this together with hypothesis testing we can find the t-statistic.
Example
Nine dogs and ten cats were tested to determine if there is a difference in the
average number of days that the animal can survive without food. The dogs
averaged 11 days with a standard deviation of 2 days while the cats averaged 12
days with a standard deviation of 3 days. What can be concluded? (Use a = .05)
drsherwanshal@gmail.comStatitics, Null Hypothesis, z-test, significance
009647504541577
Solution
We write:
We have:
n1 = 9, n2 = 10
x1 = 11, x2 = 12
s1 = 2, s2 = 3
so that
and
If two samples are counted independently of each other we use the test statistic:
drsherwanshal@gmail.comStatitics, Null Hypothesis, z-test, significance
009647504541577
where
r1 + r2
p =
n1 + n2
and
q=1-p
Example
Is the severity of the drug problem in high school the same for boys and girls? 85
boys and 70 girls were questioned and 34 of the boys and 14 of the girls admitted
to having tried some sort of drug. What can be concluded at the .05 level?
Solution
H0: p1 - p2 = 0
H1: p1 - p2 0
We have
Since we are using a significance level of .05 and it is a two tailed test, the critical
value is 1.96. Clearly 2.68 is in the critical region, hence we can reject the null
hypothesis and accept the alternative hypothesis and conclude that gender does
make a difference for drug use. Notice that the P-Value is
is less than .05. Yet another way to see that we reject the null hypothesis.
Paired Differences
Example
The best such survey is one that investigates identical twins who have been reared
in two different environments, one that is nurturing and one that is non-nurturing.
We could measure the difference in high school GPAs between each pair. This is
better than just pooling each group individually. Our hypotheses are
Ho: md = 0
H1: md > 0
xd t sd/
Example
Suppose that ten identical twins were reared apart and the mean difference between
the high school GPA of the twin brought up in wealth and the twin brought up in
poverty was 0.07. If the standard deviation of the differences was 0.5, find a 95%
confidence interval for the difference. Assume the distribution of GPA's is
approximately normal.
Solution
We compute
or
drsherwanshal@gmail.comStatitics, Null Hypothesis, z-test, significance
009647504541577
[-0.29, 0.43]
We are 95% confident that the mean difference in GPA is between -0.29 and 0.43.
Notice that 0 falls in this interval, hence we would fail to reject the null hypothesis
at the 0.05 level.