topic 3: hypothesis testing - web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · topic 3 econ...

154
Topic 3 econ 246 page 1 Topic 3: Hypothesis Testing Introduction # Within Topics 1 and 2, we employed point and interval estimation to estimate some unknown p_________ parameter. I.e. μ and σ. # Within Topic 3, we now want to test the validity of some statement about the p_________. Example: Did the price of gasoline increase by an average of only 104 a litre last month? Example : Is the proportion of income paid as tax the same in 1999 as in 2009? # These assumptions (or questions) about unknown values of

Upload: others

Post on 11-Jun-2020

11 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 1

Topic 3: Hypothesis Testing Introduction

# Within Topics 1 and 2, we employed point and interval estimation to estimate some unknown p_________ parameter. I.e. μ and σ. # Within Topic 3, we now want to test the validity of some statement about the p_________. Example: Did the price of gasoline increase by an average of only 104 a litre last month? Example: Is the proportion of income paid as tax the same in 1999 as in 2009? # These assumptions (or questions) about unknown values of

Page 2: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 2

population parameters are generally referred to as STATISTICAL HYPOTHESES. # Determining the validity of an assumption of this nature is called Ahypothesis testing.@ #The primary goal of hypothesis testing is to choose between ___ e_______ and mutually exclusive competing hypotheses about the value of a population parameter. Eg. A student cannot fail and pass the same test. Eg. Average weekly income is either $1500 or not $1500. Types of Hypotheses:

Page 3: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 3

When specifying the competing hypotheses with respect to some

statement about a population parameter, it is convenient to distinguish between s_____ hypotheses and c________ hypotheses:

1) Simple Hypotheses: only ___ value of the population parameter is specified. Example: Test whether the average price of gasoline last month μ=704/litre. Example: The variability of the increase in gas prices last month was σ2=100 4.

2) C_______ Hypotheses: Specifies a r_____of values that the population parameter may assume.

Page 4: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 4

With composite hypotheses, more than one value is specified in each case. Examples: The average price of gasoline last month was μ

≠ 704/litre. The price of gasoline was μ> 704/litre. The variability of gas prices σ2≠ 100 42

Simple hypotheses are generally ______ to test than

composite hypotheses. With simple hypotheses we only have to determine whether

or not the population parameter e_____ the specified value.

Page 5: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 5

With composite hypotheses, we must determine whether or not the population parameter takes on any one of a ___ of values.

Page 6: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 6

The two mutually exclusive hypotheses in a statistical test are referred to as the ____ hypothesis and the alternative hypothesis:

(I) Null Hypothesis: It is the statement being tested

Denoted by H0. H0 is pronounced AH-nought.@ It is called Anull= because this hypothesis corresponds to a

theory about a population parameter that is thought __ to be ____. Hence, the title: >null= or >invalid=. BUT: assume it is t___ until proven otherwise.

Example: θi~(μ, σ2) H0: μ=0 (Testing to see if the population mean is zero.)

We can either reject or fail to reject the null hypothesis.

Page 7: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 7

(II) Alternative Hypothesis: It is the situation which prevails if the null is _____. Denoted Ha. Generally, Ha specifies the values of the parameter that the

researcher believes is ____. Example: θi~(μ, σ2) If the null is H0: μ=0, the alternative could be:

(a) Ha:μ>0

One-sided alternative. (b) Ha:μ<0

(c) Ha:μ≠ 0 Two-sided alternative.

Page 8: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 8

Remarks:

(i) H0 (the null hypothesis) and Ha (the alternative hypothesis), must be mutually exclusive (i.e. no

overlap). P A B( )I = 0 .

If H0 is ____, then Ha is false.

(ii) The null and alternative hypotheses can both be either simple or composite:

Page 9: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 9

Examples:

HH

Simple null and alternative

HH

Composite and composite

HH

Simple null composite alternative

a

a

a

0

0

0

01

00

00

::

.

::

.

::

, .

μμ

μμ

μμ

==

⎫⎬⎭⇐

≤ ⎫⎬⎭⇐

= ⎫⎬⎭⇐

>

<

Regardless of the form of the two hypotheses, the true population parameter under consideration ____ be either in the set specified by H0 or in the set specified by Ha NO Overlap!!

Page 10: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 10

Cannot have: H0: μ=5 Ha: μ>4 To guarantee there is no ______, one convention is to create

complementary hypotheses: H0: μ=0 Ha: μ≠ 0 (There are no common elements in each hypothesis.)

(iii) The hypothesis is always specified about the __________ parameter, and not about the sample statistic.

H correct form

H X incorrect form0

0

25

25

:

: !

μ = ⇐

= ⇐

Page 11: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 11

One and Two-Sided Tests

If the null hypothesis is ______, (H0: μ=0), then the alternative hypothesis may specify value(s) for the population parameter that are entirely above (Ha: μ>0), entirely below, (Ha: μ<0) or on both sides of the value specified by the null hypothesis, (Ha: μ≠ 0).

Page 12: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 12

Notation: One-sided Test: A statistical test where Ha Ha specifies that the population parameter lies either entirely >above= or >below= the value specified in the ____ hypothesis.

Example:

HHa

0 77

::μμ= ⎫

⎬⎭> One sided test, since Ha specifies that μ

lies on one particular side of 7.

Page 13: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 13

Two-Sided Test: A statistical test where the Ha (alternative hypothesis) specifies that the parameter can lie on either side of the value indicated by H0 (null hypothesis).

Example:HHa

0 77

::μμ=≠

⎫⎬⎭ Two-sided test since Ha specifies that μ

lies on either side of 7. Decision Problem

Page 14: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 14

We must use s____nformation to determine whether to reject or

not reject the null hypothesis.

Hence, we must deal with the Auncertainty@ associated with using samples to test hypotheses pertaining to __________ parameters.

We again are faced with using sample information to say something about the unknown population parameter.

Achances of error@.

In hypothesis testing, the usual procedure to solving these

Page 15: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 15

decisions is to: (1) initially assume that the null hypothesis is ____; (2) establish a probability testing criteria; (3) take a sample; and (4) then employ probability based testing criteria.

We can then decide whether there is sufficient evidence to reject the null.

The probability value (c_______ value) which we base our conclusion, that the null is false, is extremely important.

Moreover, since the decisions to accept or reject the null are probability based, there are Achances of error@ in these decisions.

Page 16: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 16

Two Types of Potential Error Based on the sample result:

(1) T____ Error: Reject the null hypothesis when the ____ is actually true.

Page 17: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 17

(2) Type II Error: ______ the null hypothesis when the null is actually _____.

Page 18: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 18

True Situation:

H0 is True H0 is False

Action:

Accept H0

Incorrect Decision

Type II error Reject H0

Correct Decision

Page 19: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 19

Notes: Type I and Type II errors are c_________l probabilities.

1)Type I Error: Conditional on H0 being ____. The probability of Type I error is denoted by Aα@. Aα@ is referred to as the level of significance or ____ of the

test. Aα@ = P(Type I error) = P(Reject H0 | H0 is true).

The level of significance of a statistical test is comparable to the probability of an error, also referred to as >α=, as discussed in Topic 2.

Page 20: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 20

20

The value of A(1-α)@ is referred to as the confidence level and represents the c_________ of P(Type I Error). (1-α) = Confidence level = 1-P(Type I Error) = P(Accept H0 | H0 is true). Example: Set α = 10%. We will reject H0 when it is true, in 10% of the samples.

Page 21: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 21

21

2) Type II Error:

Conditional on H0 being _____.

The probability of a Type II error is denoted by >β=. β = P(Type II error) = P(Accept H0| H0 is false).

