Chapter two: Hypothesis testing 1-Some basic concepts two Hypothesis Tests… · Chapter two:...

19
Subject: Hypothesis Testing Chapter two Stage: First Lecturer: Hozan Taha Abdalla 1 Chapter two: Hypothesis testing 1- Some basic concepts: - Data: The raw material of statistics is data. For our purposes we may define data as numbers. The two kinds of numbers that we use in statistics are numbers that result from the taking of a measurement, and those that result from the process of counting. - Biostatistics: The tools of statistics are employed in many fields business, education, psychology, agriculture, and economics, to mention only a few. When the data analyzed are derived from the biological sciences and medicine, we use the term biostatistics to distinguish this particular application of statistical tools and concepts. 2- Hypothesis testing: A hypothesis may be defined simply as a statement about one or more populations. The hypothesis is frequently concerned with the parameters of the populations about which the statement is made. By means of hypothesis testing one determines whether or not such statements are compatible with the available data. There are two statistical hypotheses involved in hypothesis testing, and these should be stated explicitly. The null hypothesis is the hypothesis to be tested. It is designated by the symbol H o , The null hypothesis is sometimes referred to as a hypothesis of no difference, since it is a statement of agreement with (or no difference from) conditions presumed to be true in the population of interest. In the testing process the null hypothesis either is rejected or is not rejected. If the null hypothesis is not rejected, we will say that the data on which the test is based do not provide sufficient evidence to cause rejection. If the testing procedure leads to rejection, we will say that the data at hand are not compatible with the null hypothesis, but are supportive of some other hypothesis.

Transcript of Chapter two: Hypothesis testing 1-Some basic concepts two Hypothesis Tests… · Chapter two:...

Page 1: Chapter two: Hypothesis testing 1-Some basic concepts two Hypothesis Tests… · Chapter two: Hypothesis testing 1-Some basic concepts: ... Hypothesis Testing Chapter two Stage: First

Subject: Hypothesis Testing Chapter two

Stage: First

Lecturer: Hozan Taha Abdalla

1

Chapter two: Hypothesis testing

1- Some basic concepts:

- Data: The raw material of statistics is data. For our purposes we may define data as

numbers. The two kinds of numbers that we use in statistics are numbers that result from the

taking of a measurement, and those that result from the process of counting.

- Biostatistics: The tools of statistics are employed in many fields—business, education,

psychology, agriculture, and economics, to mention only a few. When the data analyzed are

derived from the biological sciences and medicine, we use the term biostatistics to distinguish

this particular application of statistical tools and concepts.

2- Hypothesis testing:

A hypothesis may be defined simply as a statement about one or more populations. The

hypothesis is frequently concerned with the parameters of the populations about which the

statement is made. By means of hypothesis testing one determines whether or not such

statements are compatible with the available data.

There are two statistical hypotheses involved in hypothesis testing, and these should be stated

explicitly.

The null hypothesis is the hypothesis to be tested. It is designated by the symbol Ho, The

null hypothesis is sometimes referred to as a hypothesis of no difference, since it is a statement

of agreement with (or no difference from) conditions presumed to be true in the population of

interest. In the testing process the null hypothesis either is rejected or is not rejected. If the null

hypothesis is not rejected, we will say that the data on which the test is based do not provide

sufficient evidence to cause rejection. If the testing procedure leads to rejection, we will say

that the data at hand are not compatible with the null hypothesis, but are supportive of some

other hypothesis.

Page 2: Chapter two: Hypothesis testing 1-Some basic concepts two Hypothesis Tests… · Chapter two: Hypothesis testing 1-Some basic concepts: ... Hypothesis Testing Chapter two Stage: First

Subject: Hypothesis Testing Chapter two

Stage: First

Lecturer: Hozan Taha Abdalla

2

The alternative hypothesis is a statement of what we will believe is true if our sample data

cause us to reject the null hypothesis. Usually the alternative hypothesis and the research

hypothesis are the same, and in fact the two terms are used interchangeably. We shall

designate the alternative hypothesis by the symbol H1 (or HA).

Rules for Stating Statistical Hypotheses: When hypotheses are of the type considered an

indication of equality (either = , or ) must appear in the null hypothesis.

Suppose, for example, that we want to answer the question: Can we conclude that a certain

population mean is not 50? The null hypothesis is

Ho: =50

and the alternative is

H1: 50

Suppose we want to know if we can conclude that the population mean is greater than

50. Our hypotheses are

Ho: 50 , H1: > 50

If we want to know if we can conclude that the population mean is less than 50, the

hypotheses are

Ho: 50 , H1: < 50

Distribution of test statistic. It has been pointed out that the key to statistical inference is the

sampling distribution. We are reminded of this again when it becomes necessary to specify the

probability distribution of the test statistic. The distribution of the test statistic

for example, follows the standard normal distribution if the null hypothesis is true and the

assumptions are met.

n

XZ o

Page 3: Chapter two: Hypothesis testing 1-Some basic concepts two Hypothesis Tests… · Chapter two: Hypothesis testing 1-Some basic concepts: ... Hypothesis Testing Chapter two Stage: First

Subject: Hypothesis Testing Chapter two

Stage: First

Lecturer: Hozan Taha Abdalla

3

- Significance Level: The decision as to which values go into the rejection region and which

ones go into the non-rejection region is made on the basis of the desired level of significance,

designated by .

The term level of significance reflects the fact that hypothesis tests are sometimes called

significance tests, and a computed value of the test statistic that falls in the rejection region is

said to be significant. The level of significance , specifies the area under the curve of the

distribution of the test statistic that is above the values on the horizontal axis constituting the

rejection region.

We select a small value of in order to make the probability of rejecting a true null

hypothesis small. The more frequently encountered values of are 0.01, 0.05, and 0.10.

- Types of Errors: The error committed when a true null hypothesis is rejected is called the

type I error. The type II error is the error committed when a false null hypothesis is not

rejected. The probability of committing a type II error is designated by . Whenever we reject

a null hypothesis there is always the concomitant risk of committing a type I error, rejecting a

true null hypothesis. Whenever we fail to reject a null hypothesis the risk of failing to reject a

false null hypothesis is always present. We never know whether we have committed one of

these errors when we reject or fail to reject a null hypothesis, since the true state of affairs is

unknown. Figure 2-1 shows for various conditions of a hypothesis test the possible actions that

an investigator may take and the conditions under which each of the two types of error will be

made.

Figure (2-1): Conditions under which type I and type II errors may be committed

Page 4: Chapter two: Hypothesis testing 1-Some basic concepts two Hypothesis Tests… · Chapter two: Hypothesis testing 1-Some basic concepts: ... Hypothesis Testing Chapter two Stage: First

Subject: Hypothesis Testing Chapter two

Stage: First

Lecturer: Hozan Taha Abdalla

4

Purpose of Hypothesis Testing: The purpose of hypothesis testing is to assist

administrators and clinicians in making decisions. The administrative or clinical decision

usually depends on the statistical decision. If the null hypothesis is rejected, the administrative

or clinical decision usually reflects this, in that the decision is compatible with the alternative

hypothesis. The reverse is usually true if the null hypothesis is not rejected. The administrative

or clinical decision, however, may take other forms, such as a decision to gather more data.

Figure (2-2): Steps in the hypothesis testing procedure

Page 5: Chapter two: Hypothesis testing 1-Some basic concepts two Hypothesis Tests… · Chapter two: Hypothesis testing 1-Some basic concepts: ... Hypothesis Testing Chapter two Stage: First

Subject: Hypothesis Testing Chapter two

Stage: First

Lecturer: Hozan Taha Abdalla

5

One-Sided Hypothesis Tests: The hypothesis test in the example (1) is of a two-sided test

(two tailed test), so called because the rejection region is split between the two sides or tails of

the distribution of the test statistic. A hypothesis test may be one-sided test (one tailed test), in

which case all the rejection region is in one or the other tail of the distribution. Whether a one-

sided or a two-sided test is used depends on the nature of the question being asked by the

researcher. If both large and small values will cause rejection of the null hypothesis, a two

sided test is indicated. When either sufficiently “small” values only or sufficiently “large”

values only will cause rejection of the null hypothesis, a one-sided test is indicated.

Figure (2-3): One and two sided test

𝐻1

Page 6: Chapter two: Hypothesis testing 1-Some basic concepts two Hypothesis Tests… · Chapter two: Hypothesis testing 1-Some basic concepts: ... Hypothesis Testing Chapter two Stage: First

Subject: Hypothesis Testing Chapter two

Stage: First

Lecturer: Hozan Taha Abdalla

6

2-1- Hypothesis testing: Single population mean.

2-1-1-Sampling from a population that is normally distributed: Population variance

known.

When sampling is from a normally distributed population and the population variance is

known, the test statistic is:

which, when Ho is true, is distributed as the standard normal.

Examples:

1. Researchers are interested in the mean age of a certain population. A random sample of 10

individuals drawn from the population of interest has a mean of 27. Assuming that the

population is approximately normally distributed with variance 20, can we conclude that the

mean is different from 30 years? Use α=0.05.

2. Boys of a certain age are known to have a mean weight of μ 85 pounds. A complaint is

made that the boys living in an Orphanage are underfed. n = 25 boys (of the same age) are

weighed and found to have a mean weight of pounds. It is known that the

population standard deviation σ is 11.6. Based on the available data, what should be concluded

concerning the complaint? With α =0.05

n

XZ

94.80x

Page 7: Chapter two: Hypothesis testing 1-Some basic concepts two Hypothesis Tests… · Chapter two: Hypothesis testing 1-Some basic concepts: ... Hypothesis Testing Chapter two Stage: First

Subject: Hypothesis Testing Chapter two

Stage: First

Lecturer: Hozan Taha Abdalla

7

2-1-2- Sampling from a population that is normally distributed: Population variance

unknown.

When sampling is from an approximately normal population with an unknown variance, the

test statistic is:

which, when Ho is true, is distributed as Student’s t with(n-1) degrees of freedom.

Examples:

1. It is assumed that the mean systolic blood pressure is μ = 120. In a Health Study, a sample

of n = 100 people had an average systolic blood pressure of 130.1 mm Hg with a standard

deviation of 21.21. Is the group significantly different from the regular population? Use

α=0.05.

2. A professor wants to know if her introductory statistics class has a good grasp of basic

math. Six students are chosen at random from the class and given a math proficiency test. The

professor wants the class to be able to score above 70 on the test. The six students get scores

of 62, 92, 75, 68, 83, and 95. Can the professor have 90 percent confidence that the mean

score for the class on the test would be above 70?

n

S

Xt

Page 8: Chapter two: Hypothesis testing 1-Some basic concepts two Hypothesis Tests… · Chapter two: Hypothesis testing 1-Some basic concepts: ... Hypothesis Testing Chapter two Stage: First

Subject: Hypothesis Testing Chapter two

Stage: First

Lecturer: Hozan Taha Abdalla

8

2-1-3- Sampling from a population that is not normally distributed.

If the sample on which we base our hypothesis test about a population mean comes from a

population that is not normally distributed, we may, if our sample is large (greater than or

equal to 30), take advantage of the central limit theorem and use (Z) as the test statistic. If the

population standard deviation is not known, the usual practice is to use the sample standard

deviation as an estimate. The test statistic is

which, when Ho is true, is distributed approximately as the standard normal distribution

if n is large. The rationale for using s to replace is that the large sample, necessary for the

central limit theorem to apply, will yield a sample standard deviation that closely

approximates .

Example: Can we conclude that the mean age at death of patients with homozygous sickle-

cell disease is less than 30 years? A sample of 50 patients yielded the following ages in years:

15.5 2 45.1 1.7 0.8 1.1 18.2 9.7 28.1 18.2

27.6 45 1 66.4 2 67.4 2.5 61.7 16.2 31.7

6.9 13.5 1.9 31.2 9 2.6 29.7 13.5 2.6 14.4

20.7 30.9 36.6 1.1 23.6 0.9 7.6 23.5 6.3 40.2

23.7 4.8 33.2 27.1 36.7 3.2 38 3.5 21.8 2.4

Let =0.05, what assumptions are necessary?

n

S

Xz

Page 9: Chapter two: Hypothesis testing 1-Some basic concepts two Hypothesis Tests… · Chapter two: Hypothesis testing 1-Some basic concepts: ... Hypothesis Testing Chapter two Stage: First

Subject: Hypothesis Testing Chapter two

Stage: First

Lecturer: Hozan Taha Abdalla

9

2-2- Hypothesis testing: The difference between two population means.

Hypothesis testing involving the difference between two population means is most

frequently employed to determine whether or not it is reasonable to conclude that the two

population means are unequal. In such cases, one or the other of the following hypotheses may

be formulated:

1. Ho: 1-2 = 0 , H1: 1-2 0

2. Ho: 1-2 0 , H1: 1-2 < 0

3. Ho: 1-2 0 , H1: 1-2 > 0

It is possible, however, to test the hypothesis that the difference is equal to, greater than or

equal to, or less than or equal to some value other than zero.

Page 10: Chapter two: Hypothesis testing 1-Some basic concepts two Hypothesis Tests… · Chapter two: Hypothesis testing 1-Some basic concepts: ... Hypothesis Testing Chapter two Stage: First

Subject: Hypothesis Testing Chapter two

Stage: First

Lecturer: Hozan Taha Abdalla

10

2-2-1- Sampling from normally distributed independent populations: population

variances known.

When each of two independent simple random samples has been drawn from a normally

distributed population with a known variance, the test statistic for testing the null hypothesis

of equal population means is

Examples:

1. Researchers wish to know if the data they have collected provide sufficient evidence to

indicate a difference in mean serum uric acid levels between normal individuals and

individuals with Down’s syndrome. The data consist of serum uric acid readings on 12

individuals with Down’s syndrome and 15 normal individuals. The means are

and . The populations are normally distributed with variance equal to (1) for the

Down’s syndrome population, and (1.5) for normal population. Are the population means

equal? With =0.05.

2. The amount of a certain trace element in blood is known to vary with a standard deviation

of 14.1 for male blood donors and 9.5 for female donors. Random samples of 75 male and 50

female donors yield concentration means of 28 and 33, respectively. What is the likelihood

that the population means of concentrations of the element are the same for men and women?

With =0.05

2

2

2

1

2

1

