You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In addition to 1, the results for polr objects are different from the source method even when type of prediction is probs.
# modelpolr_mod<- polr(Sat~Infl+Type+Cont, weights=Freq, data=housing)
# predicting class labels with `stats` (works as expected)stats::predict(polr_mod, newdata=housing, type="probs") %>%
tibble::as_tibble(.)
#> # A tibble: 72 x 3#> Low Medium High#> <dbl> <dbl> <dbl>#> 1 0.378 0.288 0.334#> 2 0.378 0.288 0.334#> 3 0.378 0.288 0.334#> 4 0.257 0.274 0.469#> 5 0.257 0.274 0.469#> 6 0.257 0.274 0.469#> 7 0.144 0.211 0.645#> 8 0.144 0.211 0.645#> 9 0.144 0.211 0.645#> 10 0.519 0.261 0.220#> # ... with 62 more rowsstats::predict(polr_mod, newdata=housing, type="class") %>%
tibble::as_tibble(.)
#> Warning: Calling `as_tibble()` on a vector is discouraged, because the behavior is likely to change in the future. Use `enframe(name = NULL)` instead.#> This warning is displayed once per session.#> # A tibble: 72 x 1#> value#> <fct>#> 1 Low #> 2 Low #> 3 Low #> 4 High #> 5 High #> 6 High #> 7 High #> 8 High #> 9 High #> 10 Low #> # ... with 62 more rows# predicting class labels with `broom`broom::augment(polr_mod, type.predict="probs")
#> # A tibble: 72 x 6#> Sat Infl Type Cont X.weights. .fitted#> <ord> <fct> <fct> <fct> <int> <dbl>#> 1 Low Low Tower Low 21 1#> 2 Medium Low Tower Low 21 1#> 3 High Low Tower Low 28 1#> 4 Low Medium Tower Low 34 3#> 5 Medium Medium Tower Low 22 3#> 6 High Medium Tower Low 36 3#> 7 Low High Tower Low 10 3#> 8 Medium High Tower Low 11 3#> 9 High High Tower Low 36 3#> 10 Low Low Apartment Low 61 1#> # ... with 62 more rowsbroom::augment(polr_mod, type.predict="class")
#> # A tibble: 72 x 6#> Sat Infl Type Cont X.weights. .fitted#> <ord> <fct> <fct> <fct> <int> <dbl>#> 1 Low Low Tower Low 21 1#> 2 Medium Low Tower Low 21 1#> 3 High Low Tower Low 28 1#> 4 Low Medium Tower Low 34 3#> 5 Medium Medium Tower Low 22 3#> 6 High Medium Tower Low 36 3#> 7 Low High Tower Low 10 3#> 8 Medium High Tower Low 11 3#> 9 High High Tower Low 36 3#> 10 Low Low Apartment Low 61 1#> # ... with 62 more rows
Created on 2019-03-03 by the reprex package (v0.2.1.9000)
The text was updated successfully, but these errors were encountered:
alexpghayes
changed the title
augment methods for ordinal logistic regression models are not working properly
augment.clm() does not respect type.predict argument
Mar 5, 2019
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.
A couple of issues here-
type.predict
is specified, theaugment
method always returns predicted class probabilties.polr
objects are different from the source method even when type of prediction isprobs
.Created on 2019-03-03 by the reprex package (v0.2.1.9000)
The text was updated successfully, but these errors were encountered: