`as(ests, "fixest_multi")`

Open
#617 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
r
Domain
data

Research direction

Start by reproducing the shown R example with a list of fixest objects and the existing fixest_multi class, then inspect the current coercion and printing entry points. Done means an as(ests, "fixest_multi") path supports mapped fixest objects and produces the demonstrated combined output without relying on manual class assignment.

Written by the indexing model from the issue text.

Description

Just a thought, is it worth exposing a as(ests, "fixest_multi") function?

Adding "fixest_multi" to the class of a list of ests works (in the cases I've tried), but I'm not sure if I'm missing anything weird? Just an idea since I often times will do a map() that returns fixest objects and it'd be nice to have them all print out nicely

library(fixest)
ests <- list(
  feols(mpg ~ hp, mtcars),
  feols(mpg ~ hp + i(cyl), mtcars)
)
class(ests) <- c("fixest_multi", "list")
ests
#>                                 x.1              x.2
#> Dependent Var.:                 mpg              mpg
#>                                                     
#> Constant           30.10*** (1.634) 28.65*** (1.588)
#> hp              -0.0682*** (0.0101) -0.0240 (0.0154)
#> cyl = 6                             -5.968** (1.639)
#> cyl = 8                             -8.521** (2.326)
#> _______________ ___________________ ________________
#> S.E. type                       IID              IID
#> Observations                     32               32
#> R2                          0.60244          0.75386
#> Adj. R2                     0.58919          0.72749
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lrberge/fixest

All issues in lrberge/fixest

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.