Hypothesis testing for - UCLA Statistics

[Pages:22]University of California, Los Angeles Department of Statistics

Statistics 13

Instructor: Nicolas Christou

Hypothesis testing

? Elements of a hypothesis test:

1. Null hypothesis, H0 (always =). 2. Alternative hypothesis, Ha (>, ?0, ? < ?0, ? = ?0 (use only one of these!)

? When is known: Test statistic X? - ? Z =

n

? When is unknown: Test statistic X? - ? t = s

n

? If is known: Reject H0 if Z falls in the rejection region. The rejection region is based on the significance level we choose.

? If is unknown: Reject H0 if t falls in the rejection region. The rejection region is based on the significance level we choose and the degrees of freedom n - 1.

? What is a p-value? It is the probability of seeing the test statistic or a more extreme value (extreme is towards the direction of the alternative). If p-value < the H0 is rejected. This is another way of testing a hypothesis (it should always agree with testing using Z or t).

1

? Hypothesis testing for p:

H0 : p = p0 Ha : p > p0, p < p0, p = p0 (use only one of these 3!)

Test statistic:

Z=

p^ - p0

p0(1-p0) n

? Reject H0 if Z falls in the rejection region. The rejection region is based on the significance level we choose.

? What is a p-value? As always, it is the probability of seeing the test statistic or a more extreme value (extreme is towards the direction of the alternative). If p-value < the H0 is rejected.

2

Hypothesis Test For Population Mean ?

Hypothesis Test When Is Known: H0 : ? = ?0

Alternative Hypothesis Ha

? < ?0 ? > ?0 ? = ?0

Reject H0 If

Z < -Z Z > Z Z < -Z/2 or Z > Z/2

Z

=

X? -?0 / n

Hypothesis Test When Is Not Known: H0 : ? = ?0

Alternative Hypothesis Ha

? < ?0 ? > ?0 ? = ?0

Reject H0 If

t < -t;n-1 t > t;n-1 t < -t/2;n-1 or t > t/2;n-1

t

=

X? -?0 s/ n

Hypothesis Test For Proportion:

H0 : p = p0

Alternative Hypothesis Ha

p < p0 p > p0 p = p0

Reject H0 If

Z < -Z Z > Z Z < -Z/2 or Z > Z/2

Z=

p^-p0

p0 (1-p0 ) n

3

Examples - Hypothesis testing Example 1 A manufacturer of chocolates claims that the mean weight of a certain box of chocolates is 368 grams. The standard deviation of the box's weight is known to be = 10 grams. If a sample of 49 boxes has sample mean x = 364 grams, test the hypothesis that the mean weight of the boxes is less than 368 grams. Use = 0.05 level of significance. Example 2 A large retailer wants to determine whether the mean income of families living whithin 2 miles of a proposed building site exceeds $24400. What can we conclude at the 0.05 level of significance if the sample mean income of 60 families is x = $24524? Use = $763. Example 3 It is claimed that the mean mileage of a certain type of vehicle is 35 miles per gallon of gasoline with population standard deviation = 5 miles. What can be concluded using = 0.01 about the claim if a random sample of 49 such vehicles has sample mean x = 36 miles? Example 4 A manufacturer claims that 20% of the public preferred her product. A sample of 100 persons is taken to check her claim. It is found that 8 of these 100 persons preferred her product.

a. Find the p-value of the test (use a two-tailed test). b. Using the 0.05 level of significance test her claim.

4

Examples - Hypothesis testing Solutions

Example 1 A manufacturer of chocolates claims that the mean weight of a certain box of chocolates is 368 grams. The standard deviation of the box's weight is known to be = 10 grams. If a sample of 49 boxes has sample mean x = 364 grams, test the hypothesis that the mean weight of the boxes is less than 368 grams. Use = 0.05 level of significance.

Solution: 1.

H0 : ? = 368 Ha : ? < 368

2. We compute the test statistic z:

x? - ? 364 - 368

z = =

n

10 49

z = -2.8

3. We find the rejection region. Here we use significance level = 0.05, therefore the rejection region is when z < -1.645.

4. Conclusion: Since z = -2.8 < -1.645 we reject H0. Compute the p-value of the test:

p - value = P (X? < 364) = P (Z < -2.8) = 0.0026.

Rule: If p-value < then H0 is rejected. Again, using the p-value we reject H0.

Example 2 A large retailer wants to determine whether the mean income of families living whithin 2 miles of a proposed building site exceeds $24400. What can we conclude at the 0.05 level of significance if the sample mean income of 60 families is x = $24524? Use = $763.

Solution: 1.

H0 : ? = 24400 Ha : ? > 24400

2. We compute the test statistic z:

x? - ? 24524 - 24400

z = =

n

763 60

z = 1.26

3. We find the rejection region. Here we use significance level = 0.05, therefore the rejection region is when z > 1.645.

4. Conclusion: Since z = 1.26 does not fall in the R.R. we do not reject H0.

5

Example 3 It is claimed that the mean mileage of a certain type of vehicle is 35 miles per gallon of gasoline with population standard deviation = 5 miles. What can be concluded using = 0.01 about the claim if a random sample of 49 such vehicles has sample mean x = 36 miles?

Solution: 1.

H0 : ? = 35 Ha : ? = 35

2. We compute the test statistic z:

x? - ? 36 - 35

z = = 5 z = 1.4

n

49

3. We find the rejection region. Here we use significance level = 0.01, but because of a two-sided test we have two rejection regions. They are z < -2.575 or z > 2.575.

4. Conclusion: Since z = 1.4 does not fall in any of the two rejection regions we do not reject H0.

When we have a two-sided test the p-value is computed as follows: p - value = 2P (X? > 36) = 2P (Z > 1.4) = 2(1 - 0.9192) = 0.1616.

Again, using the p-value H0 is not rejected.

Example 4 A manufacturer claims that 20% of the public preferred her product. A sample of 100 persons is taken to check her claim. It is found that 8 of these 100 persons preferred her product.

a. Find the p-value of the test (use a two-tailed test).

b. Using the 0.05 level of significance test her claim.

Solution: We test the following hypothesis:

H0 : p = 0.20 Ha : p = 0.20

We compute the test statistic z:

Z=

p^ - p0

0.08 - 0.20

=

= -3.0.

p0 (1-p0 )

0.20(1-0.20)

n

100

Therefore the p-value is:

p - value = 2P (p^ < 0.08) = 2P (Z < -3.0) = 2(0.0013) = 0.0026.

We reject H0 because p-value= 0.0026 < 0.05.

6

Hypothesis testing - t distribution

Example 1 A tire manufacturer hopes that their newly designed tires will allow a car traveling at 60 mph to come to a complete stop within an average of 125 feet after the brakes are applied. They will adopt the new tires unless there is strong evidence that the tires do not meet this objective. The distances (in feet) for 9 stops on a test track were 129, 128, 130, 132, 135, 123, 125, 128, and 130. These data have x? = 128.89, s = 3.55. Test an appropriate hypothesis to conclude whether the company should adopt the new tires. Use = 0.05. Example 2 (from Mathematical Statistics and Data Analysis), by J. Rice, 2nd Edition. In a study done at the National Institute of Science and Technology (Steel et al. 1980), asbestos fibers on filters were counted as part of a project to develop measurement standards for asbestos concentration. Asbestos dissolved in water was spread on a filter, and punches of 3-mm diameter were taken from the filter and mounted on a transmission electron microscope. An operator counted the number of fibers in each of 23 grid squares, yielding the following counts:

31 29 19 18 31 28 34 27 34 30 16 18 26 27 27 18 24 22 28 24 21 17 24 Assume normal distribution. These data have x? = 24.91, s = 5.48. Using = 0.05 test the following hypothesis: H0 : ? = 18 Ha : ? = 18

7

Hypothesis testing - t distribution

Example 1 A tire manufacturer hopes that their newly designed tires will allow a car traveling at 60 mph to come to a complete stop within an average of 125 feet after the brakes are applied. They will adopt the new tires unless there is strong evidence that the tires do not meet this objective. The distances (in feet) for 9 stops on a test track were 129, 128, 130, 132, 135, 123, 125, 128, and 130. These data have x? = 128.89, s = 3.55. Test an appropriate hypothesis to conclude whether the company should adopt the new tires. Use = 0.05.

Solution: 1.

H0 : ? = 125 Ha : ? > 125

2. We compute the test statistic t:

x? - ? 128.89 - 125

t = s =

3.55

t = 3.29.

n

9

3. We find the rejection region. Here we use significance level = 0.05 with n - 1 = 9 - 1 = 8 degrees of freedom. Therefore the rejection region is when t > 1.860.

4. Conclusion: Since t = 3.29 falls in any the rejection region we reject H0.

The p-value is: p-value= P (X? > 128.89) = P (t > 3.29). From the t table we can say that the 0.005 < p-value < 0.01 Again, using the p-value H0 is rejected.

Example 2 (from Mathematical Statistics and Data Analysis), by J. Rice, 2nd Edition. In a study done at the National Institute of Science and Technology (Steel et al. 1980), asbestos fibers on filters were counted as part of a project to develop measurement standards for asbestos concentration. Asbestos dissolved in water was spread on a filter, and punches of 3-mm diameter were taken from the filter and mounted on a transmission electron microscope. An operator counted the number of fibers in each of 23 grid squares, yielding the following counts:

31 29 19 18 31 28 34 27 34 30 16 18 26 27 27 18 24 22 28 24 21 17 24

Assume normal distribution. These data have x? = 24.91, s = 5.48. Using = 0.05 test the following hypothesis: H0 : ? = 18 Ha : ? = 18

Solution: We compute the test statistic t:

x? - ? 24.91 - 18

t = s =

n

5.48 23

t = 6.05

We find the rejection region. Here we use significance level = 0.05 with n - 1 = 23 - 1 = 22 degrees of freedom. Therefore the rejection region is when t < -2.074 or t > 2.074. Conclusion: Since t = 6.05 falls in one of the rejection regions we reject H0.

Compute the p-value of the test: This is a two-sided test therefore the p-value is p-value= 2P (X? > 24.91) = 2P (t > 6.05). From the t table we can only say that p-value is less that 0.01.

8

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download