Hypothesis Testing--t-Tests and Confidence Intervals

advertisement
UNC-Wilmington
Department of Economics and Finance
ECN 377
Dr. Chris Dumas
Testing Hypothesis about Means using t-Tests and the t-Table
(with a guest appearance by Confidence Intervals)
t-Tests are used to conduct hypothesis tests involving means when you don’t know the σ of the population (which
is the usual situation). Conducting a t-Test is similar to conducting a Z-test, but t-Tests are used much more often
in practice (because we usually don’t know the σ of the population).
We use the t-distribution, or t-Table of values to help us conduct t-Tests. Use of the t-Table will be
demonstrated in lecture. The t-distribution is also named “Student’s distribution,” but it should rightfully be
named “Gosset’s distribution.” Related to this is the fact that, if it were not for beer, the t-distribution may not
have been discovered, and statistics would not be nearly as useful. For this reason, “Beer saved statistics!” Read
more here: https://en.wikipedia.org/wiki/William_Sealy_Gosset
The t-test gives different results from the Z-test when sample size n is small; but, when sample size is large, the ttest and the Z-test give approximately the same results.
There are three different types of t-Tests about means. (The examples later in this handout will show you how to
conduct each type of t-Test.)

A One-Sample t-Test is used to test whether the mean from one sample of data is different from
a given number.

An Independent Samples t-Test is used to test whether the mean from one sample of data is
different from the mean from a second sample of data where the individuals in the first sample
are DIFFERENT FROM the individuals in the second sample. For example, if you measure
the opinion of 100 people on some issue and also measure the opinion of a different set of 100
people in some other location, say, on the same issue, and then you want to test whether the
opinion of the first set of people differs from the opinion of the second set of people (to determine
whether opinions are different in the different locations), you would conduct a Independent
Samples t-Test.

A Dependent (or "Paired") Samples t-Test is used to test whether the mean from one sample of
data is different from the mean from a second sample of data where the individuals measured in
the first sample are THE SAME individuals measured in the second sample. For example, if
you measure the opinion of 100 people on some issue and then go back later to the same 100
people and measure their opinion again on the same issue, and then you want to test whether the
opinion of these 100 people changed, you would conduct a Dependent (or "Paired") Samples tTest.
Examples of When to Use Independent Samples t-Tests
For example, X might be per capita income, and the first sample might be observations on X for east
coast cities, and the second sample might be observations on X for west coast cities, and you want to
know whether the mean value of X for east coast cities is different from the mean value of X for west
coast cities. As another example, X might be per capita income, and the first sample might be
observations on X for years in the 1960s, the second sample might be observations on X for years in the
1980s, and you want to know whether the mean value of X in the 1960s is different from the mean value
of X in the 1980s.
1
UNC-Wilmington
Department of Economics and Finance
ECN 377
Dr. Chris Dumas
Examples of When to Use Dependent/Paired Samples t-Tests
For example, suppose you have one group of students, and for each student you have two test grades, and
for all the students in the group together you want to test for a difference between the mean grade on test
1 and the mean grade on test 2. As another example, you have a group of firms for which you measure
cost per unit of production before an efficiency-improvement program is implemented and after the
program is implemented, and you want to test whether mean cost per unit before the program is different
from mean cost per unit after the program.
One-Sided versus Two-Sided t-Tests
The three types of t-tests described above can be conducted as either "One-Sided" tests or "Two-Sided" tests,
depending on how your hypotheses are set up . . .
A One-Sided t-Test is appropriate when the hypotheses you want to test are in either of the two forms
shown below. In a One-Sided t-test, the H1 hypothesis has either a less than "<" symbol or a greater than
">" symbol.
either this way:
H0: μ1 = μ0
H1: μ1 < μ0
or this way:
H0: μ1 = μ0
H1: μ1 > μ0
A Two-Sided t-Test is appropriate when the hypotheses that you want to test are of the form shown
below. In a Two-Sided t-test, the H1 hypothesis has a not-equal-to "≠" symbol.
this way:
H0: μ1 = μ0
H1: μ1 ≠ μ0
Three Different Ways of Conducting a t-Test
Conducting a t-Test is similar to conducting a Z-test. Any of the t-Tests (one-sample, independent samples, or
dependent samples, on either a one-sided or a two-sided basis) can be conducted in any of the three ways
described below. The three ways of conducting a t-Test described below all give the same answer for the test, so
it doesn't matter which of the three ways you use, but you will see all three methods used in the "real world," so
you need to be familiar with all three.
1. Comparing a "ttest" number against a "tcritital" number.
If the ttest number is farther from zero than tcritical, (that is if |ttest| > tcritical),
then conclude: Reject H0 and Accept H1.
2. Comparing a "p-value" against either (a) an "α-value," for a one-sided test, or
(b) an "(α/2)-value," for a two-sided test
 One-sided tests: Compare the p-value against an α-value. If the p-value is less than the α-value,
