Transcript 8-2-8-3

Inferences about two proportions
Assumptions
1. We have proportions from two simple random
samples that are independent (not paired)
2. For both samples, np ≥ 5 and nq ≥ 5
Possible alternative hypotheses:
p1  p2 ,
p1  p2 ,
Null Hypothesis: p1 = p2
p1  p2
Test Statistic:
z
( pˆ 1  pˆ 2 )  ( p1  p 2 )
pq pq

n1
n2
where p1 - p2 = 0 (assumed in null hypothesis)
x1
pˆ 1  ,
n1
x2
pˆ 2 
n2
x1  x2
p
n1  n2
(pooled estimate of p1 and p2)
Critical values and P-values come from the z-score tables
Example
A drug company wants to determine that their
new headache drug is effective. They give
500 people their new drug, and 400 people a
placebo. In the experimental group, 350
said their headache went away in 15
minutes. In the placebo group, 235 said
their headache went away in 15 minutes. Is
the success rate higher in the experimental
group?
Define hypotheses:
H 0 : pE  pP
H1 : pE  pP
Let’s use a 0.01 significance level
Because we’re working with a proportion, we use a normal
distribution.
350
235
pˆ E 
 0.70, pˆ P 
 0.5875
500
400
350  235
p
 0.65
500  400
Value of the test statistic:
z
( pˆ E  pˆ P )  ( p E  p P )
pq pq

nE nP

(0.70  0.5875)  (0)
(0.65)(0.35) (0.65)(0.35)

500
400
 3.516
Since we are working with a 0.01 significance level, and this is a
right-tailed test, the critical value is 2.33. Since the test statistic
is larger than the critical value, we reject the null hypothesis.
The sample data support the claim that a larger proportion of
people recovered in 15 minutes using the new drug than using the
placebo.
PValue :
P(z > 3.516) = 0.0001. Much smaller than our critical value.
This would again lead us to reject the null hypothesis.
Confidence Intervals for two proportions
E  z 2
pˆ 1qˆ1 pˆ 2 qˆ 2

n1
n2
( pˆ 1  pˆ 2 )  E  ( p1  p 2 )  ( pˆ 1  pˆ 2 )  E
Example:
The 99% confidence interval for our drug test results:
(0.70)(0.30) (0.5875)(0.4125)
E  2.575

 0.0825
500
400
pˆ E  pˆ P  0.70  0.5875  0.1125
0.03  ( p E  p P )  0.195
We are 99% confident that the difference between the
population proportions is between 0.03 and 0.195
Inferences about two means
Assumptions
1. The two samples are simple random samples, and are
independent
2. Either both samples are large (>30), or both samples
come from normally distributed populations.
Test Statistic:
t
( x1  x 2 )  ( 1   2 )
2
2
s1
s2

n1
n2
Degrees of freedom is
the smaller of n1-1 and
n2-1
Example
You want to test the theory that talking to plants
makes a difference. You put 23 bean plants in one
greenhouse and talk to them nicely each day. You
put 21 bean plants in another greenhouse and
ignore them. After 4 weeks, you find that the
mean height of the talked-to plants is 38cm, with a
standard deviation of 5cm. The mean height of
the ignored plants is 34cm, with a standard
deviation of 7cm. Test the claim that the results
are different.
Define hypotheses:
H 0 : T   I
H 1 : T   I
Let’s use a 0.05 significance level
Because we’re working with sample means, σ unknown,
we use a t distribution.
xT  38, sT  5, nT  23
x I  34, s I  7, n I  21
Degrees of freedom = 20
Value of the test statistic:
t
( xT  x I )  (  T   I )
2
2
sT
sI

nT
nI

(38  34)  (0)
2
2
 2.163
5
7

23 21
This is a two-tailed test with a 0.05 significance level. From
our critical t table, our critical values are -2.086 and 2.086
Since the test statistic is larger than the critical value, we
reject the null hypothesis.
The sample data support the claim that plants that are talked
to grow differently than plants that are ignored.
P-Value:
Since it is a two-tailed test with the test statistic to the right
of center, we want to find twice the area to the right of the
test statistic:
2.P(t > 2.163) = 2.(0.020) = 0.04 (using technology)
Since this is less than our significance level, we reject the
null hypothesis
Confidence Intervals for two means
2
E  t 2
2
s1
s2

n1
n2
( x1  x 2 )  E  ( 1   2 )  ( x1  x 2 )  E
Example:
The 95% confidence interval for our plant results above:
52 7 2
E  2.086

 3.86
23 21
xT  x I  4
0.14  ( 1   2 )  7.86
We are 95% confident that the difference between the
populations is between 0.14cm and 7.86cm.
In other words, we are 95% confident that the plants that are
talked to grow between 0.14cm and 7.86cm higher than plants
that are ignored.
Matched Pairs
When comparing two populations where the samples
are not independent, we must use the Matched
Pairs test (8.4)
Example of matched pairs:
People are given a test while listening to music, and
another test in silence. Claim: the mean test score
while listening to music is higher than the mean
test score in silence
Homework
8.2: 5, 7, 11, 21
8.3: 1, 3, 5, 7, 15