Docsity

Data Analysis for Exam - Econometric Methods | EC 228, Exams of Economics

Toggle sidebar
bg1
Thursday August 28 11:51:32 2008 Page 1
___ ____ ____ ____ ____tm
/__ / ____/ / ____/
___/ / /___/ / /___/
Statistics/Data Analysis
log: /Users/baum/doc/Courses 2008-2009/EC228 F2008/ec228_f2008_day1.smcl
log type: smcl
opened on: 28 Aug 2008, 11:51:32
1.
2. // ec228_f2008_day1 cfb 28aug2008
3.
4. // display the codebook
5. type http://fmwww.bc.edu/ec-p/data/wooldridge/crime1.des
CRIME1.DES
narr86 nfarr86 nparr86 pcnv avgsen tottime ptime86 qemp86
inc86 durat black hispan born60 pcnvsq pt86sq inc86sq
Obs: 2725
1. narr86 # times arrested, 1986
2. nfarr86 # felony arrests, 1986
3. nparr86 # property crme arr., 1986
4. pcnv proportion of prior convictions
5. avgsen avg sentence length, mos.
6. tottime time in prison since 18 (mos.)
7. ptime86 mos. in prison during 1986
8. qemp86 # quarters employed, 1986
9. inc86 legal income, 1986, $100s
10. durat recent unemp duration
11. black =1 if black
12. hispan =1 if Hispanic
13. born60 =1 if born in 1960
14. pcnvsq pcnv^2
15. pt86sq ptime86^2
16. inc86sq inc86^2
6.
7. // read in the data
8. use http://fmwww.bc.edu/ec-p/data/wooldridge/crime1, clear
9.
10 . // describe its contents and calculate descriptive stats
11 . describe
Contains data from http://fmwww.bc.edu/ec-p/data/wooldridge/crime1.dta
obs: 2,725
vars: 16 10 Jan 2000 16:54
size: 196,200 (99.9% of memory free)
storage display value
variable name type format label variable label
narr86 float %9.0g
nfarr86 float %9.0g
nparr86 float %9.0g
pcnv float %9.0g
pf3
pf4

Partial preview of the text

Download Data Analysis for Exam - Econometric Methods | EC 228 and more Exams Economics in PDF only on Docsity!

___ ____ ____ ____ ____tm /__ / ____/ / ____/ / / // / /___/ Statistics/Data Analysis log: /Users/baum/doc/Courses 2008 - 2009 /EC 228 F 2008 /ec 228 _f 2008 _day 1 .smcl log type: smcl opened on: 28 Aug 2008 , 11 : 51 : 32

  1. // ec228_f2008_day1 cfb 28aug
  2. // display the codebook
  3. type http://fmwww.bc.edu/ec-p/data/wooldridge/crime1.des CRIME 1 .DES narr 86 nfarr 86 nparr 86 pcnv avgsen tottime ptime 86 qemp 86 inc 86 durat black hispan born 60 pcnvsq pt 86 sq inc 86 sq Obs: 2725
  4. narr 86 # times arrested, 1986
  5. nfarr 86 # felony arrests, 1986
  6. nparr 86 # property crme arr., 1986
  7. pcnv proportion of prior convictions
  8. avgsen avg sentence length, mos.
  9. tottime time in prison since 18 (mos.)
  10. ptime 86 mos. in prison during 1986
  11. qemp 86 # quarters employed, 1986
  12. inc 86 legal income, 1986 , $ 100 s
  13. durat recent unemp duration
  14. black = 1 if black
  15. hispan = 1 if Hispanic
  16. born 60 = 1 if born in 1960
  17. pcnvsq pcnv^ 2
  18. pt 86 sq ptime 86 ^ 2
  19. inc 86 sq inc 86 ^ 2
  20. // read in the data
  21. use http://fmwww.bc.edu/ec-p/data/wooldridge/crime1, clear
  22. // describe its contents and calculate descriptive stats
  23. describe Contains data from http://fmwww.bc.edu/ec-p/data/wooldridge/crime 1 .dta obs: 2 , 725 vars: 16 10 Jan 2000 16 : 54 size: 196 , 200 (99.9% of memory free) storage display value variable name type format label variable label narr 86 float %9.0g nfarr 86 float %9.0g nparr 86 float %9.0g pcnv float %9.0g

avgsen float %9.0g tottime float %9.0g ptime 86 float %9.0g qemp 86 float %9.0g inc 86 float %9.0g durat float %9.0g black float %9.0g hispan float %9.0g born 60 float %9.0g pcnvsq float %9.0g pt 86 sq float %9.0g inc 86 sq float %9.0g Sorted by:

  1. summarize Variable Obs Mean Std. Dev. Min Max narr86 2725. 4044037. 8590768 0 12 nfarr86 2725. 2333945. 5810142 0 6 nparr86 2725. 1255046. 4828473 0 8 pcnv 2725. 3577872. 395192 0 1 avgsen 2725. 6322936 3. 508031 0 59. 2 tottime 2725. 8387523 4. 607019 0 63. 4 ptime86 2725. 387156 1. 950051 0 12 qemp86 2725 2. 309028 1. 610428 0 4 inc86 2725 54. 96705 66. 62721 0 541 durat 2725 2. 251376 4. 607063 0 25 black 2725. 1611009. 3676915 0 1 hispan 2725. 2176147. 4126997 0 1 born60 2725. 3625688. 48083 0 1 pcnvsq 2725. 284131. 3907343 0 1 pt86sq 2725 3. 951193 22. 08584 0 144 inc86sq 2725 7458. 933 16361. 24 0 292681
  2. // test H0: average sentence for blacks = avg for non-blacks
  3. ttest avgsen, by(black)

narr86 Coef. Std. Err. t P>|t| [95% Conf. Interval] inc86 -. 0024495. 0002426 - 10. 10 0. 000 -. 0029252 -. 0019738 _cons. 5390463. 0209514 25. 73 0. 000. 4979641. 5801286

  1. // consider prior convictions, unemployment, race as well
  2. regress narr86 inc86 pcnv durat black hispan Source SS df MS Number of obs = 2725 F( 5, 2719) = 36. 39 Model 126. 105393 5 25. 2210787 Prob > F = 0. 0000 Residual 1884. 24176 2719. 692990718 R-squared = 0. 0627 Adj R-squared = 0. 0610 Total 2010. 34716 2724. 738012906 Root MSE =. 83246 narr86 Coef. Std. Err. t P>|t| [95% Conf. Interval] inc86 -. 0021246. 0002572 - 8. 26 0. 000 -. 0026289 -. 0016203 pcnv -. 1418213. 0404691 - 3. 50 0. 000 -. 2211747 -. 0624679 durat. 002914. 0036923 0. 79 0. 430 -. 0043259. 010154 black. 3257535. 0452257 7. 20 0. 000. 2370734. 4144337 hispan. 1804347. 039774 4. 54 0. 000. 1024443. 258425 _cons. 4736218. 0322772 14. 67 0. 000. 4103314. 5369122
  3. log close log: /Users/baum/doc/Courses 2008 - 2009 /EC 228 F 2008 /ec 228 _f 2008 _day 1 .smcl log type: smcl closed on: 28 Aug 2008 , 11 : 51 : 32