econ sse 2

profiletenuised
assignment111.log

------------------------------------------------------------------------------------------------------------------------------------------- name: <unnamed> log: C:\Users\Xutong Huang\Desktop\Stata Data Sets (2)\Data Sets- STATA\assignment1.log log type: text opened on: 4 Aug 2020, 09:37:43 . . . *Question 1 . use WAGE1.dta, clear . . *a. . sum educ Variable | Obs Mean Std. Dev. Min Max -------------+--------------------------------------------------------- educ | 526 12.56274 2.769022 0 18 . *The average education level in the sample is 12.563. . *The highest year of education is 18.000 and the lowest year of education is 0.000. . . *b. . sum wage Variable | Obs Mean Std. Dev. Min Max -------------+--------------------------------------------------------- wage | 526 5.896103 3.693086 .53 24.98 . *The average hourly wage in the sample is $5.896. . *The highest hourly wage is $24.980 and the lowest hourly wage is $0.530. . *Thus the average hourly wage seems low by comparing the highest hourly wage. . . *c. . *From the internet, we find that the CPI for the year of 1976 is 56.900 and the CPI for the year of 2013 is 232.957. . . *d. . di "The average hourly wage in 2013 dollars is $" 5.896*232.957/56.9 The average hourly wage in 2013 dollars is $24.139094 . . *e. . tab female =1 if | female | Freq. Percent Cum. ------------+----------------------------------- 0 | 274 52.09 52.09 1 | 252 47.91 100.00 ------------+----------------------------------- Total | 526 100.00 . *The number of women is 252 and the number of men is 536-252=274. . . *Question 2 . use BWGHT.dta, clear . . *a. . tab male =1 if male | child | Freq. Percent Cum. ------------+----------------------------------- 0 | 665 47.91 47.91 1 | 723 52.09 100.00 ------------+----------------------------------- Total | 1,388 100.00 . *The number of women is 723. . . gen smoke=1 if cigs>0 (1,176 missing values generated) . replace smoke=0 if cigs==0 (1,176 real changes made) . . gen fsmoke=0 . replace fsmoke=1 if cigs>0 & male==0 (112 real changes made) . tab fsmoke fsmoke | Freq. Percent Cum. ------------+----------------------------------- 0 | 1,276 91.93 91.93 1 | 112 8.07 100.00 ------------+----------------------------------- Total | 1,388 100.00 . *The number of women smoked during pregnancy is 112. . . *b. . sum cigs Variable | Obs Mean Std. Dev. Min Max -------------+--------------------------------------------------------- cigs | 1,388 2.087176 5.972688 0 50 . *The average number of cigarettes smoked per day is 2.087. . *No, it is not a good measure of the "typical“ women in this case because it includes the information for all males and females. . . *c. . sum cigs if cigs>0 & male==0 Variable | Obs Mean Std. Dev. Min Max -------------+--------------------------------------------------------- cigs | 112 12.41071 7.897489 1 40 . *The average number of cigarettes smoked per day is 12.411. . *The number is larger than that in part b) because the number in part b) includes the information for males and also for females who do n > ot smoke. . . *d. . sum fatheduc Variable | Obs Mean Std. Dev. Min Max -------------+--------------------------------------------------------- fatheduc | 1,192 13.18624 2.745985 1 18 . *The average number of fatheduc is 13.186. . *Only 1192 observations used to compute this average because there are 196 missing values. . . *e. . sum faminc Variable | Obs Mean Std. Dev. Min Max -------------+--------------------------------------------------------- faminc | 1,388 29.02666 18.73928 .5 65 . *The average family income is $29026.66. . *The standard deviation is 18.739. . . *Question 3 . use COUNTYMURDERS.dta, clear . . *a. . tostring countyid, replace countyid was long now str5 . encode countyid, gen(county) . sum county Variable | Obs Mean Std. Dev. Min Max -------------+--------------------------------------------------------- county | 37,349 1099 634.2277 1 2197 . *There are 2197 counties in the data set. . . sort county year . gen zmurders=1 if murders==0 (21,698 missing values generated) . replace zmurders=0 if murders!=0 (21,698 real changes made) . by county : egen Nzmurders=sum(zmurders) . count if Nzmurders!=0 29,818 . di "Of all the counties, there are " 29818/17 " counties have zero murders." Of all the counties, there are 1754 counties have zero murders. . . gen zexecs=1 if execs==0 (205 missing values generated) . replace zexecs=0 if execs!=0 (205 real changes made) . by county : egen Nzexecs=sum(zexecs) . count if Nzexecs!=0 37,349 . di "Of all the counties, there are " 37349/17 " counties have zero executions." Of all the counties, there are 2197 counties have zero executions. . di "The percentage of counties have zero executions is " 37349/17/2197*100 "%." The percentage of counties have zero executions is 100%. . . *b. . sum murders Variable | Obs Mean Std. Dev. Min Max -------------+--------------------------------------------------------- murders | 37,349 7.286915 47.21759 0 1944 . *The largest number of murders is 1944. . sum execs Variable | Obs Mean Std. Dev. Min Max -------------+--------------------------------------------------------- execs | 37,349 .0068543 .1124476 0 7 . *The largest number of executions is 7. . *The average number of executions is 0.007, the value is so small because there are many zeros in the executions. . . *c. . cor murders execs (obs=37,349) | murders execs -------------+------------------ murders | 1.0000 execs | 0.1559 1.0000 . *The correlation coefficient between murders and execs is 0.156. Thus murders and execs are positively correlated. . . *d. . *No, we cannot draw the conclusion that more executions cause more murders to occur. . *The positive correlation explains that if the county has more murders, it is more likely to have more executions. . . *Question 4 . use ALCOHOL.dta, clear . . *a. . tab abuse =1 if abuse | alcohol | Freq. Percent Cum. ------------+----------------------------------- 0 | 8,848 90.08 90.08 1 | 974 9.92 100.00 ------------+----------------------------------- Total | 9,822 100.00 . *The percentage of the men in the sample that report abusing alcohol is 9.92%. . . tab employ =1 if | employed | Freq. Percent Cum. ------------+----------------------------------- 0 | 1,000 10.18 10.18 1 | 8,822 89.82 100.00 ------------+----------------------------------- Total | 9,822 100.00 . *The employment rate is 89.82%. . . *b. . tab employ if abuse==1 =1 if | employed | Freq. Percent Cum. ------------+----------------------------------- 0 | 124 12.73 12.73 1 | 850 87.27 100.00 ------------+----------------------------------- Total | 974 100.00 . *The employment rate for the group of men who abuse alcohol is 87.27%. . . *c. . tab employ if abuse==0 =1 if | employed | Freq. Percent Cum. ------------+----------------------------------- 0 | 876 9.90 9.90 1 | 7,972 90.10 100.00 ------------+----------------------------------- Total | 8,848 100.00 . *The employment rate for the group of men who do not report abusing alcohol is 90.10%. . . *d. . *The employment rate for the group of men who do not report abusing alcohol is higher than that for the group of men who abuse alcohol. . *No, we cannot conclude that alcohol abuse causes unemployment because we do not know whether the difference is significant or not. . . log close name: <unnamed> log: C:\Users\Xutong Huang\Desktop\Stata Data Sets (2)\Data Sets- STATA\assignment1.log log type: text closed on: 4 Aug 2020, 09:37:43 -------------------------------------------------------------------------------------------------------------------------------------------