JuliaPlots / StatsPlots.jl

Statistical plotting recipes for Plots.jl
Other
437 stars 88 forks source link

Add coefplot and groupedcoefplot for StatisticalModel #491

Open getzze opened 2 years ago

getzze commented 2 years ago

The new dependency is minimal (StatsModels), test dependencies are a bit bigger (CategoricalArrays, DataFrames, GLM). Tested with the gr, pyplot and plotly backends. It was tested and working with GLM.jl, MixedModels.jl and RobustModels.jl models. I don't know other packages that use the StatsModels API.

getzze commented 2 years ago

coefplot (cp1 from tests in runtests.jl) coefplot

groupedcoefplot (slightly different cp5 from tests in runtests.jl) groupedcoefplot

getzze commented 2 years ago

Hi, sorry for the long delay. I had some time so I refactored the code, let me know if it is clearer. The util functions to parse the formula terms are very specific so I didn't comment them fully.

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 71.84% and project coverage change: +11.24 :tada:

Comparison is base (f14f0b0) 26.52% compared to head (115ef3c) 37.77%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #491 +/- ## =========================================== + Coverage 26.52% 37.77% +11.24% =========================================== Files 20 21 +1 Lines 1248 1660 +412 =========================================== + Hits 331 627 +296 - Misses 917 1033 +116 ``` | [Impacted Files](https://app.codecov.io/gh/JuliaPlots/StatsPlots.jl/pull/491?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaPlots) | Coverage Δ | | |---|---|---| | [src/StatsPlots.jl](https://app.codecov.io/gh/JuliaPlots/StatsPlots.jl/pull/491?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaPlots#diff-c3JjL1N0YXRzUGxvdHMuamw=) | `33.33% <ø> (ø)` | | | [src/statsmodels.jl](https://app.codecov.io/gh/JuliaPlots/StatsPlots.jl/pull/491?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaPlots#diff-c3JjL3N0YXRzbW9kZWxzLmps) | `71.84% <71.84%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.