marginscontplot2
Stata社区命令
概述
marginscontplot2,缩写为MCP2,是一款用于绘制最近拟合回归模型中连续预测变量对响应变量边际效应图的Stata社区命令。独特优势在于可以在原始变量尺度上绘制边际效应图,特别适用于分析和可视化非线性关系,为研究者提供了直观理解复杂模型的工具。
依赖
Stata 12.1 及以上
安装
ssc install marginscontplot2, replace
示例
sysuse auto, clear regress mpg i.foreign weight marginscontplot2 weight foreign, var1(20) at2(0 1) ci combopts(ycommon imargin(small))
以上也可以用mcp2完成:
sysuse auto, clear regress mpg i.foreign weight mcp2 weight foreign, var1(20) at2(0 1) ci combopts(ycommon imargin(small))
更多示例可以见Richard Williams的教程[1]和作者在Stata Journal的论文[2]。更多关于Stata边际效应的2篇论文可见这里[3]、这里[4]和这篇解释logit模型[5]。
作者
姓名:Patrick Royston
机构:MRC Clinical Trials Unit at UCL, London, UK
邮箱:j.royston@ucl.ac.uk