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

Multiple Functions require lists of Feols/Feiv/Fepois object; reject FixestMulti #693

Closed
s3alfisc opened this issue Nov 3, 2024 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@s3alfisc
Copy link
Member

s3alfisc commented Nov 3, 2024

Currently, pf.bonferroni(), pf.rwolf(), pf.coefplot(), pf.iplot() all require an input type list[Union[Feols, Feiv, Fepois]]. If a FixestMulti object is provided, the functions will return an error:

import pyfixest as pf

data = pf.get_data()
fit = pf.feols("Y + Y2 ~ X1", data = data)

#pf.bonferroni(fit, param = "X1")
#                The models argument must be either a list of Feols or Fepois instances, or
#                simply a single Feols or Fepois instance. The models argument does not accept instances
#                of type FixestMulti - please use models.to_list() to convert the FixestMulti
#                instance to a list of Feols or Fepois instances.

pf.bonferroni(fit.to_list(), param = "X1")
# runs without error

It would be nice to internally convert FixestMulti objects to lists by calling the to_list() method internally.

@s3alfisc s3alfisc added enhancement New feature or request good first issue Good for newcomers labels Nov 3, 2024
@s3alfisc s3alfisc changed the title Multiple Testing function and pf.coefplot require lists of Feols/Feiv/Fepois object Multiple Functions require lists of Feols/Feiv/Fepois object; reject FixestMulti Nov 3, 2024
s3alfisc added a commit that referenced this issue Nov 17, 2024
…FixestMulti #693 (#715)

* Issue # 693 functions that reject FixestMulti

Convert FixestMulti to a list so that it works automatically with the following functions:
- pf.bonferroni()
-  pf.rwolf()
- pf.coefplot()
- pf.iplot()

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* updates

* Update test_multcomp.py

Added a test to compare the results when passing a list of Feols/Feiv/Fepois objects vs. a FixestMulti object to bonferroni and rwolf functions.

* Update pixi.lock

pixi.lock file was updated

* Update test_multcomp.py

Minor changes for consistency

* Update summarize.py

handle .coefplot() method for FixestMulti, where models is a dict_values instance.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Alexander Fischer <alexander-fischer1801@t-online.de>
Co-authored-by: Hegde <ihegde@Compasslexecon.com>
@s3alfisc
Copy link
Member Author

s3alfisc commented Dec 1, 2024

Can be closed thanks to @IshwaraHegde97's PR.

@s3alfisc s3alfisc closed this as completed Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant