40
1 HYPOTHESIS TESTING HYPOTHESIS TESTING

HYPOTHESIS TESTING

  • Upload
    hila

  • View
    26

  • Download
    1

Embed Size (px)

DESCRIPTION

HYPOTHESIS TESTING. Introduction. The purpose of hypothesis testing is to determine whether there is enough statistical evidence in favor of a certain belief about a parameter. And to permit generalizations from a sample to the population from which it came. - PowerPoint PPT Presentation

Citation preview

Page 1: HYPOTHESIS TESTING

1

HYPOTHESIS TESTINGHYPOTHESIS TESTING

Page 2: HYPOTHESIS TESTING

2

IntroductionIntroduction

The purpose of hypothesis testing is to determine whether there is enough statistical evidence in favor of a certain belief about a parameter

And to permit generalizations from a sample to the population from which it came.

The word hypothesis is just slightly technical or mathematical term for “sentence” or “claim” or “statement”. In statistics, a hypothesis is always a statement about the value of one or more population parameter(s).

Page 3: HYPOTHESIS TESTING

3

Hypothesis:Hypothesis: A statement that something is true A statement that something is true concerning the population.concerning the population.

Typical statistical hypotheses are:

because is not a population parameter (it is a sample statistic)

x

The following are not statistical hypothesis

“µ is big enough”

5x“ “

because though it is a statement about the population parameter µ, the statement is not quantitative.

µ>5 cm P0.65 2>2.00 µ1-µ2>0 and so on.

Page 4: HYPOTHESIS TESTING

4

The statistical hypothesis test is a five-step The statistical hypothesis test is a five-step procedure.procedure.

The first two steps of the hypothesis test procedure The first two steps of the hypothesis test procedure are to formulate two hypothesis.are to formulate two hypothesis.

There are two hypotheses (about There are two hypotheses (about one or moreone or more population parameter(s)) population parameter(s))

HH00 - the null hypothesis - the null hypothesis

HH11 - the alternative hypothesis - the alternative hypothesis

The hypothesis testing is the operation of deciding whether or not data obtained for a random sample supports or fails to support a particular hypothesis.

Page 5: HYPOTHESIS TESTING

5

Null Hypothesis, HNull Hypothesis, H00:: The hypothesis upon which we The hypothesis upon which we

wish to focus our attention. Generally this is a wish to focus our attention. Generally this is a statement that a population parameter has a statement that a population parameter has a specified value.specified value.

STEP 1

Alternative Hypothesis, HAlternative Hypothesis, Haa: : A statement about the A statement about the

same population parameter that is used in the null same population parameter that is used in the null hypothesis. Generally this is a statement which hypothesis. Generally this is a statement which specifies that the population parameter has a value specifies that the population parameter has a value different from the value given in the null hypothesis.different from the value given in the null hypothesis.

STEP 2

H0: = 0

Ha: 0

H0: = 0

Ha: > 0

H0: = 0

Ha: < 0

Two-sided One-sided

Formulate the null hypothesis

Formulate the alternative hypothesis

Page 6: HYPOTHESIS TESTING

6

At the conclusion of the hypothesis test, we will reach one of two possible decisions. We will decide in agreement with null hypothesis and say that we fail to reject H0. Or we will decide in opposition to null hypothesis and say that we reject H0.

Page 7: HYPOTHESIS TESTING

7

There are four possible outcomes that could be reached as a result of the null hypothesis being either true or false and the decision being either “fail to reject” or “reject”.

Null Hypothes isNull Hypothes is

DecisionDecision TrueTrue FalseFalse

Accept HAccept H00 Correct DecisionCorrect Decision

(1- (1- αα))

Type II Error Type II Error

ββ

Reject HReject H00 Type I Error Type I Error

αα

Correct DecisionCorrect Decision

(1- (1- ββ))

Page 8: HYPOTHESIS TESTING

8

= P(commit a type I error) = P(reject H0 given that H0 is true)

= P(commit a type II error) = P(accept H0 given that H0 is false)

Accept H0 Reject H0

Page 9: HYPOTHESIS TESTING

9

STEP 3

Test Criteria:Test Criteria: Consist of Consist of

1.1. determining a test statistic, determining a test statistic,

2.2. specifying a level of significance specifying a level of significance

3.3. and determinig the critical region.and determinig the critical region.

Determine the test criteria.

Test Statistic: Test Statistic: A random variable whose value will be A random variable whose value will be used to make the decision “fail to reject Hused to make the decision “fail to reject H00” or “ ” or “

reject Hreject H00””

Critical Region:Critical Region:The set of values for the test statistic The set of values for the test statistic that will cause us to reject the null hypothesis.that will cause us to reject the null hypothesis.

Critical Value Critical Value is the first value in the critical region.is the first value in the critical region.

Level of significance: Level of significance: The probability of committing The probability of committing the type I error, the type I error, . .

Page 10: HYPOTHESIS TESTING

10

STEP 4 Obtain the value of the test statistic.

The test statistic is some statistic that may be computed from the data of the sample. The test statistic serves as a decision maker, since the decision to reject or not to reject the null hypothesis depends on the magnitude of the test statistic. An example of a test statistic is the quantity

ixz

n

xz

Page 11: HYPOTHESIS TESTING

11

STEP 5 Make a decision and interpret it.

Decision Rule: If the test statistic falls within the critical region, we will reject H0.

If the test statistic does not fall in the critical region, we will fail to reject H0.

The set of values that are not in the critical region is called the acceptance (noncritical) region.

Page 12: HYPOTHESIS TESTING

12

Researchers are interested in the mean level of some enzyme in a certain population. They take a sample of 10 individuals, determine the level of enzyme in each and compute a sample mean 22. It is known that the variable of interest is approximately normally distributed with a variance of 45. Let us say that they are asking the following question: Can we conclude that the mean enzyme level in this population is different from 25?

Example

H0: = 25

Ha: 25

Step1-2

Page 13: HYPOTHESIS TESTING

13

Since we are testing a hpothesis about a population mean, we assume that the population is normally distributed, and the population variance is known, our test statistic is z.

Let us say that we want the probability of rejecting a true null hypothesis to be =0.05. Our rejection region is to consist of two parts. It seems reasonable that we should divide equally and let /2=0.025 be associated with small values and /2=0.025 be associated with large values.

Step 3

Page 14: HYPOTHESIS TESTING

14

41.110/45

2522

n

xz

Step 4

Step 5

rejection region rejection region

Step 6 Accept H0. We conclude that the mean enzyme level in this population is not different from 25

-1.

96

1.

96

0

/2=0.025/2=0.025-1

.41

acceptance region

0.95

Page 15: HYPOTHESIS TESTING

15

Suppose, instead of asking if they could conclude that 25, the researchers had asked: Can we conclude that the mean enzyme level in this population is less than 25?

Example

H0: = 25

Ha: < 25

Step1-2

Page 16: HYPOTHESIS TESTING

16

Since we are testing a hpothesis about a population mean, we assume that the population is normally distributed, and the population variance is known, our test statistic is z.

Let us say that we want the probability of rejecting a true null hypothesis to be =0.05. We will want our rejection region is to be where the small values are –at lower tail of the distribution. This time, since we have a one-sided test, all of will go in the one tail of the distribution.

Step 3

Page 17: HYPOTHESIS TESTING

17

41.110/45

2522

n

xz

Step 4

Step 5

rejection region acceptance region

0.95

0

=0.05

-1.6

45-1

.41

Step 6 Accept H0. We conclude that the mean enzyme level in this population is not less than (greater than or equal to) 25

Page 18: HYPOTHESIS TESTING

18

Hypothesis Testing

Parametric TestsNonparametric

Tests

• Sampling should be random.

• Population should be distributed normally.

• Variables sholud be continuous.

• # of observations should be greater than 10.

• No assumption on the distribution of the population.

•No assumption on the type of the variable.

• No assumption on the # of observations.

Page 19: HYPOTHESIS TESTING

19

Even the underlying population is normally distributed if the sample size is small (n<10), again nonparametric tests are used.

Non parametric tests are used as an alternative to parametric tests. Usually are used when the distribution of underlying population is nonnormal.

While parametric tests are used to test the hypothesis based on population mean, proportion and standard deviation,nonparametric tests are used to test the hypothesis based on median or distribution of samples.

Page 20: HYPOTHESIS TESTING

20

HYPOTHESIS TESTING:HYPOTHESIS TESTING:ABOUT A SINGLE ABOUT A SINGLE

