Download Chapter 7

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

Foundations of statistics wikipedia , lookup

History of statistics wikipedia , lookup

Degrees of freedom (statistics) wikipedia , lookup

Bootstrapping (statistics) wikipedia , lookup

Taylor's law wikipedia , lookup

Statistical inference wikipedia , lookup

Misuse of statistics wikipedia , lookup

Resampling (statistics) wikipedia , lookup

Student's t-test wikipedia , lookup

Transcript
Chapter 7
Inference for Distributions
Dr. Nahid Sultana
Chapter 7
Inference for Distributions
7.1 Inference for the Mean of a Population
7.2 Comparing Two Means
7.1 Inference for the Mean of a
Population
 The t Distributions
 One-Sample t Confidence Interval
 One-Sample t Test
 Matched Pairs t Procedures
 Robustness of the t Procedures
3
Example – Sweetening colas
Cola manufacturers want to test how much the sweetness of a new cola drink is
affected by storage. The sweetness difference due to storage was evaluated by
10 professional tasters (by comparing the sweetness before and after storage):
Taster
1
2
3
4
5
6
7
8
9
10
Sweetness difference (D = Before – After)
2.0
0.4
We want to test if storage results in a loss of sweetness:
0.7
2.0
H 0 : µ diff = 0 ; H a : µ diff > 0
−0.4
2.2
This looks familiar. However, here we do not know the
−1.3
population parameter σ.
1.2
1.1
2.3
This situation is very common with real data.
4
When σ is unknown
The sample s.d. s provides an estimate of the population s.d. σ.
When the sample size is large,
But when the sample size is small,
then s is a good estimate of σ.
then s is a poor estimate of σ.
The sample is likely to contain
elements representative of the
whole population.
The sample contains only a few
individuals.
5
Standard deviation s – standard error s/√n
 When σ is not known, we estimate it with the sample standard deviation s.
 Then we estimate the standard deviation of
by
.
 This quantity is called the standard error of the sample mean
denote it by SEM or
and we
.
Example: A simple random sample of five female basketball players is
selected. Their heights (in cm) are 170, 175, 169, 183, and 177.
What is the standard error of the mean of these height
measurements?
Solution: Sample mean
= 174.8
Sample s.d, s= √32.2
SEM=
6
= √(32.2/5) = 2.538.
The t Distributions
Suppose that an SRS of size n is drawn from an N(µ,σ) population.
 When σ is known, the sampling distribution is N(μ, σ/√n).
 When σ is estimated from the sample standard deviation s, the sampling
distribution follows a t-distribution t(μ, s/√n) with degrees of freedom n − 1.
7
The t Distributions
When comparing the density curves of the standard Normal distribution
and t distributions, several facts are apparent:
 The density curves of the t distributions are
similar in shape to the standard Normal
curve.
 The spread of the t distributions is a bit
greater than that of the standard Normal
distribution.
 The t distributions have more probability in
the tails and less in the center than does
the standard Normal.
 As the degrees of freedom increase, the t
density curve approaches the standard
Normal curve ever more closely.
We can use Table D in the back of the book to determine critical values t* for t
distributions with different degrees of freedom.
8
Standardizing the data before using Table D
As with the normal distribution, the first step is to standardize the data.
Then we can use Table D to obtain the area under the curve.
Here, μ is the mean (center) of the sampling distribution,
and the standard error of the mean s/√n is its standard deviation (width).
9
Using Table D
Suppose you want to construct a 95% confidence interval for the mean µ of a
Normal population based on an SRS of size n = 12.
What critical t* should you use?
Upper-tail probability p
df
.05
.025
.02
.01
10
1.812
2.228
2.359
2.764
11
1.796
2.201
2.328
2.718
12
1.782
2.179
2.303
2.681
z*
1.645
1.960
2.054
2.326
90%
95%
96%
98%
Confidence level C
In Table D, we consult the row
corresponding to df = n – 1 = 11.
We move across that row to the
entry that is directly above 95%
confidence level.
The desired critical value is t * = 2.201.
10
One-Sample t Confidence Interval
 The level C confidence interval is an interval
with probability C of containing the true population
parameter.
 C is the area between −t* and t*.
 We find t* from Table D for df = n −1 and
