Closed matthewolckers closed 1 year ago
I read through the help file of feols
and it states:
If you want to estimate a model without exogenous variables, use
1
as a placeholder: e.g.fml = y ~ 1 | x_endo + x_inst
.
So I tried:
est_iv_fe = feols(y ~ 1 | fe | x_endo_1 + x_endo_2 ~ x_inst_1 + x_inst_2, base)
and that seems to work.
Is this the correct way to specify the an IV with a fixed effect but no other controls?
Hi Matthew: this is absolutely correct :-)
Thanks for the fantastic package! It's been super helpful.
I am estimating IV models with FE. As you describe in the intro to the package, we should use:
est_iv_fe = feols(y ~ x1 | fe | x_endo_1 + x_endo_2 ~ x_inst_1 + x_inst_2, base)
where
x1
is a control variable,fe
is a fixed effect,x_endo_1
andx_endo_2
are endogenous variables instrumented by instrumentsx_inst_1
andx_inst_2
.What if you don't have any control variables besides the fixed effect? i.e. I want to remove
x1
.I tried:
est_iv_fe = feols(y ~ | fe | x_endo_1 + x_endo_2 ~ x_inst_1 + x_inst_2, base)
, which throws an error,and
est_iv_fe = feols(y ~ fe | x_endo_1 + x_endo_2 ~ x_inst_1 + x_inst_2, base)
, which intrepretsfe
as a control and includes it in the regression output.How should I specify the model correctly?
P.S. This question might have a simple answer as I have a pretty low level of experience with R.