Documente Academic
Documente Profesional
Documente Cultură
In the world we
often need to make decisions based on population parameters.
Hypothesis Testing helps us make these decisions.
Does a drug reduce blood pressure?
Does reduced class size increase test scores?
Is a person innocent or guilty of a crime?
Does more money spent on education in low-income areas improve student performance?
Upper One Sided Alternative Hypothesis
Assume that with the current drug 10% of all pancreatic cancer patients
survive for five years. A new drug is being tested. Let p =fraction of
pancreatic patients receiving the new drug who survive for five years.
Then we should test
Often we want to know if it is reasonable to assume that two populations have equal
variance. When looking at annual investment returns, the standard deviation of annu
percentage returns is referred to as volatility. In this situation our hypotheses are
We could now look at, say, the last 10 years of annual returns on stocks and bonds. If
sample variance of the annual percentage returns on stocks and bonds are relatively
close, we would accept H0 while if the sample variance of the annual percentage retu
on stocks and bonds differ greatly, we would reject the null hypothesis.
In this example our alternative hypothesis does not specify a particular direction for t
deviation of variances from equality. Therefore, the alternative hypothesis is called a
two-sided alternative hypothesis.
One-Tailed or Two-Tailed Test
Cooley High
There is no reason to believe that Cooley High is better or worse than the state
H0: =75 Ha: 75.
Then we reject H0 if |79-75|>=1.96*15/sqrt(49)
= 4.2. xbar=79 n = 49 s = 15
Since this is false we accept the null hypothesis and conclude that the average C
-tailed test.
The level of significance chosen is rather arbitrary. For that reason, most statisticians use the concep
Probability values (P-values) to report the outcome of a hypothesis test. The P-value for a hypothes
is the smallest value of for which the data indicates rejection of H0. Thus
The P-value may also be interpreted as the probability of observing (given H0 is true) a value of the
statistic at least as extreme as the observed value of the test statistic.
Let XBAR be the random variable for the sample mean under H0. The level of significan
chosen is rather arbitrary. For that reason, most statisticians use the concept of Probab
values (P-values) to report the outcome of a hypothesis test. The P-value for a hypothes
test is the smallest value of for which the data indicates rejection of H 0Thus
P Value<= if and only if we reject H0.
P-Value> if and only if we accept H0.
The P-value may also be interpreted as the probability of observing (given H0 is true) a
value of the test statistic at least as extreme as the observed value of the test statistic.
If we let XBAR represent the random variable for the sample mean under H 0 and x be the observed
of , then the P-Value for the one sample Z-test is computed as follows:
All probabilities are computed under the assumption that H0 is true.
H0: =75 Ha: 75.
In our Cooley High example, the P-Value for the two-tailed test is
Prob(|XBAR-75|>=4
= 2*Prob(XBAR>=79)
which can be computed as
2*(1-NORM.DIST(79,75,15/sqrt(49),True)
REMEMBER FROM MODULE 4 ST DEV XBAR = SIGMA/SQRT(n)
= 2*(0.030974) = 0.061948.
Since our P-Value of 0.06>.05, for a two-tailed test we accept H0.
The P-value for a one-tailed test is simply Prob(Xbar>=79) =0.030974
Since our P-value of 0.03<.05 we reject H0.
H0: = 75 Ha: >75.
Definition of T Random Variable
xbar-
------------
s/sqrt(n)
follows a T random variable with n-1 degrees of freedom.
s= sample standard deviation
n = sample size
AS DEGREES OF FREEDOM INCREASE THE T RANDOM VARIABLE
APPROACHES THE STANDARD NORMAL
2 4 10
Normal T 5 df T 15 df T 30 df
-3.5 0.000873 0.01859 0.011273 0.004784
-3.4 0.001232 0.020027 0.012565 0.005689
-3.3 0.001723 0.021608 0.014026 0.006767
-3.2 0.002384 0.023352 0.015682 0.008052
-3.1 0.003267 0.025279 0.01756 0.009582
-3 0.004432 0.02741 0.019693 0.011401
-2.9 0.005953 0.029773 0.022118 0.01356
-2.8 0.007915 0.032397 0.024877 0.016121
-2.7 0.010421 0.035316 0.028019 0.019151
-2.6 0.013583 0.038569 0.031597 0.022728
-2.5 0.017528 0.042201 0.035676 0.026939
-2.4 0.022395 0.04626 0.040323 0.031879
-2.3 0.028327 0.050805 0.045619 0.037656
-2.2 0.035475 0.055901 0.051648 0.04438
-2.1 0.043984 0.061619 0.058505 0.05217
-2 0.053991 0.068041 0.066291 0.061146 -4 -3 -2
-1.9 0.065616 0.075259 0.075114 0.071425 Norm
-1.8 0.07895 0.083369 0.085081 0.083116
-1.7 0.094049 0.092478 0.096302 0.096312
-1.6 0.110921 0.102696 0.108873 0.111078
-1.5 0.129518 0.114134 0.12288 0.127445
-1.4 0.149727 0.126899 0.138378 0.145395
-1.3 0.171369 0.141078 0.155382 0.164851
-1.2 0.194186 0.156734 0.173854 0.185664
-1.1 0.217852 0.173877 0.193681 0.207606
-1 0.241971 0.19245 0.214663 0.230362
-0.9 0.266085 0.212295 0.236493 0.25353
-0.8 0.289692 0.233128 0.258754 0.276625
-0.7 0.312254 0.254508 0.280909 0.299092
-0.6 0.333225 0.275824 0.302319 0.320326
-0.5 0.352065 0.296296 0.322262 0.339695
-0.4 0.36827 0.315006 0.339976 0.356579
-0.3 0.381388 0.330964 0.35471 0.370398
-0.2 0.391043 0.343206 0.365787 0.380658
-0.1 0.396953 0.350918 0.372666 0.386975
0 0.398942 0.353553 0.375 0.389108
0.1 0.396953 0.350918 0.372666 0.386975
0.2 0.391043 0.343206 0.365787 0.380658
0.3 0.381388 0.330964 0.35471 0.370398
0.4 0.36827 0.315006 0.339976 0.356579
0.5 0.352065 0.296296 0.322262 0.339695
0.6 0.333225 0.275824 0.302319 0.320326
0.7 0.312254 0.254508 0.280909 0.299092
0.8 0.289692 0.233128 0.258754 0.276625
0.9 0.266085 0.212295 0.236493 0.25353
1 0.241971 0.19245 0.214663 0.230362
1.1 0.217852 0.173877 0.193681 0.207606
1.2 0.194186 0.156734 0.173854 0.185664
1.3 0.171369 0.141078 0.155382 0.164851
1.4 0.149727 0.126899 0.138378 0.145395
1.5 0.129518 0.114134 0.12288 0.127445
1.6 0.110921 0.102696 0.108873 0.111078
1.7 0.094049 0.092478 0.096302 0.096312
1.8 0.07895 0.083369 0.085081 0.083116
1.9 0.065616 0.075259 0.075114 0.071425
2 0.053991 0.068041 0.066291 0.061146
2.1 0.043984 0.061619 0.058505 0.05217
2.2 0.035475 0.055901 0.051648 0.04438
2.3 0.028327 0.050805 0.045619 0.037656
2.4 0.022395 0.04626 0.040323 0.031879
2.5 0.017528 0.042201 0.035676 0.026939
2.6 0.013583 0.038569 0.031597 0.022728
2.7 0.010421 0.035316 0.028019 0.019151
2.8 0.007915 0.032397 0.024877 0.016121
2.9 0.005953 0.029773 0.022118 0.01356
3 0.004432 0.02741 0.019693 0.011401
3.1 0.003267 0.025279 0.01756 0.009582
3.2 0.002384 0.023352 0.015682 0.008052
3.3 0.001723 0.021608 0.014026 0.006767
3.4 0.001232 0.020027 0.012565 0.005689
3.5 0.000873 0.01859 0.011273 0.004784
M VARIABLE
0.45
0.4
0.35
0.3
0.25
0.2
0.15
0.1
0.05
0
-4 -3 -2 -1 0 1 2 3 4
Norma l T 5 df T 15 df T 30 df
A B C D E F G H I J
1 One Sample Hypothesis for Mean: Small Sample, Normal Population, Variance Unknown
2
3
4 Use T.INV to get percentiles of T Random Variable
5
6 2.5 %ile 28 df -2.0484 =T.INV(0.025,28)
7 97.5%ile 28 df 2.0484 =T.INV(0.975,28)
8 0.5% ile 13 df -3.0123 =T.INV(0.005,13)
9 99.5%ile 13 df 3.0123 =T.INV(0.995,13)
10
11 Use T.DIST to get T probabilities
12 Prob T10>=2 0.0367 =1-T.DIST(2,10,1)
13 Prob T10<=-2 0.0367 =T.DIST(-2,10,1)
14
15 Basically, One Sample t-tests look just like One Sample Z-tests with s replacing and the t percentiles replacing the Z percentiles.
16
17
18
19
20
21
22
23
24 P-Values for T-Test
25 t= observed value of T-statistic
26
27
28
29
30
31
32
33
34
35
36
37 Example
38
Passing the HISTEP test is required for graduation in the state of Fredonia. The
39 average state score on the test is 75. A random sample of 25 students at Cooley
High finds xbar=81
40
and s = 15. For = 0.05 would you conclude that Cooley High Students perform
differently than the typical state student?
41
We use a two-tailed test because before doing the test we have no view about
42 whether Cooley High students will perform better or worse than the typical state
student. Then we have
43 H0: = 75 Ha: 75
44
46 We reject H0 if
47 |81-75|>=2.06*15/sqrt(25)
48 = 6.18.
50
52 =2*Prob(T24>=2)
Reject H0 if pvalue<=
s 300 of 400 Free Throws?
roved from being a 70% foul shooter?
layer makess free throws after change = 0.05
Ha: P>0.70 P-VALUE=.016<=.05
Reject Null Hypothesis
m.dist.range(trials,Pzero,successes,trials)
m.dist.range(trials,Pzero,0,successes)
fttailedpvalue,Righttailedpvalue)
Testing a Proportion
Right Tailed Test
trials 400 Ho: p<=p0
successes 217 Ha: p>p0
Pzero 0.5
Righttailedpvalue 0.04941 =_xlfn.binom.dist.range(trials,Pze
p=chance coin comes up heads
Ho: p = 0.5 Left Tailed Test
Ha:p0.5 Ho: p>=p0
Ha: p<p0
p-value 0.098
For alpha = .05 Lefttailedpvalue 0.96001 =_xlfn.binom.dist.range(trials,Pze
Accept the coin is fair Two Tailed Test
Ho: p=p0
217 of 400 coin tosses Ha: pp0
come up heads
Twotailedpvalue 0.09882 =2*MIN(Lefttailedpvalue,Righttail
Reject H0 if pvalue<=
inom.dist.range(trials,Pzero,successes,trials)
inom.dist.range(trials,Pzero,0,successes)
(Lefttailedpvalue,Righttailedpvalue)
Testing a Proportion
Right Tailed Test
trials 300 Ho: p<=p0
successes 89 Ha: p>p0
Pzero 0.3
Righttailedpvalue 0.57174 =_xlfn.binom.dist.range(trials,Pze
Reject H0 if pvalue<=
inom.dist.range(trials,Pzero,successes,trials)
inom.dist.range(trials,Pzero,0,successes)
(Lefttailedpvalue,Righttailedpvalue)
Means 98.6475771 109.1896
How Many 227 211
variance 131.662859 144.021
Marketing Finance
118 105
110 90
106 101
94 130
91 124
102 104
96 129
116 110
106 110
117 126
90 116
113 97
112 123
109 124
106 115
114 100
92 130
99 93
105 97
81 93
82 110
104 124
114 100
119 108
98 101
90 115
89 123
111 95
83 99
98 126
111 100
114 110
117 119
97 109
90 117
100 126
86 94
108 113
89 96
102 111
82 103
120 99
114 112
111 90
93 117
99 110
83 102
107 126
91 95
104 124
88 110
89 109
109 115
80 126
84 118
106 119
82 95
101 102
114 122
93 122
89 94
95 119
82 100
107 97
90 109
109 122
105 122
113 93
89 113
82 118
94 92
94 90
88 127
94 123
103 114
109 92
90 110
104 115
95 90
93 116
95 94
117 94
96 106
112 97
94 124
107 110
115 111
118 127
81 93
88 93
119 118
99 120
89 128
112 119
102 127
117 120
80 113
120 116
118 118
89 121
93 102
93 102
113 128
93 100
110 91
94 93
115 116
111 128
107 90
87 125
87 130
103 108
81 121
80 125
112 99
113 118
93 122
113 96
94 116
87 98
91 122
102 114
86 108
94 96
94 115
104 91
106 116
89 93
93 130
85 115
93 93
94 104
96 115
95 106
107 102
114 98
115 122
107 92
84 101
84 100
111 103
96 124
86 110
111 107
82 98
94 116
80 90
88 103
95 94
103 121
102 104
86 92
102 123
119 94
112 118
88 119
80 102
103 115
118 99
100 102
120 123
109 116
89 97
90 126
85 101
90 125
106 116
107 99
80 108
97 102
94 107
85 97
112 124
82 108
89 102
99 92
106 92
108 118
93 94
107 99
100 95
87 91
100 110
116 116
83 94
89 107
100 108
100 124
93 119
86 95
100 114
103 116
93 97
111 90
86 128
105 105
81 97
114 113
105 127
119 99
96 129
98 102
103 105
111 124
90 129
116 124
95 113
84 101
82 101
108 116
80 95
86
111
101
84
87
92
84
105
96
89
103
88
120
95
80
100
H0: Mean Marketing=Mean Finance
Ha: Mean Marketing Mean Finance
Situation
Goal
Swimmers ability
Design
P-VALUE =0.53
Accept H0
-14.3 H0: mean change in heating bill old insulation=mean change w
New Insulation Ha: mean change in heating bill old insulationmean change w
23
16
-28
29
30
-72
-46
-55
21
-61
on=mean change with new insulation
onmean change with new insulation
A B C D E F G H I
1
2
3 skewness 0.4342180803 -0.1972147109
4 kurtosis -0.0575170242 -2.1072878446
5 Observation Old Insulation New Insulation
6 1 -34 23
7 2 6 16
8 3 31 -28
9 4 10 29
10 5 -2 30
11 6 -12 -72
12 7 49 -46
13 8 -15 -55
14 9 -45 21
15 10 -17 -61
16
17
18 t-Test: Paired Two Sample for Means
19
20 Old Insulation New Insulation
21 Mean -2.9 -14.3
22 Variance 806.3222222222 1750.233333333
23 Observations 10 10
24 Pearson Correlation -0.2068623331
25 Hypothesized Mean D 0
26 df 9
27 t Stat 0.6529714662
28 P(T<=t) one-tail 0.2650496761
29 t Critical one-tail 1.8331129327
30 P(T<=t) two-tail 0.5300993523
31 t Critical two-tail 2.2621571628
A B C D E F G H I J K L M N O P
1
5 Eye Color
6 Gender Blue Brown Green Hazel Total
7 H0:EYE COLOR AND GENDER ARE INDEPENDENT Female 370 352 198 187 1107
8 HA: EYE COLOR AND GENDER ARE NOT INDEPENDENT Male 359 290 110 169 928
9 Total 729 642 308 356
10 Chance of eye color
11 by Gender Eye Color
12 Gender Blue Brown Green Hazel Total
13 Female 33.42% 31.80% 17.89% 16.89% 100.00%
14 Male 38.69% 31.25% 11.85% 18.21% 100.00%
15 df Cutoff Under Independence Total
16 1 3.8415 =CHISQ.INV(0.95,D16) Expected Values
17 2 5.9915 =CHISQ.INV(0.95,D17) Total 2035 Eye Color
18 3 7.8147 =CHISQ.INV(0.95,D18) Gender Blue Brown Green Hazel Total
19 4 9.4877 =CHISQ.INV(0.95,D19) Female 396.56 349.24 167.55 193.66 1107.00
20 R=2 C= 4 '($P7/Total)*(L$9/Total)*Total Male 332.44 292.76 140.45 162.34 928.00
21 3 DF (R-1)*(C-1) Degrees of Freedom Total
22 Test Statistic
23 (Oij-Eij)2 Eye Color
24 ------------- Gender Blue Brown Green Hazel
25 Eij Female 1.78 0.02 5.54 0.23
26 Male 2.12 0.03 6.60 0.27
27 Get P-VALUE with Chi Square Total
28 CHISQ.DIST.RT 16.59 Reject H0 eye color and gender are not independent!
29 0.0008581 =CHISQ.DIST.RT(H28,3)
30