Closed mattansb closed 1 year ago
@strengejacke Should we change the default plot type to type = "qq"
?
@strengejacke Should we change the default plot type to
type = "qq"
?
I think we had a reason to default to "pp"
(though it was more like a choice of personal preference). For check_model()
, we default to qq anyway. So, yes, maybe we can change the default plot type. But this needs to be done in performance?
I changed the default to "qq"
here as suggested. I also updated the detrend
argument to be TRUE
by default when qqplotr is installed; detrending is generally recommended because it makes it easier to compare distances from the line in the tails.
I'll open a similar PR in performance.
I'm good with the PR now. Ready to merge?
Yes, I think so. Not sure there is anything to update in performance though.
Actually, we can also detrend without qqplotr. I'll make a commit.
Okay, detrend now works without qqplotr:
m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars)
result <- performance::check_normality(m)
plot(result)
#> For confidence bands, please install `qqplotr`.
Created on 2023-07-23 with reprex v2.0.2
(And also with)
m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars)
result <- performance::check_normality(m)
plot(result)
Created on 2023-07-23 with reprex v2.0.2
Perfect! Can you change the PR on performance linked above to have detrend = TRUE on check_model?
Done!
Can this be merged?
Yep
hm, this code line
ggplot2::aes(y = ggplot2::after_stat("sample") - ggplot2::after_stat("theoretical"))
worked on one computer, but not on the other one and tests also fail. The line was
ggplot2::aes(y = ggplot2::after_stat(sample) - ggplot2::after_stat(theoretical))
(i.e. no quotes), but this gave the "undefined global vars" issue. Any idea how to handle this?
after_stat(.data$sample)
, etc
I think we do already, but if not, we also need to import .data
from rlang or ggplot2
I think we can't use the data pronoun here, because sample
and theoretical
refer to functions, not variables. But adding ..
worked: ..sample..
.
They aren't functions, they are columns of the data frame returned after by stat function. The ..sample..
syntax is deprecated and shouldn't be used.
Closes https://github.com/easystats/performance/issues/599
@bwiernik Should this be the new default qq/pp-band method?
Note that currently the default plot is a density plot.... I would rather it be a qq-plot, don't you think?
Old qq-plot
qq-plots with the new
"ell"
defaultpp-plots with the new
"ell"
defaultCreated on 2023-07-20 with reprex v2.0.2