estimatr icon indicating copy to clipboard operation
estimatr copied to clipboard

Support for three-part formula RHS in iv_robust

Open grantmcdermott opened this issue 4 years ago • 1 comments

As noted in #365, the AER package has been superseded by a dedicated ivreg package (link). My suggestion here is based on the idea that it would be keep to keep a consistent syntax between estimatr and its "base" counterpart(s). With that in mind...

On cool feature introduced in the upcoming 0.6.0 release of ivreg is support for a three-part formula RHS:

y ~ ex | en | in

where ex is exogenous variables, en is endogenous variables, and in is instruments. In my view, this is a much more natural way of expressing the IV syntax than the old two-part formula (which is nonetheless still supported):

y ~ ex + en | ex + in

At the very least, the three-part syntax cuts down on typing since you don't have to write out the ex vars twice. It's also closer to the IV syntax used by fixest::feols() and lfe::felm(), as well as the equivalent Stata routines.

Thanks for considering.

grantmcdermott avatar Feb 06 '21 05:02 grantmcdermott

Hi Grant,

I think this is a good suggestion. I'm wary about breaking old code so I'll want to see if there's a way to do this that is "smart" enough. I'd think so given we rely on the Formula package.

lukesonnet avatar Sep 03 '21 17:09 lukesonnet