easystats / see

:art: Visualisation toolbox for beautiful and publication-ready figures
https://easystats.github.io/see/
Other
882 stars 43 forks source link

clarifying docs on how to further modify plots from `binned_residuals` #91

Open IndrajeetPatil opened 3 years ago

IndrajeetPatil commented 3 years ago

The doc states:

Screenshot 2021-03-08 at 20 37 15

But this does not work.

plot

library(performance)
library(see)

# creating a model
model <- glm(vs ~ wt + mpg, data = mtcars, family = "binomial")

# doing what docs say
plot(binned_residuals(model)) + see::scale_color_pizza()
#> Warning: Probably bad model fit. Only about 50% of the residuals are inside the error bounds.

#> NULL

Created on 2021-03-08 by the reprex package (v1.0.0)

print

library(performance)
library(see)

# creating a model
model <- glm(vs ~ wt + mpg, data = mtcars, family = "binomial")

# doing what docs say
print(binned_residuals(model)) + see::scale_color_pizza()
#> Warning: Probably bad model fit. Only about 50% of the residuals are inside the error bounds.
#> Warning: Incompatible methods ("Ops.data.frame", "+.gg") for "+"
#> Error in print(binned_residuals(model)) + see::scale_color_pizza(): non-numeric argument to binary operator

Created on 2021-03-08 by the reprex package (v1.0.0)

DominiqueMakowski commented 3 years ago

I think this is @strengejacke's implementation