Download Chapter 1: Statistics

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

Degrees of freedom (statistics) wikipedia , lookup

Sufficient statistic wikipedia , lookup

History of statistics wikipedia , lookup

Foundations of statistics wikipedia , lookup

Taylor's law wikipedia , lookup

Bootstrapping (statistics) wikipedia , lookup

German tank problem wikipedia , lookup

Statistical inference wikipedia , lookup

Misuse of statistics wikipedia , lookup

Resampling (statistics) wikipedia , lookup

Student's t-test wikipedia , lookup

Transcript
Chapter 10: Inferences Involving
Two Populations
H 0 : 1   2
H a : 1   2
1
2
Chapter Goals
• Independent versus dependent samples.
• Compare two populations using:
the mean of the paired differences,
the difference between two means, and
the difference between two proportions.
10.1: Independent and Dependent
Samples
• Two basic kinds of samples: independent
and dependent.
• The dependence or independence of two
samples is determined by sources used for
the data.
Source:
Can be a person, an object, or anything that yields a piece of
data.
Dependent Sampling:
The same set of sources or related sets are used to obtain the
data representing both populations.
Independent Sampling:
Two unrelated sets or sources are used, one set from each
population.
Example: An experiment is designed to study the effect of
classical music on mathematical ability. Thirty-five students
are selected at random and given a basic mathematics skills
test. The following day the same 35 students first listen to 45
minutes of classical music, and then take a similar
mathematics skills test.
This sampling plan illustrates dependent sampling. The
sources used for both samples (without classical music and
with classical music) are the same.
Note: Typically, when both a pretest and a posttest are used,
the same subjects are used in the study. Thus, this kind of
sampling plan usually leads to dependent samples.
Example: A university would like to compare the math SAT
scores of male and female first-year students. Fifty males and
40 females are selected at random and their math SAT scores
are recorded.
This sampling plan illustrates independent sampling. The
sources (students) used for each sample (male and female)
were selected separately.
Example: The number of items produced by two different
assembly lines is to be compared. Twenty five days are
randomly selected for assembly line 1 and the number of
items produced on each day is recorded. Forty randomly
selected days for assembly line 2 are selected and the number
of items produced on each day is recorded.
This sampling plan illustrates independent sampling. The
sources (assembly lines) used for each sample (line 1 and 2)
were selected separately.
10.2: Inferences Concerning the
Mean Difference Using
Two Dependent Samples
• When dependent samples are involved, the
data is paired data.
• Paired data results from:
before and after studies,
a common source,
from matched pairs.
Paired difference: d  x1  x2
1. Using the differences removes the dependence in the data.
2. Also removes the effect of otherwise uncontrolled factors.
3. The difference between the two population means, when
dependent samples are used, is equivalent to the mean of
the paired differences.
4. An inference about the mean of the paired differences is an
inference about the difference of two means.
5. The mean of the sample paired differences is used as a
point estimate for these inferences.
Sampling Distribution of d
1. When paired observations are randomly selected from
normal populations, the paired difference, d = x1  x2, will
be approximately normally distributed about a mean d
with a standard deviation sd.
2. Use a t-test for one mean: make an inference about an
unknown mean (d) where d has an approximately normal
distribution with an unknown standard deviation (sd).
3. Inferences are based on a sample of n dependent pairs of
data and the t distribution with n  1 degrees of freedom.
The assumption for inferences about the mean of paired
differences (d): The paired data are randomly selected from
normally distributed populations.
Confidence Interval:
The 1  a confidence interval for estimating the mean
difference d is found using the formula:
a  sd

d  t  df, 
 2 n
to
a  sd

d  t  df, 
,
 2 n
where
df  n  1
where d is the mean of the sample differences:
d

d
n
and sd is the standard deviation of the sample differences:
  d 2 
2
d
  n 


