Stata连享会 主页 || 视频 || 推文 || 知乎 || Bilibili 站
温馨提示: 定期 清理浏览器缓存,可以获得最佳浏览体验。
New!
lianxh
命令发布了:
随时搜索推文、Stata 资源。安装:
. ssc install lianxh
详情参见帮助文件 (有惊喜):
. help lianxh
连享会新命令:cnssc
,ihelp
,rdbalance
,gitee
,installpkg
⛳ Stata 系列推文:
作者:郭盼亭 (厦门大学)
邮箱:gpting2020@163.com
目录
固定效应模型是面板数据分析的常用模型之一。当因变量为二元离散变量的时候,可以使用固定效应线性概率模型和固定效应 logit 模型 (又称面板 logit 模型)。其中,固定效应 logit 模型允许处理效应的异质性,是解决因变量为二元离散变量的有力模型。
Davezies 等人 (DDL,2021) 假设有一个
根据定义,平均边际效应可以表示为:
结合假设 1,
假如假设 1 和假设 2 成立,我们可以得到如下引理 1:
以及尖锐边界 (sharp bounds)
当协变量
假如假设 1 和假设 2 成立,我们可以得到关于尖锐边界 (sharp bounds)
对于没有接受处理的组的平均处理效应可以表示为:
从而平均处理效应为:
其估计量可以表示为:
mfelogit
实现了 Davezies 等 (DDL,2021) 关于 AME 的尖锐边界估计 (estimators of the sharp bounds on AME) 以及 AME 和 ATE 的相关置信区间估计。另外,mfelogit
还可以实现 DDL (2021) 中提出的第二种方法,该方法计算速度更快,但可能导致更大的置信区间。最后,当解释变量为二元变量时,该命令计算 ATE,否则将计算 AME。
命令安装:
ssc install mfelogit
命令语法:
mfelogit varlist [if] [in] id(string) time(string)
[, method(string) listT(string) listX(string)
level(string) eps(string) ratio(string)]
其中,varlist
是变量列表,id
指定作为个体标识符的变量,time
指定用作不同时间段标识符的变量。options
主要包含以下内容:
method
:指定使用的方法。它的参数必须是 sharp
或 quick
(默认值)中的一个。参数 sharp
代表 DDL (2021) 中的第一个方法。参数 quick
表示 DDL (2021) 中的第二个方法,此方法更快。注意,对于 ATE 只有第二个方法 quick
可用。
listT
:指定 AME/ATE 的计算周期,参见 DDL (2021) 中的 5.4 节。它可以取以下值:
all
:这将类似于上述情况,计算所有观察时期的 AME/ATE,以及所有时期的平均值。最后一种情况在最终输出表中由 Average 标记。listX
:指定计算 AME/ATE 的所选变量的列表。默认情况下,为所有协变量计算 AME/ATE。
level
:设置置信区间的值 (默认为 0.95)。
eps
:指定为第一种方法选择的置信区间类型。eps
为空的情况下,默认使用 DDL (2021) 中定义的 CI2。如果设置为不等于 0 的值,则使用 DDL (2021) 中定义的 CI3。最后,如果设置为 0,则 CI3 和 epsilon = ln(ln(n)) 一起使用。
ratio
:ratio
设置 DDL (2021) 中第一种方法的非参数估计中偏差/方差的比值 (the value of the bias/variance ratio) (更多细节请 DDL (2021) 的附录 C),默认值为 10。
. use "https://www.stata-press.com/data/r17/union.dta", clear
. mfelogit union age black if (year <=78), id("idcode") time("year") method("quick")
Estimates of coefficients in the fixed effect logit model (CMLE)
---------------------------------------------------
Point Est. Std. Err. p-value
---------------------------------------------------
age .0254468 .0100241 .011131
---------------------------------------------------
Estimates of the Average Marginal Effects in the fixed effect logit model
---------------------------------------------------
Estimate [95% Conf. Interval]
---------------------------------------------------
age(Tinf) .0022199 .0003422 .0040976
---------------------------------------------------
Notes:
Nb of observed individuals: 3167
Nb of discarded individuals: 828
Maximal number of observed periods: 6
The method used to compute AME/ATE is the quick method (i.e. the second method in DDL).
. mfelogit union age black if (year <=78), id("idcode") time("year") method("quick") listT("all")
Estimates of coefficients in the fixed effect logit model (CMLE)
---------------------------------------------------
Point Est. Std. Err. p-value
---------------------------------------------------
age .0254468 .0100241 .011131
---------------------------------------------------
Estimates of the Average Marginal Effects in the fixed effect logit model
----------------------------------------------------------------
Period Estimate [95% Conf. Interval]
----------------------------------------------------------------
age 1 .0020879 -.00034 .0045158
age 2 .002115 -.0002957 .0045256
age 3 .0018418 -.0001786 .0038622
age 4 .0013656 -.0002081 .0029394
age 5 .000772 -.0001361 .0016801
age 6 .0004178 -.0002116 .0010471
age(Average) . .0020913 .0010468 .0031358
----------------------------------------------------------------
Notes:
Nb of observed individuals: 3167
Nb of discarded individuals: 828
Maximal number of observed periods: 6
The method used to compute AME/ATE is the quick method (i.e. the second method in DDL).
Davezies L, D'Haultfoeuille X, Laage L. Identification and estimation of average marginal effects in fixed effects logit models[J]. arXiv preprint arXiv:2105.00879, 2021. -PDF-
Note:产生如下推文列表的 Stata 命令为:
lianxh probit logit, m
安装最新版lianxh
命令:
ssc install lianxh, replace
免费公开课
最新课程-直播课
专题 | 嘉宾 | 直播/回看视频 |
---|---|---|
⭐ 最新专题 | 文本分析、机器学习、效率专题、生存分析等 | |
研究设计 | 连玉君 | 我的特斯拉-实证研究设计,-幻灯片- |
面板模型 | 连玉君 | 动态面板模型,-幻灯片- |
面板模型 | 连玉君 | 直击面板数据模型 [免费公开课,2小时] |
⛳ 课程主页
⛳ 课程主页
关于我们
课程, 直播, 视频, 客服, 模型设定, 研究设计, stata, plus, 绘图, 编程, 面板, 论文重现, 可视化, RDD, DID, PSM, 合成控制法
等
连享会小程序:扫一扫,看推文,看视频……
扫码加入连享会微信群,提问交流更方便
✏ 连享会-常见问题解答:
✨ https://gitee.com/lianxh/Course/wikis
New!
lianxh
和songbl
命令发布了:
随时搜索连享会推文、Stata 资源,安装命令如下:
. ssc install lianxh
使用详情参见帮助文件 (有惊喜):
. help lianxh