Download Hypothesis Tests otherwise called Tests of Significance One Sample

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
Transcript
Hypothesis Tests
otherwise called
Tests of Significance
One Sample Means
Basketball Applet
► http://bcs.whfreeman.com/tps4e/#628644_
_666398__
Level of Significance Activity
► Fish
Oil vs Regular Oil
How can I tell if they really
Let’s say aare
government
agency
underweight?
has received numerous
complaints that a particular
Hypothesis test
restaurant
has
been
selling
will help me
underweight
decide!
Takehamburgers.
a sample & find x.The
restaurant advertises that it’s
pattiesButare
how“adoquarter
I know ifpound”
this x is(4
one
that I expect to happen or is it one
ounces).
that is unlikely to happen?
What are hypothesis tests?
Calculations that tell us if a value
occurs by random chance or not – if
it is statistically significant
Is it . . .
 a random occurrence due to
variation?
 a biased occurrence due to some
other reason?
How does a murder trial work?
Nature of hypothesis tests First - assume that the
►First begin by supposing the
person is innocent
claim or “effect” is NOT
Then – must have sufficient
present
evidence to prove guilty
►Next,
see if data provides
evidence against the
supposition
Hmmmmm …
Hypothesis tests use
the same process!
Example:
murder
trial
Another viewpoint in case you’re
still not getting it
► Someone/some
business makes a pronouncement
► You don’t believe it (if you did why test?)
► The null hypothesis is their pronouncement
► The alternative hypothesis is what you really think is
going on
► So hypothesis tests are probability tests that
measure how well the data and the pronouncement
agree
► Hypothesis tests DO NOT make decisions regarding
the trueness of the alternative hypothesis
Notice the steps are the
Steps:
same except we add
hypothesis statements –
1) Assumptions which you will learn today
Hypothesis statements & define
parameters
3) Calculations
4) Conclusion, in context
2)
Assumptions for z-test (t-test):
►Have
–
an SRSYEA
of context
These are the same
►Independent
Sample
(Pop > 10n)
assumptions
as confidence
►Distributionintervals!!
is (approximately)
normal
 Given
 Large sample size
►
s is known
Writing Hypothesis statements:
► Null
hypothesis – is the statement being
tested; this is a statement of “no effect”
or “no difference” - is an equality
statement
 In other words, the test that everything is
as it should be
H0:
Writing Hypothesis statements:
► Alternative
hypothesis – is the statement
that we suspect is true
 In other words, we think that the original
claim is not true, and we think that the actual
results are different in some way
Ha:
The form:
H0 MUST be “=“ !
Null hypothesis
H0: parameter = hypothesized value
Alternative hypothesis
Ha: parameter > hypothesized value
Ha: parameter < hypothesized value
Ha: parameter = hypothesized value
Example 2: A government agency has
received numerous complaints that a
particular restaurant has been selling
underweight hamburgers. The
restaurant advertises that it’s patties
are “a quarter pound”
(4 ounces).
Must
define what µ is
State the hypotheses :
H0: m = 4
Ha: m < 4
Where m is the true
mean weight of
hamburger patties
Example 3: A car dealer advertises
that is new subcompact models get
47 mpg. You suspect the mileage
might be overrated.
Must
State the hypotheses
: define what µ is
H0: m = 47
Ha: m < 47
Where m is the
true mean mpg
Example 4: Many older homes have electrical
systems that use fuses rather than circuit
breakers. A manufacturer of 40-A fuses
wants to make sure that the mean amperage at
which its fuses burn out is in fact 40. If the
mean amperage is lower than 40, customers
will complain because the fuses require
replacement too often. If the amperage is
higher than 40, the manufacturer might be
liable for damage to an electrical system due
to fuse malfunction. State the hypotheses :
H0: m = 40
Ha: m = 40
Where m is the true
mean amperage of
the fuses
Activity: For each pair of hypotheses,
indicate which are not legitimate &
(population)
explainMust
whyuse parameter
Must be NOT equal!
x is a statistics (sample)
a) H 0 : m  15 ; H a : m  15

is
the
population
b) H 0 : x  123 ;proportion!
H a : x  123
Must use same
c) H
:   .1as; for
H
:   .1
is 0parameter
number
H0a! population
correlation coefficient – but H0
d) H 0 : mMUST
 .4;beH“=“
a : !m  .6
e) H 0 :   0 ; H a :   0
P-values ►The
probability that the test
statistic would have a value as
extreme or more than what is
actually observed
In other words . . . is it far
out in the tails of the
distribution?
P-values ►The
smaller the p-value, the
stronger the evidence against H0
provided by the data
►Large p-values fail to give
evidence against H0
Level of significance ►This
is the amount of evidence
necessary before we begin to doubt
that the null hypothesis is true
►Is the probability that we will
reject the null hypothesis, assuming
that it is true
►Denoted by a
 Can be any value
 Usual values: 0.1, 0.05, 0.01
 Most common is 0.05