sd 
n 1
Example: Salt-free diets are often prescribed for people with
high blood pressure. The following data was obtained from
an experiment designed to estimate the reduction in diastolic
blood pressure as a result of following a salt-free diet for two
weeks. Assume diastolic readings to be normally distributed.
Before
93
106
87
92
102
95
88
110
After
92
102
89
92
101
96
88
105
1
4
-2
0
1
-1
0
5
Difference
Find a 99% confidence interval for the mean reduction.
Solution:
1. Population Parameter of Interest:
The mean reduction (difference) in diastolic blood pressure.
2. The Confidence Interval Criteria:
a. Assumptions: Both sample populations are assumed
normal.
b. Test statistic: t with df = 8  1 = 7.
c. Confidence level: 1  a = 0.99
3. Sample evidence:
Sample information:
n  8,
d  1.0,
and
sd  2.39
4. The Confidence Interval:
a. Confidence coefficients:
Two-tailed situation, a/2 = 0.005
t(df, a/2) = t(7, 0.005) = 3.50
b. Maximum error:
a  sd
2.39 


E  t  df, 
 3.50
  (3.50)(0.845)  2.957
 2 n
 8 
c. Confidence limits:
d  E to d  E
1.0  2.957 to 1.0  2.957
 1.957 to 3.957
5. The Results:
1.957 to 3.957 is the 99% confidence interval for d.
Hypothesis Testing:
When testing a null hypothesis about the mean difference, the
test statistic is
d  d
t* 
sd n
where t* has a t distribution with df = n  1.
Example: The corrosive effects of various chemicals on
normal and specially treated pipes were tested by using a
dependent sampling plan. The data collected is summarized
by
n  17, d  5.7, sd  4.8
where d is the amount of corrosion on the treated pipe
subtracted from the amount of corrosion on the normal pipe.
Example (continued): Does this sample provide sufficient
evidence to conclude the specially treated pipes are more
resistant to corrosion? Use a = 0.05
a. Solve using the p-value approach.
b. Solve using the classical approach.
Solution:
1. The Set-up:
a. Population parameter of concern: The mean difference
in corrosion, normal pipe  treated pipe.
b. The null and alternative hypothesis:
H0: d = 0 () (did not lower corrosion)
Ha: d > 0 (did lower corrosion)
2. The Hypothesis Test Criteria:
a. Assumptions: Assume corrosion measures are
approximately normal.
b. Test statistic:
d  d
t* 
, where df  n  1  16
sd n
c. Level of significance: a = 0.05.
3. The Sample Evidence:
a. Sample information: n  17, d  5.7,
b. Calculate the value of the test statistic:
d   d 5.7  0.0
5.7
t* 


 4.896
sd n 4.8 17 1.164
sd  4.8
4. The Probability Distribution (Classical Approach):
a. Critical value: t(16,0.05) = 1.75
b. t* is in the critical region.
4. The Probability Distribution (p-Value Approach):
a. The p-value: P  P(t*  4.896, with df  16)  0.0001
b. The p-value is smaller than the level of significance, a.
5. The Results:
a. Decision: Reject H0.
b. Conclusion: At the 0.05 level of significance, there is
evidence to suggest the treated pipes do not corrode as
much as the normal pipes when subjected to chemicals.
10.3: Inferences Concerning the
Difference Between Means
Using Two Independent
Samples
• When comparing the means of two
populations, consider the difference
between their means: 1 - 2.
• Inferences based on x1  x 2
Distribution of x1  x 2
If independent samples of sizes n1 and n2 are drawn randomly
2
s
from large populations with means 1 and 2 and variances 1
2
and s 2 , respectively, the sampling distribution of x1  x 2, the
difference between the sample means, has
1. a mean,  x1 x2  1  2
2. a standard error, s x1  x 2
 s 12   s 22 
     
 n1   n2 
If both populations have normal distributions, then the
sampling distribution of x1  x 2 will also be normally
distributed.
Note:
1. Preceding statement true for all sample sizes if the
populations are normal and the population variances are
known.
2. Population variances are usually unknown quantities.
3. Estimate the standard error by using the sample variances.
 s12   s22 
Estimated standard error      
 n1   n2 
The assumptions for Inferences About the Difference
Between Two Means 1  2:
The samples are randomly selected from normally distributed
populations, and the samples are selected in an independent
manner.
No assumptions are made about the population variances.
The t distribution will be used as the test statistic.
Case 1: t distribution, df calculated.
Used when a computer and statistical software computes
the number of degrees of freedom. df is a function of both
sample sizes and their relative sizes, and both sample
variances and their relative sizes.
Case 2: t distribution, df approximated.
Used when completing the inference without the aid of a
computer or calculator. Use the t distribution with the
smaller of df1 = n1  1 or df2 = n2  1 degrees of freedom.
This will give conservative results. The true level of
confidence for an interval will be slightly higher. The true
p-value and true level of significance will be slightly less
than reported.
Note: When the difference between A and B is being
discussed, it is customary to express the difference as larger
subtract smaller so that the resulting difference is positive,
A  B > 0.
Confidence Intervals:
The following formula is used for calculating the endpoints of
the 1  a confidence interval.
a

( x1  x 2 )  t  df, 
 2
to
 s12   s22 
    
 n1   n2 
a
( x1  x 2 )  t  df, 
 2
 s12   s22 
    
 n1   n2 
where df is the smaller of df1 or df2 if no computer or
calculator is used.
Example: A recent study reported the longest average
workweeks for non-supervisory employees in private industry
to be chef and construction.
Industry
Chef
Construction
n
18
12
Average Hours/Week
48.2
44.1
Standard Deviation
6.7
2.3
Find a 95% confidence interval for the difference in mean
length of workweek between chef and construction. Assume
normality for the sampled populations and that the samples
were selected randomly.
Solution:
1. Parameter of interest: The difference between the mean
hours/week for chefs and the mean hours/week for
construction workers, 1 - 2.
2. The Confidence Interval Criteria:
a. Assumptions: Both populations are assumed normal and
the samples were random and independently selected.
b. Test statistic: t with df = 11;
the smaller of n1  1 = 18  1 = 17 or n2  1 = 12  1 = 11.
c. Confidence level: 1  a = 0.95.
3. The Sample Evidence:
Sample information given in the table.
Point estimate for 1 - 2: x1  x 2  48.2  44.1  4.1
4. The Confidence Interval:
a. Confidence coefficients:
t(df, a/2) = t(11, 0.025) = 2.20 (Table 6, Appendix B)
b. Maximum error:
 s12   s22 
E  t (df, a / 2)     
 n1   n2 
 6.7 2   2.32 
  (2.20)(1.7131)  3.77
  
 (2.20) 
 18   12 
c. Confidence limits:
( x1  x 2 )  E  4.1  3.77
4.1  3.77 to 4.1  3.77
.33 to 7.87
5. The Results:
.33 to 7.87 is a 95% confidence interval for the difference
in mean hours/week for chefs and construction workers.
Note:
1. Using a calculator, the confidence interval is .55 to 7.65.
2. This confidence interval is narrower than the approximate
interval computed on the previous slide. This illustrates
the conservative (wider) nature of the confidence interval
when approximating the degrees of freedom.
Hypothesis Tests:
To test a null hypothesis about the difference between two
population means, use the test statistic
t* 
( x1  x 2 )  ( 1   2 )
 s12   s22 
    
 n1   n2 
where df is the smaller of df1 or df2 when computing t*
without the aid of a computer or calculator.
Note: The hypothesized difference between the two
population means 1  2 can be any specified value. The
most common value is zero.
Example: A recent study compared a new drug to ease postoperative pain with the leading brand. Independent random
samples were obtained and the number of hours of pain relief
for each patient were recorded. The summary statistics are
given in the table below.
Pain Reliever
New Drug
Leading Brand
n
10
17
Mean
4.350
3.929
St.Dev.
0.542
0.169
Is there any evidence to suggest the new drug provides longer
relief from post-operative pain? Use a = 0.05
a. Solve using the p-value approach.
b. Solve using the classical approach.
Solution:
1. The Set-up:
a. Parameter of concern: The difference between the mean
time of pain relief for the new drug and that for the leading
brand.
b. The null and alternative hypotheses:
H0: 1  2 = 0 (new drug relieves pain no longer)
Ha: 1  2 > 0 (new drug works longer to relieve pain)
2. The Hypothesis Test Criteria:
a. Assumptions: Both populations are assumed to be
approximately normal. The samples were random and
independently selected.
b. Test statistic: t*, df = 9
df = smaller of n1  1 = 10  1 = 9 or n2  1 = 17  1 = 16
c. Level of significance: a = 0.05.
3. The Sample Evidence:
a. Sample information: Given in the table.
b. Test statistic:
( x1  x 2 )  ( 1   2 ) (4.350  3.929)  (0.00)
t* 