The complement of this probability is known as the _____ of a statistical test.

It indicates the ability of the test to correctly recognize that the null hypothesis is _____ and should be rejected. (1-β) = Power) = P(Reject H0| H0 is false).

Page 22: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 22

22

=1- P(Accept H0| H0 is false).

The researcher always wants to create a test that will yield a power close to __. I.e., >β= close to zero, when H0 is false.

Thus, we have the decision problem now, in terms of probability:

Page 23: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 23

23

Decision Problem:

True Situation:

H0 is True

H0 is False

Action:

Accept H0

(1-α)

Confidence Level

Reject H0

α

Size or Significance level

Sum

1

1

Page 24: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 24

24

Remarks: We want a test for which both α and β are small. (i.e. the

probability of the two errors are low).

The probability of each decision outcome is a conditional probability.

Elements in each column sum to one, because the ______ events are complements. α and β need not add to 1, since their probabilities are not

complementary. However, α and β are not independent of each other.

When α is lowered, β normally ________ if the sample size remains the same.

Page 25: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 25

25

α and β are not independent of the sample size, n.

If n increases, both α and β ________, since we use more information about the population and potentially reduce the sampling error.

Researchers must decide between the higher ____ of sampling to increase the sample size, and the potential sampling error and size of α and β.

In classical hypothesis testing, we set α and try to design tests

such that β is as _____ as possible.

Page 26: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 26

26

Page 27: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 27

27

Page 28: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 28

28

The Standard Format of Hypothesis Testing The general procedure for testing hypotheses follows 5 STEPS: STEP 1: State the ____ and alternative hypotheses. i.e. Formulate the H0 and Ha.

The form of the test will depend on both H0 and Ha

Example: HH Clearly specify the two conflicting hypotheses

a

0 100100

:: .μμ=≠

⎫⎬⎭

The two hypotheses must be mutually exclusive. The ____ value of the population parameter must be included in

one of these hypotheses.

Page 29: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 29

29

STEP 2: Determine the Test _________ Used To Test the Null Hypothesis. Example: In testing: HH

We could use X to do the testa

0 100100

::

.μμ=≠

⎫⎬⎭

In this example, we must decide whether H0 is true or false by

determining if X is “close enough” to 100.

If X is far above or below 100, this will lead us to reject the null.

If the value of X is slightly below or above 100, we will fail to reject the null, and we conclude that H0 is true.

Page 30: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 30

30

“ How do we decide what is far away and what is slightly above/below the null hypothesis?”

We need to use probability — specifically the sampling

distribution of the test statistic — to determine whether to reject or not reject H0.

To obtain a sampling distribution which is known, we transform

X to the standard normal distribution form:

Z

Xn

=− μ

σ0

’ where X ~N(µ,σ 2/n), σ is known, and µ0 is the value of µ under the null. (Here µ0=100)

Page 31: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 31

31

The random variable, Z, is the test statistic. The test statistic is a ______ variable employed to determine

whether a specific sample result falls in one of the hypotheses being tested.

The test statistic (1) must have its p.d.f. known under the condition that H0 is true; (2) must ______ the parameter being tested; and (3) all of its remaining terms musts be known or calculable from the sample.

Page 32: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 32

32

So, Z

Xn

=− μ

σ0

, (1) contains µ (2) we know the distribution of Z ~N(0,1) (3) in our example n and σ are assumed known and would be specified, and (4) X can be determined from the sample.

Page 33: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 33

33

STEP 3: Determine the “C______l Region(s)” of the Test

Before the sample is taken, it is important to specify which values of the test statistic will lead to the rejection of H0 , (called the critical region,) and which values will lead to the acceptance of H0.

The Critical Region is the region of test statistic values over

which we believe H0 to be f____, leading to a rejection of the ____ hypothesis.

The Acceptance Region is the complement of the rejection region. It is the region of test statistic values over which we believe the ____ to be true: acceptance of the null.

Page 34: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 34

34

The Critical _____ is the value of the test statistic that separates the critical region and acceptance region.

The Acceptance and Critical Regions for H0 (Two-sided Alternative)

Acceptance Region (Accept )

Critical Region (Reject H0 )

Critical Region (Reject H0 )

Large Negative Z

0 Z values close to zero.

Large Positive Z

Critical Value

Critical Value

Page 35: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 35

35

Question: “How do we determine the exact location of the Critical Values?”

Since the sampling distribution gives values of statistics and associated probabilities, we can use the sampling distribution of the ____ statistic, assuming H0 is ___, to evaluate the probability of observing different values of the test statistic under the null hypothesis.

Then we can derive critical values which depend on the level of risk of Type I errors (α) and Type II errors (β).

Page 36: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 36

36

Note: Decreasing the size of α will ________ the size of β. Traditionally, the value of α is set and then we choose the critical region that yields the ________ value of β.

The value of α is an indicator of the degree of _________ that a researcher attaches to the consequences of incorrectly rejecting the null H0.

Usually in Social Sciences, we use a level of significance of α =0.05. I.e. we are willing to accept a 5% chance of being wrong when we reject H0. In contrast, hard sciences, like pharmacology, α is set much lower α =0.0005 or α =0.00005 indicating a greater concern of incorrectly rejecting H0.

Page 37: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 37

37

Example Continuation:

HHa

0 100100

::μμ=≠

⎫⎬⎭

Suppose the researcher desires a level of significance of α =0.05. I.e., no more than a 5% chance of committing a Type I error.

The researcher wants the critical region to cut off 5% of the appropriate p.d.f. Z- distribution.

When Ha hypothesis is two-sided, the optimal critical region will cut off α /2 of the area in each tail. (Same procedure as construction of a confidence interval.)

Page 38: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 38

38

If α =0.05, then α /2 =0.025. The Z-values that correspond to α /2=0.025 in each tail are ±1.96. 0 Z Critical Region Acceptance Region Critical Region

-1.96 1.96

α /2=0.025

Page 39: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 39

39

The above illustration expresses the critical value (±1.96) in terms of the Z-distribution.

i.e. We standardize X , so we could determine the critical values for a known probability distribution. We can also express the c_______ values in terms of X .

It is simple to transform a Z critical value into its X critical

value format by solving for X :

ZX

nOur test statistic

rearranging

X Zn

*

*

( )

:

=−

⎫⎬⎪

⎭⎪⇐

=⎡⎣⎢

⎤⎦⎥+

μσ

σμ

0

0

α /2=0.025

Page 40: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 40

40

−⎡⎣⎢

⎤⎦⎥+Z

n* σ μ0 μ0 100= +

⎡⎣⎢

⎤⎦⎥+Z

n* σ μ0

These 2 illustrations are equivalent means of depicting the critical regions.

X

Page 41: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 41

41

STEP 4: Take Your Sample and Calculate the Value of the Test Statistic

Recap: 1) Specified ___ hypotheses: H0 and Ha. 2) Determined the appropriate test statistic. 3) Found the critical region(s).

Now we must determine if the sample result lands in the acceptance or rejection regions.

Page 42: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 42

42

If we use Z-values to define the ________ values, we must standardize the sample results into Z-values.

This is called determining the “computed-Z” value: Zc

Z X

nc =

−⎛⎝⎜

⎞⎠⎟

( )μσ

0

Notation: Z* Critical Z-value Zc Computed Z value t* Critical t-value tc Computed t-value

Page 43: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 43

43

STEP 5: Compare the Calculated Test Statistic With the Critical Value and Make the Statistical Decision Decision Rule: If Zc value of the test statistic falls within the critical region, then the belief that H0 is true, is r_______. If Zc value of the test statistic falls within the acceptance region, H0 is a_______. Remarks: The final decision depends on:

