statistics hypotheses test (i) professor ke-sheng cheng department of bioenvironmental systems...
TRANSCRIPT
STATISTICSHYPOTHESES TEST (I)
Professor Ke-Sheng ChengDepartment 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.
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.
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.
04/10/23 5Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 6Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
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.
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.
What is hypothesis test
04/10/23 9Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
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.
Simple and Composite Hypotheses
04/10/23 11Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
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.
• 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.
Why is it fixed?
04/10/23 14Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
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.
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.
04/10/23 17Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 18Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 19Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 20Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 21Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 22Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
Types of error
04/10/23 23Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 24Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 25Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 26Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
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.
04/10/23 28Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 29Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
Example
04/10/23 30Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 31Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 32Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 33Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 34Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 35Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
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.
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.
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.
04/10/23 39Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 40Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 41Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 42Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 43Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 44Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
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.
04/10/23 46Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 47Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 48Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 49Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 50Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 51Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 52Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 53Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 54Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 55Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
328.119,1.0 t
04/10/23 56Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
Noncentral t distribution in R
04/10/23 57Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 58Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
04/10/23 59Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.
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.
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.
• 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