Skip to content

Commit 1fb5413

Browse files
committed
fix print polr
1 parent eff54e5 commit 1fb5413

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: parameters
33
Title: Processing of Model Parameters
4-
Version: 0.24.0.3
4+
Version: 0.24.0.4
55
Authors@R:
66
c(person(given = "Daniel",
77
family = "Lüdecke",

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
* Fixed issues due to breaking changes in the latest release of the *datawizard*
88
package.
99

10+
* Fixed issue with wrong column-header in printed output of `model_parameters()`
11+
for `MASS::polr()` models with probit-link.
12+
1013
# parameters 0.24.0
1114

1215
## Breaking Changes

R/utils_model_parameters.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@
257257
"Coefficient"
258258
)
259259
}
260-
} else if (!is.null(info) && info$family != "unknown") {
260+
} else if (!is.null(info) && info$family != "unknown" && !info$is_probit) {
261261
if (isTRUE(exponentiate)) {
262262
if (info$is_exponential && identical(info$link_function, "log")) {
263263
coef_col <- "Prevalence Ratio"

tests/testthat/test-polr.R

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
skip_if_not_installed("MASS")
2+
skip_on_cran()
3+
4+
test_that("robust-se polr", {
5+
data(housing, package = "MASS")
6+
m <- MASS::polr(Sat ~ Infl + Type + Cont, weights = Freq, data = housing)
7+
out <- model_parameters(m)
8+
expect_identical(attributes(out)$coefficient_name, "Log-Odds")
9+
m <- MASS::polr(Sat ~ Infl + Type + Cont, weights = Freq, data = housing, method = "probit")
10+
out <- model_parameters(m)
11+
expect_identical(attributes(out)$coefficient_name, "Coefficient")
12+
})

0 commit comments

Comments
 (0)