Download Lecture 12.1-12.4

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Probability wikipedia , lookup

History of statistics wikipedia , lookup

Statistics wikipedia , lookup

Transcript
Chapter 12 Tests of
Hypotheses Means







12.1 Tests of Hypotheses
12.2 Significance of Tests
12.3 Tests concerning Means
12.4 Tests concerning Means(unknown
variance)
12.5 Differences between Means
12.6 Differences between Means(unknown
variances)
12.7 Paired Data
12.1 Tests of Hypotheses


In a law case, there are 2 possibilities for the
truth—innocent or guilty
Evidence is gathered to decide whether to
convict the defendant. The defendant is
considered innocent unless “proven” to be
guilty “beyond a reasonable doubt.” Just
because a defendant is not found to be guilty
doesn’t prove the defendant is innocent. If
there is not much evidence one way or the
other the defendant is not found to be guilty.
For Statistical Hypothesis Testing


H0=Null hypothesis (innocent)
Held on to unless there is sufficient
evidence to the contrary
HA=Alternative hypothesis (guilty)
We reject H0 in favor of HA if there is
enough evidence favoring HA
12.1 Tests of Hypotheses



Distribution(s) or population(s):
Parameter(s) such as mean and variance
Assertion or conjecture about the
population(s) – statistical hypotheses
1. About parameter(s): means or variances
2. About the type of populations: normal ,
binomial, or …
Example 12.1

Is a coin balanced?
This is the same as to ask if p=0.5

Is the average lifetime of a light bulb equal to
1000 hours?
The assertion is μ=1000
Null Hypotheses and Alternatives
We call the above two assertions
Null Hypotheses
Notation: H0: p=0.5 and H0:μ=1000
If we reject the above null hypotheses,
the appropriate conclusions we arrive are
called alternative hypotheses
HA: p0.5
HA: μ1000

Null Hypothesis vs Alternative

H0: p=0.5 vs HA: p0.5

H0:μ=1000



vs HA: μ1000
It is possible for you to specify other
alternatives
HA: p>0.5 or HA: p<0.5
HA: μ>1000 or HA: μ<1000
12.2 Significance of Tests


A company claims its light bulbs last on
average 1000 hours. We are going to test
that claim.
We might take the null and alternative
hypotheses to be
H0:μ=1000 vs HA: μ1000
or may be
H0:μ=1000 vs HA: μ<1000
Mistakes or errors:


Law case—convict an innocent
defendant; or fail to convict a guilty
defendant.
The law system is set up so that the
chance of convicting an innocent person
is small. Innocent until “proven guilty”
beyond a reasonable doubt.
Two Types of Errors in statistical testing


Type I error -- reject H0 when it is true
(convict innocent person)
Type II error -- accept H0 when it is not
true (find guilty person innocent)
Statistical hypotheses are set up to
Control type I error
=P(type I error)
=P(reject H0 when H0 true)
(a small number)

Minimize type II error
=P(type II error)
=P(accept H0 when H0 false)

Control Types of Errors




In practice,  is set at some small
values, usually 0.05
If you want to control  at some small
values, you need to figure out how
large a sample size (n) is required to
have a small  also.
1-  is called the power of the test
1- =Power=P(reject H0 when H0 false)
Example 12.2
X=breaking strength of a fish line, normal
distributed withσ=0.10.
 Claim: mean is =10
 H0: =10 vs HA: 10
A random sample of size n=10 is taken,
and sample mean is calculated
9.95  x  10.05
 Accept H0 if
 Type I error?
 Type II error when =10.10?

Solution

Type I error=P(reject H0 when =10)
  P ( x  9.95)  P( x  10.05)
 1  P (9.95  x  10.05)
9.95  10
10.05  10
 1  P(
Z
)
0.10 / 10
0.10 / 10
 1  P (1.58  Z  1.58)
 1  2(.4429)
 0.1142
Solution

