Вы находитесь на странице: 1из 10

Chapter 9

Hypothesis Testing
• Test of hypothesis - Test whether a
Hypothesis Testing population parameter is less than, equal
to, or greater than a specified value.
• Remember an inference without a
measure of reliability is little more than a
guess.

Example Example
• A contract between a city and a road • Suppose building specifications for a city require
construction company called for an asphalt road that the average breaking strength of residential
with an average thickness of 10 inches. The sewer pipe to be more than 2,400 lbs per foot of
county thought that the construction company length. To sell pipe in the city a manufacturer
must demonstrate that its product meets the
had defrauded the city by making the road less specifications.
than 10 inches thick. The city then took 100
• Here we are interested not so much in the value
core samples 1 inch in diameter. The mean of  than we are in testing a hypothesis about its
thickness of the samples was 9.5 inches. Did value. In other words, we are interested in
fraud occur? whether the mean breaking strength of the pipe
exceeds 2,400 lbs per foot.

1
Chapter 9

Hypotheses Statements
Hypotheses Statements
Examples
• Two hypotheses: • For pipe example:
– Null hypothesis (H0) - status quo to the party – (H0)   2 , 400 (the pipe does not meet
performing the experiment. The hypothesis will not specifications)
be rejected unless the data provide convincing
evidence that it is false. – (Ha)   2 , 4 0 0 (the pipe meets specifications)
– Alternative or research hypothesis (Ha) - which will • How can the city decide when enough evidence
be accepted only if the data provide convincing exists to conclude the pipe meets specifications?
evidence of its truth. – When the sample mean x convincingly indicates that
the population mean exceeds 2,400 lbs per foot.

Evidence Example
• “Convincing” evidence in favor of the alternative • The test statistic is:
exists when the value of x exceeds 2,400 by x   x  2 , 400
z  
an amount that cannot be readily attributed to  x

n
sampling variability.
• We need to compute a “test statistic” which will
• A value of z=1 means that x-bar is 1
standard error above   2 ,4 0 0
be the z-value that measures the distance
between the values of x and the value of
 specified in the null hypothesis. • A value of z=1.5 means that x-bar is 1.5
standard errors above   2 ,4 0 0

2
Chapter 9

Two Types of Errors:


The Test Itself
Type I Error
• Deciding that the null hypothesis is false when in • Null and alternative hypothesis:
fact it is true is called a Type I error. The H 0 :   2 , 400 H a :   2 ,4 0 0
probability of making a Type I error is only: • Test statistic: x  2 , 40 0
z
• =P(Type 1 error)   0 . 0 5 x
• =P(reject H0 when in fact H0 is true) • Rejection region:
• =P(z > 1.645 when in fact • z  1 .6 4 5 for   0 .0 5

  2 , 400 )=0.05 • Example: assume


x  2 , 46 0 s  200 n  5 0
• What is your decision?

Judicial Analogy Two Types of Errors:


Type II Error
• Not rejecting the null hypothesis when in fact it is
false is called a Type II error. We denote the
probability of committing a Type II error by  .

• Usually difficult to determine so we simply say


that the sample evidence is insufficient to reject
the null hypothesis at the   0.05 confidence
level.

11

3
Chapter 9

Decisions and Consequences Elements of a Test of


for a Test of Hypothesis Hypothesis
• 1. Null Hypothesis
True State of Nature • 2. Alternative Hypothesis
Decision Ho True Ha True
• 3. Test Statistic
Do Not Reject Ho Correct Decision Type II Error
Reject Ho Type I Error Correct Decision
• 4. Rejection Region
• 5. Assumptions
A Type I error has a probability of  . • 6. Sample and Calculate Test Statistic
A Type II error has a probability of  .
• 7. Conclusion

Statistical Hypothesis Test Steps for Selecting the Null and


Alternative Hypotheses
1. Select the alternative hypothesis - 3 types:
One-tailed, upper tail Ha:   2 4 0 0
One-tailed, lower tail Ha:   2 4 0 0
Two-tailed Ha:   2400