POPULATIONPOPULATION

Page 21: HYPOTHESIS TESTING

21

INTRODUCTIONINTRODUCTION

In this lecture we consider the testing of hypothesis about a population mean under three different conditions:

1. When sampling is from a normally distributed population of values with known variance,

2. When sampling is from a normally distributed population of values with unknown variance,

3. When sampling is from a population that is not normally distributed.

A SINGLE POPULATION MEANA SINGLE POPULATION MEAN

Page 22: HYPOTHESIS TESTING

22

If the population that we are sampling is approximately normal and n30, we will base our procedures on Student’s t distribution. Student’s t distribution is the distribution of t statistic. When n>30, t distribition approaches to the normal distribution.

When is known and n is large

When is unknown and n is small (n30) ns

xt

n

xz

Page 23: HYPOTHESIS TESTING

23

Properties of t Distribution:

1. t is distributed with a mean of 0.

2. t is distributed symmetrically about its mean.

3. t is distributed with a variance greater than 1, but as the sample size n increases, the variance approaches to 1

4. t is distributed so as to be less peaked at the mean and thicker at the tails than the normal distribution.

5. t is distributed so as to form a family of distributions, a separate distribution for each sample size. The t distribution approaches to the normal distribution as the sample size increases.

Page 24: HYPOTHESIS TESTING

24

Student’s t, n=10

Student’s t, n=2

0

Normal Distribution

Page 25: HYPOTHESIS TESTING

25

Example Researchers collected serum amylase values from a random sample of 15 apparently healty subjects. The mean and standard deviation computed from the sample are 96 and 35 units/100 ml, respectively. They want to know whether they can conclude that the mean of population from which the sample of serum amylase determinations came is different from 120.

H0: = 120

Ha: 120

Hypothesis

Test statistic

Since the population variance is unknown, our test statistic is t

Level of significanceLevel of significance =0.05=0.05

Page 26: HYPOTHESIS TESTING

26

65.21535

12096

ns

xt

0

/2=0.025/2=0.025

-2.14

2.14

t(/2,n-1)= t(0.025,15-1)=2.14

0.95

Accept H0 Reject H0

-2.65

Reject H0

Page 27: HYPOTHESIS TESTING

27

0.20 0.01 0.05 0.025 0.01

0.40 0.20 0.10 0.05 0.02

1 1.376 3.078 6.314 12.706 31.821

2 1.061 1.886 2.920 4.303 6.965

... ... ... ... ... ...

30 0.854 1.310 1.697 2.042 2.457

40 0.851 1.303 1.684 2.021 2.423

... ... ... ... ... ...

120 0.845 1.289 1.658 1.980 2.358

... ... ... ... ... ...

Sonsuz 0.842 1.282 1.645 1.960 2.326

df.Amount of in one-tail

t Distribution Table

Amount of in two-tail

Page 28: HYPOTHESIS TESTING

28

THE SIGN TESTTHE SIGN TEST

When the normality assumptions can not be made or when the data at hand are ranks rather than measurments on an interval or ratio scale, an alternative test must be sought.

A frequently used nonparametric test does not depend on the assumptions of the t test, or measurement beyond the ordinal scale is the sign test.This test focus on the median rather than the mean as a measure of central tendency or location.

Page 29: HYPOTHESIS TESTING

29

The sign test gets its name from the fact that pluses and minuses, rather than numerical value, provide the raw data used in the calculation.

The null hypothesis to be tested concerns the value of the population median M.

H0: Population median is M0. (M=M0)

HA: Population median is not M0. (MM0)

The data converted to (+) and (-) signs

A plus sign will be assigned to each piece of data larger than M0, a minus sign to each piece of data smaller than M0 and the zero to those data equal M0

The sign test uses only the plus and minus signs.

Page 30: HYPOTHESIS TESTING

30

When n < 25, the sign test table are used where k is the number of the less frequent sign and n is number of observations.Reject the null hypothesis whenever the number of the less frequent sign is extremely small.

p < or p < p > or p >

When n 25/2n

2

nk

z

Reject H0Accept H0

or zz 2/ zz Otherwise

Page 31: HYPOTHESIS TESTING

31

