Open ngreifer opened 2 years ago
Apparently the method dispatches differently for iv_robust than lm_robust - please try using the lm method explicitly, like:
stats:::model.frame.lm(fit)
This is another edge case for #123
Thank you, unfortunately, this is for use inside insight::get_data()
which I'm aware you have no control over. That function simply calls model.frame()
so ideally the method for iv_robust
objects would naturally dispatch correctly.
It's weird, someone in the other thread said get_data used to work? https://github.com/DeclareDesign/estimatr/issues/123#issuecomment-492163357
Maybe it changed?
It actually produced incorrect output in that thread, as well (note the second column).
Hello,
I have found that
model.frame()
gives unexpected results when used withiv_robust()
, possibly due to it being unable to parse the model formula. With a factor variable in the model, no dataset is produced, and without factor variables, the formula is misinterpreted, with the|
interpreted as "or". See reprex below:Created on 2022-08-29 with reprex v2.0.2
This fix is needed to fully resolve #374, because as of right now there is no clear way to extract the original dataset from the model. Thanks!