2. Select the null hypothesis as the status quo,


which will be presumed true unless the
sample evidence conclusively establishes the
alternative hypothesis: Ho:   2400
15

4
Chapter 9

Large-Sample Test of Hypothesis Small-Sample Test of Hypothesis


about a Mean about a Mean
• Use the z-statistic. • If n is small, we cannot assume that the sample
standard deviation will provide a good
• Example - A farmer hypothesizes that the mean approximation of the population standard
yield of soybeans per acre is greater than 520 deviation. We must use the t-distribution rather
bushels. A sample of 36 1-acre plots results in than the z-distribution to make inferences about
a sample mean value of 543 with a standard the population mean.
deviation of 124. At a .025 level, can we
x  0
conclude that the mean yield is above 520? • Test Statistic: t 
s
n

Example P-Values
• A tire company guarantees that a particular tire • For all the hypothesis testing examples so far,
has a mean useful lifetime of 42,000 miles or the value of and thus the rejection region are
more. A consumer testing agency, wishing to selected prior to conducting the test.
verify this claim, observed n=10 tires on a test
wheel that simulated normal road conditions.
The lifetimes (in thousands of miles) were as • A second method is to report the extent to which
follows: 42, 36, 46, 43, 41, 35, 43, 45, 40, 39. the statistic disagrees with the null hypothesis
Use these data to determine whether there is and letting the reader decide whether to reject
sufficient evidence to contradict the the null hypothesis. This measure of
manufacturers claim at the .05 level. disagreement is called the p-value.

5
Chapter 9

Steps for Calculating the p-


Example
value
• Choose the maximum level of α you are willing to • According to a national survey, the price of a new family
tolerate. home averages $115,000. You hypothesize that the
• Determine the value of the test statistic z from the average price in your city exceeds the national average.
sample data. Look up the z-statistic and find the To test your belief, you record the prices of 20 new
corresponding probability: homes in your city and find the sample mean to equal
– One-tailed test - the p-value = tail area beyond z $120,000 with a sample standard deviation of $30,000.
in the same direction as the alternative If  =.05, does the data support your belief? What is the
hypothesis. p-value? What would be the result if the sample was
– Two-tailed test - the p-value= 2 times the tail area 100 homes with the same mean and standard deviation
beyond the z value in the direction of the sign of above? What is the p-value?
z.
• Reject the null hypothesis if the observed p-value is
less than .

Large Sample Test of Hypothesis about


a Binomial Probability
Hypothesis Test
• Inferences about proportions (or percentages) • H0: p  p 0
are often made in the context of the probability,
p, of “success” for a binomial distribution. • Ha: p  p0
• Previously we have calculated a confidence p  p0
interval for p. p  p0
• For hypothesis tests on proportions, do not use p  p0
the sample proportion to calculate the standard • Test statistic: z   p
deviation. Instead, use the standard deviation • Rejection region: z  z
based on the value of the null hypothesis. 

z  z 

z  z 
2

6
Chapter 9

Example
• Where • A rating service for local radio stations claims
x that 40% of the prime drive-time audience listens
p 
n to WXIX. You are the advertising manager of a
competing radio station and you doubt that
p 0q WXIX’s market share is that large. Formulate
 p  0
n and test the appropriate hypothesis at the 5%
significance level if 380 people out of 1,000
surveyed say that they listen to WXIX. What is
the p-value?

The Relationship Between Confidence


Intervals and Hypothesis Tests Example
• A Confidence Interval is really a two-tailed • Our previous farmer example:
Hypothesis Test (at the same -level): – A farmer hypothesizes that the mean yield of
– For a confidence interval, we are (1-)% sure that the soybeans per acre is not equal to 520 bushels.
true value of the population parameter is between the Sampling info of 36 one-acre plots finds a sample
lower confidence level (LCL) and the upper mean of 543 with a standard deviation of 124.
confidence level (UCL). We are % sure that the true
value of the population parameter is not in this range. – At a 0.10 level, can we conclude that the mean yield
– For a hypothesis test, we either (1) fail to reject H0 at is not equal to 520?
the (1-)% level effectively creating a confidence – Construct a 90% confidence interval using the above
interval or (2) reject H0 in favor of Ha which is the information.
area outside of the confidence interval.

7
Chapter 9

Two Population Means, 1 and 2 Independent Sampling


• Independent Samples:
• Consider the Sampling Distribution of ( X 1  X 2 )
– Mean income of households in two different
neighborhoods in Fairfax County, VA: Incomes in – The Mean of the sampling distribution of
(  1   2 ) is ( X 1  X 2 )
one neighborhood are unrelated (independent) to
incomes in the other neighborhood. – Since the two samples are independent, the
standard deviation of the sampling distribution
• Dependent Samples: (standard error of ( X 1  X 2 ) ) is:
– Mean daily sales of two restaurants located on the  2
 2

same block in New York City: Is there a difference in  (X  X )


 1
 2
1 2
n1 n2
daily sales volume between the two restaurants?
– The sampling distribution of ( X 1  X 2 )is
approximately normal for large samples (Central
Limit Theorem) so use a z-statistic.

Large Sample Hypothesis Test for Small Sample Confidence Interval for
(1 - 2) - Independent Sampling (1 - 2) - Independent Sampling
• One-tailed Test: • Both populations must be approximately
– H0: (1 - 2) = D0 (or 0) vs Ha: (1 - 2) > D0 (or 0)
– H0: (1 - 2) = D0 (or 0) vs Ha: (1 - 2) < D0 (or 0)
normally distributed with equal variances (these
variances are usually unknown):
• Two-tailed Test:
– H0: (1 - 2) = D0 (or 0) vs Ha: (1 - 2) not equal to D0 (or 0)
( x1  x 2 )  t  ( x1  x 2 ) 
2

• Test statistic:
 x1  x2   D0  1 1 
zcalc  ( x1  x 2 )  t s 2p   
 x x  2  n1 n2 
1 2

 2
 2
2

n 1  1 s 12  n 2  1 s 22
  1
 2 s
n1  n2  2
(X  X ) p
1 2
n1 n2

8
Chapter 9

Small Sample Hypothesis Test for


Dependent Sampling
(1 - 2) - Independent Sampling
• One-tailed Test: • We are unable to use the two-sample (1 - 2)
– H0: (1 - 2) = D0 (or 0) vs Ha: (1 - 2) > D0 (or 0) method for performing hypothesis tests and
– H0: (1 - 2) = D0 (or 0) vs Ha: (1 - 2) < D0 (or 0) calculating confidence intervals if the samples
• Two-tailed Test: are dependent on some external factor.
– H0: (1 - 2) = D0 (or 0) vs Ha: (1 - 2) not equal to D0 (or 0)
• Test statistic: • Instead, use Paired Difference method which
t 
x 1  x2  D
takes sample dependence into account when
0

 1 1 
s 2p   
 n1 n2  performing hypothesis tests and calculating
confidence intervals.
s 2p 
n1  1s12  n2  1s22
n1  n2  2

Paired Difference Hypothesis


Paired Difference Method
Test
• The test statistic becomes:
• One-tailed Test:
xD  0
t  – H0: (1 - 2) = D0 (or 0) vs Ha: (1 - 2) > D0 (or 0)
 sD  D = D0 (or 0) D > D0 (or 0)
 
 n  – H0: (1 - 2) = D0 (or 0) vs Ha: (1 - 2) < D0 (or 0)
 D 
D = D0 (or 0) D < D0 (or 0)
• Two-tailed Test:
– Assumptions:
– H0: (1 - 2) = D0 (or 0) vs Ha: (1 - 2) not equal to D0 (or 0)
• The distribution of differences is approximately normally D = D0 (or 0) D not equal to D0 (or 0)
distributed.
• The sample differences are random. • Test statistic: t  x D  D 0
 sD  where t has (nD-1)
  degrees of
 n 
 D  freedom

9
Chapter 9

Hypothesis Testing using Excel

10

Вам также может понравиться