statistics hypotheses test (i) professor ke-sheng cheng department of bioenvironmental systems...

62
STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

Upload: jada-hernandez

Post on 27-Mar-2015

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

STATISTICSHYPOTHESES TEST (I)

Professor Ke-Sheng ChengDepartment of Bioenvironmental Systems Engineering

National Taiwan University

Page 2: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

Examples of hypothesis tests

• Based on historical records, do female students really perform better in statistics class than male students?

• Data from a simulated AR(2) process.

04/10/23 2Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 3: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

Do you see an increasing/decreasing trend?

y = 0.1947x - 5.4625

R2 = 0.0297

-40

-30

-20

-10

0

10

20

30

40

50

60

70

1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46

y = -0.407x - 0.8923

R2 = 0.0176

-50-40-30-20-10

010203040

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

04/10/23 3Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 4: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

The trends are apparent.

y = 2.1941x - 44.805

R2 = 0.751

-80-60-40-20

020406080

100

1 3 5 7 9 11 13 1517 19 21 2325 27 2931 33 3537 39 41 4345

y = -0.3842x + 20.048

R2 = 0.3286-80

-60

-40

-20

0

20

40

60

1 9 17 25 33 41 49 57 65 73 81 89 97 105 113

04/10/23 4Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 5: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 5Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 6: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 6Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 7: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

An AR(2) process

-80

-40

0

40

80

0 100 200 300 400 500 600 700 800 900 1000

)()2(7.0)1(4.0)( ttXtXtX )225,0(~)( 2 Niidt

Stationary process

04/10/23 7Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 8: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

An AR(2) process

-80

-40

0

40

80

120

0 100 200 300 400 500 600 700 800 900 1000

)()2(25.0)1(62.0)( ttXtXtX

)225,0(~)( 2 Niidt

Stationary process

04/10/23 8Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 9: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

What is hypothesis test

04/10/23 9Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 10: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

Null and alternative hypotheses

• Two hypotheses and are defined as: (Null hypothesis) (Alternative hypothesis)

• A procedure for deciding whether to accept (or more precisely, fail to reject) the hypothesis or to accept the hypothesis (or reject ) is called a “test procedure” or simply a “test”.

00 : H

11 : H

0H

1H 0H

04/10/23 10Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 11: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

Simple and Composite Hypotheses

04/10/23 11Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 12: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

The Critical Region and Test Statistics

• Consider the following hypotheses test:

• Suppose that we are given a random sample of size n, , from a distribution with parameter . Let S denote the sample space of the n-dimensional random vector .

00 : H 11 : H

nXX ,...,1

),...,( 1 nXXX

04/10/23 12Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 13: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

• In order to carry out the test we can partition the sample space S into two disjoint subsets So

and S1. Subset So contains the values of X for

which we will accept , and subset S1

contains the values of X for which we will reject . The subset for which will be rejected is called the “critical region” of the test.

0H

0H0H

04/10/23 13Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 14: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

Why is it fixed?

04/10/23 14Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 15: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

Critical region – fixed due to specification of Ho , distribution of the test statistic, and the level of significance.

04/10/23 15Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 16: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

The Power Function

• Either the “critical region” or the “fixed” interval for the test statistic of a test is independent of the test parameter .

• However, the value of is unknown, therefore the probability that a test will reject is a function of , and is denoted by , i.e.,

where C is the critical region of . The function is called the power function of the test .

0H

)( for][)( CXP

)(

04/10/23 16Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 17: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 17Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 18: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 18Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 19: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 19Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 20: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 20Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 21: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 21Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 22: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 22Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 23: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

Types of error

04/10/23 23Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 24: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 24Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 25: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 25Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 26: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 26Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 27: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

Making a test have a specific significance level

04/10/23 27Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 28: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 28Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 29: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 29Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 30: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

Example

04/10/23 30Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 31: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 31Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 32: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 32Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 33: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 33Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 34: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 34Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 35: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 35Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 36: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

Power function of the test

C=6

04/10/23 36Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 37: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

Power functions

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

0 0.2 0.4 0.6 0.8 1

p

Pow

er f

un

ctio

n

C=6

C=7

C=8

04/10/23 37Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 38: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

Now, let’s set the size of the random sample n = 20 and conduct the same test.

Let .

]3.0[

1.0|]3.0[3.0

pCXP

ppCTPp

T

20

11 ii

n

ii XXT

cc

ii pp

cpcTPcXT

20

20

1

)1(20

][

04/10/23 38Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 39: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 39Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 40: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 40Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 41: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 41Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 42: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 42Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 43: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 43Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 44: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 44Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 45: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

Example

• Suppose that is a random sample of size n and we wish to test the hypotheses:

),...,( 1 nXXX

00 : H

01 : H

04/10/23 45Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 46: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 46Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 47: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 47Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 48: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 48Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 49: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 49Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 50: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 50Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 51: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 51Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 52: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 52Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 53: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 53Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 54: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 54Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 55: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 55Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 56: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

328.119,1.0 t

04/10/23 56Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 57: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

Noncentral t distribution in R

04/10/23 57Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 58: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 58Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 59: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

04/10/23 59Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 60: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

Non-centrality parameter

ncp=0ncp=1,-1ncp=2,-2ncp=3,-3

04/10/23 60Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 61: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

Guidelines for Hypothesis Testing

1. When testing a hypothesis concerning the value of some parameter , the statement of equality will always be included in H0. In this way H0 pinpoints a specific numerical value that could be the actual value of . This value is called the null value and is denoted by 0.

2. Whatever is to be detected or supported is the alternative hypothesis.

3. It is hoped that the evidence leads us to reject H0 and thereby to accept H1.

04/10/23 61Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

Page 62: STATISTICS HYPOTHESES TEST (I) Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

• A confidence interval is just the flip side of a hypothesis test.

• If the hypothesis test fails to reject H0, then the parameter from H0 is definitely within the confidence interval.

04/10/23Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ. 62