2
2
 s1   s2 
 0.542 2   0.169 2 
    

  

 n1   n2 
 10   17 
0.421
0.421


 2.39
0.0294  0.0017 0.1763
4. The Probability Distribution (Classical Approach):
a. Critical value: t(df, 0.05) = t(9, 0.05) = 1.83
b. t* is in the critical region.
4. The Probability Distribution (p-Value Approach):
a. The p-value: P  P(t*  2.39, with df  9)  0.019
b. The p-value is smaller than the level of significance, a.
5. The Results:
a. Decision: Reject H0.
b. Conclusion: There is evidence to suggest that the new drug
provides longer relief from post-operative pain.
Note: Here are the results using Minitab.
Two sample T for New Drug vs Leading Brand
New Drug
Leading
N
10
17
Mean
4.350
3.929
StDev
0.542
0.169
SE Mean
0.17
0.041
95% CI for mu New Drug - mu Leading: ( 0.03, 0.813)
T-Test mu New Drug = mu Leading (vs >): T = 2.39 P = 0.019
DF = 10
10.4: Inferences Concerning the
Difference Between
Proportions Using Two
Independent Samples
• Often interested in making statistical
comparisons between two proportions,
percentages, or probabilities associated with
two populations.
Recall: The properties of a binomial experiment.
1. The observed probability is p'  x / n where x is the
number of observed successes in n trials.
2. q'  1  p'
3. p is the probability of success on an individual trial in a
binomial probability experiment of n repeated independent
trials.
Goal:
To compare two population proportions.
Point Estimate:
The difference between the observed proportions: p1  p2
Sampling Distribution:
If independent samples of sizes n1 and n2 are drawn randomly
from large populations with p1 = P1(success) and
p2 = P2(success), respectively, then the sampling distribution of
p1  p2 has these properties:
1. a mean  p1  p2  p1  p2
2. a standard error s p  p 
1
2
p1q1 p2 q2

n1
n2
3. an approximately normal distribution if n1 and n2 are
sufficiently large.
Note: To ensure normality:
1. The sample sizes are both larger than 20.
2. The products n1p1, n1q1, n2p2, n2q2 are all larger than 5.
Since p1 and p2 are unknown, these products are estimated
by n1 p1 , n1q1 , n2 p2 , n2 q2
3. The samples consist of less than 10% of respective
populations.
The assumptions for inferences about the difference
between two proportions p1  p2: The n1 random
observations and the n2 random observations forming the two
samples are selected independently from two populations that
are not changing during the sampling.
Confidence Intervals:
1. A confidence interval for p1  p2 is based on the unbiased
sample statistic p1  p2 .
2. The confidence limits are found using the following
formula:
p1q1 p2 q2
( p1  p2 )  z (a / 2) 

n1
n2
to
p1q1 p2 q2
( p1  p2 )  z (a / 2) 

