easystats / performance

:muscle: Models' quality and performance metrics (R2, ICC, LOO, AIC, BF, ...)
https://easystats.github.io/performance/
GNU General Public License v3.0
1.01k stars 87 forks source link

multiple R instead of R2 #371

Open bwiernik opened 2 years ago

bwiernik commented 2 years ago

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.

mattansb commented 2 years ago

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.

DominiqueMakowski commented 2 years ago

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

bwiernik commented 2 years ago

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

strengejacke commented 2 years ago

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