sgaure / lfe

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

setting `weights = NULL` errors #12

Open ghost opened 5 years ago

ghost commented 5 years ago

Setting the argument weights explicitly to NULL errors with

   # Error in sqrt(weights) : non-numeric argument to mathematical function

My reading of the man page is that this should not error (also, NULL is mentioned there as the functions default).

Example (building upon the example from the man page):

felm(y ~ x+x2| id + firm, weights = NULL)
MatthieuStigler commented 5 years ago

Mmh interesting, I don't get this with your code (maybe because I'm using the github dev version?)

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

example(felm, echo=FALSE)
felm(y ~ x+x2| id + firm, weights = NULL)
#>       x      x2 
#> -0.4606  0.5819

Created on 2019-08-01 by the reprex package (v0.3.0)