Presentation is loading. Please wait.

Presentation is loading. Please wait.

Part 8: Hypothesis Testing 8-1/50 Econometrics I Professor William Greene Stern School of Business Department of Economics.

Similar presentations


Presentation on theme: "Part 8: Hypothesis Testing 8-1/50 Econometrics I Professor William Greene Stern School of Business Department of Economics."— Presentation transcript:

1 Part 8: Hypothesis Testing 8-1/50 Econometrics I Professor William Greene Stern School of Business Department of Economics

2 Part 8: Hypothesis Testing 8-2/50 Econometrics I Part 8 – Interval Estimation and Hypothesis Testing

3 Part 8: Hypothesis Testing 8-3/50 Interval Estimation  b = point estimator of   We acknowledge the sampling variability. Estimated sampling variance b =  + sampling variability induced by 

4 Part 8: Hypothesis Testing 8-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 

5 Part 8: Hypothesis Testing 8-5/50 Confidence Interval b k = the point estimate Std.Err[b k ] = sqr{[σ 2 (XX) -1 ] kk } = v k Assume normality of ε for now: b k ~ N[β k,v k 2 ] for the true β k. (b k -β k )/v k ~ N[0,1] Consider a range of plausible values of β k given the point estimate b k. b k  sampling error. Measured in standard error units, |(b k – β k )/ v k | < z* Larger z*  greater probability (“confidence”) Given normality, e.g., z* = 1.96  95%, z*=1.645  90% Plausible range for β k then is b k ± z* v k

6 Part 8: Hypothesis Testing 8-6/50 Computing the Confidence Interval Assume normality of ε for now: b k ~ N[β k,v k 2 ] for the true β k. (b k -β k )/v k ~ N[0,1] v k = [σ 2 (X’X) -1 ] kk is not known because σ 2 must be estimated. Using s 2 instead of σ 2, (b k -β k )/Est.(v k ) ~ 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.

7 Part 8: Hypothesis Testing 8-7/50 Confidence Interval Critical t[.975,29] = 2.045 Confidence interval based on t: 1.27365  2.045 *.1501 Confidence interval based on normal: 1.27365  1.960 *.1501

8 Part 8: Hypothesis Testing 8-8/50 Bootstrap Confidence Interval For a Coefficient

9 Part 8: Hypothesis Testing 8-9/50 Bootstrap CI for Least Squares

10 Part 8: Hypothesis Testing 8-10/50 Bootstrap CI for Least Absolute Deviations

11 Part 8: Hypothesis Testing 8-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.

12 Part 8: Hypothesis Testing 8-12/50 Test a Hypothesis About a Coefficient

13 Part 8: Hypothesis Testing 8-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.

14 Part 8: Hypothesis Testing 8-14/50 Types of Tests  Nested Models: Restriction on the parameters of a particular model y =  1 +  2 x +  3 z + ,  3 = 0  Nonnested models: E.g., different RHS variables y t =  1 +  2 x t +  3 x t-1 +  t y t =  1 +  2 x t +  3 y t-1 + w t  Specification tests:  ~ N[0,  2 ] vs. some other distribution

15 Part 8: Hypothesis Testing 8-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

16 Part 8: Hypothesis Testing 8-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.

17 Part 8: Hypothesis Testing 8-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

18 Part 8: Hypothesis Testing 8-18/50 Testable Implications of a Theory  Investors care about interest rates and expected inflation: I = b 1 + b 2 r + b 3 dp + e  Investors care about real interest rates I = c 1 + c 2 (r-dp) + c 3 dp + e No testable restrictions implied. c 1 =b 1, c 2 =b 2 -b 3, c 3 =b 3.  Investors care only about real interest rates I = f 1 + f 2 (r-dp) + f 3 dp + e. f 3 = 0

19 Part 8: Hypothesis Testing 8-19/50 The General Linear Hypothesis: H 0 : 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 variability Rb – q is too large (by some measure) to be plausibly attributed to sampling variability Large Rb – q is the rejection region.

