工具变量 两阶段的协变量_综合工具变量

工具变量 两阶段的协变量

I love papers that make you go “This is obvious in hindsight. Why did nobody try it before?” Some NLP folks made this remark about Transformers (“Attention Is All You Need”). To me, “The Blessings of Multiple Causes” evokes a similar feeling: why didn’t people create synthetic instruments?

我喜欢那些能助您一臂之力的论文。 为什么以前没有人尝试过?” 一些NLP人士对《变形金刚》发表了这样的评论(“ 注意就是你所需要的 ”)。 对我来说,“ 多重原因的祝福 ”让人想起类似的感觉:人们为什么不创造合成工具?

先决条件 (Prerequisites)

This article assumes basic familiarity with causal DAGs and causal inference. If you are unfamiliar with those terms, read the last third of my previous article on causality to get a brief overview.

本文假定对因果DAG和因果推理有基本的了解。 如果您不熟悉这些术语,请阅读上一篇有关因果关系的文章的后三分之一,以进行简要概述。

Additionally, while there are many ways of creating synthetic instruments, this article uses probabilistic PCA as it’s one of the most generic methods. If you don’t know much about PCA, I suggest reading this wonderful and intuitive explanation.

此外,尽管有很多创建合成工具的方法,但是本文使用概率PCA作为最通用的方法之一。 如果您对PCA不太了解,我建议您阅读此精彩而直观的说明

什么是仪器? (What Are Instruments?)

Instrumental variables have been around for a long time and can be said to be one of the backbones of econometrics. We are concerned with this DAG:

工具变量已经存在很长时间了,可以说是计量经济学的骨干之一。 我们关注此DAG:

U is an unobserved confounder. We want to estimate the causal eff

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个可能的工具变量阶段回归的ivprobit代码: ``` use "mydata.dta", clear * 定义变量 gen double ystar = . gen double iv = . gen double z = . * 第一阶段回归 reg iv x1 x2 x3 x4 * 存储预测值 predict ivhat, xb * 计算y的星号值 gen double ystar = invnorm(ivhat * (1 - 2 * invnorm(iv))) * 第二阶段回归 ivprobit y x1 x2 x3 x4 (z = iv) * 输出结果 estimates store ivprobit estimates table ivprobit ``` 在这个代码中,我们首先定义了三个新变量:`ystar`,`iv`和`z`。`ystar`是因变量的潜在值,基于正态分布的假设,它等于因变量在给定变量下的线性组合的逆标准正态分布累积分布函数。`iv`是我们选择的工具变量,可能与因变量的潜在值相关,但不直接影响因变量。`z`是用于指定工具变量的附加变量,它在第二阶段回归中作为工具变量的一部分。 在第一阶段回归中,我们使用所有的变量来预测工具变量`iv`。我们使用`reg`命令,但我们可以使用任何其他的回归命令。我们将预测值存储在`ivhat`变量中,以便在第二阶段回归中使用。 接下来,我们计算因变量的潜在值`ystar`,根据上面提到的公式,使用`invnorm()`函数(逆标准正态分布累积分布函数)。 最后,我们在第二阶段回归中使用`ivprobit`命令,指定`z = iv`来使用`iv`作为工具变量的一部分。我们将估计值存储在`ivprobit`中,并使用`estimates table`命令输出结果。 需要注意的是,这只是一个示例代码,实际使用中可能需要根据数据和研究问题进行修改。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值