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

Better docstring for VarianceTests #254

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

KronosTheLate
Copy link

This applies to both Equal and Unequal, T and Z tests. E.g. EqualVarianceTTest.

I have added the third positional argument mu0, as well as it default value, in the docstring.
I have also added a reference to VarianceTTest, because I does not hurt, and that was what I was looking for, so it would have been very helpful to me.

@nalimilan
Copy link
Member

Thanks, but the meaning of the argument should be mentioned too, otherwise it's impossible to use.

src/z.jl Outdated Show resolved Hide resolved
@KronosTheLate
Copy link
Author

Thanks, but the meaning of the argument should be mentioned too, otherwise it's impossible to use.

Good point. I have now changed all 4 docstrings to mention μ0, in a uniform and clear manner. Satisfied with my suggestion?

src/t.jl Outdated Show resolved Hide resolved
@mschauer
Copy link
Member

mschauer commented Feb 7, 2022

I would separate model assumptions, e.g. equal variance from hypotheses (eq. equal mean.) Something like:

For samples from two populations perform a two sample t-test for the null-hypothesis that the means of the two populations differ by $μ_diff = E[Y] - E [X]$ under the assumption that both populations have equal, but unknown variances.

Can we also rename μ0 to μ_diff or Δμ?

@KronosTheLate
Copy link
Author

I would separate model assumptions, e.g. equal variance from hypotheses (eq. equal mean.) Something like:

For samples from two populations perform a two sample t-test for the null-hypothesis that the means of the two populations differ by $μ_diff = E[Y] - E [X]$ under the assumption that both populations have equal, but unknown variances.

Can we also rename μ0 to μ_diff or Δμ?

I think that both you suggestions are great. Do you agree that $μ_diff = E[Y] - E [X]$ would be more readable as $μ_diff = mean(x) - mean(y)$? I think that it is understandable even if you don't know standard notation, and that since it is actual code, it is as clear as can be. Note that the data arguments are (x, y), and a quick test tells me that the point estimate is mean(x)-mean(y), so I have swapped the order.

On the matter of μ_diff ovsΔμ, I would personally think that Δμ looks the best. And since we are already using Unicode for mu, adding the delta should not do much harm.

Does μ0 occur in other places with the meaning "mean difference"? If so, this change should be enforced everywhere.

@nalimilan
Copy link
Member

Yes the E[X] notation may be more appropriate.

μ0 is used as an argument to OneSampleTTest, but there it's really the mean, so using a different notation is justified. It's also used as the name of an (internal) field of some other tests, but again referring to a mean. So overall it doesn't seem you'd have to rename anything else.

Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
@KronosTheLate
Copy link
Author

So mu0 should become Deltamu (on phone, no unicode). If you see this comment, please vote yes or no by comment and reason, so that the potential rename is a real concensus.

@codecov-commenter
Copy link

codecov-commenter commented Sep 25, 2022

Codecov Report

Base: 92.93% // Head: 93.67% // Increases project coverage by +0.74% 🎉

Coverage data is based on head (a8af75d) compared to base (992fe20).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #254      +/-   ##
==========================================
+ Coverage   92.93%   93.67%   +0.74%     
==========================================
  Files          28       28              
  Lines        1641     1723      +82     
==========================================
+ Hits         1525     1614      +89     
+ Misses        116      109       -7     
Impacted Files Coverage Δ
src/t.jl 98.30% <100.00%> (ø)
src/z.jl 98.00% <100.00%> (ø)
src/common.jl 100.00% <0.00%> (ø)
src/correlation.jl 100.00% <0.00%> (ø)
src/jarque_bera.jl 100.00% <0.00%> (ø)
src/kruskal_wallis.jl 100.00% <0.00%> (ø)
src/wald_wolfowitz.jl 100.00% <0.00%> (ø)
src/breusch_godfrey.jl 100.00% <0.00%> (ø)
src/kolmogorov_smirnov.jl 95.77% <0.00%> (+0.06%) ⬆️
src/durbin_watson.jl 98.91% <0.00%> (+0.07%) ⬆️
... and 11 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@nalimilan
Copy link
Member

Maybe call the argument Δμ0, for consistency with the one-sample tests where μ0 is used to refer to "mean under H0"?

@KronosTheLate
Copy link
Author

Sounds good by me. Are you okay with making the change?

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

Successfully merging this pull request may close these issues.

None yet

4 participants