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
Implemented meanZTest #33354
Implemented meanZTest #33354
Conversation
@achimbab May I ask you to write all formulas in Latex format inside the comments? And could you leave a link to some paper there? |
@nikitamikhaylov |
I wrote all formulas in Latex format inside the comments at #a8a20b6. Formulas and Descriptions for Mean z-test Online calculator for Mean z-test |
``` | ||
|
||
Values of both samples are in the `sample_data` column. If `sample_index` equals to 0 then the value in that row belongs to the sample from the first population. Otherwise it belongs to the sample from the second population. | ||
The null hypothesis is that means of populations are equal. Normal distribution is assumed. Populations may have unequal variance and the variances are known. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is is really means that population are equal? I thought that null hypothesis is that only means of two distributions are equal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the alternative? Two sided or one sided? E.g. mean1 != mean2 or mean1 >(<) mean2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The alternative is Two sided.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found that the null hypothesis for z-test is the below.
Null hypothesis:
The two sample z test tests the following null hypothesis (H0):
H0: μ1 = μ2
Here μ1 is the population mean for group 1, and μ2 is the population mean for group 2.
Could you please explain why do you think like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I somehow misread (I don't know how). I thought that it was written that the null hypothesis is that the two distributions are equal.. Sorry, my fault
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's OK. I dont mind. Thank you.
Can we also add a python test with scipy? Please take a look at |
return {std::numeric_limits<Float64>::quiet_NaN(), std::numeric_limits<Float64>::quiet_NaN()}; | ||
} | ||
|
||
Float64 pvalue = 2.0 * boost::math::cdf(boost::math::normal(0.0, 1.0), -1.0 * std::abs(zstat)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nikitamikhaylov |
https://mathcracker.com/z-test-for-two-means |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Implemented meanZTest
Detailed description / Documentation draft:
I implemented meanZTest aggregate function.