Skip to content

Drop deviance and reformat lrtest table#346

Open
andreasnoack wants to merge 1 commit into
masterfrom
an/lrtest
Open

Drop deviance and reformat lrtest table#346
andreasnoack wants to merge 1 commit into
masterfrom
an/lrtest

Conversation

@andreasnoack
Copy link
Copy Markdown
Member

@andreasnoack andreasnoack commented May 1, 2026

Summary

  • Drop the deviance field from LRTestResult and the matching column from the printed table.
  • Reorder/rename remaining columns to LogLik, p (number of parameters), χ², df (Δ degrees of freedom), p(>χ²).
  • Center column headers, mirroring the style on the an/ftest branch of GLM.

Before

Likelihood-ratio test: 3 models fitted on 12 observations
────────────────────────────────────────────────────
     DOF  ΔDOF   LogLik  Deviance   Chisq  p(>Chisq)
────────────────────────────────────────────────────
[1]    1        -8.1503   16.3006
[2]    2     1  -7.9780   15.9559  0.3447     0.5571
[3]    4     2  -7.0286   14.0571  1.8988     0.3870
────────────────────────────────────────────────────

After

Likelihood-ratio test: 3 models fitted on 12 observations
───────────────────────────────────
     LogLik   p    χ²    df  p(>χ²)
───────────────────────────────────
[1]  -8.1503  1
[2]  -7.9780  2  0.3447   1  0.5571
[3]  -7.0286  4  1.8988   2  0.3870
───────────────────────────────────

Test plan

  • Pkg.test() for the lrtest testset passes (73/73)
  • Verify the jldoctest in the lrtest docstring matches the new format on CI

Removes the `Deviance` field from `LRTestResult` and the corresponding
column from the printed table. Renames the remaining columns and uses
χ² instead of `Chisq`, with the order: `LogLik`, `p`, `χ²`, `df`,
`p(>χ²)`. Headers are centered to match the GLM `ftest` style.
@andreasnoack
Copy link
Copy Markdown
Member Author

andreasnoack commented May 1, 2026

I don't think it is common to talk about the residual or model degrees of freedom in a likelihood setting. You usually talk about the number of parameters in the model, here p. The difference in the number of parameters gives the degrees of freedom of the Chisq test statistic (provided testing). In addition, there is not simple relationship between the deviance and the LRT, so I'm removing the column to make the output more concise. Finally, a bit of styling changes. This is a bit related to JuliaStats/GLM.jl#628

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant