statsmodels icon indicating copy to clipboard operation
statsmodels copied to clipboard

ENH: Functions for summarizing multiple model fitting results.

Open toshiakiasakura opened this issue 3 years ago • 5 comments
trafficstars

  • [ ] closes (None)
  • [ ] tests (not tested)
  • [x] code/documentation is well formatted.
  • [x] properly formatted commit message. See NumPy's guide.

Although there is a question about how to handle multiple summaries with summary_col. Python: Do not show dummies in statsmodels summary

However, I thought more featured functions to achieve easy functions of handling with multiple fitting results were needed, and I tried to implement simple one with just horizontal concatenations, and one version which lets a mosaic variable to control layout of outputs.

See the link below for practical usage. https://github.com/toshiakiasakura/statsmodels/blob/summary_multi/examples/notebooks/summary_multi_usage.ipynb

If there is a further suggestion, improvement or need to open a issue, please tell me.

toshiakiasakura avatar Jun 23 '22 14:06 toshiakiasakura

Hello @toshiakiasakura! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers:

Comment last updated at 2022-06-29 11:01:43 UTC

pep8speaks avatar Jun 23 '22 14:06 pep8speaks

@toshiakiasakura
Thanks for the PR

I might not get around looking at this very soon. I'm setting up a new notebook with dev environment and I will soon go on vacation and travelling. (I'm trying to get Window 11 to behave like my old Windows 7 or 8)

josef-pkt avatar Jun 24 '22 00:06 josef-pkt

Currently, I'm working on your code reviews, and I happened to remember to ask you how to add attributes... Whan I run the following code, I obtain the result as below.

import statsmodels.api as sm
import statsmodels.formula.api as smf
df = sm.datasets.anes96.load_pandas().data
res1 = smf.glm(formula="vote ~ logpopul" ,data=df, family = sm.families.Binomial()).fit()
res2 = sm.add_params_summary(res1)
print(res2.params_summary.to_string())
               coef   std err         t         P>|t|    [0.025    0.975]                      str
Intercept -0.073026  0.083061 -0.879178  3.793048e-01 -0.235823  0.089772   -0.073 (-0.236, 0.090)
logpopul  -0.110967  0.021216 -5.230224  1.693043e-07 -0.152550 -0.069383  -0.111 (-0.153, -0.069)

However, when I run dir(res2), .params_summary does not appear. I want to let .params_summary can be found from dir method. I can not figure out which should be modified.

toshiakiasakura avatar Jun 29 '22 09:06 toshiakiasakura

I'm sorry to rush you, but what's going on for this pull request?
Are there some problems, or should I improve my pull request?

toshiakiasakura avatar Aug 08 '22 07:08 toshiakiasakura

I just came back from my vacation and travelling. I will try to look at it during the next few days.

API decisions are difficult and I need to try this out to see how it works.

josef-pkt avatar Aug 08 '22 11:08 josef-pkt

These look like very useful functions, thanks for this PR!

EwoutH avatar Dec 06 '22 09:12 EwoutH