then conclude: Reject H0 and Accept H1.
 Two-sided test: Compare the p-value against an (α/2)-value. If the p-value is less than the (α/2)value, then conclude: Reject H0 and Accept H1.
3. Constructing a "Confidence Interval" and comparing it against either (a) a given null hypothesis
number, or (b) another Confidence Interval. See the next page for the methodology of how to construct
Confidence Intervals.
2
UNC-Wilmington
Department of Economics and Finance
ECN 377
Dr. Chris Dumas
Methodology for Conducting One-Sample t-Tests
The methodology used to conduct t-Tests by comparing a "ttest" number from a formula against a "tcritital"
number from a table, or by comparing a p-value against an α-value, is very similar to the methodologies
used for Z-tests. So, see the examples further below. (um, . . . that was easy)
Methodology for Constructing Confidence Intervals for One-Sample t-Tests
Confidence Intervals provide an alternative way of conducting hypothesis tests (instead of comparing ttest to
tcritical, or comparing the p-value with the α-value). The true population value will lie between the Confidence
Interval numbers a percentage of the time equal to the Confidence Level you have chosen for the test.
Step 1. Choose your Confidence Level for the test. (Typically, 95%, or 0.95)
Stept 2. Calculate the Signficance Level (α) of the test using the usual formula:
Significance Level (α) = 1 – Confidence Level
So, if the Confidence Level is the typical 95%, then Significance Level (α) = 5% (0.05)
Step 3. Using the t-table, find tα/2 for your d.f. and the Significance Level (α) you have chosen.
So, suppose you have chosen Confidence Level = 0.95, then α = 0.05, and α/2 = 0.025, and
suppose your d.f. is very large, so you can use the ∞ row of the t-table.
Using the t-table, we find that tα/2 = 1.96 for d.f. = ∞.
Step 4. Construct the Confidence Interval numbers based on tα/2 from the t-table and the Xbar and s.e. that
you calculated from your sample data:
Confidence Interval = Xbar +/- [ tα/2∙(s.e.)]
Notice that because of the “+/-“ in the formula above, the Confidence Interval is really two
numbers:
Upper Confidence Interval Number = Xbar + [ tα/2∙(s.e.)]
Lower Confidence Interval Number = Xbar - [ tα/2∙(s.e.)]
Step 5. Interpret the Confidence Interval
Suppose, for example, that you calculate the following Confidence Interval numbers:
Upper Confidence Interval Number = 63
Lower Confidence Interval Number = 57
and also suppose that your Confidence Level is 95%
We would write this as:
95% Confidence Interval = (57,63)
Interpretation: If you take many random samples, and calculate the Confidence Interval for each
sample, then 95% of the Confidence Intervals will contain the true population mean.
3
UNC-Wilmington
Department of Economics and Finance
ECN 377
Dr. Chris Dumas
Methodology for Conducting Independent Samples t-Tests
n1 = number of individuals in first sample
𝑋̅1 = sample mean of variable X for first sample
s1 = sample standard deviation of variable X for first sample
𝑠
s.e.1 = 1𝑛 = standard error of variable X for first sample
√
n2 = number of individuals in second sample
𝑋̅2 = sample mean of variable X for second sample
s2 = sample standard deviation of variable X for second sample
𝑠
s.e.2 = 2𝑛 = standard error of variable X for second sample
√
d = difference in true means = (μ2 – μ1) (we don't know what this is; we hypothesize about it)
D = difference in sample means = (𝑋̅2 - 𝑋̅1)
probability
Calculate the s.e. for the difference in means:
s.e.d = √𝑠. 𝑒.12 + 𝑠. 𝑒.22
H0: d = (μ2 – μ1) = 0
H1: d = (μ2 – μ1) > 0 ===> this is a one-sided test
p-value
0
ttest
t - value
First, find the ttest value for the difference in means:
ttest =
𝐷−𝑑
𝑠.𝑒.𝑑
=
̅2− X
̅ 1 )−(0)
(X
𝑠.𝑒.𝑑
Next, choose a level for α and find tcrit in the t-table using d.f. = n1 + n2 -2. Finally, compare ttest and tcrit. If ttest is
farther from zero than tcrit, then reject H0 and accept H1. Otherwise, accept H0 and reject H1.
Alternatively, you can find the p-value of ttest and compare the p-value with the level of α. If the p-value is less
than α, then reject H0 and accept H1. Otherwise, accept H0 and reject H1.
Note: Actually, the formula1 for degrees of freedom in this situation (testing for differences in means between two
independent samples with unequal standard deviations) is:
d.f. =
(𝑠.𝑒.21 +𝑠.𝑒.22 )2
4
𝑠.𝑒.4
1 )+( 𝑠.𝑒.2 )
𝑛1 −1
𝑛2 −1
(
but we are going to approximate it with d.f. = n1 + n2 -2 (which is the d.f. when the standard deviations are equal).
1
Satterthwaite, F.W. 1946. An Approximate Distribution of Estimates of Variance Components. Biometrics Bulletin. 2:110114.
4
UNC-Wilmington
Department of Economics and Finance
ECN 377
Dr. Chris Dumas
Methodology for Conducting Dependent Samples t-Tests
Suppose that there are two things, X1 and X2, that we could measure for each individual i in a population. That is, for each
individual i, we have X1i and X2i.
Definition: “d” is the true difference between X1 and X2 for all individuals in the population. Importantly, “d” might be zero.
H 0: d = 0
H 1: d > 0
The methodology will be demonstrated using an example with 10 individuals. (More than 10 individuals are allowed; we’re
just using 10 in this example.) Thus, n = 10.
̅ ” of these differences
First, find the difference “D” = X2 - X1 for each individual i in the sample. Second, find the mean “𝐷
2
for all individuals in the sample. Third, find the variance sD , standard deviation sD, and standard error s.e.D of the
̅ to test hypotheses about “d”, the true population mean
differences. Basic idea of the test: Use the sample mean difference 𝐷
difference.
Second, find:
̅ – d)/ s.e.D = (1.2 - 0)/0.512 = +2.34
ttest = (𝐷
Third, assuming alpha = 0.05, and using df = n – 1 = 9, use the t-table to find:
tcrit = +1.833.
Finally, if ttest is farther from zero than tcrit, then reject H0 and accept H1. Otherwise, accept H0 and reject H1.
So, in this example, Reject H0, and conclude that d > 0.
Individual
i
1
2
3
4
5
6
7
8
9
10
n = 10 =
number of
individuals
d.f. = n – 1
=9
First
observation
on X
(X1)
5
4
6
7
5
3
6
4
5
6
Second
observation
on X
(X2)
7
6
5
6
7
6
5
7
6
8
Difference
between first and
second
observations,
Di = X 2 – X1
2
2
-1
-1
2
3
-1
3
1
2
Sample mean
of differences
̅ ” = ∑ 𝐷𝑖 = +1.2
“𝐷
𝑛
Squared Deviations
of the Differences
̅ )2
(Di - 𝐷
0.64
0.64
4.84
4.84
0.64
3.24
4.84
3.24
0.04
0.64
Sample variance
of differences
̅ )2
∑(𝐷 −𝐷
𝑖
sD2 =
= 2.622
𝑛−1
Sample std.dev.
of differences
sD = √𝑠𝐷2 = 1.619
Sample s.e.
of differences
𝑠
s.e.D = 𝐷 = 0.512
√𝑛
5
UNC-Wilmington
Department of Economics and Finance
ECN 377
Dr. Chris Dumas
EXAMPLES
(next, lots of examples to illustrate the concepts and methodologies described above)
(don’t you just love examples?)
6
UNC-Wilmington
Department of Economics and Finance
ECN 377
Dr. Chris Dumas
Example: One-Sample t-Test (one-sided)
The City of Cavileer's new outpatient treatment program results in a mean annual health care cost per
capita of $525. The mean annual health care cost per capita for a random sample of 378 similarly-sized
U.S. cities is $586, with a standard deviation of $116. Is Cavileer's mean significantly lower than the
mean from the sample of U.S. cities?
μ0 = Cavileer's mean = 525
X = average per capita health care cost of a similarly-sized U.S. city
n = 378 cities, so d.f. = n-1 = 377
Xbar = sample mean for sample cities = 586
s = standard deviation of X = 116
𝑠
116
s.e. = standard error of Xbar = 𝑛 =
= 5.97
√
√378
H0: (μ1 for other cities) = (Caviller's value of 525 = μ0)
H1: (μ1 for other cities ) > (Caviller's value of 525 = μ0) ===> this is a ONE-SIDED test
Select a Confidence Level of 0.95
Find Significance Level α = 1 - 0.95 = 0.05
Find tcrit (α = 0.05, d.f.=377) = ±1.645 using the t-table.
𝑋𝑏𝑎𝑟−𝜇
Find the ttest-value for Xbar:
𝑡𝑡𝑒𝑠𝑡 = 𝑠.𝑒. 0 = (586 - 525) / 5.97 = 10.22
probability
0 tcrit = 1.645
ttest = 10.22
t - value
Because the ttest value is farther from zero than tcrit, we conclude: Reject H0, Accept H1.
Or, we could test the hypothesis by finding the p-value of ttest in the t-table:
for t=10.22 with df=377, the p-value is less than 0.0005.
and comparing the p-value with α = 0.05.
Because the p-value is less than α, we conclude: Reject H0, Accept H1.
Thus, we conclude that μ1 > μ0 , that is, that Cavileer's mean annual per capita health care cost is
significantly lower than the mean from the sample of U.S. cities.
7
UNC-Wilmington
Department of Economics and Finance
ECN 377
Dr. Chris Dumas
Example: One-Sample t-Test (one-sided)
(shows what to do when the t-value is negative)
The Bureau of Administration is concerned with high levels of employee absenteeism. Last year, employees
missed an average of 12.8 workdays per year. This year, there is an experimental program in which the agency
pays employees for each sick day or personal day that they do not use. A preliminary survey of 20 employees at
the end of this year reveals a mean of 8.7 days missed and a standard deviation of 4.6. Does the experimental
program make a statistically significant difference?
μ0 = mean days missed last year = 12.8
X = average workdays missed per employee this year
n = 20 employees, so d.f. = n-1 = 19
Xbar = sample mean days missed this year = 8.7
s = sample standard deviation of days missed this year = 4.6
𝑠
4.6
s.e. = standard error of Xbar = 𝑛 = 20 = 1.029
√
√
H0: (μ1 days missed this year) = (μ0 days missed last year = 12.8)
H1: (μ1 days missed this year) < (μ0 days missed last year = 12.8) ===> ONE-SIDED test
Select a Confidence Level of 0.95
Find Significance Level α = 1 - 0.95 = 0.05
Find tcrit (α = 0.05, d.f.=19) = ±1.729 using the t-table.
𝑋𝑏𝑎𝑟−𝜇0
Find the ttest-value for Xbar: 𝑡𝑡𝑒𝑠𝑡 =
= (8.7 - 12.8) / 1.029 = -3.98
𝑠.𝑒.
probability
0
ttest = -3.98
tcrit = -1.729
t - value
Because the ttest value is farther from zero than tcrit, we conclude: Reject H0, Accept H1.
Or, we could test the hypothesis by finding the p-value of ttest in the t-table:
for ttest = -3.98 with df=19, the p-value is less than 0.0005.
Because the p-value is less than α=0.05, we conclude: Reject H0, Accept H1.
Thus, we conclude that μ1 < μ0 , that is, mean days missed this year appears to be significantly less than
mean days missed last year--the experimental program appears to be working.
8
UNC-Wilmington
Department of Economics and Finance
ECN 377
Dr. Chris Dumas
Example: One-Sample t-Test (TWO-SIDED)
The police chief of Kramer, TX, reads a report that says the police solve 46.2% of all burglaries in Kramer. The
chief would like to know how good this figure is. She randomly selects 10 other Texas cities and asks them what
percentage they clear. The sample has a mean of 40.3% with a standard deviation of 7.68%. Is Kramer's
clearance rate significantly different from those of other Texas cities?
X = percent burglaries cleared
n = 10 ==> d.f = n - 1 = 9
μ0 = Kramer's mean = 0.462
μ1 = true mean of other cities = unknown
Xbar = sample mean for other cities = 0.403
s = sample standard deviation = 0.0768
𝑠
0.0768
s.e. = standard error of sample mean =
=
= 0.0243
√𝑛
√10
H0: μ0 = μ1
H1: μ0 ≠ μ1 ===> this is a TWO-SIDED test
Select a Confidence Level of 0.95
Significance Level α = 1 - 0.95 = 0.05
TWO-SIDED test, so we need to use α/2 = 0.025
Find tcrit (α/2 = 0.025, d.f.=9) = ± 2.27 using the t-table.
𝑋𝑏𝑎𝑟−𝜇
Find the ttest-value for Xbar:
𝑡𝑡𝑒𝑠𝑡 = 𝑠.𝑒. 0 = (0.403 - 0.462) / 0.0243 = -2.43
probability
tcrit = -2.27 0
ttest = -2.43
tcrit = 2.27
t - value
Because the negative ttest value is less than the negative tcrit, we conclude: Reject H0, Accept H1.
Or, we could test the hypothesis by finding the p-value of ttest in the t-table:
for t=-2.43 with df=9, the p-value is between 0.025 and 0.01.
and comparing the p-value with α/2 = 0.025.
Because the p-value is less than α/2, we conclude: Reject H0, Accept H1.
Thus, we conclude that the percent of burglaries cleared by other towns is significantly different from (in this
case, lower than) the percent cleared in the town of Kramer.
9
UNC-Wilmington
Department of Economics and Finance
ECN 377
Dr. Chris Dumas
Example: Constructing a Confidence Interval
Suppose the manager of the Bureau of Obfuscation's United Way drive wants to know the average United Way
pledge among Obfuscation Bureau employees. Under the reasonable assumption that pledge amounts are
normally-distributed, the manager takes a sample of 10 pledges and gets a sample mean pledge amount of $30 and
a sample standard deviation of $31.09. Between what two values does the Bureau's mean pledge lie with 95%
confidence?
X = pledge amount
sample size n = 10, so d.f. = n-1 = 9
Xbar = 30
s = 31.09
𝑠
31.09
s.e. = 𝑛 = 10 = 9.83
√
√
The two-sided 95% Confidence Interval gives the two values between which the manager is 95% sure that the
true mean will lie:
95% Confidence Interval: Xbar +/- [ tα/2∙(s.e.)]
To construct the Confidence Interval, we need: Xbar, s.e., and the t-value. To find the t-value:
Confidence Level = 0.95
Significance Level = α = 1 - 0.95 = 0.05
Confidence Intervals are TWO-SIDED, so we need to work with α/2 = 0.025.
From the t-table, the t-value for probability 0.025 and d.f. = 9 is ± 2.27.
So, tα/2 = ± 2.27.
Hence, the 95% Confidence Interval
= Xbar +/- [ tα/2∙(s.e.)]
= 30 +/- [ 2.27∙(9.83)]
= (7.79, 52.31)
Therefore, our best estimate of the true mean is Xbar, or $30, but, in addition, we can say that the true mean lies
between $7.79 and $52.31 with 95% confidence. The confidence interval gives us a measure of the possible error
in the Xbar estimate of $30.
Using the Confidence Interval to conduct a hypothesis test
In the example above, the mean value in the sample, Xbar, was $30. However, suppose someone hypothesized
that the true mean value in the population was $40. Could we test the null hypothesis H0: μ = $40 using the
Confidence Interval that we constructed from our sample data? Yes. This would be a two-sided test . . .
H0: μ = $40
H1: μ ≠ $40
We compare the hypothesized value of $40 with the Confidence Interval. If the hypothesized value given in H0 is
inside the Confidence Interval, then we cannot reject H0 (with 95% confidence). So, we cannot reject (with 95%
confidence) the possibility that the true mean value in the population is $40. On the other hand, if someone
hypothesized that the true mean value in the population was $60, we could reject (with 95% confidence) that
possibility, because $60 is outside the Confidence Interval.
10
UNC-Wilmington
Department of Economics and Finance
ECN 377
Dr. Chris Dumas
Example: Independent Samples t-Test (one-sided)
Suppose the William G. Harding School of Public Affairs wants to determine whether affirmative action students score
significantly lower on the school entrance exam compared to "Regular" students. A random sample of 44 "Regular" students
had a mean score of 86.4 on the exam, with a standard deviation of 17.3. A random sample of 19 affirmative action students
had a mean score of 84.1 with a standard deviation of 28.2.
nrs = number of "Regular Students" sampled = 44
𝑋̅rs = sample mean = 86.4
srs = sample standard deviation = 17.3
𝑠
17.3
s.e.rs =
=
= 2.61
√𝑛
√44
naa = number of "Affirmative Action" Students sampled = 19
𝑋̅aa = sample mean = 84.1
saa = sample standard deviation = 28.2
𝑠
28.2
s.e.aa =
=
= 6.47
√𝑛
√19
d = difference in true means = (μrs - μaa) (We don't know the value of "d". In H0 we hypothesize that d is zero.)
D = difference in sample means = (𝑋̅rs - 𝑋̅aa ) = 86.4 - 84.1 = 2.3 ("D" is our estimate, based on sample data, of "d.")
Calculate the s.e. for the difference in means:
s.e.d = √𝑠. 𝑒.2𝑟𝑠 + 𝑠. 𝑒.2𝑎𝑎 = √2.612 + 6.472 = 6.98
H0: (d = μrs - μaa) = 0
H1: (d = μrs - μaa) > 0 ===> this is a one-sided test
Select a Confidence Level of 0.95
Find Significance Level α = 1 - 0.95 = 0.05
Find the tcritical value from the t table for α = 0.05 and d.f. = nrs + naa - 2 = 61: tcrit = ±1.645.
probability
0 t = 0.330
t = 1.645
Find the ttest-value for a difference in means:
𝑡𝑡𝑒𝑠𝑡 =
𝐷−𝑑
𝑠.𝑒.𝑑
=
(𝑋̅ rs − 𝑋̅aa )−(0)
𝑠.𝑒.𝑑
t - value
= (86.4 - 84.1) / 6.98 = 0.330
To do the hypothesis test, simply compare ttest against tcritical. Because ttest is NOT farther from zero than tcritical, we conclude:
CANNOT Reject H0, so Accept H0 and Reject H1. Thus, we conclude that there is no statistically significant difference in
the means of the two groups of students.
11
UNC-Wilmington
Department of Economics and Finance
ECN 377
Dr. Chris Dumas
Example: Independent Samples t-Test (one-sided)
(shows what to do when the t-value is negative)
Suppose City Manager Tightwad wants to reduce maintenance costs associated with the city's automobile fleet. Currently,
the 300 cars undergo periodic preventive maintenance. Mr. Tightwad randomly selects 75 of the 300 cars and performs no
maintenance on these cars unless they break down. After one year, the cars undergoing periodic maintenance had a mean
cost of $625 per car with a standard deviation of $150. The no periodic maintenance cars had a mean cost of $575 with a
standard deviation of $200. Is the difference in mean cost statistically significant?
nnm = number of No Maintenance cars sampled = 75
𝑋̅nm = sample mean = $575
snm = sample standard deviation = 200
𝑠
200
s.e.nm =
=
= 23.09
√𝑛
√75
npm = number of Periodic Maintenance cars sampled = 225
𝑋̅pm = sample mean = $625
spm = sample standard deviation = 150
𝑠
150
s.e.pm =
=
= 10
√𝑛
√225
d = difference in true means = (μnm - μpm) (We don't know the value of "d". In H0 we hypothesize that d is zero.)
D = difference in sample means = (𝑋̅nm - 𝑋̅pm ) = $575 - $625 = -$50 ("D" is our estimate, based on sample data, of "d.")
Degrees of freedom for a difference in means: d.f. = nnm + npm - 2 . So, in this example: d.f. = 75 + 225 - 2 = 298.
Calculate the s.e. for the difference in means:
s.e.d = √𝑠. 𝑒.2𝑛𝑚 + 𝑠. 𝑒.2𝑝𝑚 = √23.092 + 102 = 25.16
H0: (d = μnm - μpm) = 0
H1: (d = μnm - μpm) < 0 ===> this is a one-sided test
Select a Confidence Level of 0.95. Find Significance Level α = 1 - 0.95 = 0.05
Find the tcritical value from the t table for α = 0.05 and d.f. = 298: t crit = ±1.645.
probability
t = -1.99
t = -1.645 0
t - value
First, find the ttest-value for a difference in means:
𝑡𝑡𝑒𝑠𝑡 =
𝐷−𝑑
𝑠.𝑒.𝑑
=
(𝑋̅ nm − 𝑋̅ pm )−(0)
𝑠.𝑒.𝑑
= ($575 - $625) / 25.16 = -1.99
To do the hypothesis test, simply compare ttest against tcritical. Because ttest is farther from zero than tcritical, we conclude:
Reject H0 and Accept H1. Thus, we conclude that the difference in mean cost between "No Maintenance" cars and "Periodic
Maintenance" cars is statistically significant, and our best estimate of the difference is D = -$50, meaning that the mean cost
per "No Maintenance" car is $50 less than the mean cost per "Periodic Maintenance" car.
12
UNC-Wilmington
Department of Economics and Finance
ECN 377
Dr. Chris Dumas
Example: Dependent (Paired) Samples t-Test (one-sided example)
Sharon Pebble, city manager, wants to determine whether her new personnel procedures are decreasing the time it takes to
hire an employee. She takes a sample of 10 city bureaus and calculates the average time to hire an employee in days, both
before and after the new procedures are implemented. She gets the following results:
City
Bureau
“i”
Ave. Time
Before
(X1)
Difference
between first and
second
observations,
Di = X2 – X1
Ave. Time
After
(X2)
Squared Deviations
of the Differences
̅ )2
(Di - 𝐷
1
36.4
32.2
-4.2
0.0169
2
49.2
45.2
-4
0.0049
3
26.8
31.3
4.5
73.4449
4
32.2
27.1
-5.1
1.0609
5
41.9
33.4
-8.5
19.6249
6
29.8
29
-0.8
10.6929
7
36.7
24.1
-12.6
72.7609
8
39.2
38.2
-1
9.4249
9
42.3
38
-4.3
0.0529
10
41.9
37.2
-4.7
0.3969
Sample mean
of differences
̅ ” = ∑ 𝐷𝑖 = -4.07
“𝐷
n = 10 =
number of
individuals
𝑛
Sample variance
of differences
sD2 =
̅ )2
∑(𝐷𝑖 −𝐷
𝑛−1
= 20.83
Sample std.dev.
of differences
sD = √𝑠𝐷2 = 4.564
Sample s.e.
of differences
𝑠
s.e.D = 𝐷 = 1.443
d.f. = n – 1
=9
√𝑛
̅ to test hypotheses about “d”, the true population mean difference
Basic idea of the test: Use the sample mean difference 𝐷
between X1 and X2.
H0: population mean difference d = 0
H1: population mean difference d < 0
Next, find:
̅ – d)/ s.e.D = (-4.07 - 0)/1.44 = -2.83
ttest = (𝐷
For alpha = 0.05 and df = 9, one-sided test, use the t-table to find:
tcrit = -1.833.
If ttest is farther from zero than tcrit, then reject H0 and accept H1. Otherwise, accept H0 and reject H1.
So, in this example, Reject H0, and conclude d < 0; that is, conclude that the new personnel procedures are decreasing the
time it takes to hire an employee.
13
UNC-Wilmington
Department of Economics and Finance
ECN 377
Dr. Chris Dumas
Appendix on Confidence Intervals
(Note: You won’t be held responsible for the material in this Appendix in ECN377, but I’m
putting it here for those who just can’t get enough . . . you know who you are)
In the Methodology for Constructing Confidence Intervals section earlier in this handout, we show how to use
a Confidence Interval to test a hypothesis about the value of a mean from a single sample. This was using a
Confidence Interval to conduct a One-Sample test. But, actually, you can use Confidence Intervals to conduct
Independent-Samples and Dependent-Samples tests. Here’s the scoop on how to use Confidence Intervals to
conduct all three types of tests:
One-sample tests: Compare the Confidence Interval from the sample with the given null
hypothesis value (μ0). (This is what we did in the example earlier in the handout.) If the
Confidence Interval contains the given number, then the mean of the sample is not significantly
different from the given number. If the Confidence Interval does not contain the given number,
then the mean of the sample is significantly different from the given number.
Independent-samples tests: Construct two Confidence Intervals, one for each sample, and check
whether the two Confidence Intervals overlap. If the Confidence Intervals overlap, then the
means of the two samples are not significantly different. If the intervals do not overlap, then the
means of the two samples are significantly different.
Dependent-samples tests: Compare the Confidence Interval for the mean difference with the
given null hypothesis value (μ0). If the Confidence Interval contains the given number, then the
mean difference is not significantly different from the given number. If the Confidence Interval
does not contain the given number, then the mean difference is significantly different from the
given number.
14
Download