confidence level C.
The One-Sample t Interval for a Population Mean
Choose an SRS of size n from a population having unknown mean µ.
sx
A level C confidence interval for µ is: x ± t *
n
where t* is the critical value for the t(n – 1) distribution.
The margin of error is
sx
t*
n
This interval is exact when the population distribution is Normal and
approximately correct for large n in other cases.
11
Example: Listening to music on cell phones.
On average, U.K. subscribers with 3G phones spent an average of 8.3 hours per
month listening to full-track music on their cell phones.
Suppose we want to determine a 95% confidence interval for the U.S. average
and draw the following random sample of size 8 from the U.S. population of 3G
subscribers: 5 6 0 4 11 9 2 3
Here sample mean, x = 5 ; s. d. , s = 3.63 ; df = n-1 = 7.
The standard error is
t∗ = 2.365
The 95% CI is
12
The One-Sample t Test
x − µ0
t=
sx
n
As in the previous chapter, a test of hypotheses requires a few steps:
1. Stating the null and alternative hypotheses (H0 versus Ha)
2. Calculating t and its degrees of freedom
13
3.
Finding the area under the curve with Table D
4.
Stating the P-value and interpreting the result
The One-Sample t Test
The P-value is calculated as the corresponding area under the curve,
one-tailed or two-tailed depending on Ha:
14
Example
The level of dissolved oxygen (DO) in a stream or river is an important
indicator of the water’s ability to support aquatic life.
A researcher measures the DO level at 15 randomly chosen locations along a
stream. Here are the results in milligrams per liter:
4.53
5.42
5.04
6.38
3.29
4.01
5.23
4.66
4.13
2.87
5.50
5.73
4.83
5.55
4.40
A dissolved oxygen level below 5 mg/l puts aquatic life at risk.
We want to perform a test at the α = 0.05 significance level of:
H 0: µ = 5
H a: µ < 5
where µ is the actual mean dissolved oxygen level in this stream.
15
Example
The sample mean and standard deviation are:
.
H 0: µ = 5
H a: µ < 5
P-value The P-value is the area to the left of
t = –0.94 under the t distribution curve with
df = 15 – 1 = 14.
But P(t < –0.94 )=P(t > 0.94 )
The P-value is between 0.15 and 0.20, which is
Upper-tail probability p
16
df
.25
.20
.15
13
.694
.870
1.079
14
.692
.868
1.076
15
.691
.866
1.074
50%
60%
70%
Confidence level C
greater than our α = 0.05 significance level,
- We fail to reject H0.
-We don’t have enough evidence to conclude that
the mean DO level in the stream is less than 5 mg/l.
Example – Sweetening colas
(continued)
Is there evidence that storage results in sweetness
loss for the new cola
recipe at the α=5% level of significance?
H0: μ = 0 versus Ha: μ > 0 (one-sided test)
There is a significant loss of sweetness, on average, following storage.
Matched Pairs t Procedures
Sometimes we want to compare treatments or conditions at the individual
level.
These situations produce two samples that are not independent — they are
related to each other.
The members of one sample are identical to, or matched (paired) with, the
members of the other sample.
Example: Pre-test and post-test studies look at data collected on the
same sample elements before and after some experiment is performed.
Matched Pairs t Procedures
To compare the responses to the two treatments in a matched-pairs design,
find the difference between the responses within each pair. Then apply the
one-sample t procedures to these differences.
18
Matched Pairs t Procedures
Conceptually, this is not different from tests on one population.
19
Example – Sweetening colas (revisited)
The sweetness loss due to storage was evaluated by 10 professional
tasters (comparing the sweetness before and after storage):
Although the text didn’t mention it explicitly, this is a pre-/post-test design and
the variable is the difference in cola sweetness before minus after storage.
A matched pairs test of significance is indeed just like a one-sample test.
Example: Does lack of caffeine increase depression?
Individuals diagnosed as caffeine dependent are
assigned to receive daily pills. Sometimes, the
pills contain caffeine and other times they contain
a placebo. Depression was assessed.
For each individual in the sample, we have
calculated a difference in depression score
(placebo minus caffeine).
Caffeine deprivation causes a significant increase in depression.
7.2 Comparing Two Means
 Two-sample z statistic
 Two-samples t procedures
 Two-sample t significance test
 Two-sample t confidence interval
22
Two-Sample Problems
What if we want to compare the mean of some quantitative
variable for the individuals in two populations, Population 1 and Population 2?
23
Two-sample z statistic
Then the two-sample z statistic has the
standard normal N(0, 1) sampling distribution.
24
Two independent samples t distribution
- - >> The statistic x1 − x2 is our best guess for the value of µ1 − µ 2.
- - >> The s. d. of the statistic x1 − x2 is : σ x − x =
1
2
σ1
2
n1
+
σ2
2
n2
- - >> Since here σ1 and σ 2 are unknown, we replace them with s.
2
2
s1 s2
The result is the standard error of the statistic x1 − x2 : SE =
+
n1 n2
25
Two independent samples t distribution
 We standardize the observed difference to obtain a t statistic:
 The two-sample t statistic has approximately a t distribution.
26
Two-Sample t Test
Two-Sample t Test for the Difference Between Two Means
Suppose the Random, Normal, and Independent conditions are met.
To test the hypothesis H 0 : µ1 − µ 2 = hypothesized value,
compute the t statistic t =
( x1 − x2 )
2
2
s1 s2
+
n1 n2
Find the P - value based on the direction specified by H a .
Use the t distribution with df approximated by the smaller of n1 − 1 and n2 − 1.
27
Does smoking damage the lungs of
children exposed to parental smoking?
Forced vital capacity (FVC) is the volume (in milliliters)
of air that an individual can exhale in 6 seconds.
FVC was obtained for a sample of children not exposed to parental smoking
and a group of children exposed to parental smoking.
We want to know whether parental smoking decreases children’s lung capacity
as measured by the FVC test.
Is the mean FVC lower in the population of children exposed to parental
smoking?
Does smoking damage the lungs of children exposed to
parental smoking?
Is the mean FVC lower in the population of children exposed to parental smoking?
 The difference in sample averages follows appt.
the t distribution:
In table D, for df 29 we find:
|t| > 3.659 => p < 0.0005
We reject H0.
Lung capacity is significantly impaired in children of smoking parents
Confidence Interval for µ1 - µ2
Two-Sample t Interval for a Difference Between Means
When the Random, Normal, and Independent conditions are met,
a level C confidence interval for ( µ1 − µ 2 ) is
2
2
s1 s2
( x1 − x2 ) ± t *
+
n1 n2
where t * is the critical value for confidence level C for the
t distribution with df smaller of n1 − 1 and n2 − 1.
2
2
s1 s2
The margin of error is : m = t *
+
= t * SE.
n1 n2
30
Example
Can directed reading activities in the classroom help improve reading
ability?
A class of 21 third-graders participates in these activities for 8 weeks while a
control classroom of 23 third-graders follows the same curriculum without the
activities. After 8 weeks, all children take a reading test (scores in table).
Example
Can directed reading activities in the classroom help improve reading
ability?
Third graders who receive directed reading score 1 to 19 points higher than
kids who don’t.