2121 )()(

nn

xxz

5.41 x

4.32 x

Page 11: Chapter two: Hypothesis testing 1-Some basic concepts two Hypothesis Tests… · Chapter two: Hypothesis testing 1-Some basic concepts: ... Hypothesis Testing Chapter two Stage: First

Subject: Hypothesis Testing Chapter two

Stage: First

Lecturer: Hozan Taha Abdalla

11

2-2-2- Sampling from Normally Distributed independent Populations: Population

Variances are equal and unknown.

When the population variances are unknown, but assumed to be equal, it is appropriate to

pool the sample variances by means of the following formula:

When each of two independent simple random samples has been drawn from a normally

distributed population and the two populations have equal but unknown variances, the test

statistic is given by

which, when H0 is true, is distributed as Student’s t with n1 + n2 - 2 degrees of freedom.

Examples:

1. A nurse was hired by a governmental ecology agency to investigate the impact of a lead

smelter on the level of lead in the blood of children living near the smelter. Ten children were

chosen at random from those living near the smelter. A comparison group of 7 children was

randomly selected from those living in an area relatively free from possible lead pollution.

Blood samples were taken from the children, and lead levels determined. The following are

the results:

Lead Levels

Children Living Near Smelter Children Living in Unpolluted Area

18 9

16 13

21 8

14 15

17 17

19 12

22 11

24

15

18

Using =0.01, suppose that the populations variance are equal, what do you conclude?

2

)1()1(

21

2

22

2

112

nn

snsns p

2

2

1

2

2121 )()(

n

s

n

s

xxt

pp

Page 12: Chapter two: Hypothesis testing 1-Some basic concepts two Hypothesis Tests… · Chapter two: Hypothesis testing 1-Some basic concepts: ... Hypothesis Testing Chapter two Stage: First

Subject: Hypothesis Testing Chapter two

Stage: First

Lecturer: Hozan Taha Abdalla

12

2. A psychologist was interested in exploring whether or not male and female college students

have different driving behaviors. There were a number of ways that she could quantify driving

behaviors. She opted to focus on the fastest speed ever driven by an individual. Therefore, the

particular statistical question she framed was as follows: Is the mean fastest speed driven by

male college students different than the mean fastest speed driven by female college students?

She conducted a survey of a random n1 = 34 male college students and a random n2 = 29

female college students. Here is a descriptive summary of the results of her survey:

Males Females

n=34 n=29

Mean= 105.5 Mean=90.9

Standard deviation= 20.1 Standard deviation=12.2

Suppose that the variances of the two population are equal, is there sufficient evidence at

α = 0.05 level to conclude that the mean fastest speed driven by male college students differs

from the mean fastest speed driven by female college students?

2-2-3- Sampling from Normally Distributed independent Populations: Population

Variances are unequal and unknown.

When two independent simple random samples have been drawn from normally distributed

populations with unknown and unequal variances, the test statistic is

where r, the adjusted degrees of freedom is determined by the equation:

2

2

2

1

2

1

2121 )()(

n

s

n

s

xxt

11 2

2

2

2

2

1

2

1

2

1

2

2

2

2

1

2

1

n

n

S

n

n

S

n

S

n

S

r

Page 13: Chapter two: Hypothesis testing 1-Some basic concepts two Hypothesis Tests… · Chapter two: Hypothesis testing 1-Some basic concepts: ... Hypothesis Testing Chapter two Stage: First

Subject: Hypothesis Testing Chapter two

Stage: First

Lecturer: Hozan Taha Abdalla

13

Examples:

1. A researcher examined subjects with hypertension and healthy control subjects. He assumed

that the mean of the two groups are equal. The sample sizes, means, and sample standard

deviations are:

The data constitute two independent random samples, one from a population of subjects with

hypertension and the other from a control population. We assume that the values are

approximately normally distributed in both populations. The population variances are

unknown and unequal. Test the researchers assumption, using =0.05.

2. If the average residence of a random sample of patients of size 15 in the hospital (a) equal

to 6 days and the standard deviation of the length of stay equal to 3, and the average residence

of a random sample of patients of size 20 in the hospital (b) equal to 9 days and the standard

deviation of the length of stay equal to 4. If the population variances are unequal and

unknown, calculate the 5% level of significance the hypothesis that the average patient's stay

in hospital (a) equal to the average patient's stay in hospital (b).

Page 14: Chapter two: Hypothesis testing 1-Some basic concepts two Hypothesis Tests… · Chapter two: Hypothesis testing 1-Some basic concepts: ... Hypothesis Testing Chapter two Stage: First

Subject: Hypothesis Testing Chapter two

Stage: First

Lecturer: Hozan Taha Abdalla

14

2-2-4- Sampling from populations that are not normally distributed:

When sampling is from populations that are not normally distributed, the results of the central

limit theorem may be employed if sample sizes are large (say30). This will allow the use of

normal theory since the distribution of the difference between sample means will be

approximately normal. When each of two large independent simple random samples has been

drawn from a population that is not normally distributed, the test statistic is

If the population variances are known, they are used; but if they are unknown, as is the

usual case, the sample variances, which are necessarily based on large samples, are used as

estimates. Sample variances are not pooled, since equality of population variances is not a

necessary assumption when the z statistic is used.

Example: The objective of a study was to identify the role of various disease states and

additional risk factors in the development of thrombosis. One focus of the study was to

determine if there were different levels of the antibody in subjects with and without

thrombosis.

We wish to know if we may conclude, on the basis of these results, that, in general, persons

with thrombosis have, on the average, higher IgG levels than persons without thrombosis.

2

2

2

1

2

1

2121 )()(

nn

xxz

Page 15: Chapter two: Hypothesis testing 1-Some basic concepts two Hypothesis Tests… · Chapter two: Hypothesis testing 1-Some basic concepts: ... Hypothesis Testing Chapter two Stage: First

Subject: Hypothesis Testing Chapter two

Stage: First

Lecturer: Hozan Taha Abdalla

15

2-3- Hypothesis testing: Paired comparisons:

A method frequently employed for assessing the effectiveness of a treatment or

experimental procedure is one that makes use of related observations resulting from non

independent samples. A hypothesis test based on this type of data is known as a paired

comparisons test.

Instead of performing the analysis with individual observations, we use di , the difference

between pairs of observations, as the variable of interest. When the n sample differences

computed from the n pairs of measurements constitute a simple random sample from a

normally distributed population of differences, the test statistic for testing hypotheses about

the population mean difference d is

When Ho is true, the test statistic is distributed as Student’s t with n-1 degrees of freedom.

Examples:

1. Blood samples from n = 10 people were sent to each of two laboratories (Lab 1 and Lab

2) for cholesterol determinations. The resulting data are summarized here

Subject Lab 1 Lab 2

1 296 318

2 268 287

3 310 298

4 262 285

5 230 245

6 280 310

7 290 299

8 215 220

9 257 231

10 235 287

d

d

s

dt

n..,1,2,......i iii xyd

1

2

2

n

ddS

i

dn

dd

i n

ss d

d

Page 16: Chapter two: Hypothesis testing 1-Some basic concepts two Hypothesis Tests… · Chapter two: Hypothesis testing 1-Some basic concepts: ... Hypothesis Testing Chapter two Stage: First

Subject: Hypothesis Testing Chapter two

Stage: First

Lecturer: Hozan Taha Abdalla

16

Is there a statistically significant difference at the α = 0.01 level, say, in the (population) mean

cholesterol levels reported by Lab 1 and Lab 2?

2. The following data shows the weekly sales volume of ten businesses before and after an

intensive advertising campaign, tested the hypothesis that the identical volume of sales

before and after the campaign, at 5% significance level.

Subject Before campaign After campaign

1 18 20

2 15 18

3 20 23

4 20 18

5 12 17

6 25 22

7 26 30

8 15 20

9 16 19

10 12 10

2-4- Hypothesis testing: Testing proportion

2-4-1- Hypothesis testing: Single population proportion

Testing hypotheses about population proportions is carried out in much the same way as

for means when the conditions necessary for using the normal curve are met. One sided or

two-sided tests may be made, depending on the question being asked. When a sample

sufficiently large for application of the central limit theorem is available for analysis, the test

statistic is

which, when Ho is true, is distributed approximately as the standard normal.

n

qp

ppz

oo

o

ˆ

Page 17: Chapter two: Hypothesis testing 1-Some basic concepts two Hypothesis Tests… · Chapter two: Hypothesis testing 1-Some basic concepts: ... Hypothesis Testing Chapter two Stage: First

Subject: Hypothesis Testing Chapter two

Stage: First

Lecturer: Hozan Taha Abdalla

17

Example:

Let p equal the proportion of drivers who use a seat belt in a state that does not have a

mandatory seat belt law. It was claimed that p = 0.14. An advertising campaign was conducted

to increase this proportion. Two months after the campaign, y = 104 out of a random sample

of n = 590 drivers were wearing seat belts. Was the campaign successful?

2-4-1- Hypothesis testing: The difference between two population proportions

The most frequent test employed relative to the difference between two population

proportions is that their difference is zero. It is possible, however, to test that the difference is

equal to some other value. Both one-sided and two-sided tests may be made.

When the null hypothesis to be tested is p1-p2=0, we are hypothesizing that the two population

proportions are equal. We use this as justification for combining the results of the two samples

to come up with a pooled estimate of the hypothesized common proportion. If this procedure

is adopted, one computes

where x1and x2 are the numbers in the first and second samples, respectively, possessing the

characteristic of interest. This pooled estimate of p=p1=p2 is used in computing

the estimated standard error of the estimator, as follows:

The test statistic becomes

which is distributed approximately as the standard normal if the null hypothesis is true.

pqandnn

xxp

1 ,

21

21

21

ˆˆ

)1()1(ˆ

21 n

pp

n

pppp

21 ˆˆ

2121

ˆ

)()ˆˆ(

pp

ppppz

Page 18: Chapter two: Hypothesis testing 1-Some basic concepts two Hypothesis Tests… · Chapter two: Hypothesis testing 1-Some basic concepts: ... Hypothesis Testing Chapter two Stage: First

Subject: Hypothesis Testing Chapter two

Stage: First

Lecturer: Hozan Taha Abdalla

18

Example

Time magazine reported the result of a telephone poll of 800 adult Americans. The question

posed of the Americans who were surveyed was: "Should the federal tax on cigarettes be

raised to pay for health care reform?" The results of the survey were:

Is there sufficient evidence at the α = 0.05 level, say, to conclude that the two populations

smokers and non-smokers — differ significantly with respect to their opinions?

Page 19: Chapter two: Hypothesis testing 1-Some basic concepts two Hypothesis Tests… · Chapter two: Hypothesis testing 1-Some basic concepts: ... Hypothesis Testing Chapter two Stage: First

Subject: Hypothesis Testing Chapter two

Stage: First

Lecturer: Hozan Taha Abdalla

19

Summary of the formulas