kylebutts / jive

Jackknife Instrumental Variables Estimation
Other
10 stars 2 forks source link

Standard formula interface #1

Closed grantmcdermott closed 1 year ago

grantmcdermott commented 1 year ago

Hey, this looks very promising. A wrote a JIVE vcov thing for myself a while ago, but yours looks much more comprehensive.

One suggestion is to use a standard formula (user-level) interface. I would follow fixest's lead in specifying that the final slot is always IV (to allow a middle FE slot too). Internal parsing should be pretty easy using Formula.

So your README example would become:

jive(
  guilt ~ i(black) + i(white) | bailDate | jail3 ~ judge_pre,
  data = stephenson
)
grantmcdermott commented 1 year ago

Oops, I just saw further below in the README that you're already considering a formula interface. Still... I might be missing something, but why not use a three-part formula (as I have above) instead of a four-part formula?

kylebutts commented 1 year ago

@grantmcdermott The initial reason was this is what you would have to do for high-dimensional FEs as an instrument:

guilt ~ i(black) + i(white) | bailDate | jail3 ~ i(judge_pre)

Instead of this

guilt ~ i(black) + i(white) | bailDate | jail3 ~ 0 | judge_pre

If I wanted to efficiently estimate it (using proper FE estimation for judge_pre), I would have to convert the i to fixed effects and it would get complicated. But, I think I figured out a way to parse the formula, so I'll likely switch over.

I prefer the latter because JIVE supports continuous covariates as instruments, so it's good to support this.

kylebutts commented 1 year ago

Completed in da77164