STAT 145 (Notes)
Al Nosedal [email protected]
Department of Mathematics and Statistics University of New Mexico
Fall 2013
CHAPTER 18
INFERENCE ABOUT A POPULATION MEAN.
Conditions for Inference about mean
I
We can regard our data as a simple random sample (SRS) from the population. This condition is very important.
I
Observations from the population have a Normal distribution
with mean µ and standard deviation σ. In practice, it is
enough that the distribution be symmetric and single-peaked
unless the sample is very small. Both µ and σ are unknown
parameters.
Standard Error
When the standard deviation of a statistic is estimated from data,
the result is called the standard error of the statistic. The standard
error of the sample mean ¯ x is
√sn.
Travel time to work
A study of commuting times reports the travel times to work of a
random sample of 1000 employed adults. The mean is ¯ x = 49.2
minutes and the standard deviation is s = 63.9 minutes. What is
the standard error of the mean?
Solution
The standard error of the mean is
√ s
n = 63.9
√
10000 = 2.0207 minutes
The one-sample t statistic and the t distributions
Draw an SRS of size n from a large population that has the Normal distribution with mean µ and standard deviation σ. The one-sample t statistic
t
∗= ¯ x − µ s/ √
n
has the t distribution with n − 1 degrees of freedom.
The t distributions
I
The density curves of the t distributions are similar in shape to the Standard Normal curve. They are symmetric about 0, single-peaked, and bell-shaped.
I
The spread of the t distributions is a bit greater than of the Standard Normal distribution. The t distributions have more probability in the tails and less in the center than does the Standard Normal. This is true because substituting the estimate s for the fixed parameter σ introduces more variation into the statistic.
I
As the degrees of freedom increase, the t density curve
approaches the N(0, 1) curve ever more closely. This happens
because s estimates σ more accurately as the sample size
increases. So using s in place of σ causes little extra variation
when the sample is large.
Density curves
-4 -2 0 2 4
0.00.10.20.30.4 Std. Normal t(2)t(9)
Density curves
-4 -2 0 2 4
0.00.10.20.30.4 Std. Normal t(29)
Density curves
-4 -2 0 2 4
0.00.10.20.30.4 Std. Normal t(49)
Critical values
Use Table C or software to find
a) the critical value for a one-sided test with level α = 0.05 based on the t(4) distribution.
b) the critical value for 98% confidence interval based on the t(26)
distribution.
Solution
a) t
∗= 2.132
b) t
∗= 2.479
More critical values
You have an SRS of size 30 and calculate the one-sample t-statistic. What is the critical value t
∗such that
a) t has probability 0.025 to the right of t
∗?
b) t has probability 0.75 to the left of of t
∗?
Solution
Here, df = 30 − 1 = 29.
a) t
∗= 2.045
b) t
∗= 0.683
The one-sample t confidence interval
Draw an SRS of size n from a large population having unknown mean µ. A level C confidence interval for µ is
¯ x ± t
∗s
√ n
where t
∗is the critical value for the t(n − 1) density curve with
area C between −t
∗and t
∗. This interval is exact when the
population distribution is Normal and is approximately correct for
large n in other cases.
Critical values
What critical value t
∗from Table C would you use for a confidence interval for the mean of the population in each of the following situations?
a) A 95% confidence interval based on n = 12 observations.
b) A 99% confidence interval from an SRS of 18 observations.
c) A 90% confidence interval from a sample of size 6.
Solution
a) df = 12 − 1 = 11, so t
∗= 2.201.
b) df = 18 − 1 = 17, so t
∗= 2.898.
c) df = 6 − 1 = 5, so t
∗= 2.015.
Ancient air
The composition of the earth’s atmosphere may have changed over time. To try to discover the nature of the atmosphere long ago, we can examine the gas in bubbles inside ancient amber. Amber is tree resin that has hardened and been trapped in rocks. The gas in bubbles within amber should be a sample of the atmosphere at the time the amber was formed. Measurements on specimens of amber from the late Cretaceous era (75 to 95 million years ago) give these percents of nitrogen:
63.4 65 64.4 63.3 54.8 64.5 60.8 49.1 51.0
Assume (this is not yet agreed on by experts) that these
observations are an SRS from the late Cretaceous atmosphere. Use a 90% confidence interval to estimate the mean percent of
nitrogen in ancient air (Our present-day atmosphere is about
78.1% nitrogen).
Solution
µ = mean percent of nitrogen in ancient air. We will estimate µ with a 90% confidence interval.
With ¯ x = 59.5888, s = 6.2552, and t
∗= 1.860 (df = 9 − 1 = 8), the 90% confidence interval for µ is
59.5888 ± 1.860 6.2552
√ 9
59.5888 ± 3.8782
55.7106 to 63.4670
The one-sample t test
Draw an SRS of size n from a large population having unknown mean µ. To test the hypothesis H
0: µ = µ
0, compute the one-sample t statistic
t
∗= x − µ ¯
0s/ √ n
In terms of a variable T having the t(n − 1) distribution, the P-value for a test of H
0against
H
a: µ > µ
0is P(T ≥ t
∗).
H
a: µ < µ
0is P(T ≤ t
∗).
H
a: µ 6= µ
0is 2P(T ≥ |t
∗|).
These P-values are exact if the population distribution is Normal
and are approximately correct for large n in other cases.
Is it significant?
The one-sample t statistic for testing H
0: µ = 0
H
a: µ > 0
from a sample of n = 20 observations has the value t
∗= 1.84.
a) What are the degrees of freedom for this statistic?
b) Give the two critical values t from Table C that bracket t
∗. What are the one-sided P-values for these two entries?
c) Is the value t
∗= 1.84 significant at the 5% level? Is it significant at the 1% level?
d) (Optional) If you have access to suitable technology, give the
exact one-sided P-value for t
∗= 1.84?
Solution
a) df = 20 -1 = 19.
b) t
∗= 1.84 is bracketed by t = 1.729 (with right-tail probability 0.05) and t = 2.093 (with right-tail probability 0.025). Hence, because this is a one-sided significance test,
0.025 < P-value < 0.05.
c) This test is significant at the 5% level because the
P-value < 0.05. It is not significant at the 1% level because the P-value > 0.01.
d) From TI-84, tcdf(1.84,1000,19), P-value = 0.0407.
Is it significant?
The one-sample t statistic from a sample of n = 15 observations for the two-sided test of
H
0: µ = 64 H
a: µ 6= 64
has the value t
∗= 2.12.
a) What are the degrees of freedom for t
∗?
b) Locate the two-critical values t from Table C that bracket t
∗. What are the two-sided P-values for these two entries?
c) is the value t
∗= 2.12 statistically significant at the 10% level?
At the 5% level?
d) (Optional) If you have access to suitable technology, give the
exact two-sided P-value for t
∗= 2.12.
Solution
a) df = 15 -1 = 14.
b) t
∗= 2.12 is bracketed by t = 1.761 (with two-tail probability 0.10) and t = 2.145 (with two-tail probability 0.05). Hence, because this is a two-sided significance test, 0.05 < P-value < 0.10.
c) This test is significant at the 10% level because the
P-value < 0.10. It is not significant at the 5% level because the P-value > 0.05.
d) From TI-84, tcdf(2.12,1000,19) = 0.0261,
P-value = 2(0.0261) = 0.0522.
Ancient air, continued
Do the data of Exercise 18.7 (see above) give good reason to think
that the percent of nitrogen in the air during the Cretaceous era
was different from the present 78.1%? Carry out a test of
significance at the 5% significance level.
Solution
Is there evidence that the percent of nitrogen in ancient air was different from the present 78.1%?
1. State hypotheses. H
0: µ = 78.1% vs H
a: µ 6= 78.1%.
2. Test statistic. t
∗=
σ/¯x −µ√0n=
59.5888−78.1 6.2553/√9
= −8.8778
3. P-value. For df = 8, this is beyond anything shown in Table C, so P-value < 0.001 (TI -84 gives 0.00002).
4. Conclusion. We have very strong evidence (P-value < 0.001)
that Cretaceous air is different from nitrogen than modern air.
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.
Genetic engineering for cancer treatment
Here’s a new idea for treating advanced melanoma, the most serious kind of skin cancer. Genetically engineer white blood cells to better recognize and destroy cancer cells, then infuse these cells into patients. The subjects in a small initial study were 11 patients whose melanoma had not responded to existing treatments. One question was how rapidly the new cells would multiply after infusion, as measured by the doubling time in days. Here are the doubling times:
1.4 1.0 1.3 1.0 1.3 2.0 0.6 0.8 0.7 0.9 1.9
a) Examine the data. Is it reasonable to use the t procedures?
b) Give a 90% confidence interval for the mean doubling time. Are
you willing to use this interval to make an inference about the
mean doubling time in a population of similar patients?
Solution
a) The stemplot does not show any severe evidence of non-Normality, so t procedures should be safe.
0 6 7 8 9
1 0 0 3 3 4
1 9
2 0
Solution
b) With ¯ x = 1.1727 days, s = 0.4606 days, and t
∗= 1.812 (df = 10), the 90% confidence interval is
1.1727 ± 1.812 0.4606
√ 11
1.1727 ± 0.2516
0.9211 to 1.4243 days
Solution
There is no indication that the sample represents an SRS of all patients whose melanoma has not responded to existing
treatments, so inferring to the population of similar patients may
not be reasonable.
Genetic engineering for cancer treatment, continued
Another outcome in the cancer experiment described above is
measured by a test for the presence of cells that trigger an immune
response in the body and so may help fight cancer. Here are data
for the 11 subjects: counts of active cells per 100,000 cells before
and after infusion of the modified cells. The difference (after minus
before) is the response variable.
Data
Before After Difference Difference/10
14 41 27 2.7
0 7 7 0.7
1 1 0 0
0 215 215 21.5
0 20 20 2
0 700 700 70
0 13 13 1.3
20 530 510 51
1 35 34 3.4
6 92 86 8.6
0 108 108 10.8
Genetic engineering for cancer treatment, continued
a) Examine the data. Is it reasonable to use the t procedures?
b) If your conclusion in part a) is ”Yes”, do the data give
convincing evidence that the count of active cells is higher after
treatment?
Solution
a) The stem plot of differences shows an extreme right skew, and one or two high outliers. The t procedures should not be used.
0 0 0 1 2 2 3 8
1 0
2 1
3
4
5 1
6
7 0
Solution
b) 1. State hypotheses. H
0: µ = 0 vs H
a: µ > 0.
2. Test statistic. t
∗=
σ/¯x −µ√0n=
156.3636−0234.2952/√
11
= 2.2134 3. P-value. For df = 10, using Table C we have that:
1.812 < t
∗< 2.228. Which implies that: 0.025 < P-value < 0.05.
TI -84 gives 0.0256.
4. Conclusion. We would have strong evidence against H
0(P-value < 0.05). We would conclude that the count of active cells
is higher after treatment.
Robust Procedures
A confidence interval or significance test is called robust if the
confidence level or P-value does not change very much when the
conditions for use of the procedure are violated.
Using t procedures
I
Except in the case of small samples, the condition that the data are an SRS from the population of interest is more important than the condition that the population distribution is Normal.
I
Sample size less than 15: Use t procedures if the data appear close to Normal (roughly symmetric single peak, no outliers).
If the data are clearly skewed or if outliers are present, do not use t.
I
Sample size at least 15: The t procedures can be used except in the presence of outliers or strong skewness.
I
Large samples: The t procedures can be used even for clearly
skewed distributions when the sample is large, roughly n ≥ 40.
CHAPTER 19
TWO-SAMPLE PROBLEMS
Two-sample problems
I
The goal of inference is to compare the responses to two treatments or to compare the characteristics of two populations.
I
We have a separate sample from each treatment or each
population.
Conditions for inference comparing two means
I
We have two SRSs, from two distinct populations. The samples are independent. That is, one sample has no influence on the other. Matching violates independence, for example.
We measure the same response variable for both samples.
I
Both populations are Normally distributed. The means and
standard deviations of the populations are unknown. In
practice, it is enough that the distributions have similar
shapes and that the data have no strong outliers.
The Two-Sample Procedures
Draw an SRS of size n
1from a Normal population with unknown mean µ
1, and draw and independent SRS of size n
2from another Normal population with unknown mean µ
2. A confidence interval for µ
1− µ
2is given by
(¯ x
1− ¯ x
2) ± t
∗s
s
12n
1+ s
22n
2Here t
∗is the critical value for the t(k) density curve with area C
between −t
∗and t
∗. The degrees of freedom k are equal to the
smaller of n
1− 1 and n
2− 1.
The Two-Sample Procedures
To test the hypothesis H
0: µ
1= µ
2, calculate the two-sample t statistic
t
∗= x ¯
1− ¯ x
2q
s12 n1+
sn222
and use P-values or critical values for the t(k) distribution.
Degrees of freedom (Option 1)
Option 1. With software, use the statistic t with accurate critical values from the approximating t distribution.
The distribution of the two-sample t statistic is very close to the t distribution with degrees of freedom df given by
df =
s2 1n1
+
sn222
2 1 n1−1s2 1
n1
2+
1 n2−1s2 2
n2
2This approximation is accurate when both sample sizes n
1and n
2are 5 or larger.
Degrees of freedom (Option2)
Option 2. Without software, use the statistic t with critical values
from the t distribution with degrees of freedom equal to the
smaller of n
1− 1 and n
2− 1. These procedures are always
conservative for any two Normal populations.
Logging in the rain forest
”Conservationists have despaired over destruction of tropical rain forest by logging, clearing, and burning”. These words begin a report on a statistical study of the effects of logging in Borneo.
Here are data on the number of tree species in 12 unlogged forest plots and 9 similar plots logged 8 years earlier:
Unlogged: 22 18 22 20 15 21 13 13 19 13 19 15 Logged : 17 4 18 14 18 15 15 10 12
Does logging significantly reduce the mean number of species in a
plot after 8 years? State the hypotheses and do a t test. Is the
result significant at the 5% level?
Solution
Does logging significantly reduce the mean number of species in a plot after 8 years?
1. State hypotheses. H
0: µ
1= µ
2vs H
a: µ
1> µ
2, where µ
1is the mean number of species in unlogged plots and µ
2is the mean number of species in plots logged 8 years earlier.
2. Test statistic.t
∗=
r¯x1−¯x2s21 n1+s2n22
= 2.1140 (¯ x
1= 17.5, ¯ x
2= 13.6666 , s
1= 3.5290, s
2= 4.5, n
1= 12 and n
2= 9)
3. P-value. Using Table C, we have df = 8, and 0.025 < P-value < 0.05.
Using TI-84, we have df = 14.793443, and P-value = 0.02595.
4. Conclusion. Since P-value < 0.05, we reject H
0. There is strong
evidence that the mean number of species in unlogged plots is
greater than that for logged plots 8 year after logging.
Logging in the rainforest, continued
Use the data from the previous exercise to give a 99% confidence
interval for the difference in mean number of species between
unlogged and logged plots.
Solution
1. Find ¯ x
1− ¯ x
2. From what we did earlier:
¯
x
1− ¯ x
2= 17.5 − 13.6666 = 3.8334
2. Find SE = Standard Error. We already know that: s
1= 3.5290, s
2= 4.5, n
1= 12 and n
2= 9
SE = s
s
12n
1+ s
22n
2=
r 3.5290
212 + 4.5
29 = 1.8132 3. Find m = t
∗SE . From Table C, we have df = 8 and 99%
confidence level, then t
∗= 3.355. Hence, m = (3.355)(1.8132) = 6.0832.
4. Find Confidence Interval.
¯
x
1− ¯ x
2± t
∗SE = 3.8334 ± 6.0832 = −2.2498 to 9.9166.
TI 84 gives a 99% confidence interval of −1.52 to 9.1871 species,
using df = 14.793443.
Alcohol and zoning out
Healthy men aged 21 to 35 were randomly assigned to one of two groups: half received 0.82 grams of alcohol per kilogram of body weight; half received a placebo. Participants were then given 30 minutes to read up to 34 pages of Tolstoy’s War and Peace (beginning at chapter 1, with each page containing approximately 22 lines of text). Every two to four minutes participants were prompted to indicate whether they were ”zoning out”. The proportion of time participants indicated they were zoning out was recorded for each subject. The table below summarizes data on the proportion of episodes of zoning out. (The study report gave the standard error of the mean s/ √
n, abbreviated as SEM, rather than
the standard deviation s.)
Alcohol and zoning out
Group n x ¯ SEM
Alcohol 25 0.25 0.05 Placebo 25 0.12 0.03 a) What are the two sample standard deviations?
b) What degrees of freedom does the conservative Option 2 use for two-sample t procedures for these samples?
c) Using Option 2, give a 90% confidence interval for the mean
difference between the two groups.
Solution
a) Call group 1 the Alcohol group,and group 2 the Placebo group.
Then, because SEM = s/ √
n, we have s = SEM √
n. Hence, s
1= 0.05 √
25 = 0.5(5) = 0.25 and s
2= 0.03 √
25 = 0.03(5) = 0.15.
b) Using the conservative option 2,
df = min{25 − 1, 25 − 1} = min{24, 24} = 24.
c) Here, with n
1= n
2= 25, SE = q
s12n1
+
ns222
= √
0.0034 = 0.0583.
With df = 24, we have t
∗= 1.711, and a 90% confidence interval for the mean difference in proportions is given by
0.25 − 0.12 ± 1.711(0.0583) = 0.13 ± 0.0997, that is, from 0.0303
to 0.2297.
Stress and weight in rats
In a study of the effects of stress on behavior in rats, 71 rats were randomly assigned to either a stressful environment or a control (non stressful) environment. After 21 days, the change in weight (in grams) was determined for each rat. The table below
summarizes data on weight gain. (The study report gave the standard error of the mean s/ √
n, abbreviated as SEM, rather than
the standard deviation s).
Stress and weight in rats
Group n ¯ x SEM
Stress 20 26 3
No stress 51 32 2
a) What are the standard deviations for the two groups?
b) What degrees of freedom does the conservative Option 2 use for the two-sample procedures for these data?
c) Test the null hypothesis of no difference between the two group
means against the two-sided alternative at the 5% significance
level. Use the degrees of freedom from part b).
Solution
a) Call group 1 the Stress group,and group 2 the No stress group.
Then, because SEM = s/ √
n, we have s = SEM √
n. Hence, s
1= 3 √
20 = 13.4164 and s
2= 2 √
51 = 14.2828.
b) Using the conservative option 2,
df = min{20 − 1, 51 − 1} = min{19, 50} = 19.
c) 1. Set hypotheses. H
0: µ
1= µ
2vs H
a: µ
16= µ
22. Calculate test statistic. With n
1= 20 and n
2= 51, SE =
q
s21 n1+
sn222
= √
12.9999 = 3.6055, t
∗=
x¯1SE− ¯x2= −1.6641.
3. P-value. With df = 19, using Table C, 0.10 < P-value < 0.20.
Using TI-84 (2-SampTTest), P-value = 0.1045
4. Conclusion. Since P-value > 0.05 we CAN’T reject H
0. There is
little evidence in support of a conclusion that mean weights of rats
in stressful environments differ from those of rats without stress.
CHAPTER 20
INFERENCE ABOUT A POPULATION PROPORTION
Problem
A market research consultant hired by the Pepsi-Cola Co. is
interested in determining the proportion of UNM students who
favor Pepsi-Cola over Coke Classic. A random sample of 100
students shows that 40 students favor Pepsi over Coke. Use this
information to construct a 95% confidence interval for the
proportion of all students in this market who prefer Pepsi.
Bernoulli Distribution
x
i=
1 i-th person prefers Pepsi 0 i-th person prefers Coke µ = E (x
i) = p
σ
2= V (x
i) = p(1 − p), i.e. σ = pp(1 − p) Let ˆ p be our estimate of p. Note that ˆ p = P
ni =1
x
i= ¯ x . If n is
”big”, by the Central Limit Theorem, we know that: ¯ x is roughly N
µ,
√σn, that is, ˆ p is roughly N
p,
q
p(1−p) nSampling distribution of a sample proportion
Draw an SRS of size n from a large population that contains proportion p of successes. Let ˆ p be the sample proportion of successes,
ˆ
p = number of successes in the sample n
Then:
I
The mean of the sampling distribution of ˆ p is p.
I
The standard deviation of the sampling distribution is q
p(1−p)n
.
I
As the sample size increases, the sampling distribution of ˆ p
becomes approximately Normal. That is, for large n, ˆ p has
approximately the N(p, pp(1 − p)/n).
Large-sample confidence interval for a population proportion
Draw an SRS of size n from a large population that contains an unknown proportion p of successes. An approximate level C confidence interval for p is
ˆ p ± z
∗r p(1 − ˆ ˆ p) n
where z
∗is the critical value for the standard Normal density curve with area C between −z
∗and z
∗.
Use this interval only when the numbers of successes and failures
in the sample are both 15 or greater.
Problem
A survey of 611 office workers investigated telephone answering practices, including how often each office worker was able to answer incoming telephone calls and how often incoming telephone calls went directly to voice mail. A total of 281 office workers indicated that they never need voice mail and are able to take every telephone call.
a. What is the point estimate of the proportion of the population of office workers who are able to take every telephone call?
b. At 90% confidence, what is the margin of error?
c. What is the 90% confidence interval for the proportion of the
population of office workers who are able to take every telephone
call?
Solution
p = proportion of the population of office workers who are able to take every telephone call.
a . ˆ p =
281611= 0.46 b. Margin of error = z
∗q
ˆp(1−ˆp)n
= 1.645
q
(0.46)(0.54)611
=
1.645(0.0201) = 0.0330 c. ˆ p ± z
∗q
ˆp(1−ˆp) n0.46 ± .0330
From 0.4270 to 0.4930.
We are 90% confident that the proportion of the population of
office workers who are able to take every phone call lies between
42.70% and 49.30%.
Computer/Internet-based crime
With over 50% of adults spending more than an hour a day on the internet, the number experiencing computer-or Internet- based crime continues to rise. A survey in 2010 of a random sample of 1025 adults, aged 18 and older, reached by random digit dialing found 113 adults in the sample who said that they or a household member had been the victim of a computer or Internet crime on their home computer in the past year. Give the 99% confidence interval for the proportion p of all households that have
experienced computer or Internet crime during the year before the
survey was conducted.
Solution
p = proportion of all households that have experienced computer or Internet crime during the year before the survey was conducted.
Step 1. Find ˆ p.
ˆ
p = number of successes sample size =
1025113= 0.1102.
Step 2. Find m = margin of error z
∗q
p(1−ˆˆ p)n
= 2.576
q
0.1102(1−0.1102)1025
= 2.576(0.0097) = 0.0249 Step 3. Find confidence interval, i.e. ˆ p − m and ˆ p + m.
ˆ
p − m = 0.1102 − 0.0249 = 0.0853 ˆ
p + m = 0.1102 + 0.0249 = 0.1351
Based on this sample, we are 99% confident that between 8.53%
and 13.51% of Internet users were victims of computer or Internet
crime during the year before this survey was taken.
Sample Size for desired margin of error
The level C confidence interval for a population proportion p will have margin of error approximately equal to a specified value m when the sample size is
n = z
∗m
2p
∗(1 − p
∗)
where p
∗is a guessed value for the sample proportion. The margin
of error will always be less than or equal to m if you take the guess
p
∗to be 0.5.
Problem
The percentage of people not covered by health care insurance in 2003 was 15.6%. A congressional committee has been charged with conducting a sample survey to obtain more current information.
a. What sample size would you recommend if the committee’s goal is to estimate the current proportion of individuals without health care insurance with a margin of error of 0.03? Use a 95%
confidence level.
b. Repeat part a) assuming that you have no prior information (i.e.
p
∗= 0.5).
c. Repeat part a) using a 99% confidence level.
d. Repeat part c) assuming that you have no prior information (i.e.
p
∗= 0.5).
Solution
a. n =
zm∗2p
∗(1 − p
∗) =
1.960.032(0.156)
∗(1 − 0.156) = 563 b. n =
zm∗2p
∗(1 − p
∗) =
1.960.032(0.5)
∗(1 − 0.5) = 1068 c. n =
zm∗2p
∗(1 − p
∗) =
2.5760.032(0.156)
∗(1 − 0.156) = 971 c. n =
zm∗2p
∗(1 − p
∗) =
2.5760.032(0.5)
∗(1 − 0.5) = 1844
Graph of p
∗(1 − p
∗)
0.0 0.2 0.4 0.6 0.8 1.0
0.000.050.100.150.200.25
p*
p*(1-p*)
p*=0.5
Canadians and doctor-assisted suicide
A Gallup Poll asked a sample of Canadian adults if they thought the law should allow doctors to end the life of a patient who is in great pain and near death if the patient makes a request in writing.
The poll included 270 people in Quebec, 221 of whom agreed that doctor-assisted suicide should be allowed.
a) What is the margin of error of the large-sample 95% confidence interval for the proportion of all Quebec adults who would allow doctor-assisted suicide?
b) How large a sample is needed to get the common ±3
percentage point margin of error? Use the previous sample as a
pilot study to get p
∗.
Solution
a) We find that ˆ p =
221270= 0.8185 and SE
ˆp=
q
ˆp(1−ˆp)n
= 0.0234.
Hence, the margin of error for 95% confidence is (1.96)(0.0234) = 0.0458.
b) For a ±0.03 margin of error, we need n =
1.960.032(0.8185)(1 − 0.8185) = 634.1105. Round this up in
order to obtain a required sample size of 635.
Significance tests for a proportion
Draw an SRS of size n from a large population that contains an unknown proportion p of successes. To test the hypothesis H
0: p = p
0, compute the z
∗statistic
z
∗= ˆ p − p
0q
p0(1−p0) nFind P-values from the standard Normal distribution.
Use this test when the sample size n is so large that both np
0and
n(1 − p
0) are 10 or more.
P-values
To test the hypothesis H
0: p = p
0, compute the z
∗statistic z
∗= ˆ p − p
0q
p0(1−p0) nIn terms of a variable Z having the standard Normal distribution, the approximate P-value for a test of H
0against
H
a: p > p
0is P(Z > z
∗)
H
a: p < p
0is P(Z < z
∗)
H
a: p 6= p
0is 2P(Z > |z
∗|)
Problem
A study found that, in 2005, 12.5% of U.S. workers belonged to unions. Suppose a sample of 400 U.S. workers is collected in 2006 to determine whether union efforts to organize have increased union membership.
a. Formulate the hypotheses that can be used to determine whether union membership increased in 2006.
b. If the sample results show that 52 of the workers belonged to unions, what is the p-value for your hypothesis test?
c. At α = 0.05, what is your conclusion?
Solution
p = proportion of all U.S. workers who belonged to a union in 2006.
a.H
0: p = 0.125 vs H
a: p > 0.125 b . ˆ p =
40052= 0.13
z
∗=
qp−pˆ 0p0(1−p0) n
=
q0.13−0.125(0.125)(0.875) 400
= 0.30 Using Table A,
P-value = P(Z > z
∗) = P(Z > 0.30) = 1 − 0.6179 = 0.3821
c. P-value > 0.05, do not reject H
0. We cannot conclude that
there was an increase in union membership.
Problem
A study by Consumer Reports showed that 64% of supermarket shoppers believe supermarket brands to be as good as national name brands. To investigate whether this result applies to its own product, the manufacturer of a national name-brand ketchup asked a sample of shoppers whether they believed that supermarket ketchup was as good as the national brand ketchup.
a. Formulate the hypotheses that could be used to determine whether the percentage of supermarket shoppers who believe that the supermarket ketchup was as good as the national brand ketchup differed from 64%.
b. If a sample of 100 shoppers showed 52 stating that the
supermarket brand was as good as the national brand, what is the p-value?
c. At α = 0.05, what is your conclusion?
Solution
p = proportion of all shoppers who believe supermarket brands to be as good as this particular national brand ketchup.
a.H
0: p = 0.64 vs H
a: p 6= 0.64 b . ˆ p =
10052= 0.52
z
∗=
qp−pˆ 0p0(1−p0) n
=
q0.52−0.64(0.64)(0.36) 100
= −2.50
Using Table A, P-value = 2P(Z > |z
∗|) = 2P(Z > | − 2.50|) = 2P(Z > 2.50) = 2(0.0062) = 0.0124
c. P-value < 0.05, reject H
0. Proportion differs from the reported
0.64.
Problem
The National Center for Health Statistics released a report that stated 70% of adults do not exercise regularly. A researcher decided to conduct a study to see whether the claim made by the National Center for Health Statistics differed on a state-by-state basis.
a. State the null and alternative hypotheses assuming the intent of the researcher is to identify states that differ from 70% reported by the National Center for Health Statistics.
b. At α = 0.05, what is the research conclusion for the following states?: Wisconsin: 252 of 350 adults did not exercise regularly.
California: 189 of 300 adults did not exercise regularly.
Solution (Wisconsin)
p = proportion of all adults in the state of Wisconsin that do not exercise regularly.
a.H
0: p = 0.70 vs Ha : p 6= 0.70 b. (Wisconsin) ˆ p =
252350= 0.72 z
∗=
qp−pˆ 0p0(1−p0) n
=
q0.72−0.70(0.70)(0.30) 350
= 0.82
Using Table A, P-value = 2P(Z > |z
∗|) = 2P(Z > |0.82|) = 2P(Z > 0.82) = 2(0.2061) = 0.4122
c. P-value > 0.05, do not reject H
0. We don’t have evidence to
claim that Wisconsin is one of those states where the proportion of
adults that do not exercise regularly differs from 70%.
Solution (California)
p = proportion of all adults in the state of California that do not exercise regularly.
a.H
0: p = 0.70 vs Ha : p 6= 0.70 b. (California) ˆ p =
189300= 0.63 z
∗=
qp−pˆ 0p0(1−p0) n
=
q0.63−0.70(0.70)(0.30) 300= −2.65
Using Table A, P-value = 2P(Z > |z
∗|) = 2P(Z > | − 2.65|) = 2P(Z > 2.65) = 2(1 − 0.9960) = 0.0080
c. P-value < 0.05, we reject H
0. We have strong evidence to claim
that California’s proportion of adults that do not exercise regularly
differs from 70%.
CHAPTER 23
TWO CATEGORICAL VARIABLES: THE CHI-SQUARE TEST
Problem
A sample of 70 girls and boys was taken at random from a
population of children (perhaps of a particular age of interest), and then the numbers of right-handed boys, right-handed girls,
left-handed boys, and left-handed girls were recorded as shown below:
Girls Boys Total
Left-handed 12 6 18
Right-handed 24 28 52
Total 36 34 70
Is there evidence that, in the sampled population, handedness is
independent of sex? (Use α = 0.05)
Step 1. State Hypotheses
H
0: In the sampled population, there is NO relationship between handedness and sex.
H
a: In the sampled population, there is a relationship between
handedness and sex.
Step 2. Compute test statistic.
Draw an SRS from a large population and make a two-way table of the sample counts for two categorical variables. To test the null hypotheses H
0that there is no relationship between the row and column variables in the population, calculate the chi-square statistic
X
2= X ( observed count - expected count )
2expected count
The sum is over all cells in the table.
The chi-square test rejects H
0when χ
2is large. Sofware finds
P-values from a chi-square distribution.
Step 2. (cont.)
Expected Counts.
P(left-handed) =
1870P(right-handed) =
5270Expected number of left-handed girls =
number of girls × P(left-handed) = (36)(
1870) =
(36)(18)70= 9.26.
Expected number of right-handed girls =
number of girls × P(right-handed) = (36)(
5270) =
(36)(52)70= 26.74.
Expected number of left-handed boys =
number of boys × P(left-handed) = (34)(
1870) =
(34)(18)70= 8.74.
Expected number of right-handed boys =
number of boys × P(right-handed) = (34)(
5270) =
(34)(52)70= 25.26.
Expected Counts
The expected counts in any cell of a two-way table when H
0is true is:
expected count = row total x column total
table total
Table of Expected Counts
Girls Boys Total Left-handed 9.26 8.74 18 Right-handed 26.74 25.26 52
Total 36 34 70
X
2=
(12−9.26)9.26 2+
(24−26.74)26.74 2+
(6−8.74)8.74 2+
(28−25.26)25.26 2X
2= 0.8107 + 0.2807 + 0.8589 + 0.2972 = 2.2475
(Using TI-84, X
2= 2.2523).
Step 3. Find P-value
d.f. = (r − 1)(c − 1) = (2 − 1)(2 − 1) = 1
Using Table D, 2.07 < X
2= 2.2475 < 2.71 which implies that
0.10 < P-value < 0.15. (Using TI-84,P-value = 0.1334.)
Step 4. Conclusion
Since P-value > 0.10 > 0.05 = α, we CAN’T reject H
0. We
conclude that there is NO relationship between handedness and
sex.
Example
Suppose the Federal Correction Agency wants to investigate the following question: Does a male released from federal prison make better adjustment to civilian life if he returns to his hometown or if he goes elsewhere to live? To put it another way, is there a
relationship between adjustment to civilian life and place of residence after release from prison?
The agency’s psychologists interviewed 200 randomly selected former prisoners. Using a series of questions, the psychologists classified the adjustment of each individual to civilian life as being outstanding, good, fair, or unsatisfactory. The counts are given in the following contingency table.
Examine the hypothesis that there is no relationship between
adjustment to civilian life and place of residence after release from
prison. Test at the α = 0.01 level.
Table of observed counts
Outstanding Good Fair Unsatisfactory Total
Hometown 27 35 33 25 120
Not hometown 13 15 27 25 80
Total 40 50 60 50 200
Step 1. State hypotheses
H
0: There is NO relationship between adjustment to civilian life and where the individual lives after being released from prison.
H
a: There is a relationship between adjustment to civilian life and
where the individual lives after being released from prison.
Table of EXPECTED counts
Outstanding Good Fair Unsatisfactory Total
Hometown 24 30 36 30 120
Not hometown 16 20 24 20 80
Total 40 50 60 50 200
Step 2. Compute test statistic.
X
2=
(27−24)24 2+
(35−30)30 2+
(33−36)36 2+
(25−30)30 2+
(13−16)16 2+
(15−20)2
20
+
(27−24)24 2+
(25−20)20 2X
2= 0.375 + 0.833 + 0.250 + 0.833 + 0.563 + 1.250 + 0.375 + 1.250 X
2= 5.729
(Using TI-84, X
2= 5.7291).
Step 3. Find P-value
d.f. = (r − 1)(c − 1) = (2 − 1)(4 − 1) = 3
Using Table D, 5.32 < X
2= 5.729 < 6.25 which implies that
0.10 < P-value < 0.15. (Using TI-84,P-value = 0.1255.)
Step 4. Conclusion
Since P-value > 0.10 > 0.01 = α, we CAN’T reject H
0. We
conclude that there is NO relationship between adjustment to
civilian life and where the prisoner resides after being released from
prison. For the Federal Correction Agency’s advisement program,
adjustment to civilian life is not related to where the ex-prisoner
lives after being released.
Cell counts required for the chi-square test
You can safely use the chi-square test with P-values from the
chi-square distribution when no more than 20% of the expected
counts are less than 5 and all individual expected counts are 1 or
greater. In particular, all four expected counts in a 2 × 2 table
should be 5 or greater.
Majors for men and women in business
A study of the career plans of young women and men sent
questionnaires to all 722 members of the senior class in the College of Business Administration at the University of Illinois. One
question asked which major within the business program the student had chosen. Here are the data from the students who responded:
Female Male Total
Accounting 68 56 124
Administration 91 40 131
Economics 5 6 11
Finance 61 59 120
Total 225 161 386
This is an example of a single sample classified according to two
categorical variables (gender and major).
Majors for men and women in business (cont.)
a) Test the null hypothesis that there is no relationship between the gender of students and their choice of major. Give a P-value and state your conclusion(Use α = 0.05.)
b) Verify that the expected cell counts satisfy the requirement for use of chi-square.
c) Which two cells have the largest terms in the chi-square
statistic? How do observed and expected counts differ in these
cells?
Solution
a) Step 1. State Hypotheses.
H
0: There is NO relationship between gender and choice of major.
H
a: There is a relationship between gender and choice of major.
Solution
Expected counts.
Female Male Total Accounting 72.28 51.72 124 Administration 76.36 54.64 131
Economics 6.41 4.59 11
Finance 69.95 50.05 120
Total 225 161 386
Solution
Step 2. Compute test statistic.
X
2=
(68−72.28)72.28 2+
(56−51.72)51.72 2+
(91−76.36)76.36 2+
(40−54.64)54.64 2+
(5−6.41)2
6.41
+
(6−4.59)4.59 2+
(61−69.95)69.95 2+
(59−50.05)50.05 2X
2= 0.253 + 0.354 + 2.807 + 3.923 + 0.311 + 0.434 + 1.145 + 1.600
X
2= 10.827
Solution
Step 3. Find P-value.
d.f. = (r − 1)(c − 1) = (2 − 1)(4 − 1) = 3
Using Table D, 9.84 < X
2= 10.827 < 11.34 which implies that
0.01 < P-value < 0.02. (Using TI-84,P-value = 0.0127.)
Solution
Step 4. Conclusion.
Since P-value < 0.05, we reject H
0. We have fairly strong evidence that gender and choice of major are related.
b) One expected count is less than 5, which is only one-eight (12.5%) of the counts in the table, so the chi-square procedure is acceptable.
c) The largest chi-square components are the two from the
”Administration” row. Many more women than we expect (91
actual, 76.36 expected) chose this major, whereas only 40 men
chose this (54.64 expected).
The Chi-square distributions
The chi-square distributions are a family of distributions that take only positive values and are skewed to the right. A specific
chi-square distribution is specified by giving its degrees of freedom.
The chi-square test for a two-way table with r and c columns uses
critical values from the chi-square distribution with (r-1)(c-1)
degrees of freedom. The P-value is the area under the density
curve of this chi-square distribution to the right of the value of the
test statistic.
Density curves
0 5 10 15 20
0.00.10.20.30.40.5 df=1
df=4df=8