Hypothesis Test: Difference between revisions
No edit summary |
No edit summary |
||
Line 4: | Line 4: | ||
claim. | claim. | ||
This page will focus on ''usage'' of hypothesis tests ''in the context | |||
of mean comparison''. | |||
= Procedure (Mean Comparison) = | |||
== 1. Null and Alternative Hypothesis == | |||
To perform hypothesis test with mean comparison, we need two things: | |||
* The '''null hypothesis <math>H_0</math>''' is the statement which we assume to be ''true'' | * The '''null hypothesis <math>H_0</math>''' is the statement which we assume to be ''true'' | ||
* The '''alternative hypothesis <math>H_A</math>''' is the complement of the null hypothesis. | * The '''alternative hypothesis <math>H_A</math>''' is the complement of the null hypothesis. | ||
Mean comparison work with the difference in means | |||
<math> | |||
\mu_1 - \mu_2 | |||
</math> | |||
As such, there are three sets of hypotheses: | |||
* <math>H_0: \mu_1 - \mu_2 = 0</math> vs <math>H_A: \mu_1 - \mu_2 \neq 0</math> | |||
* <math>H_0: \mu_1 - \mu_2 \geq 0</math> vs <math>H_A: \mu_1 - \mu_2 < 0</math> | |||
* <math>H_0: \mu_1 - \mu_2 \leq 0</math> vs <math>H_A: \mu_1 - \mu_2 > 0</math> | |||
== 2. Test-Statistic == | |||
Next, we need to calculate a '''test-statistic <math>t_s</math>'''. This | |||
measures how much our sample data differ from <math>H_0</math>. For mean | |||
comparison, this is | |||
<math> | |||
t_s = \frac{\bar{y_1} - \bar{y_2} - 0 }{ \sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}} | |||
</math> | |||
<math>t_s</math> follows t-distribution with <math>df = \upsilon</math>. | |||
The larger the <math>t_s</math>, the more our data differs from | |||
<math>H_0</math>. Notice that it increases with sample mean difference | |||
and decreases with variance. | |||
==== Distribution ==== | |||
Because sample mean has normal distribution, by RV linear combination, | Because sample mean has normal distribution, by RV linear combination, | ||
Line 18: | Line 51: | ||
</math> | </math> | ||
We are not going to derive it, but the degree of freedom for this particular combination is | == 3. Find P-value == | ||
The '''p-value''' is the probability of observing our data or more | |||
extreme if <math>H_0</math> is in fact true. | |||
In the case of mean comparison, we have the following p-values: | |||
* For <math>H_A: \mu_1 - \mu_2 \neq 0</math>, the p-value is <math>2P(t > |t_s|)</math> | |||
** Two tails | |||
* For <math>H_A: \mu_1 - \mu_2 > 0</math>, the p-value is <math>P(t > t_s)</math> | |||
** Upper tail | |||
* For <math>H_A: \mu_1 - \mu_2 < 0</math>, the p-value is <math>P(t < t_s)</math> | |||
** Lower tail | |||
The smaller the p-value, the less likely it is to observe our data or | |||
more extreme if <math>H_0</math> is true. | |||
== 4. Conclusion == | |||
We decide a cutoff point for our p-values, typically at <math>\alpha = | |||
0.1, 0.05, 0.01</math>, called the '''level of significance'''. | |||
If <math>p < \alpha</math>, our data supports <math>H_A</math>, | |||
therefore <math>H_0</math> is rejected. Otherwise, we failed to reject | |||
<math>H_0</math>. | |||
We are not going to derive it, but the degree of freedom for this | |||
particular combination is | |||
<math> | <math> | ||
\upsilon = \frac{ (\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2} )^2 } | |||
{ \frac{(s_1^2 / n_1)^2}{ n_1 - 1} + \frac{(s_2^2 / n_2)^2}{ n_2 - 1} } | { \frac{(s_1^2 / n_1)^2}{ n_1 - 1} + \frac{(s_2^2 / n_2)^2}{ n_2 - 1} } | ||
</math> | </math> |
Revision as of 06:35, 12 March 2024
Hypothesis test is a technique where sample data is used to determine if the confidence interval supports a particular claim. Hypothesis tests quantify how likely our data is given a particular claim.
This page will focus on usage of hypothesis tests in the context of mean comparison.
Procedure (Mean Comparison)
1. Null and Alternative Hypothesis
To perform hypothesis test with mean comparison, we need two things:
- The null hypothesis is the statement which we assume to be true
- The alternative hypothesis is the complement of the null hypothesis.
Mean comparison work with the difference in means
As such, there are three sets of hypotheses:
- vs
- vs
- vs
2. Test-Statistic
Next, we need to calculate a test-statistic . This measures how much our sample data differ from . For mean comparison, this is
follows t-distribution with . The larger the , the more our data differs from . Notice that it increases with sample mean difference and decreases with variance.
Distribution
Because sample mean has normal distribution, by RV linear combination, the sampling distribution of is
3. Find P-value
The p-value is the probability of observing our data or more extreme if is in fact true.
In the case of mean comparison, we have the following p-values:
- For , the p-value is
- Two tails
- For , the p-value is
- Upper tail
- For , the p-value is
- Lower tail
The smaller the p-value, the less likely it is to observe our data or more extreme if is true.
4. Conclusion
We decide a cutoff point for our p-values, typically at , called the level of significance.
If , our data supports , therefore is rejected. Otherwise, we failed to reject .
We are not going to derive it, but the degree of freedom for this
particular combination is
Round down the value to use t-table.
A CI that covers implies that there is no significant difference, as it is plausible for the population means to be equal.