FEC 512.05

Preview:

DESCRIPTION

Hypothesis Testing

Citation preview

1

Introduction to Hypothesis Testing

Istanbul Bilgi University

FEC 512 Financial Econometrics-I

Asst. Prof. Dr. Orhan Erdem

2

What is a Hypothesis?

A hypothesis is a claim (assumption) about a population parameter:

population meanExample: The mean age of the citizens of this city is = 50.

3

Is always about a population parameter, not about a sample statistic

Begin with the assumption that the null hypothesis is true Similar to the notion of innocent until proven guilty

Always contains “=” , “≤” or “” sign May or may not be rejected

The Null Hypothesis, H0

50μ:H 0 50x:H 0

4

The Alternative Hypothesis, HA

Is the opposite of the null hypothesis e.g.: The mean age of this city is not 50

( HA: 50 )

Never contains the “=” , “≤” or “” sign May or may not be accepted Is generally the hypothesis that is

believed (or needs to be supported) by the researcher

5

Formulating Hypotheses

Example: The average annual income of citizens of this city is claimed to be $65,000 per year. An analyst would like to test this claim.

What is the appropriate hypothesis test?

6

Example 1: The average annual income of city A is claimed to be $65,000 per year. An analyst would like to test this claim.

What is the appropriate test?

H0: µ = 65,000 (income is as claimed) status quoHA: µ ≠ 65,000 (income is different than claimed)

The analyst will believe the claim unless sufficient evidence is found to discredit it.

Formulating Hypotheses

7

A Trial as a Hypothesis Test

Hypothesis testing is very much like a court trial. The null hypothesis is that the defendant is

innocent. We then present the evidence—collect data. Then we judge the evidence—”Could these data

plausibly have happened by chance if the null hypothesis were true?” If they were very unlikely to have occurred, then the

evidence raises more than a reasonable doubt in our minds about the null hypothesis.

8

What to Do with an “Innocent” Defendant If the evidence is not strong enough to reject the

presumption of innocent, the jury returns with a verdict of “not guilty.” The jury does not say that the defendant is innocent.All it

says is that there is not enough evidence to convict, to reject innocence.

The defendant may, in fact, be innocent, but the jury has no way to be sure.

Said statistically, we will fail to reject the null hypothesis.

We never declare the null hypothesis to be true, because we simply do not know whether it’s true or not.

Population

Claim: thepopulationmean age is 50.(Null Hypothesis:

REJECT

Supposethe samplemean age is 20: x = 20

SampleNull Hypothesis

20 likely if = 50?Is

Hypothesis Testing Process

If not likely,

Now select a random sample

H0: = 50 )

x

10

Sampling Distribution of x

= 50If H0 is true

If it is unlikely that we would get a sample mean of this value ...

... then we reject the null

hypothesis that = 50.

Reason for Rejecting H0

20

... if in fact this were the population mean…

x

11

Level of Significance,

Defines unlikely values of sample statistic if null hypothesis is true Defines rejection region of the sampling

distribution

Is designated by , (level of significance)

Typical values are .01, .05, or .10 Is selected by the researcher at the beginning

Provides the critical value(s) of the test

12

Level of Significance and the Rejection Region

H0: μ ≥ 50

H1: μ < 500

H0: μ ≤ 50

H1: μ > 50

Represents critical value

Lower-tail test

Level of significance =

0Upper-tail test

Two-tail test

Rejection region is shaded

/2

0

/2H0: μ = 50

H1: μ ≠ 50

13

Errors in Making Decisions

Type I Error Reject a true null hypothesis Considered a serious type of error

The probability of Type I Error is Called level of significance of the test Set by researcher in advance

14

Errors in Making Decisions

Type II Error Fail to reject a false null hypothesis

The probability of Type II Error is β

(continued)

15

Outcomes and Probabilities

Actual SituationDecision

Do NotReject

H0

No error (1 - )

Type II Error ( β )

RejectH0

Type I Error( )

Possible Hypothesis Test Outcomes

H0 False H0 True

Key:Outcome

(Probability) No Error ( 1 - β )

16

Power of the Test

The power of a test is the probability of rejecting a null hypothesis that is false

i.e., Power = P(Reject H0 | H1 is true)

Power of the test increases as the sample size increases

17

Hypothesis Tests for the Mean

σ Known σ Unknown

Hypothesis Tests for

Assume first that the population standard deviation σ is known

18

Test of Hypothesis for the Mean (σ Known)

Convert sample result ( ) to a z value

The decision rule is:

α0

0 z

n

σμx

z if H Reject

σ Known σ Unknown

Hypothesis Tests for

Consider the test

00 μμ:H

01 μμ:H

(Assume the population is normal)

x

19

Level of Significance and the Rejection Region

H0: μ ≥ 50

HA: μ < 50

50

H0: μ ≤ 50

HA: μ > 50

H0: μ = 50

HA: μ ≠ 50

/2

Lower tail test

Level of significance =

50

/2

Upper tail test Two tailed test

50

-? ? -? ?

Reject H0 Reject H0 Reject H0 Reject H0Do not

reject H0

Do not reject H0

Do not reject H0

Example:Example: Example:

20

Level of Significance and the Rejection Region

H0: μ ≥ 50

HA: μ < 50

0

H0: μ ≤ 50

HA: μ > 50

H0: μ = 50

HA: μ ≠ 50

/2

Lower tail test

Level of significance =

0

/2

Upper tail test Two tailed test

0

-zα zα -zα/2 zα/2

Reject H0 Reject H0 Reject H0 Reject H0Do not

reject H0

Do not reject H0

Do not reject H0

Example:Example: Example:

21

Reject H0Do not reject H0

Upper Tail Tests

zα0

μ0

H0: μ ≤ μ0

H1: μ > μ0

Critical value

Z

α0

0 z

n

σμx

z if H Reject

nσ/ZμX if H Reject α00

n

σzμ α0

Alternate rule:

x

22

Reject H0 Do not reject H0

The cutoff value,

or , is called

a critical value

Lower Tail Tests

-zα

-zα xα

0

μ

H0: μ ≥ μ0

HA: μ < μ0

n

σμ 0 zx

I always find a corresponding z

value to x

23

There are two cutoff

values (critical values):

or

Do not reject H0 Reject H0Reject H0

Two Tailed Tests

/2

-zα/2

xα/2

± zα/2

xα/2

0μ0

H0: μ= μ0

HA: μ μ0

zα/2

xα/2

n

σμ /20/2 zx

Lower

Upperxα/2

Lower Upper

/2

24

Example: Upper-Tail Z Test

for Mean ( Known) A supermarket chain manager thinks that

customer age have increased, and now average over 52. The company wishes to test this claim. (Assume = 10 is known)

H0: μ ≤ 52 the average is not over 52 per month

H1: μ > 52 the average is greater than 52 (i.e., sufficient evidence exists to support the manager’s claim)

Form hypothesis test:

25

Reject H0Do not reject H0

Suppose that = .10 is chosen for this test

Find the rejection region:

= .10

1.280

Reject H0

Example: Find Rejection Region

(continued)

1.28nσ/

μxz if H Reject 0

0

26

Obtain sample and compute the test statistic

Suppose a sample is taken with the following results: n = 64, x = 53.1 (=10

was assumed known)

Using the sample results,

0.88

64

105253.1

n

σμx

z 0

Example: Sample Results(continued)

27

Reject H0Do not reject H0

Example: Decision

= .10

1.280

Reject H0

Do not reject H0 since z = 0.88 < 1.28

i.e.: there is not sufficient evidence that the mean age is over 52

z = 0.88

Reach a decision and interpret the result:(continued)

28

Known

Large Samples

Unknown

Hypothesis Tests for

Small Samples

The test statistic is:

Calculating the Test Statistic

n

sμx

t 1n

But is sometimes approximated using a z:

n

σμx

z

(continued)

29

Known

Large Samples

Unknown

Hypothesis Tests for

Small Samples

The test statistic is:

Calculating the Test Statistic

n

sμx

t 1n

(The population must be approximately normal)

(continued)

30

Review: Steps in Hypothesis Testing

1. Specify the population value of interest

2. Formulate the appropriate null and alternative hypotheses

3. Specify the desired level of significance

4. Determine the rejection region

5. Obtain sample evidence and compute the test statistic

6. Reach a decision and interpret the result

31

Example: Risk and Return of an Equity Mutual Fund (σ unknown) The ABC Fund, that has been in existence for

36 months achieved a monthly return of 1.5% with s=3.6%. This fund was expected to have earned at least 1.9% mean monthly return over that time period. Are the actual results consistent with an underlying population mean return of at least 1.9% with 5% level of significance?

32

Solution

Test the claim that the true mean # of ABC Fund return is at least 1.9

1. Specify the population value of interest The mean return of ABC

2. Formulate the appropriate null and alternative hypotheses H0: μ 1.9 HA: μ < 1.9 (This is a lower

tail test) 3. Specify the desired level of significance

= .05 is chosen for this test

33

Reject H0 Do not reject H0

Hypothesis Testing Example 4. Determine the

rejection region

= .05

-tα= -1.68 0

This is a one-tailed test with = .05. Since σ is not known, the cutoff value is a t value. But since we have 36 data, z-value can also be used.

Reject H0 if t < t = -1.68 ; otherwise do not reject H0

(continued)

34

5. Obtain sample evidence and compute the test statistic sample is taken with the following results: n = 36, x = 1.5

Then the test statistic is:

Hypothesis Testing Example

66.0

36

6.39.15.1

n

sx

t

35

Reject H0 Do not reject H0

= .05

-1.68 0

6. Reach a decision and interpret the result

-0.66

Since t = -1.68 <-0.66, we fail to reject the null hypothesis that the mean return for ABC Fund is at least 1.9%

Hypothesis Testing Example(continued)

z

36

Smallest value of for which H0 can

be rejected

Obtain the p-value from a table or computer

Compare the p-value with

If p-value < , reject H0

If p-value , do not reject H0

p-Value Approach to Testing

37

Reject H0

= .10

Do not reject H0 1.28

0

Reject H0

Z = .88

Calculate the p-value and compare to (assuming that μ = 52.0)

(continued)

.1894

.810610.88)P(z

6410/

52.053.1zP

52.0) μ | 53.1xP(

p-value = .1894

Example: p-Value Solution

Do not reject H0 since p-value = .1894 > = .10

38

p-value =0.26

= .05

p-value example

Example: How likely is it to see a sample mean of 0.93 (or something further below the mean) if the true mean is = 1.9?

-1.68

-0.66

x

39

Compare the p-value with

If p-value < , reject H0

If p-value , do not reject H0

Here: p-value = 0.26 = .05

Since .05 < 0.26, we fail to reject the null hypothesis

(continued)p-value example

40

Reject H0: μ 52

Do not reject H0 : μ 52

Type II Error (Revisited)

Type II error is the probability of

failing to reject a false H0

5250

Suppose we fail to reject H0: μ 52 when in fact the true mean is μ = 50

41

Reject H0: 52

Do not reject H0 : 52

Type II Error

Suppose we do not reject H0: 52 when in fact the true mean is = 50

5250

This is the true distribution of x if = 50

This is the range of x where H0 is not rejected

(continued)

42

Reject H0: μ 52

Do not reject H0 : μ 52

Type II Error

Suppose we do not reject H0: μ 52 when in fact the true mean is μ = 50

5250

β

Here, β = P( x cutoff ) if μ = 50

(continued)

43

Reject H0: μ 52

Do not reject H0 : μ 52

Suppose n = 64 , σ = 6 , and = .05

5250

So β = P( x 50.766 ) if μ = 50

Calculating β

50.76664

61.64552

n

σzμxcutoff

(for H0 : μ 52)

50.766

44

Reject H0: μ 52

Do not reject H0 : μ 52

.1539.3461.51.02)P(z

646

5050.766zP50)μ|50.766xP(

Suppose n = 64 , σ = 6 , and = .05

5250

Calculating β(continued)

Probability of type II error:

β = .1539

45

Type I & II Error Relationship

Type I and Type II errors can not happen at the same time

Type I error can only occur if H0 is true

Type II error can only occur if H0 is false

If Type I error probability ( ) , then

Type II error probability ( β )

46

Factors Affecting Type II Error All else equal,

β when the difference between hypothesized parameter and its true value

β when

β when σ

β when n

47

Making Errors

How often will a Type I error occur? Since a Type I error is rejecting a true null

hypothesis, the probability of a Type I error is our level.

When H0 is false and we reject it, we have done the right thing. A test’s ability to detect a false hypothesis is

called the power of the test.

48

Making Errors

When H0 is false and we fail to reject it, we have made a Type II error. We assign the letter to the probability of this

mistake. It’s harder to assess the value of because we

don’t know what the value of the parameter really is.

There is no single value for --we can think of a whole collection of ’s, one for each incorrect parameter value.

49

Making Errors (cont.)

One way to focus our attention on a particular is to think about the effect size. Ask “How big a difference would matter?”

We could reduce for all alternative parameter values by increasing . This would reduce but increase the chance of a Type I

error. This tension between Type I and Type II errors is

inevitable.

50

Power

The power of a test is the probability that it correctly rejects a false null hypothesis.

When the power is high, we can be confident that we’ve looked hard enough at the situation.

The power of a test is 1 – .

51

Reject H0: μ 52

Do not reject H0 : μ 52

Type II Error

Suppose we do not reject H0: μ 52 when in fact the true mean is μ = 50

52

50

β

(continued)

Power

52

Power (cont.)

Whenever a study fails to reject its null hypothesis, the test’s power comes into question.

When we calculate power, we imagine that the null hypothesis is false.

The value of the power depends on how far the truth lies from the null hypothesis value. The distance between the null hypothesis value,

p0, and the truth, p, is called the effect size. Power depends directly on effect size.

53

Reducing Both Type I and Type II Error The previous figure seems to show that if we

reduce Type I error, we must automatically increase Type II error.

But, we can reduce both types of error by making both curves narrower.

How do we make the curves narrower? Increase the sample size.