最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How marginaleffects::predictions calculates confidence intervals in R? - Stack Overflow

programmeradmin3浏览0评论

I am using package marginaleffects in R to get confidence intervals for my predictions of a marginal effect. However, I did some calculations by hand and some of the confidence intervals I am getting with marginaleffects::predictions seem too large. Am I missing something on how these confidence intervals are calculated or is there something weird going on?

I have the following regression model: Y = b_1 endogenous + b_2 endogenous^2 + b_3 controls + error

Because I have endogenous variables, I employ instrument. In terms of code, I use package fixest to estimate the model below:

model <- feols(outcome ~ control1 + control2 + control3 + control4 |
                    fixed_effect1 + fixed_effect2 |
                    endogenous + I(endogenous^2) ~ instrument + I(instrument^2) ,
                  data = dataset,  se = "cluster", cluster = "cluster_id")
Variable Estimate Std. Error
fit_endogenous -0.041626570 0.156600333
fit_I(endogenous^2) 0.037313536 0.264656733
control1 0.003302789 0.001053634
control2 -0.004176099 0.003436881
control3 0.000320232 0.000164557
control4 -0.000000270 0.000000127
发布评论

评论列表(0)

  1. 暂无评论