Beruflich Dokumente
Kultur Dokumente
Lecture 7
Hypothesis testing
Siv-Elisabeth Skjelbred
University of Oslo
February 8th
Last updated: February 5, 2016
1 / 47
Overview
2 / 47
Hypothesis testing
3 / 47
Hypothesis testing
4 / 47
Compute test statistic
The test statistic for the regression coefficient is the t statistic
estimator hypothesised value
t=
standard error of the estimator
Since the standard error is always positive the t-statistic has the same
sign as the difference between the estimator and the hypothesized
value.
For a given standard error the larger value of the estimator the larger
value of the t-statistic.
If the null hypothesis is that the true parameter is zero, a large
estimator provides evidence against the null.
t-values sufficiently far from the hypothesized value result in rejection
of the null.
5 / 47
Compute t-statistic
1 1,0
t=
SE (1 )
If the null hypothesis is that 1 = 1
1 1
t=
SE (1 )
6 / 47
Hypothesis testing
wage = 0 + 1 educ + u
If H0 : 1 = 0:
t = 0.092/0.007 = 13.14
7 / 47
Distribution of estimators
8 / 47
Normality assumption
In large samples we can invoke the CLT to conclude that the OLS
satisfy asymptotic normality.
Whenever Y takes on just a few values and we have few observations
it cannot have anything close to a normal distribution.
If the 1 is not normally distributed the t-statistic does not have t
distribution.
The normal distribution of u is the same as the distribution of Y given
X.
9 / 47
Distribution of estimators
j j
t=
se(j )
10 / 47
Hypothesis testing in MLRM
11 / 47
Hypothesized value
12 / 47
Example
Monday February 2 20:38:46 2015 Page 1
Robust
wage Coef. Std. Err. t P>|t| [95% Conf. Interval]
Is the t-statistic for the coefficient of education large? What about the
statistic of the intercept?
13 / 47
The t-statistic
j
small| |
se(j )
j
large| |
se(j )
14 / 47
Critical value
The critical value of the t-distribution determines what is small and large.
The critical value depends on your desired level of accuracy.
The accuracy is determined by the significance level - the probability
of rejecting H0 when it is in fact true. (type I error)
A 5% significance level means that we mistakenly reject H0 5% of the
time.
The critical value increases as significance level falls, thus a null
hypothesis that is rejected at a 5% level is automatically rejected at
the 10% level as well.
The lower the possible significance level the lower is the risk that we
mistakenly reject the null.
15 / 47
Make conclusion
16 / 47
Make conclusions
The graphs illustrates f (1 /(se(1 )). 10% of the distribution is in the grey
area.
17 / 47
Finding critical values
Critical Values for Two-Sided and One-Sided Tests Using the Student t Distribution
Significance Level
19 / 47
P-value
20 / 47
P-value stata
Monday February 2 20:38:46 2015 Page 1
Robust
wage Coef. Std. Err. t P>|t| [95% Conf. Interval]
21 / 47
Computing p-values for t-tests
22 / 47
Finding p-value
Table entry
Table entry for z is the area under the standard normal curve
to the left of z.
z
z .00 .01 .02 .03 .04 .05 .06 .07 .08 .09
3.4 .0003 .0003 .0003 .0003 .0003 .0003 .0003 .0003 .0003 .0002
3.3 .0005 .0005 .0005 .0004 .0004 .0004 .0004 .0004 .0004 .0003
3.2 .0007 .0007 .0006 .0006 .0006 .0006 .0006 .0005 .0005 .0005
3.1 .0010 .0009 .0009 .0009 .0008 .0008 .0008 .0008 .0007 .0007
3.0 .0013 .0013 .0013 .0012 .0012 .0011 .0011 .0011 .0010 .0010
2.9 .0019 .0018 .0018 .0017 .0016 .0016 .0015 .0015 .0014 .0014
2.8 .0026 .0025 .0024 .0023 .0023 .0022 .0021 .0021 .0020 .0019
2.7 .0035 .0034 .0033 .0032 .0031 .0030 .0029 .0028 .0027 .0026
2.6 .0047 .0045 .0044 .0043 .0041 .0040 .0039 .0038 .0037 .0036
2.5 .0062 .0060 .0059 .0057 .0055 .0054 .0052 .0051 .0049 .0048
2.4 .0082 .0080 .0078 .0075 .0073 .0071 .0069 .0068 .0066 .0064
2.3 .0107 .0104 .0102 .0099 .0096 .0094 .0091 .0089 .0087 .0084
2.2 .0139 .0136 .0132 .0129 .0125 .0122 .0119 .0116 .0113 .0110
2.1 .0179 .0174 .0170 .0166 .0162 .0158 .0154 .0150 .0146 .0143
2.0 .0228 .0222 .0217 .0212 .0207 .0202 .0197 .0192 .0188 .0183
1.9 .0287 .0281 .0274 .0268 .0262 .0256 .0250 .0244 .0239 .0233
1.8 .0359 .0351 .0344 .0336 .0329 .0322 .0314 .0307 .0301 .0294
1.7 .0446 .0436 .0427 .0418 .0409 .0401 .0392 .0384 .0375 .0367
1.6 .0548 .0537 .0526 .0516 .0505 .0495 .0485 .0475 .0465 .0455
1.5 .0668 .0655 .0643 .0630 .0618 .0606 .0594 .0582 .0571 .0559
1.4 .0808 .0793 .0778 .0764 .0749 .0735 .0721 .0708 .0694 .0681
1.3 .0968 .0951 .0934 .0918 .0901 .0885 .0869 .0853 .0838 .0823
1.2 .1151 .1131 .1112 .1093 .1075 .1056 .1038 .1020 .1003 .0985
1.1 .1357 .1335 .1314 .1292 .1271 .1251 .1230 .1210 .1190 .1170
1.0 .1587 .1562 .1539 .1515 .1492 .1469 .1446 .1423 .1401 .1379
0.9 .1841 .1814 .1788 .1762 .1736 .1711 .1685 .1660 .1635 .1611
0.8 .2119 .2090 .2061 .2033 .2005 .1977 .1949 .1922 .1894 .1867
0.7 .2420 .2389 .2358 .2327 .2296 .2266 .2236 .2206 .2177 .2148
0.6 .2743 .2709 .2676 .2643 .2611 .2578 .2546 .2514 .2483 .2451
0.5 .3085 .3050 .3015 .2981 .2946 .2912 .2877 .2843 .2810 .2776
0.4 .3446 .3409 .3372 .3336 .3300 .3264 .3228 .3192 .3156 .3121
0.3 .3821 .3783 .3745 .3707 .3669 .3632 .3594 .3557 .3520 .3483
0.2 .4207 .4168 .4129 .4090 .4052 .4013 .3974 .3936 .3897 .3859
0.1 .4602 .4562 .4522 .4483 .4443 .4404 .4364 .4325 .4286 .4247
0.0 .5000 .4960 .4920 .4880 .4840 .4801 .4761 .4721 .4681 .4641
23 / 47
Finding p-value
Monday February 2 20:38:46 2015 Page 1
Robust
wage Coef. Std. Err. t P>|t| [95% Conf. Interval]
The constant has a computed t value of 1.83. Since n is large we can use
the z-table. The p-value is 2(1.83).
24 / 47
Finding p-value
Standard Normal Probabilities
Table entry
Table entry for z is the area under the standard normal curve
to the left of z.
z
z .00 .01 .02 .03 .04 .05 .06 .07 .08 .09
3.4 .0003 .0003 .0003 .0003 .0003 .0003 .0003 .0003 .0003 .0002
3.3 .0005 .0005 .0005 .0004 .0004 .0004 .0004 .0004 .0004 .0003
3.2 .0007 .0007 .0006 .0006 .0006 .0006 .0006 .0005 .0005 .0005
3.1 .0010 .0009 .0009 .0009 .0008 .0008 .0008 .0008 .0007 .0007
3.0 .0013 .0013 .0013 .0012 .0012 .0011 .0011 .0011 .0010 .0010
2.9 .0019 .0018 .0018 .0017 .0016 .0016 .0015 .0015 .0014 .0014
2.8 .0026 .0025 .0024 .0023 .0023 .0022 .0021 .0021 .0020 .0019
2.7 .0035 .0034 .0033 .0032 .0031 .0030 .0029 .0028 .0027 .0026
2.6 .0047 .0045 .0044 .0043 .0041 .0040 .0039 .0038 .0037 .0036
2.5 .0062 .0060 .0059 .0057 .0055 .0054 .0052 .0051 .0049 .0048
2.4 .0082 .0080 .0078 .0075 .0073 .0071 .0069 .0068 .0066 .0064
2.3 .0107 .0104 .0102 .0099 .0096 .0094 .0091 .0089 .0087 .0084
2.2 .0139 .0136 .0132 .0129 .0125 .0122 .0119 .0116 .0113 .0110
2.1
2.0
.0179
.0228
.0174
.0222
.0170
.0217
.0166
.0212
.0162
.0207
.0158
.0202
.0154
.0197
.0150
.0192
.0146
.0188
.0143
.0183
p = 2 0.036
1.9 .0287 .0281 .0274 .0268 .0262 .0256 .0250 .0244 .0239 .0233
1.8 .0359 .0351 .0344 .0336 .0329 .0322 .0314 .0307 .0301 .0294
1.7
1.6
.0446
.0548
.0436
.0537
.0427
.0526
.0418
.0516
.0409
.0505
.0401
.0495
.0392
.0485
.0384
.0475
.0375
.0465
.0367
.0455
= 0.0672
1.5 .0668 .0655 .0643 .0630 .0618 .0606 .0594 .0582 .0571 .0559
1.4 .0808 .0793 .0778 .0764 .0749 .0735 .0721 .0708 .0694 .0681
1.3 .0968 .0951 .0934 .0918 .0901 .0885 .0869 .0853 .0838 .0823
1.2 .1151 .1131 .1112 .1093 .1075 .1056 .1038 .1020 .1003 .0985
1.1 .1357 .1335 .1314 .1292 .1271 .1251 .1230 .1210 .1190 .1170
1.0 .1587 .1562 .1539 .1515 .1492 .1469 .1446 .1423 .1401 .1379
0.9 .1841 .1814 .1788 .1762 .1736 .1711 .1685 .1660 .1635 .1611
0.8 .2119 .2090 .2061 .2033 .2005 .1977 .1949 .1922 .1894 .1867
0.7 .2420 .2389 .2358 .2327 .2296 .2266 .2236 .2206 .2177 .2148
0.6 .2743 .2709 .2676 .2643 .2611 .2578 .2546 .2514 .2483 .2451
0.5 .3085 .3050 .3015 .2981 .2946 .2912 .2877 .2843 .2810 .2776
0.4 .3446 .3409 .3372 .3336 .3300 .3264 .3228 .3192 .3156 .3121
0.3 .3821 .3783 .3745 .3707 .3669 .3632 .3594 .3557 .3520 .3483
0.2 .4207 .4168 .4129 .4090 .4052 .4013 .3974 .3936 .3897 .3859
0.1 .4602 .4562 .4522 .4483 .4443 .4404 .4364 .4325 .4286 .4247
0.0 .5000 .4960 .4920 .4880 .4840 .4801 .4761 .4721 .4681 .4641
25 / 47
The Z-table
Remember that:
(Z ) = 1 (Z )
Thus the table does not have to show the probability distribution for both
positive and negative Z.
26 / 47
Interpreting p-values
Small p-values are evidence against the null, large p-values provide
little evidence against the null.
If for example the p-value =0.5 then we would observe a value of the
t statistic as extreme as we did in 50% of all random samples if the
null hypothesis is true.
If denotes the significance level then H0 is rejected if p-value< .
27 / 47
Interpreting p-values
p-value
Correct interpretation: Assuming that the null is true you would obtain
the observed difference or more in p% of studies due to random sampling
error.
Wrong interpretation: P-value is the probability of making a mistake by
rejecting a true null hypothesis.
28 / 47
Collective illusions
Think that you have made a t-test and get a p-value of 0.01
You have not absolutely disproved the null hypothesis.
You have not found the probability of the null hypothesis being true.
You do not know if you decide to reject the null hypothesis the
probability that you are making the wrong decision.
29 / 47
An example
30 / 47
An example
math10 = 8.28 + 0.498sal
(3.22) (0.10)
0.498 0
t= = 4.98
0.10
p value = 2(4.98) < 0.00001
c = 1.96
The 5% critical value is given by: t406
We can reject the null that salary does not affect the percentage of
students passing the math10.
31 / 47
An example
32 / 47
One-sided vs two-sided test
33 / 47
T-statistic one sided test
We remember that for the two sided test it was the absolute value of the
t-statistic that was important. For the one sided test the sign of the
t-statistic is also important.
Rejection rules for one sided tests:
One sided: H1 : 1 > 0 : t act > t c
One sided: H1 : 1 < 0 : t act < t c
Note: The degrees of freedom of the test statistic is given by n k 1
where k is the number of independent variables.
34 / 47
One sided p-value
35 / 47
One-sided vs two-sided test
36 / 47
One-sided vs two-sided test
An illustration of the difference between two-sided and one sided test with
40 degrees of freedom.
37 / 47
Example one-sided test
0.82 1
t= = 1.8
0.10
With n=20 and tc,18,5% = 2.101) (two-sided) we cannot reject the null
hypothesis that 1 = 1 at the 5% level.
38 / 47
Example one-sided test
H0 : 2 = 1 vs H1 : 1 < 1
The t-statistic is the same as long as the null is the same. But the critical
t-value changes.
tc,18,5% = 1.734 one-sided test
Now we can reject the null hypothesis and conclude that price inflation is
significantly lower than wage inflation at the 5% level.
39 / 47
One sided vs two sided
If you can justify the use of a one-sided test, for example with H0 : 1 > 0,
the estimate has to be only 1.65 standard deviations above 0.
41 / 47
Economic versus statistical significance
42 / 47
Example Thursday January 29 18:11:48 2015 Page 1
43 / 47
Thursday January 29 19:07:55 2015 Page 1
Homoskedasticity ___ ____ ____ ____ ____(R)
/__ / ____/ / ____/
Homoskedasticity assumption: ___/ / /___/ / /___/
Statistics/Data Analysis
Robust
ahe Coef. Std. Err. t P>|t| [95% Conf. Interval]
44 / 47
Implication of heteroskedasticity
45 / 47
Note of caution:
The test statistic: The t-value and hence the p-value and confidence
interval is only as good as the underlying assumptions used to
construct it.
If any of the underlying assumptions are violated the test statistic is
not reliable.
Most often the violated assumption is the zero conditional mean
assumption, X is often correlated with the error term.
More about this in the next lecture when we talk about omitted
variable bias.
46 / 47
Power
47 / 47