rikhuijzer / PowerAnalyses.jl

Statistical power analyses in Julia
https://poweranalyses.jl.huijzer.xyz
MIT License
16 stars 1 forks source link

HypothesisTests #19

Open jverzani opened 1 year ago

jverzani commented 1 year ago

Is there a reason that the HypothesisTests package isn't a dependency, so that its similarly named types (e.g., OneSampleTTest) could be used in the same session more easily? That package pulls in a few more things than PowerAnalyses, but it seems modest (maybe just Combinatorics)?

I could try working out a PR if you weren't opposed to the modification.

rikhuijzer commented 1 year ago

I have thought about it and it was just not worth the downsides in my opinion. HypothesisTests depends on StatsBase and that one is quite heavy (https://github.com/JuliaStats/StatsBase.jl/blob/master/Project.toml). As a pro-argument there is the more easy interface, but then again I think few people in practice require easy switching between the power analysis and the hypothesis test. When seeing a statistics project as a whole, the time spent on matching the right test to the right power analysis is probably around 0.000001%. Let me know if you know practical reasons where a match would be useful.

jverzani commented 1 year ago

Thanks for the explanation. I see it isn't a problem in general and my use is atypical (drafting some notes).

ararslan commented 3 months ago

I was about to open this same issue. đŸ˜„

If the argument against using HypothesisTests is that it uses StatsBase internally and StatsBase is a heavy dependency, note that this package is already using Distributions, which is even heavier and already uses StatsBase. That means StatsBase is already loaded when this package is loaded. @time_imports using PowerAnalyses shows StatsBase just under 7ms with Distributions at nearly 50ms. I tried adding HypothesisTests to the environment locally and it adds less than 2ms. So if you're worried about load time, HypothesisTests won't really affect it.

Let me know if you know practical reasons where a match would be useful.

To me, it's consistency: with a unified API, a test is called one thing, whether you're planning it (this package) or conducting it (HypothesisTests). Statistics projects can also end up as a series of scripts in a common environment, which makes the differing interfaces confusing and can easily lead to situations like what (I assume) motivated this issue.

rikhuijzer commented 3 months ago

Fair enough @ararslan. The biggest question I have though is whether you have an actual (recurrent) use for power analyses in Julia? This package could use some work but I suspect most people just want a pretty GUI like G*Power. Me and Jose have worked a bit on that at https://poweranalyses.org/ (Running poweranalyses in WebAssembly over there), but I have lost interest due to me not believing much in power analyses. I suspect that most of today's users of power analyses can and should move over to cross-validation and a more prediction-based mindset.

So anyway please let me know whether you have a recurrent use for this package.

ararslan commented 3 months ago

Power analyses are a standard part of clinical trial design, particularly in the determination of sample size. The advantage of having it in code as opposed to a GUI is that it can be more easily reviewed and saved alongside other project-specific code. I could see significant recurring use from that perspective.

If you don't have interest in continued maintenance/development of this package (which would be understandable—I personally have many such projects), I could try to help out.

rikhuijzer commented 3 months ago

Power analyses are a standard part of clinical trial design, particularly in the determination of sample size. The advantage of having it in code as opposed to a GUI is that it can be more easily reviewed and saved alongside other project-specific code. I could see significant recurring use from that perspective.

Fair enough.

If you don't have interest in continued maintenance/development of this package (which would be understandable—I personally have many such projects), I could try to help out.

Currently not no especially since I should finish my PhD instead of doing this kind of development đŸ˜‹

Invited you as a collaborator on the repo!

ararslan commented 3 months ago

Currently not no especially since I should finish my PhD instead of doing this kind of development đŸ˜‹

Procrastinating on one's degree by working on Julia is a tale as old as time. Best of luck!

Invited you as a collaborator on the repo!

Nice, thank you! Are there any specific contribution guidelines you have for your repositories?

rikhuijzer commented 3 months ago

Procrastinating on one's degree by working on Julia is a tale as old as time. Best of luck!

Haha thanks Alex! :)

Nice, thank you! Are there any specific contribution guidelines you have for your repositories?

With your background, I think you're more likely to make the "right" decisions than me, so no I don't have specific guidelines