-
Notifications
You must be signed in to change notification settings - Fork 114
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
ftest improvements #337
ftest improvements #337
Conversation
Allow passing models from simpler to more complex, giving equivalent tests but with reversed signs for ΔDOF, ΔSSR and ΔR². Stop printing degrees of freedom, as residual DOF and difference in DOF seems enough. Print two spaces instead of one between columns to make table more readable, and add horizontal lines to match the CoefTable printing. Make struct type stable by filling tuples with an initial NaN entry when needed. Make tests cover more situations by having a model with ΔDOF of 2. Small code improvements.
Cc: @LewisHein |
Codecov Report
@@ Coverage Diff @@
## master #337 +/- ##
==========================================
+ Coverage 68.79% 69.49% +0.69%
==========================================
Files 6 6
Lines 516 531 +15
==========================================
+ Hits 355 369 +14
- Misses 161 162 +1
Continue to review full report at Codecov.
|
src/ftest.jl
Outdated
Model 3 11 2 -1 3.2292 -3.1008 0.0000 0.9603 241.6234 <1e-7 | ||
julia> ftest(nullmodel.model, model.model) | ||
────────────────────────────────────────────────────────────────────── | ||
Res. DOF ΔDOF SSR ΔSSR R² ΔR² F* p(>F) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something to discuss is whether to print the residual degrees of freedom or the consumed degrees of freedom. Other implementations are inconsistent in that regard.
It could make more sense to print the consumed ones, as they give an indication about the complexity of the model, while the residual degrees of freedom reflect the sample size (which is common to all models). It also takes fewer characters in the heading (just "DOF"). Opinions?
Another question is whether we should continue allowing to pass a single model. That doesn't sound terribly useful, and we could eventually do a test against the null model in that case instead (which is what But technically speaking, throwing an error would be breaking. Maybe just print a deprecation warning for now? |
My feeling is that passing a single model doesn't provide a useful test and if you're just doing it to get a convenient printout of the DOF, RSS, etc. statistics that's too punny. So we should deprecate that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good modulo one comment on docstring.
Hi. Pardon me for being thick, but how does one easily get the fstat which is routinely printed out on all R regressions? |
Allow passing models from simpler to more complex, giving equivalent tests but with
reversed signs for ΔDOF, ΔSSR and ΔR².
Stop printing degrees of freedom, as residual DOF and difference in DOF seems enough.
Print two spaces instead of one between columns to make table more readable, and add
horizontal lines to match the
CoefTable
printing.Make struct type stable by filling tuples with an initial NaN entry when needed.
Make tests cover more situations by having a model with ΔDOF of 2.
Small code improvements.
Fixes #275 (Cc: @andreasnoack)