伍德里奇计量经济学第四章
2016年10⽉25⽇ 星期⼆ 下午10:21 Page 1User: ⺩建英
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//SD19456.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