具体可以看帮助或者到论坛下载sj13-1
reganat -- Graphical inspection of linear multivariate models
Syntax
reganat depvar varlist [if] [in] [, options]
options Description
--------------------------------------------------------------------------------------------------------------------------------
Options
dis(varlist) graphs only the variables in varlist and omits the rest
biline plots a regression line for the bivariate linear model
biscat plots a scatterplot for the bivariate linear model
reg displays the results for the estimation of the multivariate model
nolegend prevents the legend to be displayed
nocovlist prevents the list of covariates to be displayed
scheme(scheme) specifies the graphical scheme
--------------------------------------------------------------------------------------------------------------------------------
by is not allowed.
Description
reganat is a graphical tool for inspecting the effect of a covariate on a dependent variable in the context of multivariate OLS estimation. The name is an acronym for the expression regression anatomy, a result in OLS' algebra originally due to Frisch and Waugh (1933) and recently revived by Angrist and Pischke's Mostly Harmless Econometrics (2009).
In a bivariate regression model Y = bx1 + g, the graphical inspection of the scatterplot provides useful information on the relation between the independent variable x1 and the dependent variable Y, but can be highly misleading when the underlying real model is multivariate of the type Y = X'B + e where X' includes also x1.
In general, the OLS multivariate estimator is not equivalent to an OLS estimator obtained using a separate regression on each independent variable since correlation among independent variables must be accounted for.
Angrist and Pischke (2009) show that in a multivariable model, the regression parameter for a given regressor is the bivariate slope coefficient for the corresponding regressor after partialling out all other covariates. Accordingly, this command displays a table of scatterplots, with the dependent variable plotted against the independent variable net of any linear correlation with the other independent variables. This combined graph can be helpful when inspecting the data for outliers, nonlinearities, and other modelling issues.
********************************************************************
*例子:
*Setup
sysuse auto, clear
*Obtain a combined graph of the effect of several regressors
reganat price length weight headroom mpg,reg
*Obtain a combined graph of the effect of a subset of the regressors,
* along with scatterplots and fitted line for the univariate models
reganat price length weight headroom mpg, dis(weight length) biline reg
*******************************************
. *Setup
. sysuse auto, clear
(1978 Automobile Data)
.
. *Obtain a combined graph of the effect of several regressors
. reganat price length weight headroom mpg,reg
Dependent variable: price
Independent variables: length weight headroom mpg
Plotting: length weight headroom mpg
Source | SS df MS Number of obs = 74
-------------+------------------------------ F( 4, 69) = 10.21
Model | 236190226 4 59047556.6 Prob > F = 0.0000
Residual | 398875170 69 5780799.56 R-squared = 0.3719
-------------+------------------------------ Adj R-squared = 0.3355
Total | 635065396 73 8699525.97 Root MSE = 2404.3
------------------------------------------------------------------------------
price | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
length | -94.49651 40.39563 -2.34 0.022 -175.0836 -13.90944
weight | 4.335045 1.162745 3.73 0.000 2.015432 6.654657
headroom | -490.9667 388.4892 -1.26 0.211 -1265.981 284.048
mpg | -87.95838 83.5927 -1.05 0.296 -254.7213 78.80449
_cons | 14177.58 5872.766 2.41 0.018 2461.735 25893.43
------------------------------------------------------------------------------
.
. *Obtain a combined graph of the effect of a subset of the regressors,
. * along with scatterplots and fitted line for the univariate models
. reganat price length weight headroom mpg, reg dis(weight length) biline
Dependent variable: price
Independent variables: length weight headroom mpg
Plotting: weight length
Source | SS df MS Number of obs = 74
-------------+------------------------------ F( 4, 69) = 10.21
Model | 236190226 4 59047556.6 Prob > F = 0.0000
Residual | 398875170 69 5780799.56 R-squared = 0.3719
-------------+------------------------------ Adj R-squared = 0.3355
Total | 635065396 73 8699525.97 Root MSE = 2404.3
------------------------------------------------------------------------------
price | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
length | -94.49651 40.39563 -2.34 0.022 -175.0836 -13.90944
weight | 4.335045 1.162745 3.73 0.000 2.015432 6.654657
headroom | -490.9667 388.4892 -1.26 0.211 -1265.981 284.048
mpg | -87.95838 83.5927 -1.05 0.296 -254.7213 78.80449
_cons | 14177.58 5872.766 2.41 0.018 2461.735 25893.43
------------------------------------------------------------------------------


雷达卡




京公网安备 11010802022788号







