Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functionality to compare coefficiants #264

Open
mattansb opened this issue Sep 15, 2022 · 1 comment
Open

Add functionality to compare coefficiants #264

mattansb opened this issue Sep 15, 2022 · 1 comment
Labels
feature idea 🔥 New feature or request

Comments

@mattansb
Copy link
Member

See https://rdrr.io/cran/psych/man/r.test.html

Would be nice to have an easystats version of this.

Here are some mockups:

Independent correlations

Interface 1: pass a grouped data frames

mtcars |> 
  dplyr::group_by(am) |> 
  compare_correlations(select = c("mpg", "hp", "drat"))
#> # Differences between independant Pearson correlations
#> 
#> Group | Parameter1 | Parameter2 |    r1 |    r2 |  diff |         95% CI |     z |       p
#> -------------------------------------------------------------------------------------------
#> 0 - 1 |        mpg |         hp | -0.83 | -0.13 | -0.71 | [-0.93, -0.61] | -6.17 | < .001***
#> 0 - 1 |        mpg |       drat |  0.47 |  0.50 | -0.03 | [ 0.02,  0.76] |  2.19 | 0.086    
#> 0 - 1 |         hp |       drat | -0.34 | -0.01 | -0.34 | [-0.69,  0.13] | -1.50 | 0.151    
#> 

Interface 2: name variables

compare_correlations(mtcars, select = c("mpg", "hp", "drat"), group = "am")

Dependent correlations

Not sure...

Effect size

Differences between correlations are already pretty standardized... but there is also the difference between Fished z-transformed correlations, which is called Cohen's q.

@IndrajeetPatil IndrajeetPatil added the feature idea 🔥 New feature or request label Sep 15, 2022
@DominiqueMakowski
Copy link
Member

DominiqueMakowski commented Sep 15, 2022

that'd be very nice indeed!

in terms of API, perhaps we could include an argument by_group to correlation(), which would take a column or a vector?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature idea 🔥 New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants