From 675133d367c6de9355f256c0430590e5251e32a8 Mon Sep 17 00:00:00 2001 From: Dominique Makowski Date: Thu, 10 Jun 2021 18:16:39 +0800 Subject: [PATCH] #120 --- R/visualisation_recipe.estimate_predicted.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/R/visualisation_recipe.estimate_predicted.R b/R/visualisation_recipe.estimate_predicted.R index 2f827cd9c..16d1753a6 100644 --- a/R/visualisation_recipe.estimate_predicted.R +++ b/R/visualisation_recipe.estimate_predicted.R @@ -168,7 +168,11 @@ visualisation_recipe.estimate_predicted <- function(x, if (insight::model_info(info$model)$is_binomial && show_data %in% c("point", "points")) { shape <- "|" stroke <- 1 - # TODO: adjust in the case of non 0-1 rawdata[[y]] + + # Change scale to 1-2 in case outcome is factor (see #120) + if(!all(unique(rawdata[[y]]) %in% c(0, 1))) { + data[c("Predicted", "CI_low", "CI_high")] <- data[c("Predicted", "CI_low", "CI_high")] + 1 + } } for (i in show_data) {