Statistically significant –
►The
p-value is as small or smaller
than the level of significance (a)
►If
p > a, “fail to reject” the null
hypothesis at the a level.
►If p < a, “reject” the null hypothesis
at the a level.
Facts about p-values:
► ALWAYS
make decision about the null
hypothesis!
► Large p-values show support for the
null hypothesis, but never that it is
true!
► Small p-values show support that the
null is not true.
► Double the p-value for two-tail (=)
tests
► Never accept the null hypothesis!
In AP Statistics, which is what colleges
accept as a college level course, they
insist that you Never “accept” the null
hypothesis or say that it is “true”!
However, this is not always followed. For
example, IB allows students to “accept” the
null hypothesis, or say that it is “true”.
You need to be aware of both mentalities
At an a level of .05, would you
reject or fail to reject H0 for
the given p-values?
.03
b) .15
c) .45
d) .023
a)
Reject
Fail to reject
Fail to reject
Reject
Calculating p-values
► With
z-test statistic (same as z-score but for
statistic (ie sample))
 normalcdf(lb, ub,[mean,standard deviation])
 You may have to find the z-test number first
Draw & shade a curve &
calculate the p-value:
1) right-tail test
z = 1.6; n = 20
2) left-tail test
z = -2.4; n = 15
3) two-tail test
z = 2.3; n = 25
Writing Conclusions:
1)
A statement of the decision being
made (reject or fail to reject H0) &
why (linkage)
AND
2)
A statement of the results in
context. (state in terms of Ha)
“Since the p-value < (>) a,
I reject (fail to reject)
the H0. There is (is not)
sufficient evidence to
suggest that Ha.”
Be sure to write Ha in
context (words)!
Example 5: Drinking water is
considered unsafe if the mean
H0: m = 15
concentration
of lead is 15 ppb (parts
Ha: m
> 15 or greater. Suppose a
per
billion)
z=2.1
Where
m
is
the
true
mean
concentration
community randomly
selects
of 25
of leadsamples
in drinking
water
water
and
computes a t-test
Since
the of
p-value
a, I reject
H0. lead
There is
P-value
= normcdf(2.1,10^99)
statistic
2.1. <Assume
that
sufficient
suggest that the
=.0179 evidence
concentrations
aretonormally
mean concentration
leadhypotheses,
in drinking
distributed.
Writeofthe
water is greater than 15 ppb.
calculate the p-value & write the
appropriate conclusion for a = 0.05.
Example 6: A certain type of frozen
dinners states that the dinner
H0: m240
= 240calories. A random
contains
Ha: of
m > 12
240of these frozen dinners
sample
z=1.9
Where
m
is
the
mean caloric
was selected fromtrue
production
to see
content
of content
the <frozen
dinners
the p-value
a, I was
reject
H0. There is
if Since
the
caloric
greater
sufficient
evidence
to
suggest
that
the
than
stated
on
the
box.
The
t-test
P-value = normcdf(1.9,10^99)
true
mean
caloric
content
of
these
frozen
statistic
was
calculated
to
be
1.9.
=.0287
dinnerscalories
is greatervary
thannormally.
240 calories.
Assume
Write
the hypotheses, calculate the p-value
& write the appropriate conclusion
for a = 0.05.
Formulas:
s known:
statistic - parameter
test statistic 
standard deviation of statistic
z=
x m
σ
n
Example 7: The Fritzi Cheese Company buys milk from
several suppliers as the essential raw material for its
cheese. Fritzi suspects that some producers are
adding water to their milk to increase their profits.
Excess water can be detected by determining the
freezing point of milk. The freezing temperature of
natural milk varies normally, with a mean of -0.545
degrees and a standard deviation of 0.008. Added
water raises the freezing temperature toward 0
degrees, the freezing point of water (in Celsius). The
laboratory manager measures the freezing
temperature of five randomly selected lots of milk
from one producer with a mean of -0.538 degrees. Is
there sufficient evidence to suggest that this
producer is adding water to his milk?
SRS?
Assumptions:
Independent
•I have an SRS of milk from one producer
Normal?
sample?
•Assume more than 50 lots of milk
How do you
•The freezing temperature of milk is a normal distribution.
know?
(given)
Do you
• s is known
What are your
know s?
H0: m = -0.545
hypothesis
statements? Is
Ha: m > -0.545
there a key word?
where m is the true mean freezing temperature of milk
 .538   .545 
z
 1.9566
.008
5
p-value = normalcdf(1.9566,1E99)=.0252
a = .05
Plug values
into formula.
Use normalcdf to
calculate p-value.
Compare your p-value to
a & make decision
Since p-value < a, I reject the null hypothesis.
There is sufficient evidence to suggest that the true mean freezing
temperature is greater than -0.545. This suggests that the
producer is adding water to the milk.
Conclusion:
Write conclusion in
context in terms of Ha.
Example 9: The Wall Street Journal
(January 27, 1994) reported that based
on sales in a chain of Midwestern grocery
stores, President’s Choice Chocolate Chip
Cookies were selling at a mean rate of
$1323 per week with a SD of 290.
Suppose a random sample of 30 weeks in
1995 in the same stores showed that the
cookies were selling at the average rate of
$1208. Does this indicate that the sales
of the cookies is different from the
earlier figure?
Assume:
•Have an SRS of weeks
•Assume one week’s sale is independent of the next
•Distribution of sales is approximately normal due to large
sample size
• s unknown
H0: m = 1323
Ha: m ≠ 1323
where m is the true mean cookie sales per
week
1208  1323
z
 2.17
