楼主: 蓝色
6747 4

[程序分享] reganat 多元回归中控制其它变量,Y与X1 作图分析的命令 [推广有奖]

贵宾

已卖:4081份资源

泰斗

34%

还不是VIP/贵宾

-

TA的文库  其他...

统计软件和图书资源

Stata FAQ and Econometrics

威望
13
论坛币
1100656 个
通用积分
78918.0340
学术水平
3454 点
热心指数
3913 点
信用等级
2749 点
经验
472847 点
帖子
11699
精华
5
在线时间
20312 小时
注册时间
2004-7-15
最后登录
2026-2-2

初级热心勋章 初级信用勋章 初级学术勋章 中级学术勋章 中级热心勋章 中级信用勋章 高级热心勋章 高级信用勋章

楼主
蓝色 发表于 2013-5-15 13:33:21 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
Stata Journals 2013 Volume 13 No.1 中提供的命令
具体可以看帮助或者到论坛下载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
------------------------------------------------------------------------------
Graph1.png
.
. *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
------------------------------------------------------------------------------


Graph2.png



二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Regan 多元回归 REG Multivariate econometrics 主成分分析法 spss主成分分析 逐步回归分析 多元回归分析 因子分析法 应用时间序列分析

已有 3 人评分经验 论坛币 学术水平 热心指数 信用等级 收起 理由
crystal8832 + 10 + 1 + 1 精彩帖子
零点晓敏 + 1 + 1 + 1 精彩帖子
Sunknownay + 100 + 15 + 1 + 1 + 1 鼓励积极发帖讨论

总评分: 经验 + 100  论坛币 + 25  学术水平 + 2  热心指数 + 3  信用等级 + 3   查看全部评分

本帖被以下文库推荐

沙发
peyzf 发表于 2013-9-27 14:02:22
interesting~

藤椅
零点晓敏 学生认证  发表于 2014-6-7 10:22:51
多谢楼主!果断存起来~

板凳
ericford 发表于 2015-9-4 12:28:00
如果想做调节变量的回归图形,该怎么做呢?

报纸
fangzi9204 发表于 2020-2-20 22:00:11
为什么我在用这个命令的时候总是显示因变量没有找到,可是因变量在的呀,做回归的时候因变量也没问题呀。

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-2-2 18:19