Open KronosTheLate opened 2 years ago
Thanks, but the meaning of the argument should be mentioned too, otherwise it's impossible to use.
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?
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 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.
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.
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.
Base: 92.93% // Head: 93.67% // Increases project coverage by +0.74%
:tada:
Coverage data is based on head (
a8af75d
) compared to base (992fe20
). Patch coverage: 100.00% of modified lines in pull request are covered.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Maybe call the argument Δμ0
, for consistency with the one-sample tests where μ0
is used to refer to "mean under H0"?
Sounds good by me. Are you okay with making the change?
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.