Feature request: Implementing `fitstat` for `fixest_multi`
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
Research direction
Start by reading the existing fitstat behavior and the fixest_multi methods for coef, confint, coeftable, and models. Reproduce the issue's feols split example, compare fitstat(m, "f", simplify = TRUE) with the manual lapply and rbind workflow, and make the built-in result provide per-model statistics aligned with models(m).
Written by the indexing model from the issue text.
Description
It seems to me that it would be useful to be able to call fitstat on fixest_multi objects, and get a data frame with the statistics for each model. This would be analogous to/consistent with how coef, confint, coeftable, etc. currently behave. I imagine it looking something like this:
library(fixest)
m <- feols(Sepal.Length ~ Sepal.Width, iris, split = ~Species)
fitstat(m, "f", simplify = TRUE)
#> id sample.var sample stat p df1 df2
#> 1 1 Species setosa 58.99373 6.709843e-10 1 48
#> 2 2 Species versicolor 18.35169 8.771860e-05 1 48
#> 3 3 Species virginica 12.68707 8.434625e-04 1 48
We could also produce this output manually like this:
model_stats <- m |>
lapply(fitstat, "f", simplify = TRUE) |>
lapply(as.data.frame) |>
do.call(rbind, args = _)
rownames(model_stats) <- NULL
cbind(models(m), model_stats)
But this relies on some assumptions about the internals of fixest_multi (specifically that lapply(m) lists the models in the same order as models(m)), which made me feel a bit uneasy. And it would of course be nice to have this built in 😁
- 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