Example: Researchers wished to know if instruction in personal care and grooming would improve the appearance of mentally retarded girls. In a school for the mentally retarded, 10 girls selected at random received special instruction in personal care and grooming. Two weeks after completion of the course of instruction the girls were interwieved by a nurse and a social worker who assigned each girl a score based on her general appearance. We wish to know if we can conclude that the median score of the population from which we assume this sample to have been drawn is different from 5.

GirlGirl 11 22 33 44 55 66 77 88 99 1010

ScoreScore 44 55 88 88 99 66 1010 77 66 66

Page 32: HYPOTHESIS TESTING

32

H0: The population median is 5.

HA: The population median is not 5.

GirlGirl 11 22 33 44 55 66 77 88 99 1010

ScoreScore 44 55 88 88 99 66 1010 77 66 66

<5-

>5+

>5 >5 >5 >5 >5 >5+ + + + + +

>5+

=50

Since # of (-)=1 and # of (+)=8 and # of (0)=1;

k=1, n=10-1=9

Page 33: HYPOTHESIS TESTING

33

From the sign test table p=0.0195

Since p<0.025, we reject H0.

We conclude that the median score is not 5.

Page 34: HYPOTHESIS TESTING

34

A SINGLE POPULATION PROPORTIONA SINGLE POPULATION PROPORTION

The proportion or the percentage of a population and the probability associated with the occurence of a particular event all involve the binomial parameter p. Recall that p was defined to be the theoretical or population probability of success on a single trial in a binomial experiment.

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.

Page 35: HYPOTHESIS TESTING

35

The mean of x is np, thus the mean of p, p should be np/n=p

Standard error of p npqnnpqp

An observed value of p belongs to a sampling distribution that

• is approximately normal

• has a mean , equal to p

• has a standard error , equal to npqp

p

/ nPQ

Ppz

Page 36: HYPOTHESIS TESTING

36

Example Suppose we are interested in knowing what proportion of automobile drivers regularly wear sealt belts. In a survey of 300 adult drivers, 123 said they regularly wear seat belts. Can we conclude that from these data that in the sample population the proportion who regularly wear belts is not 0.50?

p=123/300=0.41H0: p=0.50

HA: p0.50

11.3300/)50.0)(50.0(

50.041.0

/

nPQ

Ppz

Critical z values are -1.96

-3.11<-1.96 Reject H0.

We conclude that in the population the proportion who regularly wear belts is not 0.50.

Page 37: HYPOTHESIS TESTING

37

ONE SAMPLE CHI SQUARE TESTONE SAMPLE CHI SQUARE TESTThere are many problems for which the information is categorized and the results are shown by the way of counts.

Suppose that we have a number of celss into which n observations have been sorted. The observed frequencies in each cell are denoted by O1, O2, O3, ..., Ok. Note that the sum of all observed frequencies is equal to O1+ O2+ O3+ ...+ Ok=n

What would like to do is to compare the observed frequencies with some expected or theoretical frequencies, denoted by E1, E2, E3, ..., Ek, for each of these cells. Again, the sum of these expected frequencies must be exactly E1+ E2+ E3+ ...+ Ek=n

Page 38: HYPOTHESIS TESTING

38

We will decide whether the observed frequencies seem to agree or seem to disagree with the expected frequencies. This will be accomplished by a hypothesis test using the chi-square distribution, 2.

The calculated value of the test statistic will be

k

i i

ii

E

EO

1

22 )(

022

),1( Hreject kdf

Page 39: HYPOTHESIS TESTING

39

Chi-square table

df

0.05 0.01 0.001

1 3,841 6,635 10,827

2 5,991 9,210 13,815

3 7,815 11,340 16,268

... ... ...

30 43,770 50,890 59,703

Page 40: HYPOTHESIS TESTING

40

wearing wearing sealt beltssealt belts

ObservedObserved ExpectedExpected (O-E)(O-E) (O-E)(O-E)22 (O-E)(O-E)22/E/E

YesYes 123123 150150 -27-27 729729 4.864.86

NoNo 177177 150150 2727 729729 4.864.86

TotalTotal 300300 300300 00 9.729.72

H0: The proportion of drivers wearing sealt belts is equal to 0.50.

HA: The proportion of drivers wearing sealt belts is not equal to 0.50.

72.9)(2

1

22

i i

ii

E

EO0

22)05.0,1( Hreject 84.3