Closed dfrankow closed 3 years ago
Generally it's better to go through the corresponding accessor methods, in this case model.frame
, rather than digging into the object internals.
> m <- estimatr::lm_robust(mpg ~ cyl, data=mtcars)
> nrow(model.frame(m))
[1] 32
Oh great!
Yeah, it's not always clear to me what's internal and what's not.
If that's always available, then it might be enough for me.
In some cases, I have had problems with the data object going out of scope, while I wish the model would hang onto it.
However, you can close this issue, and I can re-open if I have a reproducible issue.
Or I can close it. :)
This is a feature request.
It would be useful if the results returned from
lm_robust
could have the data the model was built on. Could be an optional flag.Example:
I wrote the following function to hack around the lack of this feature.
Example usage:
It really only matters in the face of NAs, but that's an important use case.