Skip to content

Commit

Permalink
fix print polr
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Dec 15, 2024
1 parent eff54e5 commit 1fb5413
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: parameters
Title: Processing of Model Parameters
Version: 0.24.0.3
Version: 0.24.0.4
Authors@R:
c(person(given = "Daniel",
family = "Lüdecke",
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
* Fixed issues due to breaking changes in the latest release of the *datawizard*
package.

* Fixed issue with wrong column-header in printed output of `model_parameters()`
for `MASS::polr()` models with probit-link.

# parameters 0.24.0

## Breaking Changes
Expand Down
2 changes: 1 addition & 1 deletion R/utils_model_parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@
"Coefficient"
)
}
} else if (!is.null(info) && info$family != "unknown") {
} else if (!is.null(info) && info$family != "unknown" && !info$is_probit) {
if (isTRUE(exponentiate)) {
if (info$is_exponential && identical(info$link_function, "log")) {
coef_col <- "Prevalence Ratio"
Expand Down
12 changes: 12 additions & 0 deletions tests/testthat/test-polr.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
skip_if_not_installed("MASS")
skip_on_cran()

test_that("robust-se polr", {
data(housing, package = "MASS")
m <- MASS::polr(Sat ~ Infl + Type + Cont, weights = Freq, data = housing)
out <- model_parameters(m)
expect_identical(attributes(out)$coefficient_name, "Log-Odds")
m <- MASS::polr(Sat ~ Infl + Type + Cont, weights = Freq, data = housing, method = "probit")
out <- model_parameters(m)
expect_identical(attributes(out)$coefficient_name, "Coefficient")
})

0 comments on commit 1fb5413

Please sign in to comment.