290
30
p  value  .030
Since p-value < a of 0.05, I reject the null hypothesis. There
is sufficient evidence to suggest that the sales of cookies are
different from the earlier figure.
Example 9 Cont.: President’s Choice
Chocolate Chip Cookies were selling at a
mean rate of $1323 per week and a SD of
$275. Suppose a random sample of 30
weeks in 1995 in the same stores showed
that the cookies were selling at the
average rate of $1208. Compute a 95%
confidence interval for the mean weekly
sales rate.
CI = ($1109.6, $1306.4)
Based on this interval, is the mean
weekly sales rate statistically different
from the reported $1323?
What do you notice about the decision from the
confidence interval & the hypothesis test?
You expect that the significance test would
support the confidence interval and visa versa.
That means that if you reject the null hypothesis,
you would expect that the null hypothesis value to
be outside of your calculated interval.
Matched
Pairs Test
A special type of tinference
Matched Pairs – two forms
►
Pair individuals by
► Individual persons or
certain characteristics items receive both
treatments
► Randomly select
► Order of treatments
treatment for
are randomly
individual A
assigned or before &
► Individual B is
after measurements
assigned to other
are taken
treatment
► The two measures are
dependent on the
► Assignment of B is
individual
dependent on
assignment of A
Is this an example of matched pairs?
1)A college wants to see if there’s a difference in
time it took last year’s class to find a job after
graduation and the time it took the class from five
years ago to find work after graduation.
Researchers take a random sample from both
classes and measure the number of days between
graduation and first day of employment
No, there is no pairing of individuals, you have
two independent samples
Is this an example of matched pairs?
2) In a taste test, a researcher asks people in a
random sample to taste a certain brand of
spring water and rate it. Another random
sample of people is asked to taste a different
brand of water and rate it. The researcher
wants to compare these samples
No, there is no pairing of individuals, you have
two independent samples – If you would have
the same people taste both brands in random
order, then it would bean example of matched
pairs.
Is this an example of matched pairs?
3) A pharmaceutical company wants to test its
new weight-loss drug. Before giving the drug
to a random sample, company researchers
take a weight measurement on each person.
After a month of using the drug, each
person’s weight is measured again.
Yes, you have two measurements that are
dependent on each individual.
A whale-watching company noticed that many
customers wanted to know whether it was better to
book an excursion in the morning or the afternoon.
You
mayquestion,
subtract either
To test
this
the company collected the
way – just
be on
careful
following
data
15 when
randomly selected days over
writing Ha
the past month. (Note: days were not consecutive.)
Day
1 2
3
4
5
6
7
Morning
8 9
7 9 10 13 10 8
Afternoon
8 10 9 8 9
11 8
Since you have two values for
each day, they are dependent on
the day – making this data
matched pairs
8
9
10
1
1
1
2
1
3
1
4
1
5
2 5
7 7 6 8 7
10 4 7
8 9 6 6 9
First, you must find the
differences for each
day.
Day
1 2
3
4 5
6
7
8
Morning
8 9
7
9 10 13 10 8
Afternoon
8 10 9
9
10
2 5
1
1
1
2
1
3
1
4
1
5
7 7 6 8 7
8 9
11 8 10 4 7 8 9 6 6 9
I subtracted:
Differen
Morning – afternoon - 0
-1
-2
1
1
2
2
-2
-2
-2
0
2
ces
1 2
2
You could subtract the other way!
Assumptions:
• Have an SRS of days for whale-watching
• s of difference is 1.6
•Since the normal probability plot is approximately linear, the
distribution of difference is approximately normal.
You need to state assumptions using the
differences!
Differen
ces
0 -1
-2 1 1
2
2
-2
-2 -2
- 0 2
1 2
2
Is there sufficient evidence that more whales are sighted in the
afternoon?
H0: mD = 0
Ha: mD < 0
Be careful writing your Ha!
Think
about how
you
If you subtract
afternoon
– morning;
subtracted: M-A
thenmDHfor
mdifferences
>0 should the
Notice we
a: is
Dmore
If used
afternoon
& it equals 0 since
the null be
should
differences
+ or be
-?
that there
is NO
difference.
Don’t
look
at numbers!!!!
Where mD is the true mean difference
in whale sightings from morning
minus afternoon
Differen
ces
0 -1
-2 1 1
2
2
-2
finishing the hypothesis test:
x m
.4  0
z

 .968
s
1.6
n
15
p  .1664
a  .05
-2 -2
- 0 2
1 2
2
In your calculator,
perform
Notice
thata ift-test
you
using
the differences
subtracted
A-M,
(L3) test
then your
statistic
t = + .945, but pvalue would be the
same
Since p-value > a, I fail to reject H0. There is insufficient
evidence to suggest that more whales are sighted in the
afternoon than in the morning.