Sunteți pe pagina 1din 12

10/29/2019

8. Hypothesis testing and


statistical inference

[1] 6
[2] 5
[3] 9, 10; [4] 9, 10

Data Analysis 10/29/2019

2
Outline

 LARGE-SAMPLE TESTS FOR A POPULATION MEAN


 SMALL‐SAMPLE TESTS FOR A POPULATION MEAN
 LARGE‐SAMPLE TESTS FOR DIFFERENCE BETWEEN TWO MEANS
 THE CHI‐SQUARE TEST

Data Analysis 10/29/2019

1
10/29/2019

3
LARGE-SAMPLE TESTS FOR A
POPULATION MEAN

 Steps in Performing a Hypothesis Test


1. Define H0 and H1.
2. Assume H0 to be true.
3. Compute a test statistic. A test statistic is a statistic that is used to
assess the strength of the evidence against H0.
4. Compute the P-value of the test statistic. The P-value is the
probability, assuming H0 to be true, that the test statistic would have
a value whose disagreement with H0 is as great as or greater than
that actually observed. The P-value is also called the observed
significance level.
5. State a conclusion about the strength of the evidence against H0.

Data Analysis 10/29/2019

4
Example

Ex. 6.2 [1] A scale is to be calibrated by weighing a 1000 g test weight 60 times. The 60
scale readings have mean 1000.6 g and standard deviation 2 g. Find the P-value for
testing H0 : μ = 1000 versus H1 : μ ≠ 1000.
Solution:
Let μ denote the population mean reading.
H0: μ = 1000
(2.58) = = = 0.258

The z-score of the observed value = 1000.6:


We will compute the distribution of X under the assumption that H0 is true. This
distribution is called the null distribution of X

Data Analysis 10/29/2019

2
10/29/2019

5
Example

P-value = 0.0102 + 0.0102 = 0.0204  Reject H0 and recalibrate the scale

a two-sided or
two-tailed test

Data Analysis 10/29/2019

Data Analysis 10/29/2019

3
10/29/2019

7
Decision
Rules

Data Analysis 10/29/2019


[2]
7

Data Analysis 10/29/2019

4
10/29/2019

9
Exercise

Q1 [1]6.1.1. In an experiment to measure the lifetimes of parts


manufactured from a certain aluminum alloy, 73 parts were
loaded cyclically until failure. The mean number of kilocycles to
failure was 783, and the standard deviation was 120. Let μ
represent the mean number of kilocycles to failure for parts of
this type. A test is made of H0 : μ ≤ 750 versus H1 : μ > 750.
a. Find the P-value.
b. Either the mean number of kilocycles to failure is greater than
750, or the sample is in the most extreme % of its distribution.

Data Analysis 10/29/2019

10
SMALL‐SAMPLE TESTS FOR A
POPULATION MEAN

 Problem: Spacer collars for a transmission countershaft have a


thickness specification of 38.98–39.02 mm. The process that
manufactures the collars is supposed to be calibrated so that the
mean thickness is 39.00 mm, which is in the center of the
specification window. A sample of six collars is drawn and
measured for thickness. The six thicknesses are 39.030, 38.997,
39.012, 39.008, 39.019, and 39.002. Assume that the population of
thicknesses of the collars is approximately normal.
 Can we conclude that the process needs recalibration?

Data Analysis 10/29/2019

10

5
10/29/2019

11
Student’s t distribution

Data Analysis 10/29/2019

11

12
SMALL‐SAMPLE TESTS FOR A
POPULATION MEAN

 When the sample size is small, s may not be close to σ, which invalidates
this large-sample method. However, when the population is approximately
normal, the Student’s t distribution [1_5.3/345] can be used.
 Denoting the population mean by μ, the null and alternate hypotheses are

 = 39.01133 and s = 0.011928. The sample size is n = 6.


 The value of the test statistic is

Data Analysis 10/29/2019

12

6
10/29/2019

13

Data Analysis 10/29/2019

13

14

Reject H0
(recalibrate)

Data Analysis 10/29/2019

14

7
10/29/2019

15
LARGE‐SAMPLE TESTS FOR DIFFERENCE
BETWEEN TWO MEANS
 Problem: Suppose that a production manager for a manufacturer of industrial
machinery is concerned that ball bearings produced in environments with low
ambient temperatures may have smaller diameters than those produced
under higher temperatures.
To investigate this concern, she samples 120 ball bearings that were
manufactured early in the morning, before the shop was fully heated, and
finds their mean diameter to be 5.068 mm and their standard deviation to be
0.011 mm. She independently samples 65 ball bearings manufactured during
the afternoon and finds their mean diameter to be 5.072 mm and their
standard deviation to be 0.007 mm.
 Can she conclude that ball bearings manufactured in the morning have
smaller diameters, on average, than ball bearings manufactured in the
afternoon?

Data Analysis 10/29/2019

15

16
LARGE‐SAMPLE TESTS FOR DIFFERENCE
BETWEEN TWO MEANS

 X1, . . . , X120: a simple random sample of diameters of ball bearings manufactured in


the morning.
 Y1, . . . , Y65: a simple random sample of diameters of ball bearings manufactured in
the afternoon.
 Ques: can we conclude that the population mean for the morning bearings is less
than that for the afternoon bearings?
 The null and alternate hypotheses are

Data Analysis 10/29/2019

16

8
10/29/2019

17
LARGE‐SAMPLE TESTS FOR DIFFERENCE
BETWEEN TWO MEANS

 = 5.068; = 5.072
 sX = 0.011; sY = 0.007
 Under H0: μX − μY = 0;  The null distribution of − is
 The observed value of − is 5.068 − 5.072 = −0.004. The z-score is

Data Analysis 10/29/2019

17

18

Conclusion: The bearings manufactured in the morning have a smaller mean diameter.

Data Analysis 10/29/2019

18

9
10/29/2019

19
CHI‐SQUARE TEST FOR INDEPENDENCE

 The idea behind the hypothesis test is that if H0 is true, then the observed and
expected values are likely to be close to each other. Therefore, we will construct a
test statistic that measures the closeness of the observed to the expected values.
The statistic is called the chi-square statistic.
 To define it, let k be the number of outcomes, and let Oi and Ei be the observed
and expected numbers of trials, respectively, that result in outcome i. The chi-
square statistic is

(6.6)

 The larger the value of χ2, the stronger the evidence against H0.

Data Analysis 10/29/2019

19

20
CHI‐SQUARE TEST FOR INDEPENDENCE

 We use the chi-square


distribution with k − 1
degrees of freedom,
denoted X , to determine
P-value for the test.
 Use of the chi-square
distribution is appropriate
whenever all the expected
values are greater than or
equal to 5.

Data Analysis 10/29/2019

20

10
10/29/2019

21

Examples
Is the die fair?

Data Analysis 10/29/2019

21

22
Examples

 The null hypothesis is H0 : p1 = · · · = p6 = 1/6.


 The number of degrees of freedom is 5 (one less than the number of
outcomes). Using Equation (6.6), the value of the statistic is

Data Analysis 10/29/2019

22

11
10/29/2019

23
Examples

 To determine the P-value for


the test statistic, we first note
that all the expected values
are greater than or equal to 5,
so use of the chi-square
distribution is appropriate. We
consult the chi-square table
under five degrees of freedom.
The upper 10% point is 9.236.
We conclude that P > 0.10.
(See Figure 6.20.) There is no
evidence to suggest that the
die is not fair.

Data Analysis 10/29/2019

23

24
Reading

 [2] 6, 7
 [3] 18; [4] 11

Data Analysis 10/29/2019

24

12

S-ar putea să vă placă și