logo 2uData.com

The previous pageBasics of hypothesis testingThe next page

In statistics, hypothesis is a statement or a claim about a property of one or more populations. It may concern the mean, the difference of variances, distribution of a variable. In order to accept or reject a hypothesis, we have to test it.

To test an hypothesis, we take sample from population, collect data from that sample, calculate, analyze data, compare hypothesis with reality, then decide to accept or reject hypothesis. This procedure is known as hypothesis testing.

Two types of error

 

Hypothesis testing is realized based on one or more samples drawn from population or populations, so our decision may be right or wrong. There are 2 types of error as classification in Table 1.

Table 1 Types of error in hypothesis testing
Hypothesis
Right Wrong
Decision Accept Correct decision Error type 2
Reject Error type 1 Correct decision

In hypothesis testing, we can commit two types of error:

  • type 1 : reject a true hypothesis; probability of this type of error is `alpha`.
  • type 2 : accept a false hypothesis; probability of this type of error is `beta`.

Example : After a microbiological control of 5000 cans, 18 cans are contaminated. Company C announces that 99,6 % of their products are safe. Department of Quality Control D analyses 10 cans of this company and there is one can contaminated. So D decides that the announcement of C is wrong. In this case D commits type 1 error.

Example : 9 % of pupils of school A are ranked as grade A, and this school announces that there are more than 10 % of its pupils are ranked as grade A. The Department of Education D controls 20 pupils of this school, there are 3 pupils that are ranked as grade A, and D decides that the announcement of school A is right. In this case D commits type 2 error.


Rare event rule

 

To reject a statement, we can use the rare event rule:

“if, under given assumptions, the probability of an event is very small, we consider that this event does not happen”.

Therefore, to accept an hypothesis H we can:

  • prove that H is true by proving that probability `P("H")` is large (greater than 0,95 for example), then accept H. In this case we can commit type 2 error.
  • or we construct an alternative hypothesis Ha, then calculate `P("Ha")`. If this probability is very small, we reject Ha, it means that we accept H. In this case we can commit type 1 error.

The second method is more frequently used.


Procedure of hypothesis testing

 

In general, hypothesis testing consists of the following steps:

  • From the context, identifying the parameter (or parameters) of interest.
  • Stating the null hypothesis Ho and appropriate alternative hypothesis Ha.
  • Determining test statistic `t` and distribution of `t`.
  • Based on problem context such as confidence level, sample size, ... we can determine critical value (or values) `t`*. This one will separate the values of `t` to two regions, one corresponds to accepting Ho, other corresponds to reject Ho.
  • From the data obtained, determining `t_o`.
  • Comparing `t_o` and `t`*, determining the region which `t_o` belongs.
  • If `t_o` belongs to rejection region (also known as critical region), we reject Ho and accept Ha. On the contrary, we accept Ho.

Note : When we construct Ho and Ha, we must be careful, because there are cases when Ho is false, Ha is not true.

Example

  • Ho : `M=123`   and Ha : `M!=123`. If Ho is false then Ha is true.
  • Ho : `M=123`   and Ha : `M>123`. If Ho is false ; Ha can be false too (`M=111` for example).

Rejection region

 

As stated above, `t`* divides all the value of `t` to 2 regions: acceptance region and rejection region (also known as critical region). Depending on Ha, there are three main cases.

Case 1

Rejection region is in the right of `t`* (Fig. 1) : to reject Ho, `t_o>t`* with `t`* is the percentage point corresponding to `alpha`.

tt* αHat o Hot o

Fig. 1 Rejection region is in the right of `t`*

This cases is usually applied when Ha has the form of `X>a` in which `X` is tested parameter, `a` is a value.

Case 2

Rejection region is in the left of `t`* (Fig. 2) : to reject Ho, `t_o< t`* with `t`* is the percentage point corresponding to `1-alpha`.

tt* αHat o Hot o

Fig. 2 Rejection region is in the left of `t`*

This cases is usually applied when Ha has the form of `Y< b` in which `Y` is tested parameter, `b` is a value.

Case 3

Rejection region consists of two zones in two sides of `t_1`* and `t_2`* (Fig. 3): to reject Ho,
`t_o< t_1`* or `t_o>t_2`* with `t_1`* is the percentage point corresponding to (`1 – alpha//2)` and `t_2`* is the percentage point corresponding `alpha//2`.

tt*1t*2 αHat oHat o Hot o

Fig. 3 Two-sided rejection region

This cases is usually applied when Ha has the form of `Z!=c` in which `Z` is tested parameter, `c` is a value.

Cases 1 and 2 are also known as one-sided (or one-tailed) hypothesis testing, case 3 is also known as two-sided (or two-tailed) hypothesis testing.

Note : When probability density function of `t` is even (Fig. 4):

`t_(1-alpha)=-t_alpha`(1)

t*1 - αt*α

Fig. 4 Percentage point when probability density function is even

In case of two-sided hypothesis testing, the condition to reject Ho is: `|t_o|>t_alpha`*.


p value

 

As discussed above, `t_o` is determined from data of sample, and it is used to characterized sample. Consider case 1, when rejection region is in the right of `t`*. `p` value is defined by formula:

`p=int_(t_o)^oo f(t)dt`(2)

in which `f(t)` is probability density function of test statistic.

`p` value is also illustrated in Fig. 5.

tt* pt o

Fig. 5 `p` value illustration

So, `p` is the highest probability to obtain the result of sample in case that Ho is right. The smaller `p` is, the higher ability Ho is rejected. When `t_o` in the rejection region, `p< alpha`.

Therefore, we have another way to reject or accept Ho: comparing `p` with `alpha`. If `p` is smaller than `alpha`, we reject Ho, if `p` is greater than `alpha`, we accept Ho.

Note that this conclusion apply for all three cases, both one-sided and two-sided hypothesis testing.



The previous pageThe first page of chapterThe next page


This web page was last updated on 03 December 2018.