clear
use "C:\Econ 107\LAB0\Stata dataset\cps92_08.dta"
ttest ahe, by(year)
Results:
. ttest ahe, by(year)
Two-sample t test with equal variances
------------------------------------------------------------------------------
Group | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval]
---------+--------------------------------------------------------------------
1992 | 7,605 11.62637 .0643675 5.613272 11.50019 11.75254
2008 | 7,711 18.97609 .1154672 10.13944 18.74975 19.20244
---------+--------------------------------------------------------------------
combined | 15,316 15.32666 .0726803 8.994762 15.1842 15.46912
---------+--------------------------------------------------------------------
diff | -7.349727 .1326828 -7.609801 -7.089653
------------------------------------------------------------------------------
diff = mean(1992) - mean(2008) t = -55.3932
Ho: diff = 0 degrees of freedom = 15314
Ha: diff < 0 Ha: diff != 0 Ha: diff > 0
Pr(T < t) = 0.0000 Pr(|T| > |t|) = 0.0000 Pr(T > t) = 1.0000
gen ahe92_08=ahe
replace ahe92_08=ahe92_08*215.2/140.3 if year==1992
ttest ahe92_08, by(year)
Results:
. gen ahe92_08=ahe
.
. replace ahe92_08=ahe92_08*215.2/140.3 if year==1992
(7,605 real changes made)
.
.
.
. ttest ahe92_08, by(year)
Two-sample t test with equal variances
------------------------------------------------------------------------------
Group | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval]
---------+--------------------------------------------------------------------
1992 | 7,605 17.83317 .0987304 8.609951 17.63963 18.02671
2008 | 7,711 18.97609 .1154672 10.13944 18.74975 19.20244
---------+--------------------------------------------------------------------
combined | 15,316 18.40859 .0761822 9.428138 18.25926 18.55791
---------+--------------------------------------------------------------------
diff | -1.142922 .1520928 -1.441042 -.8448022
------------------------------------------------------------------------------
diff = mean(1992) - mean(2008) t = -7.5146
Ho: diff = 0 degrees of freedom = 15314
Ha: diff < 0 Ha: diff != 0 Ha: diff > 0
Pr(T < t) = 0.0000 Pr(|T| > |t|) = 0.0000 Pr(T > t) = 1.0000
We should use result in (b) since it is reasonable that we compare two wages in same price level.
ttest ahe if year == 2008, by(bachelor)
Results:
. ttest ahe if year == 2008, by(bachelor)
Two-sample t test with equal variances
------------------------------------------------------------------------------
Group | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval]
---------+--------------------------------------------------------------------
0 | 4,002 15.33174 .121733 7.700994 15.09308 15.57041
1 | 3,709 22.90834 .179853 10.95333 22.55572 23.26096
---------+--------------------------------------------------------------------
combined | 7,711 18.97609 .1154672 10.13944 18.74975 19.20244
---------+--------------------------------------------------------------------
diff | -7.576594 .2144021 -7.996881 -7.156308
------------------------------------------------------------------------------
diff = mean(0) - mean(1) t = -35.3382
Ho: diff = 0 degrees of freedom = 7709
Ha: diff < 0 Ha: diff != 0 Ha: diff > 0
Pr(T < t) = 0.0000 Pr(|T| > |t|) = 0.0000 Pr(T > t) = 1.0000
ttest ahe92_08 if year == 1992, by(bachelor)
Results:
. ttest ahe92_08 if year == 1992, by(bachelor)
Two-sample t test with equal variances
------------------------------------------------------------------------------
Group | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval]
---------+--------------------------------------------------------------------
0 | 4,643 15.31326 .1034966 7.052216 15.11036 15.51616
1 | 2,962 21.78319 .1712247 9.31878 21.44745 22.11892
---------+--------------------------------------------------------------------
combined | 7,605 17.83317 .0987304 8.609951 17.63963 18.02671
---------+--------------------------------------------------------------------
diff | -6.469927 .1883968 -6.839237 -6.100617
------------------------------------------------------------------------------
diff = mean(0) - mean(1) t = -34.3420
Ho: diff = 0 degrees of freedom = 7603
Ha: diff < 0 Ha: diff != 0 Ha: diff > 0
Pr(T < t) = 0.0000 Pr(|T| > |t|) = 0.0000 Pr(T > t) = 1.0000
High school: 15.33174 -> 15.31326 decrease
College: 22.90834 -> 21.78319 decrease
Difference (absolute value): 6.469927 -> 7.576594 incease