伍德里奇计量经济学第四章

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

伍德里奇计量经济学第四章
name:
log: /Users/wangjianying/Desktop/Chapter 4 Computer exercise.smcl log type: smcl
opened on: 25 Oct 2016, 22:20:41
1. do "/var/folders/qt/0wzmrhfd3rb93j2h5hhtcwqr0000gn/T//SD1945 6.000000"
2. ****************************Chapter 4***********************************
3. **C1
4. use "/Users/wangjianying/Documents/data of wooldridge/stata/VOTE1.DTA"
5. des
Contains data from /Users/wangjianying/Documents/data of wooldridge/stata/VOTE1.DTA obs: 173
vars: 10 25 Jun 1999 14:07
size: 4,498
storage display value
variable name type format label variable label
state str2 %9s state postal code
district byte %3.0f congressional district
democA byte %3.2f =1 if A is democrat
voteA byte %5.2f percent vote for A
expendA float %8.2f camp. expends. by A, $1000s
expendB float %8.2f camp. expends. by B, $1000s
prtystrA byte %5.2f % vote for president
lexpendA float %9.0g log(expendA)
lexpendB float %9.0g log(expendB)
shareA float %5.2f 100*(expendA/(expendA+expendB)) Sorted by:
6. reg voteA lexpendA lexpendB prtystrA
Source SS df MS Number of obs = 173
F( 3, 169) = 215.23 Model 38405.1096 3 12801.7032 Prob > F = 0.0000
Residual 10052.1389 169 59.480112 R-squared = 0.7926
Adj R-squared = 0.7889 Total 48457.2486 172 281.728189 Root MSE = 7.7123
voteA Coef. Std. Err. t P>|t| [95% Conf. Interval] lexpendA 6.083316 .38215 15.92 0.000 5.328914 6.837719 lexpendB -6.615417 .3788203 -17.46 0.000 -7.363246 -5.867588 prtystrA .1519574 .0620181 2.45 0.015 .0295274 .2743873 _cons 45.07893 3.926305 11.48 0.000 37.32801 52.82985
7. gen cha=lexpendB-lexpendA // variable cha is a new variable//
8. reg voteA lexpendA cha prtystrA
Source SS df MS Number of obs = 173
F( 3, 169) = 215.23 Model 38405.1097 3 12801.7032 Prob > F = 0.0000
Residual 10052.1388 169 59.4801115 R-squared = 0.7926
Adj R-squared = 0.7889 Total 48457.2486 172 281.728189 Root MSE = 7.7123 voteA Coef. Std. Err. t P>|t| [95% Conf. Interval] lexpendA -.532101 .5330858 -1.00 0.320 -1.584466 .5202638 cha -6.615417 .3788203 -17.46 0.000 -7.363246 -5.867588
prtystrA .1519574 .0620181 2.45 0.015 .0295274 .2743873
_cons 45.07893 3.926305 11.48 0.000 37.32801 52.82985
9. clear
10.
11. **C3
12. use "/Users/wangjianying/Documents/data of wooldridge/stata/hprice1.dta"
13. des
Contains data from /Users/wangjianying/Documents/data of wooldridge/stata/hprice1.dta obs: 88
vars: 10 17 Mar 2002 12:21
size: 2,816
storage display value
variable name type format label variable label
price float %9.0g house price, $1000s
assess float %9.0g assessed value, $1000s
bdrms byte %9.0g number of bdrms
lotsize float %9.0g size of lot in square feet
sqrft int %9.0g size of house in square feet
colonial byte %9.0g =1 if home is colonial style
lprice float %9.0g log(price)
lassess float %9.0g log(assess
llotsize float %9.0g log(lotsize)
lsqrft float %9.0g log(sqrft)
Sorted by:
14. reg lprice sqrft bdrms
Source SS df MS Number of obs = 88
F( 2, 85) = 60.73 Model 4.71671468 2 2.35835734 Prob > F = 0.0000
Residual 3.30088884 85 .038833986 R-squared = 0.5883
Adj R-squared = 0.5786 Total 8.01760352 87 .092156362 Root MSE = .19706 lprice Coef. Std. Err. t P>|t| [95% Conf. Interval] sqrft .0003794 .0000432 8.78 0.000 .0002935 .0004654
bdrms .0288844 .0296433 0.97 0.333 -.0300543 .0878232
_cons 4.766027 .0970445 49.11 0.000 4.573077 4.958978
15. gen cha=sqrft-150*bdrms
16. reg lprice cha bdrms
Source SS df MS Number of obs = 88
F( 2, 85) = 60.73 Model 4.71671468 2 2.35835734 Prob > F = 0.0000
Residual 3.30088884 85 .038833986 R-squared = 0.5883
Adj R-squared = 0.5786 Total 8.01760352 87 .092156362 Root MSE = .19706
lprice Coef. Std. Err. t P>|t| [95% Conf. Interval] cha .0003794 .0000432 8.78 0.000 .0002935 .0004654 bdrms .0858013 .0267675 3.21 0.002 .0325804 .1390223 _cons 4.766027 .0970445 49.11 0.000 4.573077 4.958978
17. clear
18.
19. **C5
20. use "/Users/wangjianying/Documents/data of wooldridge/stata/MLB1.DTA"
21. des
Contains data from /Users/wangjianying/Documents/data of wooldridge/stata/MLB1.DTA obs: 353
vars: 47 16 Sep 1996 15:53
size: 45,537
storage display value
variable name type format label variable label
salary float %9.0g 1993 season salary
teamsal float %10.0f team payroll
nl byte %9.0g =1 if national league
years byte %9.0g years in major leagues
games int %9.0g career games played
atbats int %9.0g career at bats
runs int %9.0g career runs scored
hits int %9.0g career hits
doubles int %9.0g career doubles
triples int %9.0g career triples
hruns int %9.0g career home runs
rbis int %9.0g career runs batted in
bavg float %9.0g career batting average
bb int %9.0g career walks
so int %9.0g career strike outs
sbases int %9.0g career stolen bases
fldperc int %9.0g career fielding perc frstbase byte %9.0g = 1 if first base scndbase byte %9.0g =1 if second base shrtstop byte %9.0g =1 if shortstop thrdbase byte %9.0g =1 if third base outfield byte %9.0g =1 if outfield
catcher byte %9.0g =1 if catcher
yrsallst byte %9.0g years as all-star
hispan byte %9.0g =1 if hispanic
black byte %9.0g =1 if black
whitepop float %9.0g white pop. in city blackpop float %9.0g black pop. in city hisppop float %9.0g hispanic pop. in city pcinc int %9.0g city per capita income gamesyr float %9.0g games per year in league hrunsyr float %9.0g home runs per year atbatsyr float %9.0g at bats per year
allstar float %9.0g perc. of years an all-star slugavg float %9.0g career slugging average rbisyr float %9.0g rbis per year
sbasesyr float %9.0g stolen bases per year
runsyr float %9.0g runs scored per year
percwhte float %9.0g percent white in city
percblck float %9.0g percent black in city
perchisp float %9.0g percent hispanic in city
blckpb float %9.0g black*percblck
hispph float %9.0g hispan*perchisp
whtepw float %9.0g white*percwhte
blckph float %9.0g black*perchisp
hisppb float %9.0g hispan*percblck
lsalary float %9.0g log(salary)
Sorted by:
22. reg lsalary years gamesyr bavg hrunsyr
Source SS df MS Number of obs = 353
F( 4, 348) = 145.24 Model 307.800674 4 76.9501684 Prob >
F = 0.0000 Residual 184.374861 348 .52981282 R-squared =
0.6254
Adj R-squared = 0.6211 Total 492.175535 352 1.39822595 Root MSE = .72788
lsalary Coef. Std. Err. t P>|t| [95% Conf. Interval] years .0677325 .0121128 5.59 0.000 .0439089 .091556 gamesyr .0157595 .0015636 10.08 0.000 .0126841 .0188348 bavg .0014185 .0010658 1.33 0.184 -.0006776 .0035147 hrunsyr .0359434 .0072408 4.96 0.000 .0217021 .0501847 _cons 11.02091 .2657191 41.48 0.000 10.49829 11.54353
23. reg lsalary years gamesyr bavg hrunsyr runsyr fldperc sbasesyr
Source SS df MS Number of obs = 353
F( 7, 345) = 87.25 Model 314.510478 7 44.9300682 Prob > F = 0.0000 Residual 177.665058 345 .514971181 R-squared =
0.6390
Adj R-squared = 0.6317 Total 492.175535 352 1.39822595 Root MSE = .71761
lsalary Coef. Std. Err. t P>|t| [95% Conf. Interval] years .0699848 .0119756 5.84 0.000 .0464305 .0935391 gamesyr .0078995 .0026775 2.95 0.003 .0026333 .0131657 bavg .0005296 .0011038 0.48 0.632 -.0016414 .0027007 hrunsyr .0232106 .0086392 2.69 0.008 .0062185 .0402027 runsyr .0173922 .0050641 3.43 0.001 .0074318 .0273525 fldperc .0010351 .0020046 0.52 0.606 -.0029077 .0049778 sbasesyr -.0064191 .0051842 -1.24 0.216 -.0166157 .0037775 _cons 10.40827 2.003255 5.20 0.000 6.468139 14.3484
24. test bavg fldperc sbasesyr
( 1) bavg = 0
( 2) fldperc = 0
( 3) sbasesyr = 0
F( 3, 345) = 0.69
Prob > F = 0.5617
25. clear
26. **C7
27. use "/Users/wangjianying/Documents/data of wooldridge/stata/twoyear.dta"
28. sum phsrank
Variable Obs Mean Std. Dev. Min Max
phsrank 6763 56.15703 24.27296 0 99
29. reg lwage jc totcoll exper phsrank
Source SS df MS Number of obs = 6763
F( 4, 6758) = 483.85 Model 358.050568 4 89.5126419 Prob >
F = 0.0000 Residual 1250.24552 6758 .185002297 R-squared =
0.2226
Adj R-squared = 0.2222 Total 1608.29609 6762 .237843255 Root MSE = .43012 lwage Coef. Std. Err. t P>|t| [95% Conf. Interval] jc -.0093108 .0069693 -1.34 0.182 -.0229728 .0043512 totcoll .0754756 .0025588 29.50 0.000 .0704595 .0804918 exper .0049396 .0001575 31.36 0.000 .0046308 .0052483 phsrank .0003032 .0002389 1.27 0.204 -.0001651 .0007716 _cons 1.458747 .0236211 61.76 0.000 1.412442 1.505052
30. reg lwage jc univ exper id
Source SS df MS Number of obs = 6763
F( 4, 6758) = 483.42 Model 357.807307 4 89.4518268 Prob >
F = 0.0000 Residual 1250.48879 6758 .185038293 R-squared =
0.2225
Adj R-squared = 0.2220 Total 1608.29609 6762 .237843255 Root MSE = .43016 lwage Coef. Std. Err. t P>|t| [95% Conf. Interval] jc .0666633 .0068294 9.76 0.000 .0532754 .0800511
univ .0768813 .0023089 33.30 0.000 .0723552 .0814074
exper .0049456 .0001575 31.40 0.000 .0046368 .0052543
id 1.14e-07 2.09e-07 0.54 0.587 -2.97e-07 5.24e-07
_cons 1.467533 .0228306 64.28 0.000 1.422778 1.512288
31. reg lwage jc totcoll exper id
Source SS df MS Number of obs = 6763
F( 4, 6758) = 483.42 Model 357.807307 4 89.4518267 Prob > F = 0.0000
Residual 1250.48879 6758 .185038293 R-squared = 0.2225 Adj R-squared = 0.2220 Total 1608.29609 6762 .237843255 Root MSE = .43016 lwage Coef. Std. Err. t P>|t| [95% Conf. Interval] jc -.010218 .0069366 -1.47 0.141 -.023816 .00338
totcoll .0768813 .0023089 33.30 0.000 .0723552 .0814074
exper .0049456 .0001575 31.40 0.000 .0046368 .0052543
id 1.14e-07 2.09e-07 0.54 0.587 -2.97e-07 5.24e-07
_cons 1.467533 .0228306 64.28 0.000 1.422778 1.512288
32. clear
33. **C9
34. use "/Users/wangjianying/Documents/data of wooldridge/stata/discrim.dta"
35. des
Contains data from /Users/wangjianying/Documents/data of wooldridge/stata/discrim.dta obs: 410
vars: 37 8 Jan 2002 22:26
size: 47,150
storage display value
variable name type format label variable label
psoda float %9.0g price of medium soda, 1st wave
pfries float %9.0g price of small fries, 1st wave
pentree float %9.0g price entree (burger or chicken), 1st wave wagest float %9.0g starting wage, 1st wave
nmgrs float %9.0g number of managers, 1st wave
nregs byte %9.0g number of registers, 1st wave
hrsopen float %9.0g hours open, 1st wave
emp float %9.0g number of employees, 1st wave
psoda2 float %9.0g price of medium soday, 2nd wave
pfries2 float %9.0g price of small fries, 2nd wave
pentree2 float %9.0g price entree, 2nd wave
wagest2 float %9.0g starting wage, 2nd wave
nmgrs2 float %9.0g number of managers, 2nd wave
nregs2 byte %9.0g number of registers, 2nd wave
hrsopen2 float %9.0g hours open, 2nd wave
emp2 float %9.0g number of employees, 2nd wave
compown byte %9.0g =1 if company owned
chain byte %9.0g BK = 1, KFC = 2, Roy Rogers = 3, Wendy's
= 4 density float %9.0g population density, town
crmrte float %9.0g crime rate, town
state byte %9.0g NJ = 1, PA = 2
prpblck float %9.0g proportion black, zipcode
prppov float %9.0g proportion in poverty, zipcode
prpncar float %9.0g proportion no car, zipcode
hseval float %9.0g median housing value, zipcode
nstores byte %9.0g number of stores, zipcode
income float %9.0g median family income, zipcode
county byte %9.0g county label
lpsoda float %9.0g log(psoda)
lpfries float %9.0g log(pfries)
lhseval float %9.0g log(hseval)
lincome float %9.0g log(income)
ldensity float %9.0g log(density)
NJ byte %9.0g =1 for New Jersey
BK byte %9.0g =1 if Burger King
KFC byte %9.0g =1 if Kentucky Fried Chicken
RR byte %9.0g =1 if Roy Rogers
Sorted by:
36. reg lpsoda prpblck lincome prppov
Source SS df MS Number of obs = 401
F( 3, 397) = 12.60 Model .250340622 3 .083446874 Prob > F = 0.0000
Residual 2.62840943 397 .006620679 R-squared = 0.0870
Adj R-squared = 0.0801 Total 2.87875005 400 .007196875 Root MSE = .08137 lpsoda Coef. Std. Err. t P>|t| [95% Conf. Interval]
prpblck .0728072 .0306756 2.37 0.018 .0125003 .1331141
lincome .1369553 .0267554 5.12 0.000 .0843552 .1895553
prppov .38036 .1327903 2.86 0.004 .1192999 .6414201
_cons -1.463333 .2937111 -4.98 0.000 -2.040756 -.8859092
37. corr lincome prppov
(obs=409)
lincome prppov
lincome 1.0000
prppov -0.8385 1.0000
38. reg lpsoda prpblck lincome prppov lhseval
Source SS df MS Number of obs = 401
F( 4, 396) = 22.31 Model .529488085 4 .132372021 Prob > F = 0.0000 Residual 2.34926197 396 .00593248 R-squared = 0.1839 Adj R-squared = 0.1757 Total 2.87875005 400 .007196875 Root MSE = .07702
lpsoda Coef. Std. Err. t P>|t| [95% Conf. Interval] prpblck .0975502 .0292607 3.33 0.001 .0400244 .155076 lincome -.0529904 .0375261 -1.41 0.159 -.1267657 .0207848 prppov .0521229 .1344992 0.39 0.699 -.2122989 .3165447 lhseval .1213056 .0176841 6.86 0.000 .0865392 .1560721 _cons -.8415149 .2924318 -2.88 0.004 -1.416428 -.2666019
39. test lincome prppov
( 1) lincome = 0
( 2) prppov = 0
F( 2, 396) = 3.52
Prob > F = 0.0304
40.
end of do-file
41. log close
name:
log: /Users/wangjianying/Desktop/Chapter 4 Computer exercise.smcl log type: smcl
closed on: 25 Oct 2016, 22:21:04。

相关文档
最新文档