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

Implementing Cohen's Dz for paired sample T-Test #450

Open
PibeChorro opened this issue Nov 28, 2024 · 5 comments
Open

Implementing Cohen's Dz for paired sample T-Test #450

PibeChorro opened this issue Nov 28, 2024 · 5 comments
Assignees
Labels
feature request 🚧 New feature or request

Comments

@PibeChorro
Copy link

Hallo Raphael,
first of - thanks for providing this great library.

I was wondering if you could implement the Cohen's Dz for paired samples. There are already some (closed) issues that your calculation of Cohen's D differs from other packages or from R and that you have good reasons to use the formula you are using.
But since Cohen's Dz is simply calculated by

T/sqrt(N)
or
X_diff.mean() / X_diff.std()

and is also the one often reported (at least in my field) and also the one you find when looking for effect sized on Wikipedia, I would really appreciate it.

Best
Vincent

@raphaelvallat raphaelvallat added the feature request 🚧 New feature or request label Dec 6, 2024
@raphaelvallat raphaelvallat self-assigned this Dec 6, 2024
@raphaelvallat
Copy link
Owner

Hi Vincent,

Thanks for opening the issue. While it is straightforward to add the Cohen Dz to the low-level compute_effsize function, there's some work in making that new metric available in higher-level functions such as pairwise_tests.

I think we would need to expose a new keyword-argument to all impacted functions, e.g.

pairwise_test(..., paired_cohen_type="avg")
pairwise_test(..., paired_cohen_type="dz")

Alternatively, we could define this as a global option.

Curious to hear what you and other thinks here.

Best
Raphael

@PibeChorro
Copy link
Author

Hey Raphael,

... there's some work in making that new metric available in higher-level functions ...

yeah that makes sense. I don't have a good overview of your project nor am I a good coder, so I don't wanna make assumptions about the best solution. However, it seems counterintuitive to me to have a paired_cohen_type argument, when a user chooses a different effect size, e.g., Hedge's g ...

Generally, to me it seems that Cohen's Dz is better known than Cohen's D_avg and I would go for dz as the standard.

In the end it's your choice.

Best, Vincent

@remrama
Copy link
Contributor

remrama commented Dec 10, 2024

Would it be okay to just add something like cohen_z to the low-level compute_effsize? Then users could pass that into the effsize argument in pairwise_test and related functions, so both Cohen's are available (separately) and other effect sizes as well. Maybe if there is concern about users requesting inappropriate effect sizes given a certain stat, a warning could be raised.

@PibeChorro
Copy link
Author

Yes I think that would be a great solution

@raphaelvallat
Copy link
Owner

Agreed, @remrama!

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

No branches or pull requests

3 participants