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

OneSampleTTest - Adding Changable Confidence Interval, tail direction, and alpha level. #228

Open
HiramTheHero opened this issue Apr 1, 2021 · 4 comments

Comments

@HiramTheHero
Copy link

Is there a specific reason as to why the Confidence Interval, tail direction, and alpha level can't be changed in the OneSampleTTest?

From what I've been seeing, it looks like it just wasn't implemented in t.jl and HypothesisTests.jl. I was thinking about implementing this feature but I just want to make sure that there isn't some other, unbeknownst to me, reason as to why this hasn't been done.

@nalimilan
Copy link
Member

They can be changed AFAICT:

pvalue(x::TTest; tail=:both) = pvalue(TDist(x.df), x.t; tail=tail)
default_tail(test::TTest) = :both
# confidence interval by inversion
function StatsBase.confint(x::TTest; level::Float64=0.95, tail=:both)
Maybe just a documentation issue?

@KronosTheLate
Copy link

I think @HiramTheHero means in the constructor, e.g. OneSampleTTest(my_data, my_μ0; α=0.01, tail=:left). I want to add a HUGE +1 to this suggestion. This would also make the seperate function pvalue and confint redundant AFAICT, reducing the complexity of the package, and allowing the pretty output with custum tail and aplha level.

@nalimilan
Copy link
Member

If that's the case then better file another issue with isn't specific to t-test. But note that this would change the design significantly, as currently test objects don't store confidence intervals nor p-values.

@KronosTheLate
Copy link

KronosTheLate commented Nov 12, 2022

I have cooked up an experimental redo for HypothesisTests.jl, which closer that what I would have liked the interface and internals to be like (obviously). It is quite opininated, but I just wanted to play around with what was possible as there are (clearly) several things I would do different in designing the package. As mentioned in the readme, the propose of the package is to have any good ideas stolen and ported into this package. Play around with it or read the readme, and let me know if you see anything that would be nice to have. I will probably make a dedicated issue for that package depending on the little feeling I get for the response here.

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

No branches or pull requests

3 participants