Type II error=P(accept H0 when H0 false)
  P(9.95  x  10.05)
9.95  
10.05  
 P(
Z
)
0.10 / 10
0.10 / 10
9.95  10.10
10.05  10.10
 P(
Z
)
0.10 / 10
0.10 / 10
 P(4.74  Z  1.58)
 0.5  0.4429  0.0571

Power=1-0.0571=0.9429
12.3 & 12.4 Tests concerning Means


A company claims its light bulbs last an
average 1,000 hours
5 steps to set up a statistical hypothesis
test
5 steps: step 1
1. Set up H0 and HA
H0: =1,000 vs HA: <1,000
This is a one-sided alternative.
Other possibilities include
H0: =1,000 vs HA: 1,000
(Two sided alternative)
Note: we could write H0:  ≥1,000, but in this book H0
is always written with an equal (=) sign.
5 steps: step 2 and 3
2. Specify =P(type I error): level of
significance.
=0.05 usually. This corresponds to
95% confidence.
3. Decide on sample size, n, and specify
when to reject H0 based on some
statistic so that
=P(Reject H0 when H0 is true)
Step 3 continued


Suppose we use n=10 bulbs. Find the sample
mean x , and compare to 1000. We need to
set a probability to =0.05, so we want a
statistic we can compare to a table of
probabilities.
If we know , then set
x  1000
z
/ n
z has a standard normal distribution if
=1,000 and then we can use the normal
table.
Step 3 continued



Reject H0: =1,000 in favor of HA: <1,000 if
the sample mean is too far below 1000. This
will give us a negative value of z. How far
below 0 does z have to be for us to reject H0?
The rejection region is set up so that the
probability of rejecting H0 is only a=5% if H0
is true.
So we reject H0 if
x  1000
  Z 0.05  1.645
 / 10
Step 3 continued: if  is unknown

If  is unknown, the usual situation,
and the population is normal, we use a
t distribution. Calculate sample
deviation s:
x  1000
t
s/ n

Rejection region:
x  1000
t
 t0.05  1.833
s / 10
5 steps: step 4
4. Collect the data and compute the
statistics:
z or t
Suppose x  970 , s=30, n=10 then
970  1000
t
 3.16
30 / 10
5 steps: step 5
5. Decide whether to reject H0
t=-3.16<-1.833
is in the rejection region
Reject H0: =1,000 in favor of HA:
<1,000 at =0.05 level.
5 steps summary





1.
2.
3.
4.
5.
hypothesis statement
Specify level of significance 
determine the rejection region
compute the test statistic from data
conclusion
Relationship Between Hypotheses Testing
and Confidence Intervals
For two tailed test:
To accept null hypothesis at level 
H0: =0
is equivalent to showing 0 is in the (1-)
Confidence Interval for .

Example 12.3



Normal population.  unknown
H0: =750 vs HA: 750
Define t  x  750
s/


n
Reject H0 if the sample mean is too far
from 750 in either direction
Rejection region: | t | t / 2
Example


Let’s take =0.05,
n=20 (df=19)
Data turned out to be
x  730, s  50




t
730  750
 1.788
50 / 20
Get t:
t0.025=2.093
|t|<2.093
Conclusion: accept H0
C.I. 730  2.093(11.2)  730  23.44  (706.6,753.44)
Example 12.3 (continued)






=50 is known, =0.05, n=20
H0: =750 vs HA: 750
Reject region |z|>z0.025=1.96
Calculate z
730  750
z
 1.788
50 / 20
|z|<1.96. Accept H0
Question: if =0.10, what is the conclusion?
More cases



H0: =1000 vs HA: >1000
Define t or z statistics
( unknown or known)
Rejection regions:
t>t
or z>z
Rejection Regions:
Alternative
Hypotheses
> 0
< 0
 0
Rejection
Regions
z>z
z<-z
-----------------
---------------
z>z/2 or
z<-z/2
t>t
t<-t
------------------
t>t/2 or
t<-t/2
P-value


