温馨提示: 定期 清理浏览器缓存,可以获得最佳浏览体验。
作者:连玉君 (中山大学)
E-Mail: arlionn@163.com
目录
交乘项的使用越来与普遍。Stata 官方提供的 margins
以及 marginsplot
命令可以很好地分析和图示边际效果。其局限在于只能呈现特定数值上的边际效应,而无法连续的呈现边际效应。
外部命令 interflex
可能弥补这一局限。
这里介绍的 marginscontplot2
也可以很好地实现这一分析目的。其他相关资料可以参考 连享会·交乘项专题 和 连享会 回归分析专题。
marginscontplot2
provides a graph of the marginal effect of a continuous predictor on the response variable in the most recently fitted regression model. See Royston (2013) for details and examples; the paper is available at http://www.stata-journal.com/article.html?article=gr0056.
help marginscontplot2
// Graph margins for continuous predictors*-Basic examples
sysuse auto, clear
regress mpg i.foreign weight
marginscontplot2 weight, name(my_graph)
marginscontplot2 weight, at1(2000(100)4500) ci
marginscontplot2 weight foreign, var1(20) at2(0 1)
marginscontplot2 weight foreign, var1(20) at2(0 1) ///
ci combopts(ycommon imargin(small))
*-Example using a log-transformed covariate
gen logwt = log(weight)
regress mpg i.foreign c.logwt i.foreign#c.logwt
quietly summarize weight
range w1 r(min) r(max) 20
generate logw1 = log(w1)
marginscontplot2 weight (logwt), var1(w1 (logw1)) ci
输出效果:
连享会-直播课 上线了!
http://lianxh.duanshu.com
免费公开课:
直击面板数据模型 - 连玉君,时长:1小时40分钟 Stata 33 讲 - 连玉君, 每讲 15 分钟. 部分直播课 课程资料下载 (PPT,dofiles等)
支持回看,所有课程可以随时购买观看。
专题 | 嘉宾 | 直播/回看视频 |
---|---|---|
⭐ 最新专题 ⭐ | DSGE, 因果推断, 空间计量等 | |
⭕ Stata数据清洗 | 游万海 | 直播, 2 小时,已上线 |
研究设计 | 连玉君 | 我的特斯拉-实证研究设计,-幻灯片- |
面板模型 | 连玉君 | 动态面板模型,-幻灯片- |
面板模型 | 连玉君 | 直击面板数据模型 [免费公开课,2小时] |
Note: 部分课程的资料,PPT 等可以前往 连享会-直播课 主页查看,下载。
关于我们
课程, 直播, 视频, 客服, 模型设定, 研究设计, stata, plus, 绘图, 编程, 面板, 论文重现, 可视化, RDD, DID, PSM, 合成控制法
等
连享会小程序:扫一扫,看推文,看视频……
扫码加入连享会微信群,提问交流更方便
✏ 连享会学习群-常见问题解答汇总:
✨ https://gitee.com/arlionn/WD