22 Hypothesis Testing: Type I and Type II errors, One Tailed and Two Tailed Tests

Dr Deependra Sharma

 

Hypothesis Testing: Type I and Type II errors, One Tailed and Two Tailed Tests

 

‘A hypothesis in statistics is simply a quantitative statement about a population.’

 

Morris Hamburg

 

Learning Objectives

 

After reading this module student should be able to:

 

i)  Distinguish between Type –I and Type-II errors.

 

ii)  Understand the concept of level if significance and power of test.

 

iii)  Distinguish between One tail and two tailed test.

 

iv)  Apply suitable test statistic when σ is known

 

v)  Apply suitable test statistic when σ is unknown

 

vi)    Apply suitable test statistic when data is qualitative in nature.

 

 

1. Introduction

 

Once the data is cleaned and ready for analysis, hypothesis testing is undertaken. It is used to resolve conflicts between two opposite views on a population parameter of interest. Hypothesis is an unconfirmed statement which needs to be tested empirically in order to explain any phenomena. It is based on assumption or on pre-conceived notion drawn from the existing theories or practices prevalent in the market.

 

2. Type I and Type II errors

 

Since the decision of a hypothesis is based on the limited sample information, we are bound to make errors. Ideally, we would like to be able to reject the null hypothesis when the null hypothesis is false and do not reject the null hypothesis when the null hypothesis is true. However, we may end up rejecting or not rejecting the null hypothesis erroneously. That is, many a times t the null hypothesis is rejected when it should not, or choose not to reject the null hypothesis when it should be.

 

Principally, while deducing inferences about a population, there is always a threat associated that an wrong conclusion is being made as the decisions are based on limited sample information .This may cause two types of errors namely, Type I(denoted as α) and Type II(denoted as β).Following table summarizes the various decisions circumstances surrounding Type I and Type II errors.

Type I error occurs when hypothesis is true but our test rejects it. As already mentioned in the above paragraph that the probability of having type I error is called level of significance.Type II error occurs when, the null       hypothesis is false but test does not reject it.

 

The complement of the probability of occurring of a type II error ( i.e.,1 – β) is called the power of a statistical test. Thus, power of a test is the probability (1 – β) of rejecting the null hypothesis when it is false and should be rejected.

 

It is important to note that although β is unknown, it is related to α and an extremely low value of α (e.g.0.001) will result in intolerably high β errors. So it is advisable to balance the two types of errors. As a normal trend, α is often set at 0.05; sometimes it is 0.01; other values of α are rare. The level of α along with the sample size will determine the level of β for a particular research design. However, the risk of both α and β can be restricted by taking a larger sample. For a given level of α, increase in the sample size will decrease β, thereby increasing the power of the test (i.e. 1- β).

 

In other words as the sample size increases, both α and β tend to decrease. However, for a given sample size, any attempt to reduce the likelihood of one error will increase the likelihood of other error. For a given n, α can be reduced only at the expense of higher β. Similarly, the only way to reduce β is to accept a higher value of α. The optimal choice of α and β depends on the cost of these two types of error, and determining these costs is not always easy. Typically, the decision regarding the optimal use of Type-I and Type-II errors is made by the organization’s management where the job of a statistician is to conduct the hypothesis test for a chosen value of α.

 

 

Example-

 

If the hypotheses read as:

 

H0: A person is free of malaria.

 

HA: A person has malaria.

 

In this case, Type I error will occur when the medical test indicates that the person has malaria (i.e. null hypothesis is rejected) but in reality the patient is free from malaria (H0 is true).

 

In the similar case Type II error will occur when the test indicates that the person is free from malaria (i.e.

 

H0 is not rejected) whereas in reality he is suffering from malaria.

 

3 One Tailed and Two Tailed Tests

 

A hypothesis test will either be one-tailed or two-tailed. One tailed test involves the hypothesis that can only be rejected on one side of the hypothesized value i.e. H0 : µ≤µ0 versus HA: µ>µ0. In this type of situation null hypothesis may be rejected only when there is substantial evidence that the population mean is greater than µ0. It is also known as right-tailed test since the rejection of the null hypothesis occurs on the right side of the hypothesized mean. Similarly, if the hypotheses read as H0: µ≥µ0 versus HA: µ< µ0, it can only be rejected on left side of the hypothesized mean. Such tests are known as left tailed tests.

 

