------------------------------------------------------------------------------------------------------ log: /Users/rossman/Documents/f08_210A/homework7.log log type: text opened on: 12 Nov 2008, 09:31:28 . sysuse nlsw88.dta (NLSW, 1988 extract) . browse . ttest age , by ( married) Two-sample t test with equal variances ------------------------------------------------------------------------------ Group | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] ---------+-------------------------------------------------------------------- single | 804 39.21891 .1075621 3.049911 39.00777 39.43004 married | 1442 39.1165 .0807417 3.066058 38.95812 39.27489 ---------+-------------------------------------------------------------------- combined | 2246 39.15316 .0645679 3.060002 39.02654 39.27978 ---------+-------------------------------------------------------------------- diff | .1024006 .1346966 -.1617424 .3665437 ------------------------------------------------------------------------------ diff = mean(single) - mean(married) t = 0.7602 Ho: diff = 0 degrees of freedom = 2244 Ha: diff < 0 Ha: diff != 0 Ha: diff > 0 Pr(T < t) = 0.7764 Pr(|T| > |t|) = 0.4472 Pr(T > t) = 0.2236 . ttest wage, by ( collgrad) Two-sample t test with equal variances ------------------------------------------------------------------------------ Group | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] ---------+-------------------------------------------------------------------- not coll | 1714 6.910561 .1276104 5.283132 6.660273 7.16085 college | 532 10.52606 .2742596 6.325833 9.987296 11.06483 ---------+-------------------------------------------------------------------- combined | 2246 7.766949 .1214451 5.755523 7.528793 8.005105 ---------+-------------------------------------------------------------------- diff | -3.615502 .2753268 -4.155424 -3.07558 ------------------------------------------------------------------------------ diff = mean(not coll) - mean(college) t = -13.1317 Ho: diff = 0 degrees of freedom = 2244 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 wage, by (south) Two-sample t test with equal variances ------------------------------------------------------------------------------ Group | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] ---------+-------------------------------------------------------------------- 0 | 1304 8.402271 .1660493 5.996195 8.076518 8.728024 1 | 942 6.88748 .1721331 5.283112 6.549671 7.225289 ---------+-------------------------------------------------------------------- combined | 2246 7.766949 .1214451 5.755523 7.528793 8.005105 ---------+-------------------------------------------------------------------- diff | 1.514791 .2440768 1.036151 1.993431 ------------------------------------------------------------------------------ diff = mean(0) - mean(1) t = 6.2062 Ho: diff = 0 degrees of freedom = 2244 Ha: diff < 0 Ha: diff != 0 Ha: diff > 0 Pr(T < t) = 1.0000 Pr(|T| > |t|) = 0.0000 Pr(T > t) = 0.0000 . preserve . xi i.south*collgrad i.south _Isouth_0-1 (naturally coded; _Isouth_0 omitted) i.south*collg~d _IsouXcollg_# (coded as above) . codebook _IsouXcollg_1 ------------------------------------------------------------------------------------------------------ _IsouXcollg_1 (south==1)*collgrad ------------------------------------------------------------------------------------------------------ type: numeric (byte) range: [0,1] units: 1 unique values: 2 missing .: 0/2246 tabulation: Freq. Value 2028 0 218 1 . ttest wage, by( _IsouXcollg_1) Two-sample t test with equal variances ------------------------------------------------------------------------------ Group | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] ---------+-------------------------------------------------------------------- 0 | 2028 7.531432 .1259655 5.672644 7.284396 7.778467 1 | 218 9.957909 .4107796 6.065088 9.148281 10.76754 ---------+-------------------------------------------------------------------- combined | 2246 7.766949 .1214451 5.755523 7.528793 8.005105 ---------+-------------------------------------------------------------------- diff | -2.426478 .4071116 -3.224833 -1.628123 ------------------------------------------------------------------------------ diff = mean(0) - mean(1) t = -5.9602 Ho: diff = 0 degrees of freedom = 2244 Ha: diff < 0 Ha: diff != 0 Ha: diff > 0 Pr(T < t) = 0.0000 Pr(|T| > |t|) = 0.0000 Pr(T > t) = 1.0000 . keep if south==1 (1304 observations deleted) . ttest wage, by(collgrad) Two-sample t test with equal variances ------------------------------------------------------------------------------ Group | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] ---------+-------------------------------------------------------------------- not coll | 724 5.962959 .1726776 4.646279 5.623949 6.301968 college | 218 9.957909 .4107796 6.065088 9.148281 10.76754 ---------+-------------------------------------------------------------------- combined | 942 6.88748 .1721331 5.283112 6.549671 7.225289 ---------+-------------------------------------------------------------------- diff | -3.994951 .387019 -4.754472 -3.23543 ------------------------------------------------------------------------------ diff = mean(not coll) - mean(college) t = -10.3224 Ho: diff = 0 degrees of freedom = 940 Ha: diff < 0 Ha: diff != 0 Ha: diff > 0 Pr(T < t) = 0.0000 Pr(|T| > |t|) = 0.0000 Pr(T > t) = 1.0000 . restore . exit, clear