[Request] sw equivalent for weights
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
The request centers on sw, feols, and etable in an R example; begin by tracing how feols currently accepts its weights argument and how sw expands specifications. Define the expected behavior for multiple weight sets and verify that the resulting models can be compared by etable; no repository files or tests are named in the issue.
Written by the indexing model from the issue text.
Description
I often need to run the same regression with different sets of weights, and compare results. For example:
df <- tribble(
~country, ~gdp, ~interest_rate, ~population, ~weights,
"Country A", 50000, 3.5, 1000000, 0.1,
"Country B", 80000, 4.2, 5000000, 0.15,
"Country C", 120000, 2.8, 8000000, 0.2,
"Country D", 25000, 5.0, 2000000, 0.05
)
formula = as.formula("gdp ~ interest_rate")
reg1 <- feols(formula, data = df, weights = 1)
reg2 <- feols(formula, data = df, weights = ~population)
reg3 <- feols(formula, data = df, weights = ~weights)
etable(list(reg1, reg2, reg3))
Is it possible to have an equivalent version of the sw function for weights, so that it would be possible to specify a single regression, and run it over different sets of weights?
- Dominant language
- R
- Stars
- 464
- Forks
- 82
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 12
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lrberge/fixest
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
lrberge/fixest#686 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
lrberge/fixest#713 · 1 comment ·
Maintainers usually reply within 1 day
-
etable notes spacingOpen
Difficulty 3/5 Half a day Newbie friendliness 50/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 47/100
lrberge/fixest#689 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
bug dependencies R
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
enhancement needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
JamesHWade/graft#142 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100