Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: evaluate weights possibly from data #21

Open
MatthieuStigler opened this issue Aug 1, 2019 · 0 comments
Open

feature request: evaluate weights possibly from data #21

MatthieuStigler opened this issue Aug 1, 2019 · 0 comments

Comments

@MatthieuStigler
Copy link
Contributor

Hi

It would be great if argument weights could also be evaluated from the environment of data, not only GLobal Environment, like lm does?

Thanks!

library(lfe)
#> Loading required package: Matrix

lm(freeny.y~lag.quarterly.revenue +price.index, data = freeny, weights = income.level)
#> 
#> Call:
#> lm(formula = freeny.y ~ lag.quarterly.revenue + price.index, 
#>     data = freeny, weights = income.level)
#> 
#> Coefficients:
#>           (Intercept)  lag.quarterly.revenue            price.index  
#>                2.1230                 0.8942                -0.2480
felm(freeny.y~lag.quarterly.revenue +price.index, data = freeny, weights = freeny$income.level)
#>           (Intercept) lag.quarterly.revenue           price.index 
#>                2.1230                0.8942               -0.2480
felm(freeny.y~lag.quarterly.revenue +price.index, data = freeny, weights = income.level)
#> Error in eval(mf[[wpos]], pf): object 'income.level' not found

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant