performance icon indicating copy to clipboard operation
performance copied to clipboard

multiple R instead of R2

Open bwiernik opened this issue 2 years ago • 4 comments

I'd like to have a method to transform R2 indices into multiple correlations (R).

I am thinking a an S3 method for sqrt() that transforms appropriate columns might be good.

m <- lm(mpg ~ disp * hp, data = mtcars)
p <- performance::performance(p)
sqrt.performance_model <- function(x) {
    x |> mutate(R2 = sqrt(R2), R2_adjusted = sqrt(R2_adjusted)) |> rename(R = R2, R_adjusted = R2_adjusted)
}
sqrt(p)

What do you think @strengejacke @mattansb @DominiqueMakowski ? This could also be applied in effectsize.

bwiernik avatar Oct 04 '21 23:10 bwiernik

This can be added as a column always / show up in the print method, maybe?

Similar to how tolerance shows up in the VIF print.

mattansb avatar Oct 05 '21 03:10 mattansb

This can be added as a column always / show up in the print method

I'm not sure it's necessary to clutter the printing with this as it's not a critical info is it? So I'd say a method sounds good

DominiqueMakowski avatar Oct 05 '21 03:10 DominiqueMakowski

In most cases, I would expect a user to want one or the other

bwiernik avatar Oct 05 '21 07:10 bwiernik

Does sqrt.performance_model() makes sense, if it only applies to R2? Why not sqrt.r2_class()?

strengejacke avatar Oct 21 '21 09:10 strengejacke