the particular ______ α, the level of significance/size of the test form of the a__________ hypothesis: Ha

Page 44: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 44

44

Example: Two-Sided Test Let Xi ~N(µ,σ 2) We want to test the belief that µ=$50.

HHa

0 5050

::μμ=≠

⎫⎬⎭

We decide that we will test at the 5% significance level α =0.05. Suppose that n=144; σ 2=36; and X =48.5. Question: Is the value of X (=48.5) “close enough” to the value of µ under the null?

Page 45: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 45

45

The sampling distribution: X ~ N(µ,σ 2/n) = N(50, 36/144=0.25) if H0 is true.

P( X |H0 is true) Acceptance Region 0 X

XUpper Crit

*

α =5% P(reject H0|H0 is true)=0.05

P(Z > Z*)=0.025 Where Z* is the critical value for Z. From the standard normal table we get:

X Lower Crit*

Page 46: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 46

46

Z*upper =_____ Z*Low = -1.96 We reject H0 if either: Zc >1.96 Zc<-1.96

ZX

nc =

−=

−= = −

μσ

0 485 506

122 15 3

( . )( . )

Since Zc =-3 which is less than -1.96, we ______ H0 at 5% level of significance.

Page 47: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 47

47

0 Z -3

rejection Notice we split the significance level into 2 parts — one

relating to each condition under which we would reject H0.

-1.96 1.96

Page 48: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 48

48

One-Sided Tests For these tests, the only difference from the two-sided tests is that the one-sided tests have a one-sided ___________ hypothesis, such that we have a single critical rejection region. HHa

0 5050

::μμ=>

⎫⎬⎭

0 Z Z* Example:

α =probability in upper tail.

Page 49: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 49

49

Let Xi ~N(µ,σ 2 =36) Test to determine if the population mean is equal to 50 (µ=50)

HH

One sided null hypothesisa

0 5050

::

.μμ= ⎫

⎬⎭⇐ −

< Suppose n=144; X = 48.5; Test at 5% significance α =0.05.

“Is X close enough to the value of µ under the null?” X ~ N(µ,σ 2/n) =N(50, 36/144=0.25) if H0 is true.

Page 50: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 50

50

50 X

Rejection region Acceptance region

X * is the critical value for X .

X *

Page 51: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 51

51

Standardize X :

ZX

nc =

−=

−= − = −

μσ

0 485 506

122 15 3

( . )( . )

Zc ~N(0,1) Zα = = −0 05 1645.

* . Critical value

Since, Zc < Z =0.05*α , reject the null: The population mean does

not equal 50.

Page 52: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 52

52

In terms of the original units:

X Zn

X

X

* *

*

*

.

. .

= − ⎛⎝⎜

⎞⎠⎟+

= − ⎛⎝⎜

⎞⎠⎟ +

= − + =

ασ μ

1 645 612

50

0 8225 50 49 1775Critical value

X Zn

X

X

c c

c

c

= −⎛⎝⎜

⎞⎠⎟+

= −⎛⎝⎜

⎞⎠⎟ +

= − + =

σμ

306

1250

150 50 485

.

. .Calculated value

Since 48.5 is less than and left of 49.1775, we reject the null.

Page 53: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 53

53

XC = 48 5. 50 X

X * .= 49 177

Page 54: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 54

54

What if we change the level of significance? Test at 1% significance α =0.05.

“Is X close enough to the value of µ under the null?”

Z

X

nc =

−=

−= − = −

μσ

0 485 506

122 15 3

( . )( . )

Zc ~N(0,1) − = −=Zα 0 01 2 326.

* . We still reject the null. ******************************************************

Page 55: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 55

55

“What if we change the level of significance again?”: Test at 0.1% significance: α =0.001. “Is X close enough to the value of µ under the null?”

Z

X

nc =

−=

−= − = −

μσ

0 485 506

122 15 3

( . )( . )

Zc ~N(0,1) − = −=Zα 0 001 308.

* . We cannot reject the null at the α =0.001 level.

Page 56: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 56

56

The P-Value

Test results can vary depending on α, the level of significance. It is not unusual for researchers to _____ specifying α before

seeing the data, and instead reporting a probability that depends on the computed value of the test statistic, say Zc.

Changing the previous example such that X =49. Let Xi ~N(µ,σ 2 =36)

HH

One sided null hypothesisa

0 5050

::

.μμ= ⎫

⎬⎭⇐ −

<

Page 57: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 57

57

Suppose n=144; X = 49. Test at 5% significance α =0.05.

The computed value is now:

Z

X

nc =

−=

−= − = −

μσ

0 49 506

122 1 2

( )( )

We usually compare Zc with the critical values to decide whether to reject or not reject the null. − = −=Zα 0 01 2 326.

* . − = −=Zα 0 05 1 645.

* . − = −=Zα 0 10 1 28.

* . Zc is outside the 5% and 10% acceptance region but inside the 1% acceptance region.

Page 58: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 58

58

The P-value equals the probability that the random variable Z would take on a value as extreme as Zc, given that the null hypothesis is ____.

( )( )

P value P Z Z

P ZP Z

c− = ≤

= ≤ −= − ≥= −=

(( )

..

21 21 0 97720 0228

“A sample mean of 49 or lower will occur only 2.28% of the time when the true mean is 50. Hence, the true mean may not actually be 50.”

Page 59: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 59

59

Decision Rule: If α is larger than p-value,______ H0. If α is lower than p-value, ______ H0. The above example relates to a one-sided test about µ, when Ha is one-sided on the lower side:

( )P value P Z Zc− = ≤ When Ha is one-sided on the upper side:

( )P value P Z Zc− = ≥

Page 60: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 60

60

If the alternative hypothesis is two-sided, the one-sided probability must be _______ to obtain the p-value:

( )( )

P value P Z Z

P ZP Z

c− = ≤

= ≤ −= − ≥= −= =

2

2 22 1 22 1 0 97722 0 0228 0 0456

*

* (*( ( ))( . )*( . ) .

So, if µ=50, we would observe a sample mean with the difference from the mean higher than one, (50-49), either above or below µ, in 4.56% of the samples.

Relating back to the example above, reject H0 at the α =0.05, but accept H0 at α =0.01.

Page 61: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 61

61

Given that we have a 2-sided alternative:

-2.575 –2 –1.96 –1.645 0 1.645 1.96 2 2.575

At α =5% , Z*=1.96 At α = 10%, Z*=1.645 At α =1% , Z*=2.575 For any test, the p-values can be obtained (at least approximately or within a range) from interpolation within a probability table such as Z-table, t-table, etc. Exact p-values can be found using ______.

Page 62: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 62

62

Example: Your research group is hired as consultants to a major financial institution in Toronto who plan to market a new financial product, targeting people living in major urban areas. In a previous census 5 years ago, the mean income of people 25-40 years old was normally distributed with a mean of $42,000 per year, and a standard deviation of $8,000. Within wage gaps closing due to union and pay equity, it is believed that the mean income has increased. Your team takes a random sample of 75 incomes and finds

X =$43,500. Report a p-value, assuming the standard deviation has not changed. Would you accept or reject the null hypothesis at the 5% significance level?

Page 63: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 63

63

(1) Establish the Hypotheses: HHa

0 42: (in thousands):μμ=> 42 (one - sided)

(2) Test Statistic: Z

X

nc =

−⎛⎝⎜

⎞⎠⎟

( )μ

σ0

(3) Determine critical regions: Since α =0.05 and Ha is one sided on the high side, the critical value is Z α =Z0.05=1.645.

Page 64: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 64

64

(4)Calculate the test statistic value and report a p-value:

ZX

nc =

−=

−= =

μσ

0 435 428

75

150 924

1623( . ) .

..

Zc =1.623 P(Z >1.623) =1-P(Z<1.623)=1-0.9474=0.0526 P-value= 0.0526 (5) Decision rule: Since the p-value is greater than 0.05, we cannot reject the null. P-value falls within the ________ region. The mean income has not changed.

Page 65: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 65

65

Testing Hypotheses About µ When σ 2 is Unknown

In general, there are two types of tests involving µ σ assumed to be known: use of the Z-distribution is appropriate. σ assumed to be unknown: t-distribution appropriate test statistic (although Z-distribution is OK if n > 30.

If we need to solve problems involving X when σ is unknown, use the t-distribution if the parent population is ______.

Page 66: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 66

66

So, if µ0 is the value of µ specified by the ____ hypothesis, then when σ is _______ and the population is normal, the appropriate test statistic for tests on µ is:

tX

sn

Standardize X and form t statisticn( )− =−

⇐ −10μ

Page 67: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 67

67

Example: In 1975, the average birth-weight was 7.5 lbs. We believe that newborn birth-weights are ______ now than they were 25 years ago. We sample 25 such weights and find that X =8.2 lbs. with s2=4 lbs2. Using a significance level of 5%:

[ ]α = =P Reject H H is true0 0 0 05. ,test to see if birth-weights have

increased. (1) Determine the hypotheses:

Test: HHa

0 7 57 5

: .: .μμ=>

(2) Test Statistic:

tX

sn

n( )− =−

10μ

Page 68: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 68

68

(3) Determine Critical Region:

t t

X

critical = =

=⎡⎣⎢

⎤⎦⎥+ =

0 05 24 1711

171125

7 5 81844

. ,*

*

.

. . .

(4) Calculate the test statistic and p-value:

tX

sn

Calculated t valuec =−

=−

= ⇐ −μ0 8 2 7 5

25

175. .

.

t

X

calculated

c

=

=⎡⎣⎢

⎤⎦⎥+ =

175

17525

7 5 8 2

.

. . .

Page 69: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 69

69

(5) Since t* is less than tc and the calculated value is _______ the acceptance region, we reject the null to be true, and conclude that birth-weights have increased. Or since Xc > X * , we reject the null and conclude that birth- weights have increased. 0 1.711* 1.75c t24

8.2* 8.208c X Notice at the 1% level, t*=2.492, and at the 2.5% level, t*=2.064 We would accept the null that birth-weights have not changed in 25years.

Page 70: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 70

70

|_distrib t/type=t df=24 T DISTRIBUTION DF= 24.000 VARIANCE= 1.0909 H= 1.0000

DATA PDF CDF 1-CDF T ROW 1 1.7500 0.87989E-01 0.95355 0.0464481

( )P value P t CDF− = ≥ = − =175 1 0 04644. .

If we had a two sided alternative hypothesis: HHa

0 7 57 5

: .: .μμ=≠

( )

( )

P value P tP t P t

P t CDF

− == ≥ + ≤ −

= ≥ = −= =

> 175175 175

2 175 2 12 0 04644 0 09288

.( . ) ( . )( . ) *( )*( . ) .

Can reject the null at 10% significance level.

Page 71: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 71

71

Measuring β and the P____ of A Test

Up to this point, we have not calculated the value of β: P(Type II error),

primarily because the alternative hypothesis has been composite in format, and hence there is no one _____ specified for µ that makes H0 false. Example: H0: µ=100 Ha: µ≠100 (µ=100 makes it true, but µ=101, or 102, …makes it _____.)

Page 72: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 72

72

A Type I error, incorrectly _________ H0, is α, since it will occur when µ=100.

A Type II error, incorrectly _________ H0, can occur for any value of µ not equal to 100.

The probability of incorrectly accepting H0:µ=100, is much higher when the true value of µ=99.9 than when the true value is µ=125.

And, the _____ of β is different for these 2 situations.

β is higher for µ= 99.9 than β for µ=125, and it is more likely that a Type II error will be committed.

Page 73: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 73

73

So, one can calculate the values of β for other values of µ which may be possible under the ___________ hypothesis.

These different probabilities of β that occur when Ha is _________ can be summarized in either table format, by graphical illustration, or described by a functional relationship.

Often a _____ curve illustrates the value of (1-β) — the power function — which depicts the ability or power of the test to correctly reject a _____ null hypothesis.

Page 74: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 74

74

Example: Illustration of β Error Calculation:

Suppose Xi~N(µ=50, σ 2= 36); n=144 ; α =0.05 Zα /2=___.

Step 1: Determine your hypotheses: H0: µ = 50 Ha: µ ≠50 Step 2: Test Statistic:

ZX

n=

− μσ

0

A Type I error occurs when we believe µ≠ 50, when the null is actually true: H0: µ= 50.

Page 75: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 75

75

A Type II error occurs when we believe µ=50, when the null is actually _____ Ha: µ≠50.

Step 3: Critical values:

μσ

α0 2 50 1966

1250 0 98± = ± = ±Z

n*

/ ( . ) .

Acceptance region is from 49.02 to 50.98 in X units.

Page 76: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 76

76

Acceptance Region | | -1.96 0 1.96 Z __.__ 50 50.98 X

Page 77: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 77

77

How Do We Calculate β?

Since β is a conditional probability that depends on the ___ value of µ, we will assume that µ= 50.5. β=P(Accept H0:µ0=50|µ=50.5) We know that H0 will be ________ whenever X lies between 49.02 and 50.98. So, β=P(49.02 ≤ X ≤ 50.98|µ=50.5).

Page 78: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 78

78

Using the same Zα/2 and test statistic, we transform this problem into the standardized ______ format, but allow µ=____, σ = 6, and n= 144:

[ ]

P X PX

n

P Z

P ZF F

( . . ). . . .

.

...

. .( . ) ( . )

. . .

49 02 50 9849 02 505

612

50 98 5056

12

14805

0 4805

2 96 0 960 96 2 96

08315 0015 083

≤ ≤ =−

≤−

≤−

⎢⎢⎢

⎥⎥⎥

=−

≤ ≤⎡⎣⎢

⎤⎦⎥

= − ≤ ≤= − −= − =

μσ

P(Type II error) =0.83=β

Page 79: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 79

79

Interpretation: When µ=50.5, we will incorrectly ______ H0:µ0=50 as being true 83% of the time using our test procedure. The _____ of this test is (1- β)= 1-0.83= 0.17. This test will correctly recognize this _____ null hypothesis 17% of the time when µ= 50.5.

Page 80: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 80

80

Acceptance Region | | -1.96 0 1.96 Z 49.02 50 50.5 50.98 X µ0 µ The distribution is centred over the ____ value of µ.

Probability β of Type II Error for the acceptance region (49.02 to 50.98) if the true mean is 50.5.

Page 81: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 81

81

Remark: This is only one possible result using µ= 50.5. What about when µ=49.5?

[ ]

P X PX

n

P Z

P ZF F

( . . ). . . .

.

...

. .( . ) ( . )

. ( . ) .

49 02 50 9849 02 49 5

612

50 98 49 56

12

0 4805

14805

0 96 2 962 96 0 96

0 9985 1 08315 083

≤ ≤ =−

≤−

≤−

⎢⎢⎢

⎥⎥⎥

=−

≤ ≤⎡⎣⎢

⎤⎦⎥

= − ≤ ≤= − −= − − =

μσ

Symmetry! The power of this test is (1- β)= 1-0.83= 0.17.

This test will _________recognize this false null hypothesis 17% of the time when µ= 49.5.

Page 82: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 82

82

What if µ= 49.6

[ ]

P X PX

n

P Z

P ZF F

( . . ). . . .

.

...

. .( . ) ( . )

. . .

49 02 50 9849 02 49 6

612

50 98 49 66

12

05805

13805

116 2 762 76 116

0 9971 0123 08741

≤ ≤ =−

≤−

≤−

⎢⎢⎢

⎥⎥⎥

=−

≤ ≤⎡⎣⎢

⎤⎦⎥

= − ≤ ≤= − −= − =

μσ

P(Type II error) = 0.8741 When µ= 49.6, we will ________ accept H0:µ= 50 as being true

87.41% of the time The power 1-β =0.1259.

We will correctly recognize this false ____ hypothesis 12.5% of the time when µ=49.6.

Page 83: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 83

83

What about when µ=49.25?

[ ]

P X PX

nP ZF F

( . . ). . . .

. .( . ) ( . )

. ( . )

. . .

49 02 50 9849 02 49 25

612

50 98 49 256

12

0 46 346346 0 46

0 9997 1 0 67720 9997 0 3228 0 6769

≤ ≤ =−

≤−

≤−

⎢⎢⎢

⎥⎥⎥

= − ≤ ≤= − −= − −= − =

μσ

P(Type II error)= 0.6769 What about when µ=49.1?

[ ]

P X PX

nP ZF F

( . . ). . . .

. .( . ) ( . )( . ). .

49 02 50 9849 02 4910

612

50 98 49106

12

016 376376 016

1 1 056361 0 4264 05635

≤ ≤ =−

≤−

≤−

⎢⎢⎢

⎥⎥⎥

= − ≤ ≤= − −= − −= − =

μσ

P(Type II error)= 0.5635

Page 84: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 84

84

What about when µ=48.9?

[ ]

P X PX

nP ZF F

( . . ). . . .

. .( . ) ( . )

. ).

49 02 50 9849 02 48 9

612

50 98 48 96

12

0 24 416416 0 24

1 059480 4052

≤ ≤ =−

≤−

≤−

⎢⎢⎢

⎥⎥⎥

= − ≤ ≤= −= −=

μσ

P(Type II error)= 0.4052 What about when µ=48?

[ ]

P X PX

nP ZF F

( . . ). .

. .( . ) ( . )

. .

49 02 50 9849 02 48

612

50 98 486

12

2 04 596596 2 04

1 0 9793 0 0207

≤ ≤ =−

≤−

≤−

⎢⎢⎢

⎥⎥⎥

= ≤ ≤= − −= − =

μσ

P(Type II error)= 0.0207

Page 85: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 85

85

Table of Results: µ β Power=(1-β)

48.0 0.0207 0.9793 48.9 0.4052 0.5948 49.1 0.5635 0.4365

49.25 0.6769 0.3231 49.5 0.8300 0.1700 49.6 0.8741 0.1259

50.4 0.8741 0.1259 50.5 0.8300 0.1700

50.75 0.6769 0.3231 50.9 0.5635 0.4365 51.1 0.4052 0.5948 52.0 0.0207 0.9793

H0:μ0=50

Page 86: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 86

86

The most powerful ___ are ones with the steepest ascending power. (Power rises quickly towards ____.)

These are tests that quickly recognize a false ___ hypothesis for small differences between µ0, the hypothesized value of the parameter and µ, the true value. The Trade-Off Between α and β

When the sample size, n, is fixed, α and β have an _______ relationship. I.e. Cannot decrease α without _________ β. As α acceptance area widens β power of your test’s ability to reject H0|H0 is false.

Page 87: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 87

87

Illustration: repeat the example from above, but this time α = 10% instead of α = 5%. Since α has increased, the acceptance region will be ________ and β will be lower than before. Hence the power of the test will ________. Z0.10 = ± _____ Critical values Hypotheses: H0: µ0=50 Ha: µ0≠50 Critical and Acceptance Regions:

X Zn

* */ ( . ) .= ± = ± = ±μ

σα0 2 50 1645

612

50 08225

Page 88: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 88

88

Critical Values are 49.18 and 50.82, so the acceptance region is from 49.18 to 50.82. So, β = P(Accept H0:µ0=50| H0 is false) = P(Accept H0:µ0=50| µ=50.5) Since H0 is accepted whenever X lies between 49.18 and 50.82:

β = P(49.18 ≤ X ≤ 50.83 | µ=50.5)

Page 89: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 89

89

[ ]

P X PX

nP ZF F

( . . ). . . .

. .( . ( . )

. ( . )

.

4918 50824918 505

612

5082 5056

12

2 64 0 640 64 2 64

0 7389 1 0 99590 7348

≤ ≤ =−

≤−

≤−

⎢⎢⎢

⎥⎥⎥

= ≤ ≤= − −= − −=

μσ

β =0.7348 (which is less than 0.8300). This means that when µ=50.5, we will incorrectly accept H0:µ0=50 as being true about 73% of the time. The power of this test is (1- β)=27%.

Page 90: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 90

90

This test will correctly reject the _____ null 27% of the time when µ is actually 50.5. Note: Trade-off is not one-to-one.

Increasing α resulted in a _____ β and a higher power.

Recall, in classical testing we fix the P(Type I Error) and attempt to construct a test that minimizes P(Type II error) to maximize power:

Page 91: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 91

91

Definition: The “Power Curve” associated with a test plots power against the value of the parameter under the test. A) H0:µ=µ0 versus Ha:µ>µ0 : Upper-tail test Power=(1- β) P(reject H0|μ=μ*)=power at μ=μ* 1 P(reject H0|H0 is true)=α μ0 μ* μ H0 true {H0 is false}

Page 92: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 92

92

If the true value of μ = μ0, the Power of the test is α. β = 1- α.

As we move to the right and the value of μ gets farther away from μ0 (null) the power of the test rises and β falls. μ* is the value where we would reject a false null 100% of the time.

β=___ Prob(Type II Error)=0

Page 93: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 93

93

B) H0:µ=µ0 versus Ha:µ<µ0 Power=(1- β) P(reject H0|μ=μ*)=power at μ=μ* 1 P(reject H0|H0 is true)=α μ μ* μ0 {H0 is false} H0 true

Page 94: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 94

94

C) H0:µ=µ0 versus Ha: µ≠µ0 Power Power=(1- β) P(reject H0|μ=μ*)=power at μ=μ* 1 1 P(reject H0|H0 is true)=α μ * μ0 Symmetry of Power

