Upload
evan-harmon
View
222
Download
2
Tags:
Embed Size (px)
Citation preview
Part 8: Hypothesis Testing8-1/50
Econometrics IProfessor William Greene
Stern School of Business
Department of Economics
Part 8: Hypothesis Testing8-2/50
Econometrics I
Part 8 – Interval Estimation and Hypothesis Testing
Part 8: Hypothesis Testing8-3/50
Interval Estimation
b = point estimator of We acknowledge the sampling variability.
Estimated sampling variance b = + sampling variability induced by
Part 8: Hypothesis Testing8-4/50
Point estimate is only the best single guess Form an interval, or range of plausible values Plausible likely values with acceptable degree
of probability. To assign probabilities, we require a distribution
for the variation of the estimator. The role of the normality assumption for
Part 8: Hypothesis Testing8-5/50
Confidence Intervalbk = the point estimate
Std.Err[bk] = sqr{[σ2(XX)-1]kk} = vk
Assume normality of ε for now: bk ~ N[βk,vk
2] for the true βk. (bk-βk)/vk ~ N[0,1]
Consider a range of plausible values of βk given the point estimate bk. bk sampling error. Measured in standard error units, |(bk – βk)/ vk| < z* Larger z* greater probability (“confidence”) Given normality, e.g., z* = 1.96 95%, z*=1.64590% Plausible range for βk then is bk ± z* vk
Part 8: Hypothesis Testing8-6/50
Computing the Confidence IntervalAssume normality of ε for now:
bk ~ N[βk,vk2] for the true βk.
(bk-βk)/vk ~ N[0,1]
vk = [σ2(X’X)-1]kk is not known because σ2 must be estimated.
Using s2 instead of σ2, (bk-βk)/Est.(vk) ~ t[N-K].
(Proof: ratio of normal to sqr(chi-squared)/df is pursued in your text.)
Use critical values from t distribution instead of standard normal. Will be the same as normal if N > 100.
Part 8: Hypothesis Testing8-7/50
Confidence Interval
Critical t[.975,29] = 2.045Confidence interval based on t: 1.27365 2.045 * .1501Confidence interval based on normal: 1.27365 1.960 * .1501
Part 8: Hypothesis Testing8-8/50
Bootstrap Confidence Interval For a Coefficient
Part 8: Hypothesis Testing8-9/50
Bootstrap CI for Least Squares
Part 8: Hypothesis Testing8-10/50
Bootstrap CI for Least Absolute Deviations
Part 8: Hypothesis Testing8-11/50
Testing a Hypothesis Using a Confidence Interval
Given the range of plausible values
Testing the hypothesis that a coefficient equals zero or some other particular value:
Is the hypothesized value in the confidence interval?
Is the hypothesized value within the range of plausible values? If not, reject the hypothesis.
Part 8: Hypothesis Testing8-12/50
Test a Hypothesis About a Coefficient
Part 8: Hypothesis Testing8-13/50
Classical Hypothesis Testing
We are interested in using the linear regression to support or cast doubt on the validity of a theory about the real world counterpart to our statistical model. The model is used to test hypotheses about the underlying data generating process.
Part 8: Hypothesis Testing8-14/50
Types of Tests
Nested Models: Restriction on the parameters of a particular modely = 1 + 2x + 3z + , 3 = 0
Nonnested models: E.g., different RHS variablesyt = 1 + 2xt + 3xt-1 + t
yt = 1 + 2xt + 3yt-1 + wt Specification tests:
~ N[0,2] vs. some other distribution
Part 8: Hypothesis Testing8-15/50
Methodology
Bayesian Prior odds compares strength of prior beliefs in two states of the
world Posterior odds compares revised beliefs Symmetrical treatment of competing ideas Not generally practical to carry out in meaningful situations
Classical “Null” hypothesis given prominence Propose to “reject” toward default favor of “alternative” Asymmetric treatment of null and alternative Huge gain in practical applicability
Part 8: Hypothesis Testing8-16/50
Neyman – Pearson Methodology
Formulate null and alternative hypotheses Define “Rejection” region = sample evidence
that will lead to rejection of the null hypothesis. Gather evidence Assess whether evidence falls in rejection region
or not.
Part 8: Hypothesis Testing8-17/50
Inference in the Linear Model
Formulating hypotheses: linear restrictions as a general framework
Hypothesis Testing J linear restrictions
Analytical framework: y = X + Hypothesis: R - q = 0,
Substantive restrictions: What is a "testable hypothesis?" Substantive restriction on parameters Reduces dimension of parameter space Imposition of restriction degrades estimation criterion
Part 8: Hypothesis Testing8-18/50
Testable Implications of a Theory Investors care about interest rates and expected
inflation:I = b1 + b2r + b3dp + e
Investors care about real interest ratesI = c1 + c2(r-dp) + c3dp + e
No testable restrictions implied. c1 =b1, c2=b2-b3, c3=b3.
Investors care only about real interest ratesI = f1 + f2(r-dp) + f3dp + e. f3 = 0
Part 8: Hypothesis Testing8-19/50
The General Linear Hypothesis: H0: R - q = 0
A unifying departure point: Regardless of the hypothesis, least squares is unbiased.
E[b] =
The hypothesis makes a claim about the population
R – q = 0. Then, if the hypothesis is true, E[Rb – q] = 0.
The sample statistic, Rb – q will not equal zero.Two possibilities:
Rb – q is small enough to attribute to sampling variabilityRb – q is too large (by some measure) to be plausibly attributed to
sampling variabilityLarge Rb – q is the rejection region.
Part 8: Hypothesis Testing8-20/50
Approaches to Defining the Rejection Region
(1) Imposing the restrictions leads to a loss of fit. R2 must go down. Does it go down “a lot?” (I.e., significantly?).
Ru2 = unrestricted model, Rr
2 = restricted model fit. F = { (Ru
2 – Rr2)/J } / [(1 – Ru
2)/(N-K)] = F[J,N-K].
(2) Is Rb - q close to 0? Basing the test on the discrepancy vector: m = Rb - q. Using the Wald criterion: m(Var[m])-1m
has a chi-squared distribution with J degrees of freedom But, Var[m] = R[2(X’X)-1]R. If we use our estimate of 2, we get an F[J,N-K], instead. (Note, this is based on using ee/(N-K) to estimate 2.)
These are the same for the linear model
Part 8: Hypothesis Testing8-21/50
Testing Fundamentals - I SIZE of a test = Probability it will incorrectly
reject a “true” null hypothesis. This is the probability of a Type I error.
Under the null hypothesis, F(3,100) has an F distribution with (3,100) degrees of freedom. Even if the null is true, F will be larger than the 5% critical value of 2.7 about 5% of the time.
Part 8: Hypothesis Testing8-22/50
Testing ProceduresHow to determine if the statistic is 'large.' Need a 'null distribution.'If the hypothesis is true, then the statistic will have a certain
distribution. This tells you how likely certain values are, and in particular, if the hypothesis is true, then 'large values' will be unlikely.
If the observed statistic is too large, conclude that the assumed distribution must be incorrect and the hypothesis should be rejected.
For the linear regression model with normally distributed disturbances, the distribution of the relevant statistic is F with J and N-K degrees of freedom.
Part 8: Hypothesis Testing8-23/50
Distribution Under the Null
Density of F[3,100]
X
.250
.500
.750
.000
1 2 3 40
FDENSIT
Y
Part 8: Hypothesis Testing8-24/50
A Simulation Experiment
sample ; 1 - 100 $matrix ; fvalues=init(1000,1,0)$proc$create ; fakelogc = rnn(-.319557,1.54236)$ Coefficients all = 0regress ; quietly ; lhs = fakelogc Compute regression ; rhs=one,logq,logpl_pf,logpk_pf$calc ; fstat = (rsqrd/3)/((1-rsqrd)/(n-4))$ Compute Fmatrix ; fvalues(i)=fstat$ Save 1000 Fsendprocexecute ; i= 1,1000 $ 1000 replicationshistogram ; rhs = fvalues ; title=F Statistic for H0:b2=b3=b4=0$
Part 8: Hypothesis Testing8-25/50
Simulation Results
48 outcomes to the right of 2.7 in this run of the experiment.
Part 8: Hypothesis Testing8-26/50
Testing Fundamentals - II
POWER of a test = the probability that it will correctly reject a “false null” hypothesis
This is 1 – the probability of a Type II error. The power of a test depends on the specific
alternative.
Part 8: Hypothesis Testing8-27/50
Power of a Test
Null: Mean = 0. Reject if observed mean < -1.96 or > +1.96.Prob(Reject null|mean=0) = 0.05
Prob(Reject null|mean=.5)=0.07902
Prob(Reject null|mean=1)=0.170066. Increases as the (alternative) mean rises.
B E TA
.084
.168
.251
.335
.419
.000
-3 -2 -1 0 1 2 3 4 5-4
N2 N0 N1
Variable
Part 8: Hypothesis Testing8-28/50
Test Statistic
For the fit measures, use a normalized measure of the loss of fit:
r rr
r rr r
0 since
and
0 since
2 2u r 2 2
u r2u
2 2u uu
yy yy
u uu u
u u
R -R / JF[J,n -K] = R R
1-R / (N-K)
Often useful
R =1- R =1-S S
Insert these in F and it becomes
/ JF[J,n -K] =
/ (N-K)
e e e e
e e e ee e e e
e e
Part 8: Hypothesis Testing8-29/50
Test StatisticsForming test statistics:
For distance measures use Wald type of distance measure, W = m[Est.Var(m)]-1m
An important relationship between t and F
For a single restriction, m = r’b - q. The variance is r’(Var[b])r
The distance measure is m / standard error of m.
Part 8: Hypothesis Testing8-30/50
An important relationship between t and F
2
Chi Squared[J] / JF
Chi squared[N K] / (N K)
where the two chi-squared variables are independent.
If J = 1, i.e., testing a single restriction,
Chi Squared[1] /1F
Chi squared[N K] / (N K)
(N[0,1])
Chi s
2
2
quared[N K] / (N K)
N[0,1] = t[1]
Chi squared[N K] / (N K)
For a single restriction, F[1,N-K] is the square of the t ratio.
Part 8: Hypothesis Testing8-31/50
ApplicationTime series regression,
LogG = 1 + 2logY + 3logPG
+ 4logPNC + 5logPUC + 6logPPT
+ 7logPN + 8logPD + 9logPS +
Period = 1960 - 1995. Note that all coefficients in the model are elasticities.
Part 8: Hypothesis Testing8-32/50
Full Model----------------------------------------------------------------------Ordinary least squares regression ............LHS=LG Mean = 5.39299 Standard deviation = .24878 Number of observs. = 36Model size Parameters = 9 Degrees of freedom = 27Residuals Sum of squares = .00855 <******* Standard error of e = .01780 <*******Fit R-squared = .99605 <******* Adjusted R-squared = .99488 <*******--------+-------------------------------------------------------------Variable| Coefficient Standard Error t-ratio P[|T|>t] Mean of X--------+-------------------------------------------------------------Constant| -6.95326*** 1.29811 -5.356 .0000 LY| 1.35721*** .14562 9.320 .0000 9.11093 LPG| -.50579*** .06200 -8.158 .0000 .67409 LPNC| -.01654 .19957 -.083 .9346 .44320 LPUC| -.12354* .06568 -1.881 .0708 .66361 LPPT| .11571 .07859 1.472 .1525 .77208 LPN| 1.10125*** .26840 4.103 .0003 .60539 LPD| .92018*** .27018 3.406 .0021 .43343 LPS| -1.09213*** .30812 -3.544 .0015 .68105--------+-------------------------------------------------------------
Part 8: Hypothesis Testing8-33/50
Test About One Parameter
Is the price of public transportation really relevant? H0 : 6 = 0.
Confidence interval: b6 t(.95,27) Standard error = .11571 2.052(.07859) = .11571 .16127 = (-.045557 ,.27698)
Contains 0.0. Do not reject hypothesis
Regression fit if drop? Without LPPT, R-squared= .99573 Compare R2, was .99605,
F(1,27) = [(.99605 - .99573)/1]/[(1-.99605)/(36-9)] = 2.187 = 1.4722 (with some rounding difference)
Part 8: Hypothesis Testing8-34/50
Hypothesis Test: Sum of Coefficients = 1?----------------------------------------------------------------------Ordinary least squares regression ............LHS=LG Mean = 5.39299 Standard deviation = .24878 Number of observs. = 36Model size Parameters = 9 Degrees of freedom = 27Residuals Sum of squares = .00855 <******* Standard error of e = .01780 <*******Fit R-squared = .99605 <******* Adjusted R-squared = .99488 <*******--------+-------------------------------------------------------------Variable| Coefficient Standard Error t-ratio P[|T|>t] Mean of X--------+-------------------------------------------------------------Constant| -6.95326*** 1.29811 -5.356 .0000 LY| 1.35721*** .14562 9.320 .0000 9.11093 LPG| -.50579*** .06200 -8.158 .0000 .67409 LPNC| -.01654 .19957 -.083 .9346 .44320 LPUC| -.12354* .06568 -1.881 .0708 .66361 LPPT| .11571 .07859 1.472 .1525 .77208 LPN| 1.10125*** .26840 4.103 .0003 .60539 LPD| .92018*** .27018 3.406 .0021 .43343 LPS| -1.09213*** .30812 -3.544 .0015 .68105--------+-------------------------------------------------------------
Part 8: Hypothesis Testing8-35/50
Imposing the Restriction----------------------------------------------------------------------Linearly restricted regressionLHS=LG Mean = 5.392989 Standard deviation = .2487794 Number of observs. = 36Model size Parameters = 8 <*** 9 – 1 restriction Degrees of freedom = 28Residuals Sum of squares = .0112599 <*** With the restrictionResiduals Sum of squares = .0085531 <*** Without the restrictionFit R-squared = .9948020Restrictns. F[ 1, 27] (prob) = 8.5(.01)Not using OLS or no constant.R2 & F may be < 0--------+-------------------------------------------------------------Variable| Coefficient Standard Error t-ratio P[|T|>t] Mean of X--------+-------------------------------------------------------------Constant| -10.1507*** .78756 -12.889 .0000 LY| 1.71582*** .08839 19.412 .0000 9.11093 LPG| -.45826*** .06741 -6.798 .0000 .67409 LPNC| .46945*** .12439 3.774 .0008 .44320 LPUC| -.01566 .06122 -.256 .8000 .66361 LPPT| .24223*** .07391 3.277 .0029 .77208 LPN| 1.39620*** .28022 4.983 .0000 .60539 LPD| .23885 .15395 1.551 .1324 .43343 LPS| -1.63505*** .27700 -5.903 .0000 .68105--------+-------------------------------------------------------------F = [(.0112599 - .0085531)/1] / [.0085531/(36 – 9)] = 8.544691
Part 8: Hypothesis Testing8-36/50
Joint Hypotheses
Joint hypothesis: Income elasticity = +1, Own price elasticity = -1.The hypothesis implies that logG = β1 + logY – logPg + β4 logPNC + ...Strategy: Regress logG – logY + logPg on the other variables and
Compare the sums of squaresWith two restrictions imposedResiduals Sum of squares = .0286877Fit R-squared = .9979006UnrestrictedResiduals Sum of squares = .0085531Fit R-squared = .9960515
F = ((.0286877 - .0085531)/2) / (.0085531/(36-9)) = 31.779951The critical F for 95% with 2,27 degrees of freedom is 3.354. The hypothesis is rejected.
Part 8: Hypothesis Testing8-37/50
Basing the Test on R2
After building the restrictions into the model and computing restricted and unrestricted regressions: Based on R2s,
F = ((.9960515 - .997096)/2)/((1-.9960515)/(36-9)) = -3.571166 (!)
What's wrong? The unrestricted model used LHS = logG. The restricted one used logG-logY. The calculation is safe using the sums of squared residuals.
Part 8: Hypothesis Testing8-38/50
Wald Distance MeasureTesting more generally about a single parameter.
Sample estimate is bk
Hypothesized value is βk
How far is βk from bk? If too far, the hypothesis is inconsistent with the sample evidence.
Measure distance in standard error units
t = (bk - βk)/Estimated vk.If t is “large” (larger than critical value), reject the
hypothesis.
Part 8: Hypothesis Testing8-39/50
The Wald Statistic
-1
Most test statistics are Wald distance measures
W = (random vector - hypothesized value)' times
[Variance of difference] times
(random vector - hypothesized value)
0 0 -1 0
= Normalized distance measure
= ( - ) [Var( - )] ( - )
Distributed as chi-squared(J ) if (1) the distance is
normally distributed and (2) the variance matrix is
the true one, not the esti
q q ' q q q q
mate.
Part 8: Hypothesis Testing8-40/50
Robust Tests The Wald test generally will (when properly
constructed) be more robust to failures of the narrow model assumptions than the t or F
Reason: Based on “robust” variance estimators and asymptotic results that hold in a wide range of circumstances.
Analysis: Later in the course – after developing asymptotics.
Part 8: Hypothesis Testing8-41/50
Particular CasesSome particular cases:One coefficient equals a particular value: F = [(b - value) / Standard error of b ]2 = square of familiar t ratio.
Relationship is F [ 1, d.f.] = t2[d.f.]A linear function of coefficients equals a particular value
(linear function of coefficients - value)2
F = ---------------------------------------------------- Variance of linear function
Note square of distance in numeratorSuppose linear function is k wk bk
Variance is kl wkwl Cov[bk,bl]This is the Wald statistic. Also the square of the somewhat
familiar t statistic.Several linear functions. Use Wald or F. Loss of fit measures may be easier to
compute.
Part 8: Hypothesis Testing8-42/50
Hypothesis Test: Sum of CoefficientsDo the three aggregate price elasticities sum to zero?H0 :β7 + β8 + β9 = 0R = [0, 0, 0, 0, 0, 0, 1, 1, 1], q = [0]
Variable| Coefficient Standard Error t-ratio P[|T|>t] Mean of X--------+------------------------------------------------------------- LPN| 1.10125*** .26840 4.103 .0003 .60539 LPD| .92018*** .27018 3.406 .0021 .43343 LPS| -1.09213*** .30812 -3.544 .0015 .68105
Part 8: Hypothesis Testing8-43/50
Wald Test
Part 8: Hypothesis Testing8-44/50
Using the Wald Statistic--> Matrix ; R = [0,1,0,0,0,0,0,0,0 / 0,0,1,0,0,0,0,0,0]$--> Matrix ; q = [1/-1]$--> Matrix ; list ; m = R*b - q $Matrix M has 2 rows and 1 columns. 1 +-------------+ 1| .35721 2| .49421 +-------------+--> Matrix ; list ; vm = R*varb*R' $Matrix VM has 2 rows and 2 columns. 1 2 +-------------+-------------+ 1| .02120 .00291 2| .00291 .00384 +-------------+-------------+--> Matrix ; list ; w = m'<vm>m $Matrix W has 1 rows and 1 columns. 1 +-------------+ 1| 63.55962 +-------------+
Joint hypothesis:b(LY) = 1b(LPG) = -1
Part 8: Hypothesis Testing8-45/50
Application: Cost Function
Part 8: Hypothesis Testing8-46/50
Regression Results----------------------------------------------------------------------Ordinary least squares regression ............LHS=C Mean = 3.07162 Standard deviation = 1.54273 Number of observs. = 158Model size Parameters = 9 Degrees of freedom = 149Residuals Sum of squares = 2.56313 Standard error of e = .13116Fit R-squared = .99314 Adjusted R-squared = .99277--------+-------------------------------------------------------------Variable| Coefficient Standard Error t-ratio P[|T|>t] Mean of X--------+-------------------------------------------------------------Constant| 5.22853 3.18024 1.644 .1023 K| -.21055 .21757 -.968 .3348 4.25096 L| -.85353*** .31485 -2.711 .0075 8.97280 F| .18862 .20225 .933 .3525 3.39118 Q| -.96450*** .36798 -2.621 .0097 8.26549 Q2| .05250*** .00459 11.430 .0000 35.7913 QK| .04273 .02758 1.550 .1233 35.1677 QL| .11698*** .03728 3.138 .0021 74.2063 QF| .05950** .02478 2.401 .0176 28.0108--------+-------------------------------------------------------------Note: ***, **, * = Significance at 1%, 5%, 10% level.----------------------------------------------------------------------
Part 8: Hypothesis Testing8-47/50
Price Homogeneity: Only Price Ratios Matter β2 + β3 + β4 = 1. β7 + β8 + β9 = 0.----------------------------------------------------------------------Linearly restricted regression....................LHS=C Mean = 3.07162 Standard deviation = 1.54273 Number of observs. = 158Model size Parameters = 7 Degrees of freedom = 151Residuals Sum of squares = 2.85625 Standard error of e = .13753Fit R-squared = .99236Restrictns. F[ 2, 149] (prob) = 8.5(.0003)Not using OLS or no constant. Rsqrd & F may be < 0--------+-------------------------------------------------------------Variable| Coefficient Standard Error t-ratio P[|T|>t] Mean of X--------+-------------------------------------------------------------Constant| -7.24078*** 1.01411 -7.140 .0000 K| .38943** .16933 2.300 .0228 4.25096 L| .19130 .19530 .979 .3289 8.97280 F| .41927** .20077 2.088 .0385 3.39118 Q| .45889*** .12402 3.700 .0003 8.26549 Q2| .06008*** .00441 13.612 .0000 35.7913 QK| -.02954 .02125 -1.390 .1665 35.1677 QL| -.00462 .02364 -.195 .8454 74.2063 QF| .03416 .02489 1.373 .1720 28.0108--------+-------------------------------------------------------------
Part 8: Hypothesis Testing8-48/50
Imposing the RestrictionsAlternatively, compute the restricted regression by converting to price ratios andImposing the restrictions directly. This is a regression of log(c/pf) on log(pk/pf), log(pl/pf) etc.----------------------------------------------------------------------Ordinary least squares regression ............LHS=LOGC_PF Mean = -.31956 Standard deviation = 1.54236 Number of observs. = 158Model size Parameters = 7 Degrees of freedom = 151Residuals Sum of squares = 2.85625 (restricted)Residuals Sum of squares = 2.56313 (unrestricted)--------+-------------------------------------------------------------Variable| Coefficient Standard Error t-ratio P[|T|>t] Mean of X--------+-------------------------------------------------------------Constant| -7.24078*** 1.01411 -7.140 .0000 LOGQ| .45889*** .12402 3.700 .0003 8.26549 LOGQSQ| .06008*** .00441 13.612 .0000 35.7913LOGPK_PF| .38943** .16933 2.300 .0228 .85979LOGPL_PF| .19130 .19530 .979 .3289 5.58162LQ_LPKPF| -.02954 .02125 -1.390 .1665 7.15696LQ_LPLPF| -.00462 .02364 -.195 .8454 46.1956--------+-------------------------------------------------------------F Statistic = ((2.85625 – 2.56313)/2) / (2.56313/(158-9)) = 8.52(This is a problem. The underlying theory requires linear homogeneity in prices.)
Part 8: Hypothesis Testing8-49/50
Wald Test of the RestrictionsChi squared = J*F
wald ; fn1 = b_k + b_l + b_f - 1 ; fn2 = b_qk + b_ql + b_qf – 0 $-----------------------------------------------------------WALD procedure. Estimates and standard errorsfor nonlinear functions and joint test ofnonlinear restrictions.Wald Statistic = 17.03978Prob. from Chi-squared[ 2] = .00020--------+--------------------------------------------------Variable| Coefficient Standard Error b/St.Er. P[|Z|>z]--------+-------------------------------------------------- Fncn(1)| -1.87546*** .45621 -4.111 .0000 Fncn(2)| .21921*** .05353 4.095 .0000--------+--------------------------------------------------Note: ***, **, * = Significance at 1%, 5%, 10% level.-----------------------------------------------------------Recall:F Statistic = ((2.85625 – 2.56313)/2) / (2.56313/(158-9)) = 8.52The chi squared statistic is JF. Here, 2F = 17.04 = the chi squared.
Part 8: Hypothesis Testing8-50/50
Test of HomotheticityCross Product Terms = 0
Homothetic Production: β7 = β8 = β9 = 0.With linearity homogeneity in prices already imposed, this is β6 = β7 = 0.
-----------------------------------------------------------WALD procedure. Estimates and standard errorsfor nonlinear functions and joint test ofnonlinear restrictions.Wald Statistic = 2.57180Prob. from Chi-squared[ 2] = .27640--------+--------------------------------------------------Variable| Coefficient Standard Error b/St.Er. P[|Z|>z]--------+-------------------------------------------------- Fncn(1)| -.02954 .02125 -1.390 .1644 Fncn(2)| -.00462 .02364 -.195 .8451--------+--------------------------------------------------
The F test would produce F = ((2.90490 – 2.85625)/1)/(2.85625/(158-7)) = 1.285