Skip to content

Commit

Permalink
https://github.com/easystats/modelbased/issues/120
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jun 15, 2021
1 parent cfba4a9 commit f8ee53e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
numeric predictors, which only allow to predict for values that are actually
present in the data.

## Bug fixes

* Fixed issue with adding raw data points for plots from logistic regression
models, when the response variable was no factor with numeric levels.

# ggeffects 1.1.0

## New supported models
Expand Down
8 changes: 7 additions & 1 deletion R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -881,8 +881,14 @@ plot.ggalleffects <- function(x,
# dots / lines for marginal effects

if (!is.null(rawdat)) {
# recode binary response to numeric? if so, make sure it starts with 0
if (identical(attributes(x)$logistic, "1")) {
lowest <- 0
} else {
lowest <- NULL
}
# make sure response is numeric
rawdat$response <- .factor_to_numeric(rawdat$response)
rawdat$response <- .factor_to_numeric(rawdat$response, lowest = lowest)

# check if we have a group-variable with at least two groups
if (.obj_has_name(rawdat, "group")) {
Expand Down

0 comments on commit f8ee53e

Please sign in to comment.