sgaure / lfe

Source code repository for the R package lfe on CRAN.
53 stars 18 forks source link

confint() won't work for multi-response, or cannot pass type #16

Closed MatthieuStigler closed 5 years ago

MatthieuStigler commented 5 years ago

Hi

It would be good to have a specific confint.felm method:

  1. confint currently fails if multi-response: confint.default won't allow to pass argument lhs to vcov?
  2. cannot pass the robust/type argument to confint? confint.default won't allow to pass argument type to vcov?

Example of both issues:

library(lfe)
#> Loading required package: Matrix
packageVersion("lfe")
#> [1] '2.8.3'

example(felm, echo = FALSE)
y2 <- 0.1*x + 0.5*x2 + id.eff[id] + firm.eff[firm] + u

est_multi <- felm(y+y2 ~ x+x2| id + firm)

## first issue: multi reaponse won't work
confint(est_multi)
#> Error in vcov.felm(object): Please specify which lhs to retrieve vcov for with vcov(...,lhs=[one of y,y2])
confint(est_multi, lhs = "y")
#> Error in vcov.felm(object): Please specify which lhs to retrieve vcov for with vcov(...,lhs=[one of y,y2])

## second issue: cannot pass type
all.equal(confint(est, type = "robust"), confint(est, type = "iid"))
#> [1] TRUE
MatthieuStigler commented 5 years ago

Pull request https://github.com/sgaure/lfe/pull/17 suggests fix

MatthieuStigler commented 5 years ago

Fixed by Pull request #17