Skip to content

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.

@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?

@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

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.67%. Comparing base (992fe20) to head (a8af75d).
⚠️ Report is 143 commits behind head on master.

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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@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?

@nalimilan nalimilan requested a review from mschauer October 22, 2022 17:09
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.

4 participants