n1
n2
Example: A consumer group compared the reliability of two
similar microcomputers from two different manufacturers.
The proportion requiring service within the first year after
purchase was determined for samples from each of two
manufacturers.
Manufacturer
1
2
Sample Size Proportion Needing Service
200
0.15
250
0.09
Find a 98% confidence interval for p1  p2, the difference in
proportions needing service.
Solution:
1. Population Parameter of Interest: The difference between
the proportion of microcomputers needing service for
manufacturer 1 and the proportion of microcomputers
needing service for manufacturer 2.
2. The Confidence Interval Criteria:
a. Assumptions:
Sample sizes larger than 20.
Products n1 p1 , n1q1 , n2 p2 , n2 q2 all larger than 5.
p1  p2 should have an approximate normal distribution.
b. Test statistic: z*.
c. Confidence level: 1  a = 0.98.
3. The Sample Evidence:
Sample information:
n1  200,
n2  250,
p1  0.15,
p2  0.09,
q1  1  0.15  0.85
q2  1  0.09  0.91
Point estimate: p1  p2  0.15  0.09  0.06
4. The Confidence Interval:
a. Confidence coefficients:
z(a/2) = z(0.01) = 2.33
0.01
0.01
0.98
0
z (0.01)
2.33
z
b. Maximum error:
p1q1 p2 q2
(0.15)(0.85) (0.09)(0.91)
E  z (a / 2) 

 2.33

n1
n2
200
250
 2.33 0.0006375  0.0003276  (2.33)(0.0311)  0.0724
c. Confidence limits:
( p1  p2 )  E
0.06  0.0724
0.06  0.0724  0.0124
to
0.06  0.0724  0.1324
d. Results:
0.0124 to 0.1324 is a 98% confidence interval for the
difference in proportions.
Hypothesis Tests:
If the null hypothesis is there is no difference between
proportions, the test statistic is
z* 
p1  p2
 1   1 
pq     
 n1   n2 
Note:
1. The null hypothesis is p1 = p2, or p1  p2 = 0.
2. Nonzero differences between proportions are not discussed
in this section.
3. The numerator of the formula above:
( p1  p2 )  ( p1  p2 )  ( p1  p2 )  0  ( p1  p2 )
Note (continued):
4. Since the null hypothesis is p1 = p2, the standard error of
the point estimate p1  p2 is
 p1q1   p2 q2 



 n1   n2 
 1   1 
pq     
 n1   n2 
where p = p1 = p2 and q = 1  p.
5. Use a pooled estimate for the common proportion.
x1  x2

pp 
, and qp  1  pp
n1  n2
The test statistic becomes
p1  p2
z* 
 1   1 
( pp )(qp )     
 n1   n2 
Example: The proportion of defective parts from two different
suppliers were compared. The following data was collected.
Supplier
1
2
Sample Size
300
275
Number Defective
15
9
Is there any evidence to suggest the proportion of defectives
is different for the two suppliers? Use a = 0.01.
a. Solve using the classical approach.
b. Solve using the p-value approach.
Solution:
1. The Set-up:
a. Population parameter of interest: The difference between
the proportion of defectives for supplier 1 and the
proportion of defectives for supplier 2.
b. The null and alternative hypotheses:
H0: p1  p2 = 0 (proportion of defectives the same)
Ha: p1  p2  0 (proportion of devectives different)
2. The Hypothesis Test Criteria:
a. Assumptions:
Populations are large (number of parts supplied).
Samples are larger than 20.
Products n1 p1 , n1q1 , n2 p2 , n2 q2 are larger than 5.
Sampling distribution should be approximately normal.
b. Test statistic: z*.
c. Level of significance: a = 0.01.
3. The Sample Evidence:
a. Sample information:
x x
15  9
24
pp  1 2 

 0.042
n1  n2 300  275 575
qp  1  pp  1  0.042  0.958
b. Test statistic:
p1  p2
0.05  0.0327
z* 

 1   1 
 1   1 
(0.042)(0.958) 
( pp )(qp )     


 300   275 
 n1   n2 
0.0173
0.0173


 1.03
0.0002804 0.0167
4. The Probability Distribution (Classical Approach):
a. Critical value: z(a/2) = z(0.005) = 2.58.
b. z* is not in the critical region.
4. The Probability Distribution (p-Value Approach):
a. The p-value:
P / 2  P( z*  1.03)  0.5000  0.3485  0.1515
P  2(0.1515)  0.3030
b. The p-value is larger than the level of significance, a.
5. The Results:
a. Decision: Do not reject H0.
b. Conclusion: There is no evidence to suggest the
proportion of defectives is different for the two
suppliers.