You are on page 1of 42

CHAPTER 9B, HYPOTHESIS

TESTING FOR SINGLE MEANS


AND SINGLE PROPORTIONS
Hypothesis Testing: t Distribution
Single Sample t Test Problem
What Happens When 𝜎𝜎 Is Unknown?
3

 Many times 𝜎𝜎 is not known; a z-test cannot be used.


 However, as with confidence intervals, if 𝜎𝜎 is
unknown, a t-distribution can be used.
 The critical value and p-values are determined from
a t-distribution with (in the case of a single mean)
n-1 degrees of freedom.
Test Statistic: One Sample t Test
4

 The one-sample t-test is analogous to the z-test statistic,


except here we do not know 𝜎𝜎:

𝑋𝑋� − 𝜇𝜇𝑥𝑥̅
𝑡𝑡 =
𝑠𝑠/ 𝑛𝑛

 We can tie this formula back to what we learned about


the distribution of means:

𝜇𝜇𝑥𝑥̅ = 𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀 𝑜𝑜𝑜𝑜 𝑡𝑡𝑡𝑡𝑡 𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷 𝑜𝑜𝑜𝑜 𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀


𝑠𝑠
� 𝑛𝑛 = 𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆 𝐸𝐸𝐸𝐸𝐸𝐸𝐸𝐸𝐸𝐸
Coca-Cola Example
5

 The Coca-Cola Company reported that the mean per


capita annual sales of its beverages in the United
States was 423 eight-ounce servings (Coca-Cola
Company website, February 3, 2009).
 Suppose you are curious whether the consumption of
Coca-Cola beverages is higher in Atlanta, Georgia, the
location of Coca-Cola's corporate headquarters. A
sample of 36 individuals from the Atlanta area showed
a sample mean annual consumption of 460.4 eight-
ounce servings with a standard deviation of s = 101.9.
Using α = .05, do the sample results support the
conclusion that mean annual consumption of Coca-Cola
beverage products is higher in Atlanta?
Coca-Cola Example
6

 Let’s do this as a hypothesis testing example.


 First of all, what do we know?
 The mean of the Atlanta sample: 𝑋𝑋� = 460.4
 The mean of the population at large: 𝜇𝜇0 = 423

 The standard deviation of the sample: 𝑠𝑠 = 101.9

 Sample size: 𝑛𝑛 = 36

 Alpha level: 𝛼𝛼 = .05, 𝑜𝑜𝑜𝑜𝑜𝑜 − 𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡


Coca-Cola Example
7

 Step 1: Develop the null and alternative hypotheses.


 Population 1: People living in Atlanta, GA (represented by µ1).
 Population 2: People in the population at large; this
population annually purchases a mean of 423 eight-ounce
servings of Coca-Cola products (µ0 = 423).

 Alternative Hypothesis:
𝐻𝐻𝐴𝐴 = 𝜇𝜇1 > 423
 Null Hypothesis:
𝐻𝐻0 = 𝜇𝜇1 ≤ 423
Coca-Cola Example
8

 Step 2: Specify the characteristics of the


comparison distribution.
 Calculate degrees of freedom and discern α from the
problem.
 One-tailed upper tail test because we are looking for
an increase in consumption due to geographic location.
 Note: all critical values and decision rules must agree
with the direction of the HA when performing Step 4
(demonstrated next).
 Appropriate df for the single sample t are (n-1).
Coca-Cola Example
9

 Step 4: Find your critical value and write a decision


rule.
 Remember, 𝐻𝐻𝐴𝐴 : 𝜇𝜇1 > 423.

 Since we are performing a one-tailed upper tail test, our


critical value will be positive and the entire alpha
percentage is contained in that tail.

 Decision Rule: If tobt ≥ ???, then reject the null; else,


retain the null.

 Find the critical value here on the t-table.


Finding t-critical
10

 Decision Rule: If tobt ≥ 1.690, then reject the null;


else, retain the null.
Coca-Cola Example
11

 Step 3: Use the sample data to compute the value


of the test statistic.

𝑋𝑋� − 𝜇𝜇0 460.4 − 423


𝑡𝑡 = = = 2.20
𝑠𝑠⁄ 𝑛𝑛 101.9⁄ 36
Coca-Cola Example
12

 Step 5: Make your decision.

 Decision Rule: If tobt ≥ 1.690, then reject the null;


else, retain the null.
tobt = 2.20. Do we reject or retain the null?

 What does that mean in terms of Coca-Cola


consumption in the city of Atlanta, GA?
Determining the p value Interval
13

 A p value interval could be used instead of a


critical value to answer questions about hypothesis
testing.
 With the table approach, you can only determine
an approximate p value by finding the interval in
which the test statistics falls in that t distribution.
 For example, in this problem, our df = 35.
 Look along the df=35 line until you find the interval
in which your score would fall.
Determining the p-value Interval
14

t = 2.20

□ Our test statistic’s one-tailed p-value interval is between


p = .025 and p = .01.
□ Since α =.05, and our tobt has a p-value between .01 and .025,
we reject the null.
□ Using this method does not require us to find a critical value in
Step 4.
Writing Results in Proper Statistical
15
Notation
 When performing t-tests, there is a formal notation
in which you should always present your results
when asked.
 Proper statistical notation for a t-test is the
following:
𝑡𝑡 𝑑𝑑𝑑𝑑 = 𝑡𝑡𝑜𝑜𝑜𝑜𝑜𝑜 , 𝑝𝑝 > 𝑜𝑜𝑜𝑜 < 𝛼𝛼
Degrees of alpha level
freedom (change to
t value you how your p a number)
p = probability of relates to
calculated
obtained t value; alpha (α)
leave this as the
letter p.
Coca-Cola Example
16

 We could discuss the findings in the following way:


A sample of 36 individuals Atlanta, GA were asked to
track their consumption of eight-ounce Coca-Cola
purchases over the course of one year to determine
whether residents of this area made significantly
greater purchases due to the presence of the
company’s headquarters in the community. Results
indicated that those living in Atlanta (𝑋𝑋� = 460.4,
𝑠𝑠 = 101.9) did make significantly more Coca-Cola
purchases during the year than the company’s annual
expected consumption (µ = 423), t(35)=2.20, p <.05.
Sample Proportions
The Distribution of the Sample
18
Proportion
 Many times our statistics are more readily
understood as proportions. For example:
 We may wish to know the proportion of freshman that
will be returning for a second year.
 We may be interested in knowing the proportion of
people of a certain demographic type who will buy a
product geared toward them.
 Population proportions must be estimated just like
population means.
Distributions of Sample Proportions
19

 When the sample size is large, a binomial


approximation to the normal distribution can be
used to determine probabilities.
 We are going to use this method for finding
proportions by looking at area under the normal
curve.
 However, use of the normal curve requires that we
have a measure of central tendency (e.g., mean)
and some measure of dispersion (e.g., std dev.).
Population and Sample Proportions
20

 Population proportion is represented as (𝑝𝑝).


 Sample proportions are designated as (𝑝𝑝). ̅
 Sampling distributions for proportions are
conceptualized like sampling distributions for means.
 Our sample proportion is just one of a multitude of
proportions we could have calculated based on the
sample chosen.
 If we were able to construct a sampling distribution of
all possible proportions coming from samples of the
same size, the resulting sampling distribution would
have the following properties.
The Mean of the Distribution of
21
Proportions
 The mean of the distribution of sample proportions
is always equal to the proportion of the parent
population.

𝑝𝑝 = 𝐸𝐸 𝑝𝑝̅ = 𝝁𝝁𝒑𝒑�

 As with means, this is unaffected by sample size.


Variance and Standard Deviation of
22
the Distribution of Proportions
 The variance and standard deviation of a
distribution of proportions are both affected by the
sample size:

𝑝𝑝(1 − 𝑝𝑝) 𝑝𝑝(1


̅ − 𝑝𝑝)̅
𝜎𝜎𝑝𝑝2̅ = ≅
Standard 𝑛𝑛 𝑛𝑛
Error for
proportions
𝑝𝑝(1 − 𝑝𝑝) 𝑝𝑝(1
̅ − 𝑝𝑝)̅
𝜎𝜎𝑝𝑝̅ = ≅
𝑛𝑛 𝑛𝑛
Single Sample Z Test for Proportions
23

 The test statistic for calculating probabilities with


proportions is a z-test:

𝑝𝑝̅ − 𝜇𝜇𝑝𝑝̅
𝑧𝑧 =
𝜎𝜎𝑝𝑝̅
 𝑝𝑝̅is the sample proportion
 𝜇𝜇𝑝𝑝̅ is the mean of the distribution of proportions

 𝜎𝜎𝑝𝑝̅ is the standard error of proportions


24 Hypothesis Testing for Proportions
Balancing the Checkbook…
25

 National banking statistics suggest that only 32% of


college students say they balance their checkbook
at least once a month. Notre Dame Federal Credit
Union conducts a survey of 40 students and finds
that proportion to be 38% among ND students.
 Can NDFCU conclude that ND students behave
differently from the general population of college
students at 𝛼𝛼=.05?
 We can use hypothesis testing procedures here.
Hypothesis Testing: Checkbook
26

 Step 1: Determine the null and alternative


hypotheses.
 Population 1: Students who attend ND.
 Population 2: General population of college students
(whose proportion is 32%).

𝐻𝐻𝑂𝑂 : 𝑝𝑝1 = .32 𝐻𝐻𝐴𝐴 : 𝑝𝑝1 ≠ .32


Hypothesis Testing: Checkbook
27

 Step 2: Determine characteristics of the comparison


distribution.
z distribution for proportions
 𝜇𝜇𝑝𝑝̅ = 𝑝𝑝 = .32

𝑝𝑝(1−𝑝𝑝) .32(1−.32)
 𝜎𝜎𝑝𝑝̅ = = = .074
𝑛𝑛 40
Hypothesis Testing: Checkbook
28

 Step 3: Calculate the test statistic.

𝑝𝑝̅ − 𝜇𝜇𝑝𝑝̅ .38 − .32


𝒛𝒛 = = =. 𝟖𝟖𝟖𝟖
𝜎𝜎𝑝𝑝̅ .074

 Step 4: Determine the critical value(s) to compare to


the test statistic or determine the p-value to
compare to α.
Hypothesis Testing: Checkbook
29

 Critical value approach:


 Critical values: 𝑧𝑧𝛼𝛼⁄2 = 𝑧𝑧.025 = ±1.96
 Decision Rule: If zobt ≤ -1.96 or zobt ≥1.96, then reject Ho.
 Determining the p-value:
 Find the value of the test statistic in the z table; calculate the
complement; double this area for a two-tailed test.
 𝑃𝑃 𝑧𝑧 > .81 = .7910; Complement: 1 − .7910 = .2090

 p value: .2090 ∗ 2 = .4180

 Compare p to α (.05)
Hypothesis Testing: Checkbook
30

 Step 5: Make a decision.


 Both the critical value approach and the p value
approach come to the same conclusion.
 Do Notre Dame students behave differently than the
general population in terms of how often they balance
their checkbooks?
31 Confidence Intervals for Proportions
Confidence Interval for Sample
32
Proportions
 Recall that we can construct confidence intervals
around sample means with the following formula:
� ± 𝒛𝒛𝜶𝜶� 𝝈𝝈𝒙𝒙�
𝑪𝑪𝑪𝑪 = 𝒙𝒙
𝟐𝟐
 A similar formula can be used to create a