20 Part 8: Hypothesis Testing 8-20/50 Approaches to Defining the Rejection Region (1) Imposing the restrictions leads to a loss of fit. R 2 must go down. Does it go down “a lot?” (I.e., significantly?). R u 2 = unrestricted model, R r 2 = restricted model fit. F = { (R u 2 – R r 2 )/J } / [(1 – R u 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]) -1 m 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

21 Part 8: Hypothesis Testing 8-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.

22 Part 8: Hypothesis Testing 8-22/50 Testing Procedures How 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.

23 Part 8: Hypothesis Testing 8-23/50 Distribution Under the Null

24 Part 8: Hypothesis Testing 8-24/50 A Simulation Experiment sample ; 1 - 100 $ matrix ; fvalues=init(1000,1,0)$ proc$ create ; fakelogc = rnn(-.319557,1.54236)$ Coefficients all = 0 regress ; quietly ; lhs = fakelogc Compute regression ; rhs=one,logq,logpl_pf,logpk_pf$ calc ; fstat = (rsqrd/3)/((1-rsqrd)/(n-4))$ Compute F matrix ; fvalues(i)=fstat$ Save 1000 Fs endproc execute ; i= 1,1000 $ 1000 replications histogram ; rhs = fvalues ; title=F Statistic for H0:b2=b3=b4=0$

25 Part 8: Hypothesis Testing 8-25/50 Simulation Results 48 outcomes to the right of 2.7 in this run of the experiment.

26 Part 8: Hypothesis Testing 8-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.

27 Part 8: Hypothesis Testing 8-27/50 Power of a Test Null: Mean = 0. Reject if observed mean +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.

28 Part 8: Hypothesis Testing 8-28/50 Test Statistic For the fit measures, use a normalized measure of the loss of fit:

29 Part 8: Hypothesis Testing 8-29/50 Test Statistics Forming test statistics: For distance measures use Wald type of distance measure, W = m[Est.Var(m)] -1 m 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.

30 Part 8: Hypothesis Testing 8-30/50 An important relationship between t and F For a single restriction, F[1,N-K] is the square of the t ratio.

31 Part 8: Hypothesis Testing 8-31/50 Application Time series regression, LogG =  1 +  2 logY +  3 logPG +  4 logPNC +  5 logPUC +  6 logPPT +  7 logPN +  8 logPD +  9 logPS +  Period = 1960 - 1995. Note that all coefficients in the model are elasticities.

32 Part 8: Hypothesis Testing 8-32/50 Full Model ---------------------------------------------------------------------- Ordinary least squares regression............ LHS=LG Mean = 5.39299 Standard deviation =.24878 Number of observs. = 36 Model size Parameters = 9 Degrees of freedom = 27 Residuals 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 --------+-------------------------------------------------------------

33 Part 8: Hypothesis Testing 8-33/50 Test About One Parameter Is the price of public transportation really relevant? H 0 :  6 = 0. Confidence interval: b 6  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 R 2, was.99605, F(1,27) = [(.99605 -.99573)/1]/[(1-.99605)/(36-9)] = 2.187 = 1.472 2 (with some rounding difference)

34 Part 8: Hypothesis Testing 8-34/50 Hypothesis Test: Sum of Coefficients = 1? ---------------------------------------------------------------------- Ordinary least squares regression............ LHS=LG Mean = 5.39299 Standard deviation =.24878 Number of observs. = 36 Model size Parameters = 9 Degrees of freedom = 27 Residuals 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 --------+-------------------------------------------------------------

35 Part 8: Hypothesis Testing 8-35/50 Imposing the Restriction ---------------------------------------------------------------------- Linearly restricted regression LHS=LG Mean = 5.392989 Standard deviation =.2487794 Number of observs. = 36 Model size Parameters = 8 <*** 9 – 1 restriction Degrees of freedom = 28 Residuals Sum of squares =.0112599 <*** With the restriction Residuals Sum of squares =.0085531 <*** Without the restriction Fit R-squared =.9948020 Restrictns. 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

