更正了 R 中 Heckman 选择模型的标准误差
我一直在尝试手动估计赫克曼的两步解决方案。 (为了与 ML 进行比较以及在相对较大的实际样本中的应用)。 因此,我回顾了sampleSelection包的功能。 “vcov”返回估计系数的方差-协方差矩阵,包文档也表明“vcov”包含正确的标准误差。
另一方面,“heckitVcov”计算 Heckit 估计系数的渐近协方差矩阵,这就是为什么我尝试使用“heckitVcov”函数,输入所示参数,但结果在所有元素中均为“NA”。 我通过使用来自同一“选择”对象的值来计算渐近协方差矩阵,作为一种捷径。
我在解释和计算 heckiVcov 时犯了错误吗? 感谢
data("Mroz87")
mroz<-as.data.frame(Mroz87)
mroz$kids <- (mroz$kids5 + mroz$kids618 > 0)
mod_TS2 <- selection(selection = lfp ~ age + I(age^2) + faminc + kids + educ, outcome = wage ~ exper + I(exper^2) + educ + city, data=mroz, method="2step")
计算“heckitVcov”
heckitVcov(xMat=model.matrix(mod_TS2), wMat=model.matrix(mod_TS2$probit), vcovProbit=vcov(mod_TS2$probit), rho=mod_TS2$rho, delta=mod_TS2$imrDelta, sigma=mod_TS2$sigma)
其结果
## XO(Intercept) XOexper XOI(exper^2) XOeduc XOcity imrData$IMR1
##XO(Intercept) NA NA NA NA NA NA
##XOexper NA NA NA NA NA NA
##XOI(exper^2) NA NA NA NA NA NA
##XOcity NA NA NA NA NA NA
##imrData$IMR1 NA NA NA NA NA NA
注意:我已经看到了类似的问题 Heckman 选择模型R 手动 但还不是结论性的。
I have been trying to estimate Heckman's two-step solution by hand. (for purposes of comparison with ML and application in a real sample of relatively large size).
Therefore, I have reviewed the functions of the sampleSelection package. 'vcov' returns the variance-covariance matrix of the estimated coefficients, also the package documentation indicates that 'vcov' contains the correct standard errors.
On the other hand 'heckitVcov' calculates the asymptotic covariance matrix for the coefficients of a Heckit estimation, that's why I tried to use the 'heckitVcov' function, entering the arguments as indicated, but the result is 'NA' in all elements.
I have cheated a bit as a shortcut by using values from the same 'selection' object, to compute the asymptotic covariance matrix.
Am I making a mistake in interpreting and calculating heckiVcov?
Thanks
data("Mroz87")
mroz<-as.data.frame(Mroz87)
mroz$kids <- (mroz$kids5 + mroz$kids618 > 0)
mod_TS2 <- selection(selection = lfp ~ age + I(age^2) + faminc + kids + educ, outcome = wage ~ exper + I(exper^2) + educ + city, data=mroz, method="2step")
Calculating 'heckitVcov'
heckitVcov(xMat=model.matrix(mod_TS2), wMat=model.matrix(mod_TS2$probit), vcovProbit=vcov(mod_TS2$probit), rho=mod_TS2$rho, delta=mod_TS2$imrDelta, sigma=mod_TS2$sigma)
its result
## XO(Intercept) XOexper XOI(exper^2) XOeduc XOcity imrData$IMR1
##XO(Intercept) NA NA NA NA NA NA
##XOexper NA NA NA NA NA NA
##XOI(exper^2) NA NA NA NA NA NA
##XOcity NA NA NA NA NA NA
##imrData$IMR1 NA NA NA NA NA NA
Note: I have already seen a similar question Heckman selection model in R manually but it is not conclusive.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论