confidence interval around a sample proportion.
 We can use the results of our confidence interval to
assist us in hypothesis testing decisions.
� ± 𝒛𝒛𝜶𝜶⁄𝟐𝟐 (𝝈𝝈𝒑𝒑� )
𝑪𝑪𝑪𝑪 = 𝒑𝒑 Margin of Error
Using CI in Hypothesis Testing
33

 Checkbook balancing example: Our null hypothesis


suggested that our sample of 40 ND students (38%)
would be no different from the general population.
𝐻𝐻𝑂𝑂 : 𝑝𝑝1 = .32
 Calculate a 95% CI for the proportion of ND
students who balance their checkbooks monthly and
use it to reject or retain Ho.
.32 1 − .32
𝑝𝑝̅ ± 𝑧𝑧𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐 𝜎𝜎𝑝𝑝̅ = .38 ± 1.96
40
Checkbook Example CI
34

.32 1 − .32
.38 ± 1.96 = .38 ± .145
40

.235, .525

 Reject or retain 𝐻𝐻𝑂𝑂 : 𝑝𝑝1 = .32?


 How do you know?
Hypothesis Testing for a Single Mean:
M&Ms Example
This example will not be covered in class; this is a
worked out example of two-tailed hypothesis testing
with a single-sample t. Please review this example on
your own if you feel you need help with two-tailed
tests.
M&M Example
36

 Let’s say that M&M Mars tells us that on average there


should be 6 Blue M&M’s in their 1.69 oz. package.
How might we test their claim?
 We could perform a single-sample t test. Let’s do this
at an alpha level of .01.
 The formula for a single sample t-test is much like that
for the single sample z-test:
Mean of the
Sample 𝑥𝑥̅ − 𝜇𝜇𝑥𝑥̅ Distribution of Means
𝑡𝑡 = 𝑠𝑠
Mean
𝑛𝑛
Standard Error
Single Sample t Test
 We sample 20 packages and find the mean
number of Blue M&M’s to be 4.6 with a standard
deviation of 2.036. Would this constitute a
significantly small number of Blue M&M’s to believe
that M&M Mars’ process is different than they
publish? Let’s test it at an alpha of .01.
Single Sample t Test
38

 1. Reframe the hypotheses.


 Population 1: M&M’s we would have purchased.
 Population 2: The population of M&M’s sold, where
there should be an average of 6 blue M&M’s per
package.
H0: μ1 = 6 HA: μ1 ≠ 6

 2. Determine the significance level.


 Two-tailed test with an alpha of .01 with 19 df.
Single Sample t Test
39

 3. Calculate your test statistic:

𝑥𝑥̅ − 𝜇𝜇𝑥𝑥̅ 4.6 − 6 −1.4


𝑡𝑡 = 𝑠𝑠 = = = −3.074
2.036 .4554
𝑛𝑛 20

Remember that in the denominator of the single


sample t-test, you need to make sure that you
are dividing the sample standard deviation by
the square root of the sample size to obtain the
proper standard deviation for the distribution of
means.
Single Sample t Test
40

4. Determine the cutoff sample score on the


comparison distribution at which the H0 should be
rejected.
Single Sample t Test
41

4. Determine the critical value on the comparison


distribution at which the H0 should be rejected.
1% level (2-tailed), df=19: t needed = ±2.861

Decision Rule: If t≤-2.861 or t≥2.861, then reject the


null hypothesis; else retain null hypothesis.
Single Sample t Test
42

5. Compare the scores obtained in Steps 3 and 4 and


follow decision rule stated in Step 4.
 Decision Rule: If t≤-2.861 or t≥2.861, then reject the
null hypothesis; else retain null hypothesis.
tobt = -3.074

Reject Ho.

The number of blue M&M’s (𝑋𝑋=4.6) was significantly
less than that suggested by M&M Mars (μ =6),
t(19) = -3.074, p < .01.

You might also like