In a two tailed test, the null hypothesis can be rejected on either side of the hypothesized value of the population parameter. H0: µ=µ0 versus HA: µ≠ µ0 is the example of such tests, where µ0 represents hypothesized value of population mean. If the H0 is rejected it means that the true parameter does not meet the hypothesized parameter.

 

4 Hypothesis test concerning one population

 

4.1 Hypothesis test of the Population mean when population standard deviation is known

 

It is not very common to be aware of the value of the population standard deviation .However, there are instances when is considered fairly stable and can be determined from previous experience. Under such conditions, σ is treated as known. A hypothesis test regarding the population mean µ is based on the sampling distribution of the sample mean, x̄. In particular, it uses the fact that E(x̄)=µ and SD (x̄)= σ/√n. Also, in order to implement the test, it is essential that the sampling distribution of x̄ follows a normal distribution. It should be remembered that x̄ is normally distributed when the underlying population is normally distributed. If the underlying population is not normally distributed, then by the central limit theorem, x̄ is approximately normally distributed if the sample size is sufficiently large, or when n ≥ 30.

 

The hypothesis testing procedure simply enables us to determine whether sample evidence is inconsistent with what is hypothesized under the null hypothesis. Consider the hypotheses, H0:µ= µ0 versus HA: µ≠ µ0 where µ0 is the hypothesized value of the population mean. If the given value of the sample means, x̄ , from µ0 it does not necessary mean that the sample evidence is inconsistent with the null hypothesis. Perhaps the difference can be explained by pure chance.

 

The basic principle of hypothesis testing is to first assume that the H0 is true and then determine if the sample evidence contradicts this assumption. This principle is analogous to the scenario in the court of law where the null hypothesis is defined as “individual is innocent” and the decision rule is best described “innocent until proven guilty”.

 

The value of the test statistic for the hypothesis test of the population mean μ when the population standard deviation σ (sigma) is known is computed as

 

z = x̄ – µ0 / (σ/ √n)

 

where µ0 is the hypothesized population mean.

 

4.2 Hypothesis test of the Population mean when population standard deviation is unknown

 

So far we have considered hypothesis test of the population mean under the assumption that the population standard deviation is known. In most of the business cases, population standard deviation is not known and we have to replace it with sample standard deviation, s , to estimate the standard error of x̄.

 

When the σ is unknown, the test statistic for testing the population mean is assumed to follow the tdf distribution with n-1 degrees of freedom, and its value is computed as

 

t df = (Sample mean – μ) / ( s/ √n)

 

where, s=sample standard deviation, df=degree of freedom, μ=population mean.

 

4.3 Hypothesis test of the Population proportion

 

Sometimes the variable of interest is qualitative rather than quantitative. While the population mean

 

μ   describes the quantitative data, population proportion (p) is used as a descriptive measure when the variable under is consideration is qualitative in nature. It is defined as the probability of success i.e. probability of a particular outcome. As in the case of the population mean, we estimate the population proportion on the basis of its sample counterpart. Population proportion is estimated on the basis of its sample proportion (P bar).i.e. P bar= X/n, where X is the number of success in n trials.

 

Here, it is important to note that although, P is based on binomial distribution but it can be approximated by normal distribution in case the sample is large. The condition that should be honored for it is,

 

n  p ≥5 and n (1-p)≥5

 

Note: In case the sample size is not large enough than the methods suggested here for statistical inferences about population proportion may not be valid.

 

Since, the value of p is unknown, sample size requirement is tested under the hypothesized value of the population proportion, po. In most cases, the sample size is large and the normal distribution approximation is justified.However, when the sample size is not deemed large enough, the statistical methods suggested here for the inference regarding the population proportion are no longer valid.

 

We know that the mean and standard deviation of the sample proportion P bar are given by E(P bar)= p and SD(P bar) = √p(1-p)/n,respectively. If p=p0 and the normal approximation of the distribution of P bar is justified, the test statistic for p is defined as follows.

 

The test statistic for the hypothesis of the population proportion, p, is assumed to follow the z distribution, the value is thus calculated as,

 

z =p (bar) – p0/√p0 (1- p0 )/n

 

p bar=x/n, p0  is the hypothesized value of population proportion.

 

 

5 Summary:

 

