Skip to content

Commit

Permalink
Print chi-squared p values with knitr for summ.glm
Browse files Browse the repository at this point in the history
Closes #138
  • Loading branch information
jacob-long committed Jul 31, 2024
1 parent 9a69afe commit 7374755
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# jtools 2.2.3.9999

Bug fix:
Bug fixes:
* `predict_merMod()` was miscalculating predictions under a specific set of
conditions: When the model was fit with `lme4::glmer()`, the link was not
identity, standard errors were simultaneously being calculated, and the
user included random effects. This error has been corrected
([#144](https://github.com/jacob-long/jtools/issues/144))
* When printing `summ.glm()` results with `knitr`, the *p* value for the
omnibus chi-squared test is now included in the model statistics, like it
already is when using the function in the console. ([#138](https://github.com/jacob-long/jtools/issues/138)

Enhancement:

Expand Down
2 changes: 2 additions & 0 deletions R/summ.R
Original file line number Diff line number Diff line change
Expand Up @@ -964,10 +964,12 @@ knit_print.summ.glm <- function(x, options = NULL, ...) {
chi <- "chi\u00B2("
}
stats <- data.frame(stat = c(paste0(chi, x$chisq$df, ")"),
"p",
"Pseudo-R\u00B2 (Cragg-Uhler)",
"Pseudo-R\u00B2 (McFadden)",
"AIC", "BIC"),
value = c(num_print(x$chisq$chi, x$digits),
num_print(x$chisq$p, x$digits),
num_print(x$rsq, digits = x$digits),
num_print(x$rsqmc, digits = x$digits),
num_print(x$aic, x$digits),
Expand Down

0 comments on commit 7374755

Please sign in to comment.