. sysuse auto,clear
(1978 Automobile Data)
.
. replace price = price / 1000
price was int now float
(74 real changes made)
. replace weight = weight / 1000
weight was int now float
(74 real changes made)
. regress price weight mpg
Source | SS df MS Number of obs = 74
-------------+------------------------------ F( 2, 71) = 14.74
Model | 186.321281 2 93.1606406 Prob > F = 0.0000
Residual | 448.744101 71 6.32033944 R-squared = 0.2934
-------------+------------------------------ Adj R-squared = 0.2735
Total | 635.065382 73 8.69952578 Root MSE = 2.514
------------------------------------------------------------------------------
price | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
weight | 1.746559 .6413538 2.72 0.008 .4677361 3.025382
mpg | -.0495122 .086156 -0.57 0.567 -.2213025 .1222781
_cons | 1.946068 3.59705 0.54 0.590 -5.226245 9.118381
------------------------------------------------------------------------------
. estimates store m1, title(Model 1)
. generate forXmpg=foreign*mpg
. regress price weight mpg forXmpg foreign
Source | SS df MS Number of obs = 74
-------------+------------------------------ F( 4, 69) = 21.22
Model | 350.319653 4 87.5799133 Prob > F = 0.0000
Residual | 284.745729 69 4.12674969 R-squared = 0.5516
-------------+------------------------------ Adj R-squared = 0.5256
Total | 635.065382 73 8.69952578 Root MSE = 2.0314
------------------------------------------------------------------------------
price | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
weight | 4.613589 .7254961 6.36 0.000 3.166263 6.060914
mpg | .2631875 .1107961 2.38 0.020 .0421553 .4842197
forXmpg | -.3072165 .1085307 -2.83 0.006 -.5237294 -.0907037
foreign | 11.24033 2.751681 4.08 0.000 5.750877 16.72978
_cons | -14.44958 4.42572 -3.26 0.002 -23.27865 -5.62051
------------------------------------------------------------------------------
. estimates store m2, title(Model 2)
. esttab m1 m2 using d:\test.doc,replace
(output written to d:\test.doc)
都没有问题啊
|