36 Part 8: Hypothesis Testing 8-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 squares With two restrictions imposed Residuals Sum of squares =.0286877 Fit R-squared =.9979006 Unrestricted Residuals Sum of squares =.0085531 Fit R-squared =.9960515 F = ((.0286877 -.0085531)/2) / (.0085531/(36-9)) = 31.779951 The critical F for 95% with 2,27 degrees of freedom is 3.354. The hypothesis is rejected.

37 Part 8: Hypothesis Testing 8-37/50 Basing the Test on R 2 After building the restrictions into the model and computing restricted and unrestricted regressions: Based on R 2 s, 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.

38 Part 8: Hypothesis Testing 8-38/50 Wald Distance Measure Testing more generally about a single parameter. Sample estimate is b k Hypothesized value is β k How far is β k from b k ? If too far, the hypothesis is inconsistent with the sample evidence. Measure distance in standard error units t = (b k - β k )/Estimated v k. If t is “large” (larger than critical value), reject the hypothesis.

39 Part 8: Hypothesis Testing 8-39/50 The Wald Statistic

40 Part 8: Hypothesis Testing 8-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.

41 Part 8: Hypothesis Testing 8-41/50 Particular Cases Some 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.] = t 2 [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 numerator Suppose linear function is  k w k b k Variance is  k  l w k w l Cov[b k,b l ] 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.

42 Part 8: Hypothesis Testing 8-42/50 Hypothesis Test: Sum of Coefficients Do the three aggregate price elasticities sum to zero? H 0 :β 7 + β 8 + β 9 = 0 R = [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

43 Part 8: Hypothesis Testing 8-43/50 Wald Test

44 Part 8: Hypothesis Testing 8-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' m $ Matrix W has 1 rows and 1 columns. 1 +-------------+ 1| 63.55962 +-------------+ Joint hypothesis: b(LY) = 1 b(LPG) = -1

45 Part 8: Hypothesis Testing 8-45/50 Application: Cost Function

46 Part 8: Hypothesis Testing 8-46/50 Regression Results ---------------------------------------------------------------------- Ordinary least squares regression............ LHS=C Mean = 3.07162 Standard deviation = 1.54273 Number of observs. = 158 Model size Parameters = 9 Degrees of freedom = 149 Residuals Sum of squares = 2.56313 Standard error of e =.13116 Fit 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. ----------------------------------------------------------------------

47 Part 8: Hypothesis Testing 8-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. = 158 Model size Parameters = 7 Degrees of freedom = 151 Residuals Sum of squares = 2.85625 Standard error of e =.13753 Fit R-squared =.99236 Restrictns. 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 --------+-------------------------------------------------------------

48 Part 8: Hypothesis Testing 8-48/50 Imposing the Restrictions Alternatively, compute the restricted regression by converting to price ratios and Imposing 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. = 158 Model size Parameters = 7 Degrees of freedom = 151 Residuals 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.7913 LOGPK_PF|.38943**.16933 2.300.0228.85979 LOGPL_PF|.19130.19530.979.3289 5.58162 LQ_LPKPF| -.02954.02125 -1.390.1665 7.15696 LQ_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.)

49 Part 8: Hypothesis Testing 8-49/50 Wald Test of the Restrictions Chi 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 errors for nonlinear functions and joint test of nonlinear restrictions. Wald Statistic = 17.03978 Prob. 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.52 The chi squared statistic is JF. Here, 2F = 17.04 = the chi squared.

50 Part 8: Hypothesis Testing 8-50/50 Test of Homotheticity Cross 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 errors for nonlinear functions and joint test of nonlinear restrictions. Wald Statistic = 2.57180 Prob. 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


Download ppt "Part 8: Hypothesis Testing 8-1/50 Econometrics I Professor William Greene Stern School of Business Department of Economics."

Similar presentations


Ads by Google