Hypothesis testing

The basic idea of statistics is simple: you want to extrapolate from the data you have collected to make general conclusions. Population can be e.g. all the voters and sample the voters you polled. Population is characterized by parameters and sample is characterized by statistics. For each parameter we can find appropriate statistics. This is called estimation. Parameters are always fixed, statistics vary from sample to sample.

Statistical hypothesis is a statement about population. In case of parametric tests it is a statement about population parameter. The only way to decide whether this statement is 100% truth or false is to research whole population. Such a research is ineffective and sometimes impossible to perform. This is the reason why we research only the sample instead of the population. Process of the verification of the hypothesis based on samples is called hypothesis testing. The objective of testing is to decide whether observed difference in sample is only due to chance or statistically significant.


Steps in Hypothesis testing:

1) Defining a null hypothesis
The null hypothesis is usually an hypothesis of "no difference"

2) Defining alternative hypothesis
Alternative hypothesis is usually hypothesis of significant (not due to chance) difference

3) Choosing alpha (significance level)
Conventionally the 5% (less than 1 in 20 chance of being wrong) level has been used.

4) Do the appropriate statistical test to compute the P value.
A P value is the largest value of alpha that would result in the rejection of the null hypothesis for a particular set of data.

5) Decision
Compare calculated P-value with prechosen alpha.
If P value is less than the chosen significance level then you reject the null hypothesis i.e. accept that your sample gives reasonable evidence to support the alternative hypothesis.
If the P value is greater than the threshold, state that you "do not reject the null hypothesis" and that the difference is "not statistically significant". You cannot conclude that the null hypothesis is true. All you can do is conclude that you don't have sufficient evidence to reject the null hypothesis.



Possible outcomes in hypothesis testing:

Decision
Truth H0 not rejected H0 rejected
H0 is true Correct decision (p = 1-α) Type I error (p = α)
H0 is false Type II error (p = β) Correct decision (p = 1-β)

H0: Null hypothesis
p: Probability
α: Significance level
1-α: Confidence level
1-β: Power