This module provides the student an understanding about the one-tailed and two tailed tests. One tailed test involves the hypothesis that can only be rejected on one side of the hypothesized value where as in a two tailed test, the null hypothesis can be rejected on either side of the hypothesized value of the population parameter. It also exposes the students to the concept of Type-I and Type-II errors and the related conceits to them i.e. about the level of significance and power of test. Further, the insights are related to various test statistic related to different situations are provided. It provides test statistic for population mean when the population standard deviation is known and in the situation when it is not known. It also discusses the test statistic under the condition when the data is qualitative in nature.

 

6   Self-Check Exercise:

 

Q-1: Consider the following hypothesis-

H0: A person is free of disease.

HA: A person has disease.

 

Suppose a person takes a medical test that attempts to detect the disease .Discuss the consequences of a Type-I and a Type-II error.

 

Sol. Type-I error occurs when the test indicates the person is having a disease, i.e., null hypothesis is rejected, where as in reality a person is free from disease. This is also referred as a false positive.

 

Type-II error occurs when the medical test shows that he is not having any disease but in reality he is having the disease. It is known as false negative.

 

Q-2: Consider the following hypothesis-

H0: An accused person is innocent.

HA: An accused person is guilty.

 

Sol. Type-I error is a verdict that finds that the accused is guilty, rejecting null hypothesis, when he is actually innocent.

 

Type-II error is due to a verdict that concludes the accused is innocent when in reality, he is guilty.

 

Q-3: A research analyst disputes a trade group’s prediction that back-to-school spending will average Rs 606.40 per family this year. She believes that average back-to-school spending will significantly differ from this amount. She decides to conduct a test on the basis of random sample of thirty households with school-age children. Analyst calculates mean as Rs 622.85.She also believes that back-to-school spending is normally distributed with the σ of Rs 65.

 

a)  Specify the competing hypotheses in order to test the research analyst’s claim.

b)  Calculate the test statistic.

 

Sol .a) It is desirable here to determine if the average is different from the predicted value of Rs 606.40, we specify the hypotheses as:

H0: µ=606.40

 

HA: µ ≠606.40

 

b)   Note that X bar is normally distributed since it is computed from a random sample drawn from a normal population. Since σ is known, the test statistic follows the standard normal distribution, and its value is

 

z = x̄ – µ0 / (σ/√n)

 

=   622.85 – 606.40/ (65/ √30) =1.39

 

Q-4: The Director of a management institute wonders if his students study less than the 1981 national average of 24 hours per week. He randomly selects thirty five students and asks their average study time per week. He calculates a sample mean of 16.37 hours and a sample standard deviation of 7.22 hrs.

 

a)  Specify the competing hypotheses to test the Director’s concern.

b)  Calculate the value of appropriate test statistic.

 

Sol. a) This is case if one tailed test, where we would like to determine if the mean hours studied is less than 24 or µ<24 .Competing hypotheses will be as,

 

H0: µ ≥ 24

 

HA: µ <24

 

b)  We can assume that sample mean is normally distributed as the sample size is greater than 30 specifically n=35.The test statistic will be

 

t d.f = (Sample mean – μ) / ( s/ √n)

 

t35-1 =16.37-24/(7.22/√35)

 

t 34= -6.25

 

Q-5: A popular magazine asserts that fewer than 40% of the households in India have changed their life styles because of escalating gas prices. A recent survey of 180 households finds that 67 households have made lifestyles changes due to escalating gas prices.

 

a)  Specify the competing hypotheses to test the magazine’s claim.

 

b)  Calculate the value of the test statistic.

 

Sol. a) We want to establish that the population is less than 40%, i.e. < .40.Thus, we have, H0: p ≥ .40

 

HA: p <.40

 

b)  We first ensure that we can use the normal distribution approximation for test. Since, np0 and n(1-p0) exceeds 5 ,the normal approximation is justified. We use the sample proportion, pbar=67/180=.3722,to compute the value of test statistic,

 

z  =p (bar) – p0/ {√p0 (1- p0 )/n} =.3772-.40/√ {.40(1-.40)/180} =-.76

Learn More:

  1. Sharma, J K (2014), Business Statistics, S Chand & Company, N Delhi.
  2. Bajpai, N (2010) Business Statistics, Pearson, N Delhi.
  3. Trevor Hastie, Robert Tibshirani, Jerome Friedman (2009), The Elements of Statistical Learning: Data Mining, Inference, and Prediction, 2nd Edition, Springer.
  4. Darrell Huff (2010), How to Lie with Statistics, W. W. Norton, California.
  5. K.R. Gupta (2012), Practical Statistics, Atlantic Publishers & Distributors (P) Ltd., N. Delhi.