In practice more commonly one performs the
test by computing a p-value.
The book describes revised steps 3, 4, 5 as
3.’ We specify the test statistic.
4.’ Using the data we compute the test
statistic and find its p-value.
5.’ If p-value<, reject H0.
P-value


The book’s definition of p-value: A p-value is the
lowest level of  at which we could reject H0.
A more usual way to think about p-values:



If H0 is true, what is the probability of observing data
with this much or more evidence against H0 in favor
of HA?
If H0 is true, what is the probability of observing data
this far or farther from what we expect under H0 in
favor of HA?
If getting data this far or father from what we expect
under H0 is small, reject H0.
Example

H0: =120 vs HA: <120
z
=0.05
x  120

n




Suppose from the data we get z=-1.78
Evidence against H0 is a sample mean quite a bit less
than 120, meaning z quite a bit less than 0.
If H0 is true, the probability of this much or more
evidence against H0 in favor of HA is P(Z ≤ -1.78)
P( z  1.78)  0.0375  p  value
P-value<0.05Reject H0: =120 in favor of HA: <120
Example

H0: =120 vs HA: <120
z
x  120

=0.05
 1.78
n
P( z  1.78)  0.0375  p  value


Reject H0 at the =0.05 level since p-value < 0.05.
The reject/accept H0 decision is the same as comparing z
to -1.645, but the p-value gives more information


How inconsistent are the data with H0?
There is a 3.75% chance of seeing a mean at least this many
SE’s below 120 if in fact the true mean is 120.
Example

If we used =0.01, in order to reject H0 we would need
to have the probability of this kind of data ( Z ≤ -1.78) to
be 0.01 or less if H0 is true.
P( z  1.78)  0.0375  p  value



Do not reject H0 at the =0.01 level

p-value > 0.01.
There is more than a 1% chance of getting a sample
mean 1.78 or more SE’s below 120 if =120.
Since this probability is not less than 1%, don’t reject H0.



If z is less than -1.645, then the p-value
is less than 0.05 for HA: <120.
Comparing the p-value to 0.05 is the
same as comparing the z value to
-1.645.
For t tests we cannot find the exact pvalue without a calculator or software.


On tests just give a range that the p-value
falls into based on the table.
Maybe 0.05 < p-value < 0.10
P-value for 2-sided test







H0: =120 vs HA: ≠120 =0.1
Suppose from the data z=1.32
Evidence against H0 is z values away from 0
in either direction
P-value=2*0.0934=0.1868
P-value>, Do not reject H0.
HA: >120, p-value = 0.0934
HA: 120, p-value = 1 – 0.0934=0.9066
Exercise



Given that n=25, =100, and sample
mean is 1050,
1. Test the hypotheses
vs HA: <1000 at level
2. Test the hypotheses
vs HA: ≠1000 at level
H0: =1000
=0.05.
H0: =1000
=0.05.
Solution

1.

2.
More evidence against
x  1000 50
z

 2.5
H0 is smaller values of z
100 25 20
p  value  P ( z  2.5)  0.9938
p  value   . Do not reject H0.
Evidence against H0 is z values
away from 0 in either direction
x  1000 50
z

 2.5
100 25 20
p  value  P( z  2.5)  P( z  2.5)  2 * 0.0062  0.0124
p  value   . Reject H0.
A word of caution


NOTE: Accepting H0 does not prove H0 is true.
There are many other possible values in the
confidence interval.
NOTE: The p-value is NOT P(H0 is true)



H0:p=0.5 HA:p≠0.5
p = prob’y tack lands point up
Toss n=1 time. Tack lands point up.
p-value = 1.




The data are perfectly consistent with H0
We have absolutely no evidence against H0
We can’t say P(p=0.5) = 1.
OPINION: In most situations it is more useful to
report confidence intervals rather than results of
hypothesis tests.