如何在 R 中的 "ivprobit" 包中使用 "ivprobit" 函数?

How can I use the "ivprobit" function in "ivprobit" package in R?

我试图理解 R 中 "ivprobit" 包中 "ivprobit" 函数的语法。指令说:

 Usage
 ivprobit(formula, data)

 Arguments
    formula y~x|y1|x2 whre y is the dichotomous l.h.s.,x is the r.h.s.    
            exogenous variables,y1 is the r.h.s. endogenous variables and 
            x2 is the complete set of instruments
    data    the dataframe

然后显示对应的例子:

 data(eco)

 pro<-ivprobit(d2~ltass+roe+div|eqrat+bonus|ltass+roe+div+gap+cfa,eco)

 summary(pro)

如果我符合指令的解释,

 y= d2 = dichotomous l.h.s.
 x= ltass+roe+div = the r.h.s. exogenous variables
 y1= eqrat+bonus = the r.h.s. endogenous variables
 x2= tass+roe+div+gap+cfa = the complete set of instruments

我不明白 x 和 x2 之间的区别。 另外,如果 x2 是完整的工具集,为什么它不包括内生变量 y1?相反,它还包括 "gap" 和 "cfa" 变量,这些变量甚至没有显示在 x(外生变量)中,甚至也没有显示在 y 中。

如果,比方说,我选择的工具变量确实是 "eqrat" 和 "bonus",我如何构造知道 x(外生变量)和 x2(完整的工具集)之间的区别?

注意这里讨论的是sintax,不是模型的"goodness",这种问题请参考https://stats.stackexchange.com/.

让我们以这个等式为例:.

正如正确指出的那样, 不是真正的,这只是一个例子。

此处:

  • 为因变量;

  • 是内生变量(一个或多个),其中 a 是 "problematic";

  • 是外生变量(一个或多个)不是 "problematic";
  • 是 "help" 具有内生变量的工具(一个或多个);

为什么内源性有问题?因为它们与误差 相关,这会导致经典 OLS 估计出现问题。

are the instruments because they have some foundamental proprieties (more here):

  • 与误差项无关;
  • 不影响 given 保持不变;
  • 相关。

在提议的语法中,我们有:

  • x,外生,对应(没问题);
  • y1,内生,对应(有问题);
  • x2,全套仪器,对应.

在您引用的示例中,x2x 共享一些公共变量,这是一组外生变量(没有问题),外加两个工具。

该模型使用 3 个外生变量作为工具,再加上两个变量。

I do not understand the difference between x and x2

x2 是工具,可能与外生变量集 (x) 重叠,也可能不重叠。

if x2 is the complete set of instruments, why doesn't it include the endogenous variables y1 as well?

不能包括内生变量,因为这些是方程需要使用工具处理的变量。


一个例子:

您想建立一个模型来预测双亲家庭中的女性是否有工作。您有这些变量:

  • fem_works,响应或因变量;
  • fem_edu,女方受教育程度,外生;
  • kids,夫妻子女数,外生;
  • other_income,家庭收入,内生的(你知道这是先验知识);
  • male_edu,男方受教育程度,仪器(你选这个).

对于 ivprobit,这将是:

mod <- ivprobit(fem_works ~ fem_edu + kids | other_income | fem_edu + kids + male_edu, data)

other_income对于模型来说是有问题的,因为你怀疑它与误差项相关(其他冲击可能会同时影响fem_worksother_income),你决定使用male_edu作为工具,为了"alleviate"那个问题。 (示例取自 here