Homework: Stata Analysis of Earnings Data and Gender Effects

Verified

Added on  2022/12/29

|4
|944
|66
Homework Assignment
AI Summary
This Stata assignment analyzes earnings data, likely focusing on the impact of gender on earnings. The analysis begins with data cleaning, including dropping missing values and filtering the dataset based on certain criteria (e.g., treatment status). A new variable, 'earncen,' is created and capped at 300. Descriptive statistics, including percentiles, are then computed for 'earncen' overall, and separately for males and females. Finally, a two-sample t-test is performed to compare the mean earnings between the two gender groups. The output includes detailed summary statistics and the results of the t-test, providing insights into the statistical significance of any observed earnings differences. The analysis is performed using Stata commands, demonstrating the application of statistical methods to real-world data.
Document Page
name: <unnamed>
log: D:\1063818.smcl
log type: smcl
opened on: 30 Aug 2019, 02:53:22
. do "C:\Users\LAPTOP~1\AppData\Local\Temp\STD02000000.tmp"
. use "D:\1063818.dta"
. drop if missing( everjch)
(79 observations deleted)
. drop if missing(earny4)
(381 observations deleted)
. drop if (earny4==0)
(1982 observations deleted)
. drop if missing( evarr)
(13 observations deleted)
. drop if missing( serious)
(42 observations deleted)
. drop if missing( kidsr)
(36 observations deleted)
. keep if ( treatmnt==0)
(5207 observations deleted)
.
. gen earncen=earny4 if earny4<300
(1021 missing values generated)
. replace earncen=300 if earncen==.
(1021 real changes made)
.
. summarize earncen, detail
earncen
Percentiles Smallest
1% 6.290748 .5187755
5% 24.90593 .6495972
10% 46.61235 1.876614 Obs 3354
25% 122.6181 1.884526 Sum of Wgt. 3354
50% 220.5069 Mean 200.5662
Largest Std. Dev. 96.66366
75% 300 300
90% 300 300 Variance 9343.862
95% 300 300 Skewness -.5208533
99% 300 300 Kurtosis 1.916291
. summarize earncen if female==0, detail
earncen
Percentiles Smallest
1% 7.578634 .6495972
5% 34.28429 1.884526
10% 60.62907 2.341935 Obs 2115
25% 150.1291 2.526211 Sum of Wgt. 2115
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
50% 242.3433 Mean 214.4078
Largest Std. Dev. 92.94116
75% 300 300
90% 300 300 Variance 8638.06
95% 300 300 Skewness -.7411724
99% 300 300 Kurtosis 2.224301
. summarize earncen if female==1, detail
earncen
Percentiles Smallest
1% 5.635281 .5187755
5% 18.04437 1.876614
10% 32.01864 2.29656 Obs 1239
25% 89.89414 2.368323 Sum of Wgt. 1239
50% 180.3761 Mean 176.9384
Largest Std. Dev. 98.3392
75% 283.0797 300
90% 300 300 Variance 9670.598
95% 300 300 Skewness -.1856239
99% 300 300 Kurtosis 1.707626
. ttest earncen, by (female)
Two-sample t test with equal variances
Group Obs Mean Std. Err. Std. Dev. [95% Conf. Interval]
0 2115 214.4078 2.020938 92.94116 210.4445 218.371
1 1239 176.9384 2.793772 98.3392 171.4573 182.4194
combined 3354 200.5662 1.669097 96.66366 197.2937 203.8388
diff 37.46937 3.397659 30.80767 44.13106
diff = mean( 0) - mean( 1) t = 11.0280
Ho: diff = 0 degrees of freedom = 3352
Ha: diff < 0 Ha: diff != 0 Ha: diff > 0
Pr(T < t) = 1.0000 Pr(|T| > |t|) = 0.0000 Pr(T > t) = 0.0000
.
. clear
.
.
end of do-file
. do "C:\Users\LAPTOP~1\AppData\Local\Temp\STD02000000.tmp"
. use "D:\1063818.dta"
. drop if missing( everjch)
(79 observations deleted)
. drop if missing(earny4)
(381 observations deleted)
Document Page
. drop if (earny4==0)
(1982 observations deleted)
. drop if missing( evarr)
(13 observations deleted)
. drop if missing( serious)
(42 observations deleted)
. drop if missing( kidsr)
(36 observations deleted)
. keep if ( treatmnt==0)
(5207 observations deleted)
.
. gen earncen=earny4 if earny4<300
(1021 missing values generated)
. replace earncen=300 if earncen==.
(1021 real changes made)
.
. summarize earncen, detail
earncen
Percentiles Smallest
1% 6.290748 .5187755
5% 24.90593 .6495972
10% 46.61235 1.876614 Obs 3354
25% 122.6181 1.884526 Sum of Wgt. 3354
50% 220.5069 Mean 200.5662
Largest Std. Dev. 96.66366
75% 300 300
90% 300 300 Variance 9343.862
95% 300 300 Skewness -.5208533
99% 300 300 Kurtosis 1.916291
. summarize earncen if female==0, detail
earncen
Percentiles Smallest
1% 7.578634 .6495972
5% 34.28429 1.884526
10% 60.62907 2.341935 Obs 2115
25% 150.1291 2.526211 Sum of Wgt. 2115
50% 242.3433 Mean 214.4078
Largest Std. Dev. 92.94116
75% 300 300
90% 300 300 Variance 8638.06
95% 300 300 Skewness -.7411724
99% 300 300 Kurtosis 2.224301
. summarize earncen if female==1, detail
earncen
Percentiles Smallest
1% 5.635281 .5187755
5% 18.04437 1.876614
10% 32.01864 2.29656 Obs 1239
25% 89.89414 2.368323 Sum of Wgt. 1239
Document Page
50% 180.3761 Mean 176.9384
Largest Std. Dev. 98.3392
75% 283.0797 300
90% 300 300 Variance 9670.598
95% 300 300 Skewness -.1856239
99% 300 300 Kurtosis 1.707626
. ttest earncen, by (female)
Two-sample t test with equal variances
Group Obs Mean Std. Err. Std. Dev. [95% Conf. Interval]
0 2115 214.4078 2.020938 92.94116 210.4445 218.371
1 1239 176.9384 2.793772 98.3392 171.4573 182.4194
combined 3354 200.5662 1.669097 96.66366 197.2937 203.8388
diff 37.46937 3.397659 30.80767 44.13106
diff = mean( 0) - mean( 1) t = 11.0280
Ho: diff = 0 degrees of freedom = 3352
Ha: diff < 0 Ha: diff != 0 Ha: diff > 0
Pr(T < t) = 1.0000 Pr(|T| > |t|) = 0.0000 Pr(T > t) = 0.0000
.
. clear
.
end of do-file
. log close
name: <unnamed>
log: D:\1063818.smcl
log type: smcl
closed on: 30 Aug 2019, 02:53:42
chevron_up_icon
1 out of 4
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]