Open MatthieuStigler opened 6 years ago
@MatthieuStigler, it looks like the default for keepModel
is FALSE
, so both of your versions end up not keeping the model frame.
library(lfe)
#> Loading required package: Matrix
example(felm, echo = FALSE)
est <- felm(y ~ x + x2 | id + firm, keepModel=TRUE)
est_noM <- felm(y ~ x + x2 | id + firm, keepModel=FALSE)
head(est$model, 1)
#> y x x2 id firm
#> 1 -0.7610686 0.5097289 0.06221951 10 3
est_noM$model
#> evalq(model.frame(formula = y ~ x + x2 + id + firm - 1, drop.unused.levels = TRUE),
#> <environment>)
all.equal(est$model, est_noM$model)
#> [1] "Modes: list, call"
#> [2] "Lengths: 5, 3"
#> [3] "names for target but not for current"
#> [4] "Attributes: < Modes: list, NULL >"
#> [5] "Attributes: < Lengths: 3, 0 >"
#> [6] "Attributes: < names for target but not for current >"
#> [7] "Attributes: < current is not list-like >"
#> [8] "current is not list-like"
Hi
For sake of space (I am running super heavy regressions), I would like to return a felm object without the model component. Is this what
keepModel
is intended for? I don't see a difference if I am using with TRUE or FALSE... it seems to return in both cases the same output? Am I doing something wrong?Thanks!
Created on 2018-10-23 by the reprex package (v0.2.1)