Page 95: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 95

95

Definition: An unbiased test is one such that Power ≥ Size everywhere: (1- β) ≥ α. Definition: A consistent test is one whose power approaches 1 as the sample size goes to infinity.

Power as n⇒ ⇒ ∞1 . Meaning, we will always reject the null when the null is ____, as sample size is large.

We are using unbiased and consistent test here.

Page 96: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 96

96

Decreasing α and β by Increasing the Sample Size (n) The former examples fixed the sample ____ in advance.

If n changes, the size of α and β may be changed, since the size of n affects the __________of the underlying probability distribution and the location of the acceptance and critical regions.

When n is increased, the test usually becomes more _________ in distinguishing H0 and Ha since the acceptance region is _________.

α and β decrease.

Page 97: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 97

97

n=50 n=10 | | 0 As sample size increases:

Page 98: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 98

98

Example: H0: µ=50 Ha: µ≠50 n=625 σ=6 α= 0.05 Z α /2=±1.96 Critical and Acceptance Regions:

X Zn

* */ ( . ) .= ± = ± = ±μ

σα0 2 50 196

625

50 0 4704 Acceptance region is between 49.53 to 50.47. What if μ=50.5?

Page 99: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 99

99

[ ]

P X PX

n

P Z

P ZF F

( . . ). . . .

..

..

. .( . ) ( )

.

49 53 50 4749 53 505

625

50 47 5056

25

0 970 24

0 030 24

4 04 0131 05517 1 1

0 4483

≤ ≤ =−

≤−

≤−

⎢⎢⎢

⎥⎥⎥

=−

≤ ≤−⎡

⎣⎢⎤⎦⎥

= − ≤ ≤ −= − − −=

μσ

β =0.4483 (1- β)=0.5517 power has increased.

Page 100: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 100

100

One Sample Test On σ 2 Test On A Population Variance σ 2

Recall ( )n s− 1 2

2σ ~ χ ( )n−12

, is a χ2 random variable with: n = sample size σ 2 = population variance s2 = sample variance Parent population is normal and (n-1)=ν= degrees of freedom.

Page 101: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 101

101

We can use this random variable to test hypotheses about the unknown population variance σ 2 based on the sample estimator s2.

The appropriate test statistic for hypotheses about σ 2 for (n-1) degrees of freedom is:

χ σ( )

( )n

n s− =

−1

22

02

1

where σ 02 is the hypothesized value of σ 2 when H0 is true

and s2 is the sample variance:

sn

X Xii

n2 2

1

11

=−

−=∑ ( )

Page 102: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 102

102

Example: Suppose Xi ~ N(35, σ 2) α =______ n=___ s2=___ Step 1: H0: σ 2=28 Ha: σ 2<28 (One-sided alternative in the lower direction)

We will reject H0 for small values of the test statistic, and all ‘size’ is in the left-hand tail.

Step 2: Test statistic: χ

σ( )

( )n

n s− =

−1

22

02

1

Page 103: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 103

103

Step 3: Critical Values: χν2*

: P( χ 242 < χ 2* )= 0.05.

Using the Chi-square table: χ 2* = ______

Step 4: Calculate the test statistic: χ c2

for this sample:

χ c2 24 25

2860028

2142=⎡⎣⎢

⎤⎦⎥= =

( )( ). .

Page 104: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 104

104

Step 5: Decision Rule:

(i) Reject H0 if χ c2

is less than 13.8: χ c2

< χ 242* reject the null.

(ii) Accept H0 if χ c2

is greater than 13.8: χ c2 > χ 24

2* do not

reject the null.

Since χ c2

> χ 242* , we accept H0.

We cannot reject H0 that σ 2=28 at the 5% significance level. acceptance χ24

2 0 13.8 21.42 rejection

Page 105: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 105

105

Example: Two Sided Test Suppose Xi ~N(35, σ 2) α=0.05 n=25 s2=25 Step 1: H0: σ 2=28 Ha: σ 2 ≠28

So reject H0 if the test statistic is “too small” or “too large.”

Page 106: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 106

106

Step 2: Test statistic: χ

σ( )

( )n

n s− =

−1

22

02

1

Step 3: Critical Values: Must split 5% rejection region into 2 tails: 2.5% in each tail.

( )( )

χ

χ

χ χ χ χ

χ χ χ χ

Upper

Lower

n Upper n Lower

Upper Lower

critical upper tail value

critical lower tail valueThen

P or H is true

P or H is true

2

2

12 2

12 2

0

242 2

242 2

0

0 05

0 05

=

=

=

=

− −

.

.:

.

.

> <

> <

Page 107: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 107

107

From the Table χ

χLower

Upper

2

2

12 439 4

=

=

.

.

Step 4: Compute the test statistic:

χ c2 24 25

2860028

2142=⎡⎣⎢

⎤⎦⎥= =

( )( ). .

Step 5: Decision rule:

(i) Reject H0 if calculated value of test statistic, χ c2

, for this sample is less than _____or greater than ____.

(ii) Accept H0 if calculated value of the test statistic, χ c2

, is between 12.4 and 39.4.

Page 108: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 108

108

Since χ c2

=21.42, which falls into the acceptance region, we cannot reject the hypothesis that σ 2 =28 against the 2-sided alternative at the 5% level of significance. α /2 Acceptance Region α /2 χ24

2 0 12.4 21.42 39.4 lower calculated upper

Page 109: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 109

109

Hypothesis Testing: Multi-Sample Tests Introduction

In the last section we tested hypotheses about the population parameters from a single sample.

This chapter will examine hypothesis testing when two or more samples are drawn and we want to determine if these samples originate from the same __________. Example: We are trying to determine whether their population _____ or variances are the same?→If they are, then the same population generated the various samples. If ___, there is some statistically significant difference between these populations.

Page 110: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 110

110

Typical Examples: 1) Testing the different treatment of two groups for drug development: _______ Group Treatment Group 2) Tests on income equality: Is the mean salary of university graduates in Victoria and Calgary the same? 3) Is the mean salary of female employees the same as male employees in the automotive industry? 4) Is the male unemployment rate in Vancouver the same as the female unemployment rate?

Page 111: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 111

111

We will explore two primary cases:

I) Testing equality of two _____ when ( )σ σ12

22and are

both known.

II) Testing equality of two means when ( )σ σ12

22and are

both unknown. (But assumed _____.)

Page 112: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 112

112

Case I: Testing Equality of Two Means

(Population variances ( )σ σ12

22and are _____)

Let µ1 = mean of population 1. Let µ2 = mean of population 2. If we restrict the null hypothesis to be ______ in format, the common form of H0 is: H0:µ1 - µ2 =0 or H0:µ1 = µ2 These two means are equal.

There is no statistically significant difference between the means in each population.

Page 113: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 113

113

The alternative hypothesis could then be either: Ha: µ1 - µ2 >0 µ1 exceeds µ2 or Ha: µ1 - µ2< 0 µ2 exceeds µ1 or Ha: µ1 ≠ µ2 µ1 not equal to µ2

Suppose a simple random sample of size n1 is taken from

population 1 and X i1 12~ N( 1μ σ, ) . Also, suppose a simple

random sample of size n2 is drawn from population 2 and X i2 2

2~ N( 2μ σ, )

Page 114: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 114

114

Determine the Test Statistic: Recall, when we standardize the Z-variable is:

Z =−Point estimator Hypothesized mean

Standard error of point estimator . The “best” unbiased point estimator of (µ1 - µ2) is ( )X X1 2− , where:

( )X1 = mean of sample 1 ( )X2 = mean of sample 2

Page 115: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 115

115

The standard error of ( )X X1 2− , denoted ( )σ X X1 2− is:

V X Xn nX X( )1 2

12

1

22

21 2

− = = +−σσ σ

Note: Assuming independence:

V X X V X V XV X V X

n n

V Xn

( ) ( ) ( )( ) ( ) ( )

( ) .

1 2 1 2

12

2

12

1

22

22

1− = + −

= + −

= +

=

σ σ

σsince

Page 116: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 116

116

If X1 and X2 are normal then, ( )X X1 2− , is normal. (It is a linear function of normal random variables.)

Hence, ( )X X1 2− ~ ( ), .Nn n

μ μ σ σ1 2

12

1

22

2

− +⎛⎝⎜

⎞⎠⎟

⎣⎢

⎦⎥

Thus, we can derive the test statistic for finding the 2-sample computed Z-value for H0: µ1 - µ2 =0:

( ) ( )X X

n n

1 2 1 2

12

1

22

2

− − −

+

⎢⎢⎢⎢⎢

⎥⎥⎥⎥⎥

μ μ

σ σ ~ N(0, 1).

Page 117: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 117

117

The critical values are determined the same way as in the former sections:

If α=0.05, then α/2=0.025 Z*=±_____will be the critical values.

Compute the test statistic:

ZX X

n n

C =− − −

+

⎢⎢⎢⎢⎢

⎥⎥⎥⎥⎥

( ) ( ).1 2 1 2

12

1

22

2

μ μ

σ σ

Page 118: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 118

118

Decision Rule : Reject H0 if: the calculated values of Z are greater than the ‘+’ critical value or less than the ‘-’ critical value.

Reject H0: Z* < Zc or -Z* > Zc.

Cannot reject otherwise.

Example: Determine if the length of time to find employment in their field of study of university graduates in Ottawa (µ1) and Victoria (µ2) is the same:

Test Hypotheses: H0: µ1 - µ2 = 0 ↔ µ1 = µ2 Ha: µ1 - µ2 ≠ 0 ↔ µ1 ≠ µ2

Page 119: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 119

119

α=0.05=5% → Z*=±1.96

Let: n X weeks weeksn X weeks weeks

1 1 12 2

2 2 22 2

50 7 2 1275 91 2 3

= = =

= = =

; . ; . .; . ; . .

σ

σ

Compute Z Value:

ZC =− −

+

=−+

=−

=−

= −

( . . ) ( ). .

.. .

..

..

.

7 2 91 01250

2 375

190 024 0 03067

190 0546

190 2338

813

Since -Z* >Zc, we reject H0.

Page 120: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 120

120

Interpretation: We believe the average amount of time these graduates search for jobs in their field of study in each city is statistically _________.

Using the P-value: p-value =2P(Z≤-8.13) = 2(1-P(Z ≤ 8.13)) =(2)(1-1) =2(0.0000) =0.0 Since 0.00 is less than 0.05, we reject the null hypothesis.

Page 121: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 121

121

Case II: Difference Between Two Means

(Variances ( )σ σ12

22and Are _______ But Assumed Equal)

The two-sample Z test is appropriate only when both

( )σ σ12

22and are _____.

When the variances are unknown, the t-distribution can be

used to test the two _____ if both parent populations are ______.

If the parent populations are not normal, but n1 and n2 are _____ (ni ≥15), the t-distribution can be used.

Page 122: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 122

122

The other difference from the last section is the assumption that ( )σ σ1

222and are the same population

variance; Both s s12

22and must represent two estimates

of the ____ population variance.

Page 123: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 123

123

Example: Suppose X ~1i N n sample size( , ); .μ σ1 1

21 =

X N n1 112

1~ ( , )μ σ

X ~2i N n sample size( , ); .μ σ2 2

22 =

X N n2 222

2

~ ( , )μ σ

We want to test: H0: µ1 - µ2 = 0 ↔ µ1 = µ2 Ha: µ1 - µ2 ≠ 0 ↔ µ1 ≠ µ2

Page 124: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 124

124

Test Statistic: Use the t-distribution since X1 and X2 are normal and the variances are _______ but equal:

Form:

( )

( )

sn

X X

sn

X X

ii

n

ii

n

12

11 1

1

2

22

22 2

1

2

11

11

1

2

=−

=−

=

=

If s s12

22and are ___ equal, which estimate of the

population variance of σ2 do we use?

Page 125: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 125

125

Use a weighted average of the two estimators. This will produce a more accurate and reliable estimate of the population variance than using one or the other.

Use ‘relative’ degrees of freedom as the _______ relative to the total number of degrees of freedom. Let: s2= weighted average.

sn

n ns

nn n

s

sn s n s

n n

2 1

1 212 2

1 222

2 1 12

2 22

1 2

12

12

1 12

=−

+ −∗ +

−+ −

=− + −

+ −

( )( )

( )( )

*

( ) ( )( )

Page 126: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 126

126

Now: X X1 2− ~ Normal

E X XandV X X V X V X by independence

n n

n n

( )

( ) ( ) ( )

1 2 1 2

1 2 1 2

12

1

22

2

2

1 2

1 1

− = −

− = + ⇐

= +

= +⎛⎝⎜

⎞⎠⎟

μ μ

σ σ

σ

since σ 2 denotes the two equal variances: σ σ σ12

22 2= = .

Page 127: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 127

127

Hence, the statistic is:

( ) ( )t

X X

n n

=− − −

+⎛⎝⎜

⎞⎠⎟

1 2 1 2

2

1 2

1 1

μ μ

σ

Using s2 as the estimator of σ 2, we get the test statistic:

( ) ( )( )t

X X

sn n

=− − −

+⎛⎝⎜

⎞⎠⎟

+ −1 2 1 2

2

1 2

21 1

μ μ~ t n n1 2

which is the two sample t-test statistic.

Page 128: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 128

128

Example: Test the difference in average salaries paid to women in Toronto and Vancouver, assuming salaries are normally distributed. Test at the α=0.05 level of significance.

TorontonXs

1

1

12

10000000

=

=

=

$41,$150,

VancouvernXs

2

2

22

9500000

=

=

=

$39,$155,

Test: H0: µ1 - µ2 = 0 ↔ µ1 = µ2 Average salaries are the same. Ha: µ1 - µ2 ≠ 0 ↔ µ1 ≠ µ2 Average salaries are not the same.

Page 129: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 129

129

The degrees of freedom = 10 + 9 - 2= 17.

t17 ~ under the null hypothesis.

The critical value from a two-sided alternative is: t*=±2.11 Computed Value:

( ) ( )

( ) ( )

tX X

sn n

s

C =− − −

+⎛⎝⎜

⎞⎠⎟

− −

+⎛⎝⎜

⎞⎠⎟

1 2 1 2

2

1 2

2

1 1

41 000 39 500 01

1019

μ μ

=, ,

Page 130: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 130

130

Must determine s2 :

sn s n s

n n2 1 1

22 2

2

1 2

1 12

10 1 150 000 9 1 155 00010 9 2

9 150 000 8 155 00017

1 350 000 1 240 00017

2 590 00017

152 352 94

=− + −

+ −

=− + −

+ −

=+

=+

= =

( ) ( )( )

( )( , ) ( )( , )( )

( )( , ) ( )( , )( )

, , , , , ,, .

Page 131: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 131

131

So, calculating tc: ( ) ( )

( ) ( )

( )

tX X

sn n

s

C =− − −

+⎛⎝⎜

⎞⎠⎟

− −

+⎛⎝⎜

⎞⎠⎟

=−

+⎛⎝⎜

⎞⎠⎟

= =

1 2 1 2

2

1 2

2

1 1

41 000 39 500 01

1019

41 000 39 500

152 352 941

1019

1500179 29

8 366

μ μ

=, ,

, ,

, .

..

Page 132: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 132

132

t*= ± 2.11 and tc= 8.366

____H0 if tc is greater than 2.11 or less than -2.11.

We clearly ______ the null.

The average salaries for women are statistically different is each city.

Page 133: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 133

133

Two Sample Tests for Population Variance Suppose we have random variables from two populations:

X NX N

i

i

1 1 12

2 2 22

~~

( , )( , )μ σ

μ σ If the two populations have equal _________ ( )σ σ1

222= , then

the populations are homoscedastic ( “homo” = same, “scedastic” = variability) as opposed to heteroscedastic (different ___________).

Why would we be interested in whether populations are homo_________ or hetero__________?

Page 134: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 134

134

To answer questions like: (1) Is there a wider ___________ in the number of hours worked between two countries? (2) Is ___________ in unemployment in Canada over the last year the same as in the United States? (3) Is the ___________ of gas prices in Victoria and Duncan the same?

To test if the variability is the same across populations, the null hypothesis is usually in the form:

H0 12

22:σ σ= the ________ is not the same across these two

populations.

Page 135: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 135

135

The alternative hypothesis can be any of the following: Ha: σ2

1 ≠ σ22 the variability is not the ____ across these

two populations Ha:σ σ1

222< the variability in population 2 is greater than

the variability in population 1. Ha:σ σ1

222> the variability in population 1 is _______ than

the variability in population 2.

The form of the alternative hypothesis will affect the critical values and p-values, but not your approach to testing hypotheses.

Page 136: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 136

136

Illustration: Two-sided Alternative Hypothesis Suppose

H0 12

22:σ σ= or H0 1

222 1: /σ σ =

Ha:σ σ12

22≠ or Ha: /σ σ1

222 1≠

Since the population variance is estimated using the sample ________, we can base the test of H0 on the ratio of sample variances ( )S and S1

222

:

Page 137: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 137

137

Recall:

Sn

X X

Sn

X X

ii

n

ii

n

12

11 1

2

1

22

22 2

2

1

11

11

1

2

=−

=−

=

=

( )

( )

The sampling distribution for testing hypotheses about two variances is called the _-distribution.

Hence the test statistic is: F S

Sν ν1 212

22, .=

The F-distribution test whether ( )σ σ12

22= , by taking the

ration of the two sample _________, ( )S and S12

22

.

Page 138: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 138

138

If the null is true we would expect ‘F’ to be close to __. Thus, the more F differs from 1, the more likely we will ____ the null for the alternative.

To test the null using S

S12

22 .

, we need to know the distribution of the test statistic under the null. It can be shown that if the null is true: S

Swhere n rees of freedom for sample

n rees of freedom for sample

12

22

1 1

2 2

1 2

1 11 2

~ Fν ν

νν

,

: deg .deg .

= − == − =

Page 139: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 139

139

Things to Note: 1) An F random variable has ___ different degrees of freedom associated with it.

FSS

nX X

nX X

ii

n

ii

n= =−

−−

=

=

∑12

22

11 1

2

1

22 2

2

1

11

11

1

2

( )

( )

F-values contains a ______ variable with (n1-1)= ν 1 d.f. in the numerator and (n2-1)= ν 2 in the denominator.

Page 140: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 140

140

2) Since the test statistic is a ratio of ___ numbers which are ≥ 0, an F random variable is always ≥ 0. 3) F- distribution is __________ skewed. Looks like a ___-square distribution because the F-distribution is the ratio of 2 independent χ2 distributions. 4) Use F-tables to find critical values associated with a given ν 1 and ν 2. (Notice that the tables are only for 1% and 5% upper tail regions.)

Page 141: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 141

141

Example: Let ν 1 = 5 and ν 2= 10. We want the 5% critical F value: We want F* such that P(F5,10≥F*)=0.05. f(F5,10) 5% 0 F*=3.33 F*=3.33 P( F5,10≥3.33)=0.05.

Page 142: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 142

142

Example: Let ν 1 = 3 and ν 2= 8. We want the 1% critical F value: Want F* such that P(F3,8≥F*)=0.01. From Table F*= P( F3,8≥____)=0.01.

So how do we determine the _____ tail critical values, since this is not a symmetrical distribution?

Page 143: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 143

143

Low Side F-Test A lower-tail critical value can be found by the following:

FFLower critical value

Upper critical value, ,

, ,ν ν

ν ν1 2

2 1

1=

“A lower-tail critical value of F can always be found by _________ the degrees of freedom of the numerator and the denominator, determining the

corresponding value in the _____ tail of the F-distribution, and then taking the r________ of this

number.”

Page 144: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 144

144

Suppose we want F* such that P(F3,12 ≤F*)= 0.05: f(F3,12) 5% not 5% F3,12 0 ______ 8.74

Page 145: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 145

145

Since: F =

1F

(Lower 3,12)*

(Upper 12, 3)* ,

where F*Upper, 12,3 is the F-value such that P(F 12,3 ≥ F* upper, 12,3)=0.05. Value ____ Hence:

F =1

F=

18.74

= 0.114

P(F

(Lower 3,12)*

(Upper 12, 3)*

3,12 ≤ =0114 0 05. ) .

Page 146: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 146

146

f(F) 5% 0 8.74 F12,3 f(F) 5% 0 0.114 F3, 12

Page 147: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 147

147

5) It does not matter if your test statistic is: S

SS

SS

S F

22

12

12

22

22

12

2 1

instead of

Under the null is distributed

.

.,ν ν

Simply put the ____ in the same order as the ratio of the _________.

Page 148: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 148

148

Returning to the two-sided alternative test: H0 1

222:σ σ= versus Ha:σ σ1

222≠

Let α = 0.02. P(Reject H0|H0 is true) =0.02. For a _-_____ alternative put 0.01 (α/2=0.01) in each tail and find the critical values of F with ν 1 and ν2 degrees of freedom. f(F) 1% 0 F*lower F*upper F ν 1 ν 2

Page 149: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 149

149

Finally calculate the value of the test statistic: S

S12

22 , and see

if it falls in the critical region or the acceptance region. Decision Rule

Reject H0 if: F or FC C< F > Flower

*upper* .

Fail to reject H0 if: F Flower

*upper*≤ ≤FC .

Page 150: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 150

150

Example: Suppose you wish to test the ___________ in flight times between Vancouver and Kelowna and between Kelowna and Vancouver. A sample of 16 flights is taken for the route originating in Vancouver (n1 =16) and a sample of 21 flights is taken for the route originating in Kelowna is taken (n2=21). We find that S1

2 225= minutes and S2

2 216= minutes .Assume that the flight times are normally distributed. Let α=____.

Test H0 12

22:σ σ= versus Ha:σ σ1

222≠

Page 151: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 151

151

Test statistic is:

F SS under the null

where n degrees of freedom for sample 1n degrees of freedom for sample

=

= − == − =

12

22

1 1

2 2

1 2

1 151 20 2

~ Fν ν

νν

, ,

: ..

P(Reject H0 | H0 is true )=0.10.

So, [ ] [ ]P F F P F Flower upper≤ = ≥ =, ,*

, ,* .15 20 15 20 0 05

From the cumulative F-distribution table (α=____) :

F FFupper lower

upper

, ,*

, ,*

, ,*

..

. .15 20 15 20

20 15

2 20 1 12 33

0 429= = = =and

Page 152: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 152

152

Calculating FC:

FSSC = = =1

2

22

2516

15625. . Since Fc is 1.5625, which lies between 0.429 and 2.20, we cannot reject the null and conclude the two samples are from a population with the same v__________. We could also use: F S

S under the null

where n degrees of freedom for sample 1n degrees of freedom for sample

=

= − == − =

22

12

1 2

2 1

2 1

1 201 15 2

~ Fν ν

νν

, ,

: ..

Page 153: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 153

153

So, [ ] [ ]P F F P F Flower upper≤ = ≥ =, ,*

, ,* .20 15 20 15 0 05

From the F-distribution table (α=____) :

F and FFupper lower

upper

, ,*

, ,*

, ,*

..

. .20 15 20 15

15 20

2 33 1 12 20

0 455= = = =

Calculating Fc:

FSSC = = =2

2

12

1625

0 64. . Since Fc is 0.64, which lies between 0.455 and 2.33, we cannot reject the null and conclude the two samples are from a population with the same variability.

Page 154: Topic 3: Hypothesis Testing - Web hostingweb.uvic.ca/~bettyj/246/topic3ppweb.pdf · Topic 3 econ 246 page 6 The two mutually exclusive hypotheses in a statistical test are referred

Topic 3 econ 246 page 154

154