Day 1A Ordinary Least Squares and GLS

Size: px
Start display at page:

Download "Day 1A Ordinary Least Squares and GLS"

Transcription

1 Day 1A Ordinary Least Squares and GLS c A. Colin Cameron Univ. of Calif.- Davis Frontiers in Econometrics Bavarian Graduate Program in Economics. Based on A. Colin Cameron and Pravin K. Trivedi (2009,2010), Microeconometrics using Stata (MUS), Stata Press. and A. Colin Cameron and Pravin K. Trivedi (2005), Microeconometrics: Methods and Applications (MMA), C.U.P. March 21-25, 2011 c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program in March Economics 21-25,. Based 2011 on A. 1 Colin / 41 C

2 1. ntroduction 1. ntroduction OLS for the linear model is the building block for other regression. Here we provide model in matrix notation statistical properties hypothesis testing simulations to show consistency and asymptotic normality. Additionally More e cient FGLS with heteroskedastic data c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program in March Economics 21-25,. Based 2011 on A. 2 Colin / 41 C

3 1. ntroduction Overview 1 ntroduction 2 OLS: Data example 3 OLS: Matrix Notation 4 OLS: Properties 5 GLS: Generalized Least Squares 6 Tests of linear hypotheses (Wald tests) 7 Simulations: OLS Consistency and Asymptotic Normality 8 Stata commands 9 Appendix: OLS in matrix notation example c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program in March Economics 21-25,. Based 2011 on A. 3 Colin / 41 C

4 2. Data Example Doctor visits 2. Data Example: OLS for doctor visits Cross-section data on individuals (from MUS chapter 10). Dependent variable docvis is a count. Here do OLS (later Poisson). Begin with data description and summary statistics.. use mus10data.dta, clear. quietly keep if year02==1. describe docvis private chronic female income storage display value variable name type format label variable label docvis int %8.0g number of doctor visits private byte %8.0g = 1 if private insurance chronic byte %8.0g = 1 if a chronic condition female byte %8.0g = 1 if female income float %9.0g ncome in $ / summarize docvis private chronic female income Variable Obs Mean Std. Dev. Min Max docvis private chronic female income c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program in March Economics 21-25,. Based 2011 on A. 4 Colin / 41 C

5 2. Data Example OLS regression with default standard errors OLS regression with default standard errors: assumes i.i.d error.. * OLS regression with default standard errors. regress docvis private chronic female income Source SS df MS Number of obs = 4412 F( 4, 4407) = Model Prob > F = Residual R-squared = Adj R-squared = Total Root MSE = docvis Coef. Std. Err. t P> t [95% Conf. nterval] private chronic female income _cons Overall t poor as R 2 = Often the case for cross-section data. Yet all regressors are stat. signi cant and have large impact. For income: annual income " $10,000 ) income " 10 units ) docvis " = c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program in March Economics 21-25,. Based 2011 on A. 5 Colin / 41 C

6 2. Data Example OLS regression with robust standard errors OLS regression with robust standard errors for OLS estimator preferred at this permits model error to be heteroskedastic. * OLS regression with robust standard errors. regress docvis private chronic female income, vce(robust) Linear regression Number of obs = 4412 F( 4, 4407) = Prob > F = R-squared = Root MSE = Robust docvis Coef. Std. Err. t P> t [95% Conf. nterval] private chronic female income _cons Same coe cient estimates. Di erent standard errors. c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program in March Economics 21-25,. Based 2011 on A. 6 Colin / 41 C

7 2. Data Example Comparison of default and robust standard errors. * Comparison of standard errors. quietly regress docvis private chronic female income. estimates store DEFAULT. quietly regress docvis private chronic female income, vce(robust). estimates store ROBUST. estimates table DEFAULT ROBUST, b(%9.4f) se stats(n r2 F) Variable DEFAULT ROBUST private chronic female income _cons N r F legend: b/se c The preferred heteroskedastic-robust standard errors are within 25% of default, sometimes more and sometimes less. A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program in March Economics 21-25,. Based 2011 on A. 7 Colin / 41 C

8 2. Data Example Hypothesis tests Hypothesis tests can be implemented using Stata command test H 0 : β private = 0, β chronic = 0 H a : at least one of β private 6= 0, β chronic 6= 0. Stata post-estimation command test yields. * Wald test of restrictions. quietly regress docvis private chronic female income, vce(robust) noheader. test (private = 0) (chronic = 0) ( 1) private = 0 ( 2) chronic = 0 F( 2, 4407) = Prob > F = Reject H 0 at level 0.05 since p < 0.05 or > F.05 (2, 4407) = 3.00 using invftail(2,4407,.05). c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program in March Economics 21-25,. Based 2011 on A. 8 Colin / 41 C

9 3. Ordinary Least Squares De nition 3. OLS: De nition in matrix notation For the i th observation y i = β 1 x 1i + β 2 x 2i + + β K x Ki + u i Usually x 1i = 1 (an intercept). ntroduce vector and matrix representation. Regressor vector x i and parameter vector β are K 1 column vectors x 1i β x i = 4. 5 and β = (K 1) x (K 1) Ki β K 2 3 xi 0 β = β x 1i x Ki 4. 5 = β 1 x 1i + β 2 x 2i + + β K x Ki β K Note that all vectors are de ned to be column vectors For the i th observation y i = xi 0 β + u i. c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program in March Economics 21-25,. Based 2011 on A. 9 Colin / 41 C

10 3. Ordinary Least Squares De nition Now combine all N observations from sample f(y i, x i ), i = 1,..., N.g The linear regression model is y 1 x β u = xn 0 β y N u N This is where 2 6 y = 4 (N 1) y 1. y N 3 y = Xβ + u X = 6 4 (N K ) x 0 1. x 0 N u = 6 4 (N 1) u 1. u N The OLS estimator derived below is bβ OLS = (X 0 X) 1 X 0 y. c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 10 Colin / 41 C

11 3. Ordinary Least Squares Example OLS: matrix notation example Example: N = 4 with (x, y) equal to (1, 1), (2, 3), (2, 4), and (3, 4). Then y is 4 1 and X is 4 2 with y 1 1 y = 6 y y 3 5 = ; X = 6 4 y 4 4 x 0 1 x 0 2 x 0 3 x = So (see appendix for detailed computation) bβ OLS = (X 0 X) 1 X 0 y = x 11 x 21 x 12 x 22 x 13 x 23 x 14 x ntercept bβ 1 = 0 and slope coe cient bβ 2 = = = c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 11 Colin / 41 C

12 3. Ordinary Least Squares Derivation of Formula Derivation of formula for OLS estimator The OLS estimator minimizes the sum of squared errors Q(β) = N i=1 u2 i = N i=1 (y i x 0 i β) 2. The rst-order conditions (f.o.c.) are Q(β) β = 2 N i=1 x i (y i x 0 i β) = 2X 0 (y Xβ) = 0. Then X 0 (y Xβ) = 0 from f.o.c. ) X 0 y = X 0 Xβ K linear equations in K unknowns β ) β = (X 0 X) 1 X 0 y if the inverse exists (i.e. rank[x ] = K ) So bβ OLS = (X 0 X) 1 X 0 y = N 1 i=1 x i xi 0 N i=1 x i y i. c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 12 Colin / 41 C

13 4. OLS Properties Summary 4. OLS Properties: Summary bβ OLS is always estimable, provided rank[x ] = K. But properties of b β OLS depend on the true model called the data generating process (d.g.p.) Essential result: f the d.g.p. is correctly speci ed and the error u i is uncorrelated with regressors x i Then (1) β b is consistent for β (2) β b is normally distributed in large samples ( asymptotically ) (3) Variance of β b varies with assumptions on error u i F default: u i are independent (0, σ 2 ) F heteroskedastic: u i are independent (0, σ 2 i ) F clustered: u i are correlated within cluster, uncorrelated across cluster F HAC: u i are serially correlated (u i are correlated with u i 1 ) c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 13 Colin / 41 C

14 4. OLS Properties Summary OLS Properties f the d.g.p. is y = Xβ + u then bβ OLS = (X 0 X) 1 X 0 y = (X 0 X) 1 X 0 (Xβ + u) = (X 0 X) 1 X 0 Xβ + (X 0 X) 1 X 0 u = β + (X 0 X) 1 X 0 u = β + ( i x i x 0 i ) 1 i x i u i So assumptions on x i and u i are crucial. c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 14 Colin / 41 C

15 4. OLS Properties Finite Sample Properties OLS Finite Sample Properties f u N [0, Ω] and regressors X are xed (nonstochastic) then bβ = β + (X 0 X) 1 X 0 u β + (X 0 X) 1 X 0 N [0, Ω] N [β, (X 0 X) 1 X 0 ΩX(X 0 X) 1 ] using linear transformation of the normal is normal z N [µ, Ω] =) Az + b N [Aµ + b, AΩA 0 ]. We instead use asumptotic theory this permits u to be nonnormal distributed. but does require a large sample so N!. c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 15 Colin / 41 C

16 4. OLS Properties Consistency OLS Consistency Consistency Means that the probability limit (plim) of β b equals β That is: lim Pr[j β b βj < ε] = 1 for any ε > 0. N! We have (using results below) plim b β = plimfβ + (X 0 X) 1 X 0 ug o = plim β + plim n( i x i xi 0) 1 i x i u i = plim β + plim 1 N i x i x 0 i 1 plim 1 N i x i u i = β + plim 1 N i x i x 0 i 1 0 = β plimfa N b N g = plim A N plim b N if the plim 0 s are constants The plim s exist using laws of large numbers (as averages) For plim N 1 i x i u i = 0 the key assumption is E[u i jx i ] = 0. c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 16 Colin / 41 C

17 4. OLS Properties Limit Distribution OLS Limit Distribution bβ has limit distribution with all mass at β (since b β p! β). To get a nondegenerate distribution in ate b β by p N. Then limit normal distribution is p N( β b β) = 1 N i x i xi 0 1 p1 N i x i u i d! plim 1 N i x i xi 0 1 h N [0, B] for some B d! N 0, plim 1 N i x i xi 0 1 B plim 1 N i x i xi 0 i 1 p d p f H N! H and bn! N [µ, Ω] then HN b N! N [Hµ, HΩH 0 ] p1 d N i x i u i! N [0, B] by a central limit theorem B = plim 1 p N i x i u i 1 p N i x i u i 0 = plim 1 N i j u i u j x i x 0 j c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 17 Colin / 41 C

18 4. OLS Properties Asymptotic Distribution OLS Asymptotic Distribution All we need for theory is the previous result. but rescale from p N( β b β) to β b for friendlier looking results drop plims and replace B by a consistent estimate bb The so-called asymptotic distribution is bβ a N N 1 β, i=1 x i xi 0 N 1 N bb i=1 x i xi 0 Usually B = Var[ 1 p N X 0 u] = Var[ 1 p N i x i u i ] For independent heteroskedastic errors bb = 1 N i bu 2 i x i x 0 i. c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 18 Colin / 41 C

19 4. OLS Properties White Estimate of VCE White Estimate of VCE Most often used: requires data to be independent over i. Then B = plim 1 N i j u i u j x i x 0 j = plim 1 N i u 2 i x i x 0 i. White (1980) showed that can use bb = 1 N i bu 2 i x i x 0 i. Yields the heteroskedastic-consistent estimate of the variance-covariance matrix of the OLS estimator (VCE) bv robust [ b β] = N 1 i=1 x i xi 0 N i=1 bu2 i x i xi 0 N 1 i=1 x i xi 0 bu i = y i xi 0 β b Leads to heteroskedastic robust or robust standard errors. n Stata this is option vce(robust) for cross-section commands c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 19 Colin / 41 C

20 4. OLS Properties Other Estimates of VCE Other Estimates of VCE Default: ndependent homoskedastic errors: V[u i jx i ] = σ 2 bv[ b β] = s 2 N i=1 x i x 0 i 1 ; s 2 = 1 N K i bu2 i Simpli cation as then B = plim N 1 i ui 2x i xi 0 = σ 2 plim i x i xi 0 Cluster robust: Errors correlated within cluster but independent across cluster. bv[ b β] = G g =1 X g X g 0 1 G g =1 X g bu g bu g 0 X g G g =1 X g X g 0 1. Here observations are stacked in cluster g as y g = X g β + u g. n Stata this is option vce(cluster id) for cross-section commands and is option vce(robust) for most xt panel commands. Heteroskedasticity and autocorrelation (HAC) robust: time series Not covered here but extends White to an MA(q) error. c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 20 Colin / 41 C

21 5. Generalized least squares Overview 5. Generalized least squares (GLS) Overview OLS is e cient (best linear unbiased estimator) if errors are i.i.d. so that V[ujX] = σ 2. n practice errors are rarely i.i.d. So we usually do OLS and obtain robust VCE that permits V[ujX] 6= σ 2 could be heteroskedastic robust, cluster-robust, HAC,... More e cient feasible GLS (FGLS) assumes a model for V[ujX] yields more precise estimates (smaller standard errors and bigger t-statistics) but then obtain robust VCE that allows for misspeci ed model for V[ujX]. called weighted LS or working matrix LS. c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 21 Colin / 41 C

22 5. Generalized least squares Feasible GLS Generalized least squares (GLS) Suppose V[ujX] = Ω where Ω is known and y = Xβ + u, E[ujX] = 0 as before. The generalized least squares estimator is e cient: bβ GLS = (X 0 Ω 1 X) 1 X 0 Ω 1 y. Derivation: Premultiply y = Xβ + u by Ω 1/2 so Ω 1/2 y = Ω 1/2 Xβ + Ω 1/2 u. This model has i.i.d. errors since V[Ω 1/2 ujx] = E[(Ω 1/2 u)(ω 1/2 u) 0 jx] = Ω 1/2 ΩΩ 1/2 = N. Then GLS is OLS in this transformed model: bβ GLS = [(Ω 1/2 X) 0 (Ω 1/2 X)](Ω 1/2 X) 0 (Ω 1/2 y) = (X 0 Ω 1 X) 1 X 0 Ω 1 y. c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 22 Colin / 41 C

23 5. Generalized least squares FGLS Feasible generalized least squares (FGLS) To implement GLS we need a consistent estimate of Ω. Assume a model for Ω = Ω(γ), estimate bγ p! γ, and form bω = Ω(bγ) p! Ω. The feasible GLS estimator (FGLS) is bβ GLS = (X 0 bω 1 X) 1 X 0 bω 1 y, and then bβ GLS a N hβ, (X 0 bω 1 X) 1i. Examples: Heteroskedasticity: V[ui 2jx i ] = exp(zi 0γ) Seemingly unrelated equations: y ig = xig 0 β g + u ig, g = 1,..., G. u ig independent over i and homoskedastic with Cov[u ig, u ih ] = σ gh. Systems of equations: SUR with β g = β. Panel data: random e ects estimator. c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 23 Colin / 41 C

24 5. Generalized least squares Weighted least squares Weighted least squares (WLS) Now do FGLS but allow for possibility that model for V[ujX] is incorrectly speci ed So then obtain robust VCE for FGLS. Distinguish between the assumed (working) error variance matrix, denoted Σ = Σ(γ) with estimate bσ = Σ(bγ). the true (unknown) error variance matrix Ω The weighted least squares (WLS) estimator is bβ WLS = (X 0 bσ 1 X) 1 X 0 bσ 1 y. Asymptotically b β WLS a N [β, V[ b β]] where robust VCE is bv[ b β] = (X 0 bσ 1 X) 1 (X 0 bσ 1 bωbσ 1 X) 1 (X 0 bσ 1 X) 1, for cross-section data bω = Diag[(y i x 0 i b β WLS ) 2 ]. c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 24 Colin / 41 C

25 6. Wald tests and Con dence intervals Single restriction Hypothesis test of single restriction Consider test of a single restriction, for notational simplicity β H 0 : β = β H a : β 6= β. A Wald test rejects H 0 if bβ di ers greatly from β. De ne σ b β to be the asymptotic standard deviation of bβ. Then ) a bβ j N [β, σ 2 b ] for unknown β β bβ β σ b β ) z j = b β β σ b β a N [0, 1] a N [0, 1] standardizing under H 0 : β = β To implement this, replace σ b β by s bβ, the standard error of bβ. This makes no di erence asymptotically (so still N [0, 1]). c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 25 Colin / 41 C

26 6. Wald tests and Con dence intervals Single restriction The Wald z-statistic is z j = b β s b β β a N [0, 1] under H 0 : β = β mplementation by two equivalent methods Test using p-values: reject H 0 at level 0.05 if p = Pr[jZ j > jz j j] < 0.05, where Z N [0, 1]. Test using critical values: reject H 0 at level 0.05 if jz j j > z.025 = Many packages such as Stata use T (N k) rather than N [0, 1] More conservative (less likely to reject H 0 ) Exact in unlikely special case that u i N [0, σ 2 ]. c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 26 Colin / 41 C

27 6. Wald tests and Con dence intervals Con dence interval Con dence interval A 100(1 α)% con dence interval for β is bβ z α/2 s b β. in particular a 95% con dence interval is bβ 1.96s b β. can replace z α/2 by T N k;α/2 for better nite sample performance c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 27 Colin / 41 C

28 6. Wald tests and Con dence intervals Multiple linear restrictions Hypothesis test of multiple linear restrictions Now consider test of several restrictions e.g. Test H 0 : β 2 = 0, β 3 = 0 against H a : at least one 6= 0. n matrix algebra we test H 0 : Rβ = r against H a : Rβ 6= r. Example: Test H 0 : β 2 = 0, β 3 = 0 against H a : at least one 6= β 1 β 2 β = β 0 3 = β or R (2K ) β (K 1) = r (21) β k c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 28 Colin / 41 C

29 6. Wald tests and Con dence intervals Multiple linear restrictions A Wald test rejects H 0 : Rβ = r if Rβ b r di ers greatly from 0. Now Rβ b r is normal as linear combination of normals is normal. bβ a N [β, V[ β]] b ) Rβ b a r N [Rβ r, RV[ β]r b 0 ] ) Rβ b a r N [0, RV[ β]r b 0 ] under H 0 ) (Rβ b r) 0 [RV[ β]r b 0 ] 1 (Rβ b r) χ 2 (h) under H 0 The last step converts to chi-square using the result z N [0, Ω] ) z 0 Ω 1 z χ 2 (dim[ω]). To implement this test, replace V[ β] b by bv[ β]. b This makes no di erence asymptotically. c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 29 Colin / 41 C

30 6. Wald tests and Con dence intervals Multiple linear restrictions The Wald chi-squared statistic is W = (Rβ b r) 0 [RbV[ β]r b 0 ] 1 (Rβ b r) a χ 2 (h) under H 0 mplementation by two equivalent methods Test using p-values: reject H 0 at level 0.05 if p = Pr[χ 2 (h) > W] < Test using critical-values: reject H 0 at level 0.05 if W > χ 2.05 (h). The alternative Wald F-test statistic is F = W h F (h, N k) under H 0 Makes no di erence asymptotically as F (h, N)! χ 2 (h)/h as N!. More conservative (less likely to reject H 0 ) Exact in unlikely special case that u i N [0, σ 2 ]. c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 30 Colin / 41 C

31 6. Wald tests and Con dence intervals Multiple linear restrictions Further test details Wald test is the commonly-used method to test H 0 against H a. Estimate β without imposing H 0. Then ask does b β approximately satisfy H 0? The other two test methods used at times are Likelihood ratio test: Estimate under both H 0 & H a and compare ln L. Lagrange multiplier or score test: Estimate under H a only. Asymptotically equivalent to Wald under H 0 and local alternatives Choice is mainly one of convenience, though Wald does have the weakness of lack of invariance to reparameterization. Also as already noted for Wald test asymptotic theory: use Z and χ 2 (q) better nite sample approximation: use T (N k) and F (q, N k) even better still: bootstrap with asymptotic re nement. c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 31 Colin / 41 C

32 7. Simulations OLS consistency and asymptotic normality 7. Simulations: OLS consistency and asymptotic normality D.g.p.: y i = β 1 + β 2 x i + u i where x i χ 2 (1) and β 1 = 1, β 2 = 2. Error: u i χ 2 (1) 1 is skewed with mean 0 and variance 2.. * Small sample: parameters differ from dgp values. clear all. quietly set obs 30. set seed quietly generate double x = rchi2(1). quietly generate y = 1 + 2*x + rchi2(1)-1 // demeaned chi^2 error. regress y x, noheader y Coef. Std. Err. t P> t [95% Conf. nterval] x _cons For N = 30: bβ 2 = di ers appreciably from β 2 = This is due to sampling error as se[bβ 2 ] = c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 32 Colin / 41 C

33 7. Simulations OLS consistency and asymptotic normality How to verify consistency: set N very large.. * Consistency: Large sample: parameters are very close to dgp values. clear all. quietly set obs set seed quietly generate double x = rchi2(1). quietly generate y = 1 + 2*x + rchi2(1)-1 // demeaned chi^2 error. regress y x, noheader y Coef. Std. Err. t P> t [95% Conf. nterval] x _cons For N = 100, 000: bβ 2 = is very close to β 2 = c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 33 Colin / 41 C

34 7. Simulations OLS consistency and asymptotic normality How to check asymptotic results: compute b β many times.. * Central limit theorem. * Write program to obtain betas for one sample of size numobs (= 150). program chi2data, rclass 1. version drop _all 3. set obs $numobs 4. generate double x = rchi2(1) 5. generate y = 1 + 2*x + rchi2(1)-1 // demeaned chi^2 error 6. regress y x 7. return scalar b2 =_b[x] 8. return scalar se2 = _se[x] 9. return scalar t2 = (_b[x]-2)/_se[x] 10. return scalar r2 = abs(return(t2))>invttail($numobs-2,.025) 11. return scalar p2 = 2*ttail($numobs-2,abs(return(t2))) 12. end. * Run this program 1,000 times to get 1,000 betas etcetera. * Results differ from MUS (2008) as MUS did not reset the seed to * First define global macro numobs for sample size. global numobs 150. set seed quietly simulate b2f=r(b2) se2f=r(se2) t2f=r(t2) reject2f=r(r2) p2f=r(p2), /// > reps(1000) saving(chi2datares, replace) nolegend nodots: chi2data Then look at the distribution of these b β 0 s and test statistics. c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 34 Colin / 41 C

35 7. Simulations OLS consistency and asymptotic normality. * Summarize the 1,000 sample means. summarize b2f se2f t2 reject2f p2f Variable Obs Mean Std. Dev. Min Max b2f se2f t2f reject2f p2f mean b2f se2f t2 reject2f p2f Mean estimation Number of obs = 1000 Mean Std. Err. [95% Conf. nterval] b2f se2f t2f reject2f p2f For S = 1, 000 simulations each with sample size N = 150. bβ (1) 2, bβ (2) 2,..., bβ (1000) 2 has distn. with mean close to β 2 = and standard deviation close to p 1/150 = F using V[bβ 2 ] ' (σ 2 u/v[x i ])/N = (2/2)/150 = 1/150. c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 35 Colin / 41 C

36 7. Simulations OLS consistency and asymptotic normality Test β 2 = 2 using z = (bβ 2 β 2 )/se[bβ 2 ] = (bβ 2 2.0)/se[bβ 2 ] to test H 0 : β 2 = 2. Histogram and kernel density estimate for z 1, z 2,..., z Density t-statistic for slope coeff from many samples Not quite standard normal: N = 150 is still not large enough for CLT. c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 36 Colin / 41 C

37 7. Simulations OLS consistency and asymptotic normality How to verify that standard errors are correctly estimated. The average of the computed standard errors of bβ 2 is (see mean of se2f) This is close to the simulation estimate of se[bβ 2 ] of (see Std.Dev. of b2f) Aside: Actually for this dgp expect p 1/150 ' using V[bβ 2 ] ' (σ 2 u/v[x i ])/N = (2/2)/150 = 1/150) How to verify that test has correct size. The Wald test of H 0 : β 2 = 2 at level 0.05 has actual size (see mean of reject2f) This is close enough as a 95% simulation interval when S = 1000 is p /1000 = = (0.046, 0.064). c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 37 Colin / 41 C

38 8. Stata commands 8. Stata commands Command regress does OLS option vce(robust) for heteroskedastic-robust standard errors option vce(cluster clid) for cluster-robust standard errors (with cluster on clid) For Feasible GLS command regress [aweight= ] for known or estimated heteroskedasticity command sureg for systems of linear equations command nlsur for systems of nonlinear equations command xtreg, re for panel random e ects. For hypothesis tests command test (and nltest for nonlinear hypotheses) c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 38 Colin / 41 C

39 9. Appendix OLS matrix notation example 9. Appendix: OLS matrix notation example Example: N = 4 with (x, y) equal to (1, 1), (2, 3), (2, 4), and (3, 4). Vector y and matrix X are y = (41) y 1 y 2 y 3 y = and X = (42) x 0 1 x 0 2 x 0 3 x = x 11 x 21 x 12 x 22 x 13 x 23 x 14 x = c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 39 Colin / 41 C

40 9. Appendix OLS matrix notation example Compute b β OLS = (X 0 X) 1 X 0 y : (X 0 X) 1 = X 0 X = (X 0 X) 1 X 0 y = X 0 y = OLS estimates: = / / = = = 7 5 = / /2. 108/ /4 intercept bβ 1 = 0 and slope coe cient bβ 2 = 1.5. = c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 40 Colin / 41 C

41 9. Appendix OLS matrix notation example OLS on intercept and single regressor: y i = β 1 + β 2 x i + u i x 1 X N X = x 1 4 x N.. 5 = i x i i x i i xi 2 1 x N (X 0 X) 1 = 1 i x 2 i i x i N i xi 2 ( i x i ) 2 i x i N = 1 N 1 i x 2 i x i xi 2 N x 2 x y 1 X y = x 1 4 x N. y N (X 0 X) 1 X 0 y = 1 ȳ i xi 2 i xi 2 N x 2 = 1 i (x i x ) 2 ȳ i x 2 i x i x i y i i (x i x)(y i ȳ) 7 5 = i y i i x i y i x i x i y i xnȳ + i x i y i " ȳ = = bβ 2 x i (x i x )(y i x ) i (x i x ) 2 Nȳ i x i y i So bβ 1 = ȳ bβ 2 x and bβ 2 = i (x i x )(y i x ) i (x i x ) 2 as in introductory course. c A. Colin Cameron Univ. of Calif.- Davis (Frontiers BGPE in Econometrics Course: OLSBavarian and GLSGraduate Program inmarch Economics 21-25, Based on A. 41 Colin / 41 C #

Day 2A Instrumental Variables, Two-stage Least Squares and Generalized Method of Moments

Day 2A Instrumental Variables, Two-stage Least Squares and Generalized Method of Moments Day 2A nstrumental Variables, Two-stage Least Squares and Generalized Method of Moments c A. Colin Cameron Univ. of Calif.- Davis Frontiers in Econometrics Bavarian Graduate Program in Economics. Based

More information

Day 3B Nonparametrics and Bootstrap

Day 3B Nonparametrics and Bootstrap Day 3B Nonparametrics and Bootstrap c A. Colin Cameron Univ. of Calif.- Davis Frontiers in Econometrics Bavarian Graduate Program in Economics. Based on A. Colin Cameron and Pravin K. Trivedi (2009,2010),

More information

Day 4 Nonlinear methods

Day 4 Nonlinear methods Day 4 Nonlinear methods c A. Colin Cameron Univ. of Calif.- Davis Frontiers in Econometrics Bavarian Graduate Program in Economics. Based on A. Colin Cameron and Pravin K. Trivedi (2009, 2010), Microeconometrics

More information

Day 4A Nonparametrics

Day 4A Nonparametrics Day 4A Nonparametrics A. Colin Cameron Univ. of Calif. - Davis... for Center of Labor Economics Norwegian School of Economics Advanced Microeconometrics Aug 28 - Sep 2, 2017. Colin Cameron Univ. of Calif.

More information

Econometrics Midterm Examination Answers

Econometrics Midterm Examination Answers Econometrics Midterm Examination Answers March 4, 204. Question (35 points) Answer the following short questions. (i) De ne what is an unbiased estimator. Show that X is an unbiased estimator for E(X i

More information

Day 1B Count Data Regression: Part 2

Day 1B Count Data Regression: Part 2 Day 1B Count Data Regression: Part 2 A. Colin Cameron Univ. of Calif. - Davis... for Center of Labor Economics Norwegian School of Economics Advanced Microeconometrics Aug 28 - Sept 1, 2017. Colin Cameron

More information

11. Bootstrap Methods

11. Bootstrap Methods 11. Bootstrap Methods c A. Colin Cameron & Pravin K. Trivedi 2006 These transparencies were prepared in 20043. They can be used as an adjunct to Chapter 11 of our subsequent book Microeconometrics: Methods

More information

Recent Advances in the Field of Trade Theory and Policy Analysis Using Micro-Level Data

Recent Advances in the Field of Trade Theory and Policy Analysis Using Micro-Level Data Recent Advances in the Field of Trade Theory and Policy Analysis Using Micro-Level Data July 2012 Bangkok, Thailand Cosimo Beverelli (World Trade Organization) 1 Content a) Classical regression model b)

More information

ECON Introductory Econometrics. Lecture 6: OLS with Multiple Regressors

ECON Introductory Econometrics. Lecture 6: OLS with Multiple Regressors ECON4150 - Introductory Econometrics Lecture 6: OLS with Multiple Regressors Monique de Haan (moniqued@econ.uio.no) Stock and Watson Chapter 6 Lecture outline 2 Violation of first Least Squares assumption

More information

1: a b c d e 2: a b c d e 3: a b c d e 4: a b c d e 5: a b c d e. 6: a b c d e 7: a b c d e 8: a b c d e 9: a b c d e 10: a b c d e

1: a b c d e 2: a b c d e 3: a b c d e 4: a b c d e 5: a b c d e. 6: a b c d e 7: a b c d e 8: a b c d e 9: a b c d e 10: a b c d e Economics 102: Analysis of Economic Data Cameron Spring 2015 Department of Economics, U.C.-Davis Final Exam (A) Saturday June 6 Compulsory. Closed book. Total of 56 points and worth 45% of course grade.

More information

Panel Data. March 2, () Applied Economoetrics: Topic 6 March 2, / 43

Panel Data. March 2, () Applied Economoetrics: Topic 6 March 2, / 43 Panel Data March 2, 212 () Applied Economoetrics: Topic March 2, 212 1 / 43 Overview Many economic applications involve panel data. Panel data has both cross-sectional and time series aspects. Regression

More information

Economics 326 Methods of Empirical Research in Economics. Lecture 14: Hypothesis testing in the multiple regression model, Part 2

Economics 326 Methods of Empirical Research in Economics. Lecture 14: Hypothesis testing in the multiple regression model, Part 2 Economics 326 Methods of Empirical Research in Economics Lecture 14: Hypothesis testing in the multiple regression model, Part 2 Vadim Marmer University of British Columbia May 5, 2010 Multiple restrictions

More information

Testing Linear Restrictions: cont.

Testing Linear Restrictions: cont. Testing Linear Restrictions: cont. The F-statistic is closely connected with the R of the regression. In fact, if we are testing q linear restriction, can write the F-stastic as F = (R u R r)=q ( R u)=(n

More information

Graduate Econometrics Lecture 4: Heteroskedasticity

Graduate Econometrics Lecture 4: Heteroskedasticity Graduate Econometrics Lecture 4: Heteroskedasticity Department of Economics University of Gothenburg November 30, 2014 1/43 and Autocorrelation Consequences for OLS Estimator Begin from the linear model

More information

Econometrics Homework 1

Econometrics Homework 1 Econometrics Homework Due Date: March, 24. by This problem set includes questions for Lecture -4 covered before midterm exam. Question Let z be a random column vector of size 3 : z = @ (a) Write out z

More information

Longitudinal Data Analysis Using Stata Paul D. Allison, Ph.D. Upcoming Seminar: May 18-19, 2017, Chicago, Illinois

Longitudinal Data Analysis Using Stata Paul D. Allison, Ph.D. Upcoming Seminar: May 18-19, 2017, Chicago, Illinois Longitudinal Data Analysis Using Stata Paul D. Allison, Ph.D. Upcoming Seminar: May 18-19, 217, Chicago, Illinois Outline 1. Opportunities and challenges of panel data. a. Data requirements b. Control

More information

Economics 582 Random Effects Estimation

Economics 582 Random Effects Estimation Economics 582 Random Effects Estimation Eric Zivot May 29, 2013 Random Effects Model Hence, the model can be re-written as = x 0 β + + [x ] = 0 (no endogeneity) [ x ] = = + x 0 β + + [x ] = 0 [ x ] = 0

More information

Instrumental Variables, Simultaneous and Systems of Equations

Instrumental Variables, Simultaneous and Systems of Equations Chapter 6 Instrumental Variables, Simultaneous and Systems of Equations 61 Instrumental variables In the linear regression model y i = x iβ + ε i (61) we have been assuming that bf x i and ε i are uncorrelated

More information

Environmental Econometrics

Environmental Econometrics Environmental Econometrics Syngjoo Choi Fall 2008 Environmental Econometrics (GR03) Fall 2008 1 / 37 Syllabus I This is an introductory econometrics course which assumes no prior knowledge on econometrics;

More information

Bootstrap-Based Improvements for Inference with Clustered Errors

Bootstrap-Based Improvements for Inference with Clustered Errors Bootstrap-Based Improvements for Inference with Clustered Errors Colin Cameron, Jonah Gelbach, Doug Miller U.C. - Davis, U. Maryland, U.C. - Davis May, 2008 May, 2008 1 / 41 1. Introduction OLS regression

More information

ECON Introductory Econometrics. Lecture 4: Linear Regression with One Regressor

ECON Introductory Econometrics. Lecture 4: Linear Regression with One Regressor ECON4150 - Introductory Econometrics Lecture 4: Linear Regression with One Regressor Monique de Haan (moniqued@econ.uio.no) Stock and Watson Chapter 4 Lecture outline 2 The OLS estimators The effect of

More information

ECON Introductory Econometrics. Lecture 5: OLS with One Regressor: Hypothesis Tests

ECON Introductory Econometrics. Lecture 5: OLS with One Regressor: Hypothesis Tests ECON4150 - Introductory Econometrics Lecture 5: OLS with One Regressor: Hypothesis Tests Monique de Haan (moniqued@econ.uio.no) Stock and Watson Chapter 5 Lecture outline 2 Testing Hypotheses about one

More information

Föreläsning /31

Föreläsning /31 1/31 Föreläsning 10 090420 Chapter 13 Econometric Modeling: Model Speci cation and Diagnostic testing 2/31 Types of speci cation errors Consider the following models: Y i = β 1 + β 2 X i + β 3 X 2 i +

More information

Introductory Econometrics. Lecture 13: Hypothesis testing in the multiple regression model, Part 1

Introductory Econometrics. Lecture 13: Hypothesis testing in the multiple regression model, Part 1 Introductory Econometrics Lecture 13: Hypothesis testing in the multiple regression model, Part 1 Jun Ma School of Economics Renmin University of China October 19, 2016 The model I We consider the classical

More information

8. Nonstandard standard error issues 8.1. The bias of robust standard errors

8. Nonstandard standard error issues 8.1. The bias of robust standard errors 8.1. The bias of robust standard errors Bias Robust standard errors are now easily obtained using e.g. Stata option robust Robust standard errors are preferable to normal standard errors when residuals

More information

Simultaneous Equations with Error Components. Mike Bronner Marko Ledic Anja Breitwieser

Simultaneous Equations with Error Components. Mike Bronner Marko Ledic Anja Breitwieser Simultaneous Equations with Error Components Mike Bronner Marko Ledic Anja Breitwieser PRESENTATION OUTLINE Part I: - Simultaneous equation models: overview - Empirical example Part II: - Hausman and Taylor

More information

Lab 07 Introduction to Econometrics

Lab 07 Introduction to Econometrics Lab 07 Introduction to Econometrics Learning outcomes for this lab: Introduce the different typologies of data and the econometric models that can be used Understand the rationale behind econometrics Understand

More information

Chapter 2. Dynamic panel data models

Chapter 2. Dynamic panel data models Chapter 2. Dynamic panel data models School of Economics and Management - University of Geneva Christophe Hurlin, Université of Orléans University of Orléans April 2018 C. Hurlin (University of Orléans)

More information

Эконометрика, , 4 модуль Семинар Для Группы Э_Б2015_Э_3 Семинарист О.А.Демидова

Эконометрика, , 4 модуль Семинар Для Группы Э_Б2015_Э_3 Семинарист О.А.Демидова Эконометрика, 2017-2018, 4 модуль Семинар 3 160418 Для Группы Э_Б2015_Э_3 Семинарист ОАДемидова * Stata program * copyright C 2010 by A Colin Cameron and Pravin K Trivedi * used for "Microeconometrics

More information

ECON Introductory Econometrics. Lecture 13: Internal and external validity

ECON Introductory Econometrics. Lecture 13: Internal and external validity ECON4150 - Introductory Econometrics Lecture 13: Internal and external validity Monique de Haan (moniqued@econ.uio.no) Stock and Watson Chapter 9 Lecture outline 2 Definitions of internal and external

More information

ECON3150/4150 Spring 2015

ECON3150/4150 Spring 2015 ECON3150/4150 Spring 2015 Lecture 3&4 - The linear regression model Siv-Elisabeth Skjelbred University of Oslo January 29, 2015 1 / 67 Chapter 4 in S&W Section 17.1 in S&W (extended OLS assumptions) 2

More information

Topic 7: Heteroskedasticity

Topic 7: Heteroskedasticity Topic 7: Heteroskedasticity Advanced Econometrics (I Dong Chen School of Economics, Peking University Introduction If the disturbance variance is not constant across observations, the regression is heteroskedastic

More information

Models, Testing, and Correction of Heteroskedasticity. James L. Powell Department of Economics University of California, Berkeley

Models, Testing, and Correction of Heteroskedasticity. James L. Powell Department of Economics University of California, Berkeley Models, Testing, and Correction of Heteroskedasticity James L. Powell Department of Economics University of California, Berkeley Aitken s GLS and Weighted LS The Generalized Classical Regression Model

More information

Lecture 4: Linear panel models

Lecture 4: Linear panel models Lecture 4: Linear panel models Luc Behaghel PSE February 2009 Luc Behaghel (PSE) Lecture 4 February 2009 1 / 47 Introduction Panel = repeated observations of the same individuals (e.g., rms, workers, countries)

More information

ECON 594: Lecture #6

ECON 594: Lecture #6 ECON 594: Lecture #6 Thomas Lemieux Vancouver School of Economics, UBC May 2018 1 Limited dependent variables: introduction Up to now, we have been implicitly assuming that the dependent variable, y, was

More information

GMM Estimation in Stata

GMM Estimation in Stata GMM Estimation in Stata Econometrics I Department of Economics Universidad Carlos III de Madrid Master in Industrial Economics and Markets 1 Outline Motivation 1 Motivation 2 3 4 2 Motivation 3 Stata and

More information

1 The Multiple Regression Model: Freeing Up the Classical Assumptions

1 The Multiple Regression Model: Freeing Up the Classical Assumptions 1 The Multiple Regression Model: Freeing Up the Classical Assumptions Some or all of classical assumptions were crucial for many of the derivations of the previous chapters. Derivation of the OLS estimator

More information

ECONOMETRICS FIELD EXAM Michigan State University May 9, 2008

ECONOMETRICS FIELD EXAM Michigan State University May 9, 2008 ECONOMETRICS FIELD EXAM Michigan State University May 9, 2008 Instructions: Answer all four (4) questions. Point totals for each question are given in parenthesis; there are 00 points possible. Within

More information

Applied Econometrics. Lecture 3: Introduction to Linear Panel Data Models

Applied Econometrics. Lecture 3: Introduction to Linear Panel Data Models Applied Econometrics Lecture 3: Introduction to Linear Panel Data Models Måns Söderbom 4 September 2009 Department of Economics, Universy of Gothenburg. Email: mans.soderbom@economics.gu.se. Web: www.economics.gu.se/soderbom,

More information

ECONOMETRICS II (ECO 2401S) University of Toronto. Department of Economics. Spring 2013 Instructor: Victor Aguirregabiria

ECONOMETRICS II (ECO 2401S) University of Toronto. Department of Economics. Spring 2013 Instructor: Victor Aguirregabiria ECONOMETRICS II (ECO 2401S) University of Toronto. Department of Economics. Spring 2013 Instructor: Victor Aguirregabiria SOLUTION TO FINAL EXAM Friday, April 12, 2013. From 9:00-12:00 (3 hours) INSTRUCTIONS:

More information

Practical Econometrics. for. Finance and Economics. (Econometrics 2)

Practical Econometrics. for. Finance and Economics. (Econometrics 2) Practical Econometrics for Finance and Economics (Econometrics 2) Seppo Pynnönen and Bernd Pape Department of Mathematics and Statistics, University of Vaasa 1. Introduction 1.1 Econometrics Econometrics

More information

ECON Introductory Econometrics. Lecture 7: OLS with Multiple Regressors Hypotheses tests

ECON Introductory Econometrics. Lecture 7: OLS with Multiple Regressors Hypotheses tests ECON4150 - Introductory Econometrics Lecture 7: OLS with Multiple Regressors Hypotheses tests Monique de Haan (moniqued@econ.uio.no) Stock and Watson Chapter 7 Lecture outline 2 Hypothesis test for single

More information

Applied Statistics and Econometrics

Applied Statistics and Econometrics Applied Statistics and Econometrics Lecture 5 Saul Lach September 2017 Saul Lach () Applied Statistics and Econometrics September 2017 1 / 44 Outline of Lecture 5 Now that we know the sampling distribution

More information

Generalized method of moments estimation in Stata 11

Generalized method of moments estimation in Stata 11 Generalized method of moments estimation in Stata 11 David M. Drukker StataCorp Stata Conference Washington, DC 2009 1 / 27 Outline 1 A quick introduction to GMM 2 gmm examples Ordinary least squares Two-stage

More information

CRE METHODS FOR UNBALANCED PANELS Correlated Random Effects Panel Data Models IZA Summer School in Labor Economics May 13-19, 2013 Jeffrey M.

CRE METHODS FOR UNBALANCED PANELS Correlated Random Effects Panel Data Models IZA Summer School in Labor Economics May 13-19, 2013 Jeffrey M. CRE METHODS FOR UNBALANCED PANELS Correlated Random Effects Panel Data Models IZA Summer School in Labor Economics May 13-19, 2013 Jeffrey M. Wooldridge Michigan State University 1. Introduction 2. Linear

More information

Question 1a 1b 1c 1d 1e 2a 2b 2c 2d 2e 2f 3a 3b 3c 3d 3e 3f M ult: choice Points

Question 1a 1b 1c 1d 1e 2a 2b 2c 2d 2e 2f 3a 3b 3c 3d 3e 3f M ult: choice Points Economics 102: Analysis of Economic Data Cameron Spring 2016 May 12 Department of Economics, U.C.-Davis Second Midterm Exam (Version A) Compulsory. Closed book. Total of 30 points and worth 22.5% of course

More information

Econometrics I KS. Module 2: Multivariate Linear Regression. Alexander Ahammer. This version: April 16, 2018

Econometrics I KS. Module 2: Multivariate Linear Regression. Alexander Ahammer. This version: April 16, 2018 Econometrics I KS Module 2: Multivariate Linear Regression Alexander Ahammer Department of Economics Johannes Kepler University of Linz This version: April 16, 2018 Alexander Ahammer (JKU) Module 2: Multivariate

More information

Introductory Econometrics

Introductory Econometrics Introductory Econometrics Violation of basic assumptions Heteroskedasticity Barbara Pertold-Gebicka CERGE-EI 16 November 010 OLS assumptions 1. Disturbances are random variables drawn from a normal distribution.

More information

Warwick Economics Summer School Topics in Microeconometrics Instrumental Variables Estimation

Warwick Economics Summer School Topics in Microeconometrics Instrumental Variables Estimation Warwick Economics Summer School Topics in Microeconometrics Instrumental Variables Estimation Michele Aquaro University of Warwick This version: July 21, 2016 1 / 31 Reading material Textbook: Introductory

More information

Applied Statistics and Econometrics

Applied Statistics and Econometrics Applied Statistics and Econometrics Lecture 6 Saul Lach September 2017 Saul Lach () Applied Statistics and Econometrics September 2017 1 / 53 Outline of Lecture 6 1 Omitted variable bias (SW 6.1) 2 Multiple

More information

Essential of Simple regression

Essential of Simple regression Essential of Simple regression We use simple regression when we are interested in the relationship between two variables (e.g., x is class size, and y is student s GPA). For simplicity we assume the relationship

More information

Violation of OLS assumption - Heteroscedasticity

Violation of OLS assumption - Heteroscedasticity Violation of OLS assumption - Heteroscedasticity What, why, so what and what to do? Lars Forsberg Uppsala Uppsala University, Department of Statistics October 22, 2014 Lars Forsberg (Uppsala University)

More information

the error term could vary over the observations, in ways that are related

the error term could vary over the observations, in ways that are related Heteroskedasticity We now consider the implications of relaxing the assumption that the conditional variance Var(u i x i ) = σ 2 is common to all observations i = 1,..., n In many applications, we may

More information

Econ 836 Final Exam. 2 w N 2 u N 2. 2 v N

Econ 836 Final Exam. 2 w N 2 u N 2. 2 v N 1) [4 points] Let Econ 836 Final Exam Y Xβ+ ε, X w+ u, w N w~ N(, σi ), u N u~ N(, σi ), ε N ε~ Nu ( γσ, I ), where X is a just one column. Let denote the OLS estimator, and define residuals e as e Y X.

More information

Quantitative Methods Final Exam (2017/1)

Quantitative Methods Final Exam (2017/1) Quantitative Methods Final Exam (2017/1) 1. Please write down your name and student ID number. 2. Calculator is allowed during the exam, but DO NOT use a smartphone. 3. List your answers (together with

More information

Least Squares Estimation-Finite-Sample Properties

Least Squares Estimation-Finite-Sample Properties Least Squares Estimation-Finite-Sample Properties Ping Yu School of Economics and Finance The University of Hong Kong Ping Yu (HKU) Finite-Sample 1 / 29 Terminology and Assumptions 1 Terminology and Assumptions

More information

Day 2B Inference for Clustered Data: Part 2 With a Cross-section Data Example (Revised August 25 to add 14. Dyadic Clustering)

Day 2B Inference for Clustered Data: Part 2 With a Cross-section Data Example (Revised August 25 to add 14. Dyadic Clustering) Day 2B nference for Clustered Data: Part 2 With a Cross-section Data Example (Revised August 25 to add 14. Dyadic Clustering) A. Colin Cameron Univ. of Calif. - Davis... for Center of Labor Economics Norwegian

More information

Please discuss each of the 3 problems on a separate sheet of paper, not just on a separate page!

Please discuss each of the 3 problems on a separate sheet of paper, not just on a separate page! Econometrics - Exam May 11, 2011 1 Exam Please discuss each of the 3 problems on a separate sheet of paper, not just on a separate page! Problem 1: (15 points) A researcher has data for the year 2000 from

More information

The Multiple Linear Regression Model

The Multiple Linear Regression Model Short Guides to Microeconometrics Fall 2016 Kurt Schmidheiny Unversität Basel The Multiple Linear Regression Model 1 Introduction The multiple linear regression model and its estimation using ordinary

More information

Robust Inference for Regression with Clustered Data

Robust Inference for Regression with Clustered Data Robust nference for Regression with Clustered Data Colin Cameron Univ. of California - Davis Joint work with Douglas L. Miller (UC - Davis). Based on A Practitioners Guide to Cluster-Robust nference, Journal

More information

Jeffrey M. Wooldridge Michigan State University

Jeffrey M. Wooldridge Michigan State University Fractional Response Models with Endogenous Explanatory Variables and Heterogeneity Jeffrey M. Wooldridge Michigan State University 1. Introduction 2. Fractional Probit with Heteroskedasticity 3. Fractional

More information

Chapter 6: Endogeneity and Instrumental Variables (IV) estimator

Chapter 6: Endogeneity and Instrumental Variables (IV) estimator Chapter 6: Endogeneity and Instrumental Variables (IV) estimator Advanced Econometrics - HEC Lausanne Christophe Hurlin University of Orléans December 15, 2013 Christophe Hurlin (University of Orléans)

More information

1 Outline. Introduction: Econometricians assume data is from a simple random survey. This is never the case.

1 Outline. Introduction: Econometricians assume data is from a simple random survey. This is never the case. 24. Strati cation c A. Colin Cameron & Pravin K. Trivedi 2006 These transparencies were prepared in 2002. They can be used as an adjunct to Chapter 24 (sections 24.2-24.4 only) of our subsequent book Microeconometrics:

More information

Heteroskedasticity. We now consider the implications of relaxing the assumption that the conditional

Heteroskedasticity. We now consider the implications of relaxing the assumption that the conditional Heteroskedasticity We now consider the implications of relaxing the assumption that the conditional variance V (u i x i ) = σ 2 is common to all observations i = 1,..., In many applications, we may suspect

More information

Panel Data Models. James L. Powell Department of Economics University of California, Berkeley

Panel Data Models. James L. Powell Department of Economics University of California, Berkeley Panel Data Models James L. Powell Department of Economics University of California, Berkeley Overview Like Zellner s seemingly unrelated regression models, the dependent and explanatory variables for panel

More information

Answer all questions from part I. Answer two question from part II.a, and one question from part II.b.

Answer all questions from part I. Answer two question from part II.a, and one question from part II.b. B203: Quantitative Methods Answer all questions from part I. Answer two question from part II.a, and one question from part II.b. Part I: Compulsory Questions. Answer all questions. Each question carries

More information

GLS. Miguel Sarzosa. Econ626: Empirical Microeconomics, Department of Economics University of Maryland

GLS. Miguel Sarzosa. Econ626: Empirical Microeconomics, Department of Economics University of Maryland GLS Miguel Sarzosa Department of Economics University of Maryland Econ626: Empirical Microeconomics, 2012 1 When any of the i s fail 2 Feasibility 3 Now we go to Stata! GLS Fixes i s Failure Remember that

More information

Empirical Asset Pricing

Empirical Asset Pricing Department of Mathematics and Statistics, University of Vaasa, Finland Texas A&M University, May June, 2013 As of May 24, 2013 Part III Stata Regression 1 Stata regression Regression Factor variables Postestimation:

More information

Greene, Econometric Analysis (7th ed, 2012)

Greene, Econometric Analysis (7th ed, 2012) EC771: Econometrics, Spring 2012 Greene, Econometric Analysis (7th ed, 2012) Chapters 2 3: Classical Linear Regression The classical linear regression model is the single most useful tool in econometrics.

More information

INTRODUCTION TO BASIC LINEAR REGRESSION MODEL

INTRODUCTION TO BASIC LINEAR REGRESSION MODEL INTRODUCTION TO BASIC LINEAR REGRESSION MODEL 13 September 2011 Yogyakarta, Indonesia Cosimo Beverelli (World Trade Organization) 1 LINEAR REGRESSION MODEL In general, regression models estimate the effect

More information

Lecture: Simultaneous Equation Model (Wooldridge s Book Chapter 16)

Lecture: Simultaneous Equation Model (Wooldridge s Book Chapter 16) Lecture: Simultaneous Equation Model (Wooldridge s Book Chapter 16) 1 2 Model Consider a system of two regressions y 1 = β 1 y 2 + u 1 (1) y 2 = β 2 y 1 + u 2 (2) This is a simultaneous equation model

More information

Review of Econometrics

Review of Econometrics Review of Econometrics Zheng Tian June 5th, 2017 1 The Essence of the OLS Estimation Multiple regression model involves the models as follows Y i = β 0 + β 1 X 1i + β 2 X 2i + + β k X ki + u i, i = 1,...,

More information

Repeated observations on the same cross-section of individual units. Important advantages relative to pure cross-section data

Repeated observations on the same cross-section of individual units. Important advantages relative to pure cross-section data Panel data Repeated observations on the same cross-section of individual units. Important advantages relative to pure cross-section data - possible to control for some unobserved heterogeneity - possible

More information

****Lab 4, Feb 4: EDA and OLS and WLS

****Lab 4, Feb 4: EDA and OLS and WLS ****Lab 4, Feb 4: EDA and OLS and WLS ------- log: C:\Documents and Settings\Default\Desktop\LDA\Data\cows_Lab4.log log type: text opened on: 4 Feb 2004, 09:26:19. use use "Z:\LDA\DataLDA\cowsP.dta", clear.

More information

1 Introduction to Generalized Least Squares

1 Introduction to Generalized Least Squares ECONOMICS 7344, Spring 2017 Bent E. Sørensen April 12, 2017 1 Introduction to Generalized Least Squares Consider the model Y = Xβ + ɛ, where the N K matrix of regressors X is fixed, independent of the

More information

ESTIMATING AVERAGE TREATMENT EFFECTS: REGRESSION DISCONTINUITY DESIGNS Jeff Wooldridge Michigan State University BGSE/IZA Course in Microeconometrics

ESTIMATING AVERAGE TREATMENT EFFECTS: REGRESSION DISCONTINUITY DESIGNS Jeff Wooldridge Michigan State University BGSE/IZA Course in Microeconometrics ESTIMATING AVERAGE TREATMENT EFFECTS: REGRESSION DISCONTINUITY DESIGNS Jeff Wooldridge Michigan State University BGSE/IZA Course in Microeconometrics July 2009 1. Introduction 2. The Sharp RD Design 3.

More information

Econometrics. 9) Heteroscedasticity and autocorrelation

Econometrics. 9) Heteroscedasticity and autocorrelation 30C00200 Econometrics 9) Heteroscedasticity and autocorrelation Timo Kuosmanen Professor, Ph.D. http://nomepre.net/index.php/timokuosmanen Today s topics Heteroscedasticity Possible causes Testing for

More information

Economics 471: Econometrics Department of Economics, Finance and Legal Studies University of Alabama

Economics 471: Econometrics Department of Economics, Finance and Legal Studies University of Alabama Economics 471: Econometrics Department of Economics, Finance and Legal Studies University of Alabama Course Packet The purpose of this packet is to show you one particular dataset and how it is used in

More information

Inference about Clustering and Parametric. Assumptions in Covariance Matrix Estimation

Inference about Clustering and Parametric. Assumptions in Covariance Matrix Estimation Inference about Clustering and Parametric Assumptions in Covariance Matrix Estimation Mikko Packalen y Tony Wirjanto z 26 November 2010 Abstract Selecting an estimator for the variance covariance matrix

More information

Instrumental Variables and Two-Stage Least Squares

Instrumental Variables and Two-Stage Least Squares Instrumental Variables and Two-Stage Least Squares Generalised Least Squares Professor Menelaos Karanasos December 2011 Generalised Least Squares: Assume that the postulated model is y = Xb + e, (1) where

More information

point estimates, standard errors, testing, and inference for nonlinear combinations

point estimates, standard errors, testing, and inference for nonlinear combinations Title xtreg postestimation Postestimation tools for xtreg Description The following postestimation commands are of special interest after xtreg: command description xttest0 Breusch and Pagan LM test for

More information

Extensions to the Basic Framework I

Extensions to the Basic Framework I Topic 5 Extensions to the Basic Framework I ARE/ECN 240 A Graduate Econometrics Professor: Òscar Jordà Outline of this topic Heteroskedasticity: reminder of OLS results and White (1980) corrected standard

More information

Econometrics I KS. Module 1: Bivariate Linear Regression. Alexander Ahammer. This version: March 12, 2018

Econometrics I KS. Module 1: Bivariate Linear Regression. Alexander Ahammer. This version: March 12, 2018 Econometrics I KS Module 1: Bivariate Linear Regression Alexander Ahammer Department of Economics Johannes Kepler University of Linz This version: March 12, 2018 Alexander Ahammer (JKU) Module 1: Bivariate

More information

x i = 1 yi 2 = 55 with N = 30. Use the above sample information to answer all the following questions. Show explicitly all formulas and calculations.

x i = 1 yi 2 = 55 with N = 30. Use the above sample information to answer all the following questions. Show explicitly all formulas and calculations. Exercises for the course of Econometrics Introduction 1. () A researcher is using data for a sample of 30 observations to investigate the relationship between some dependent variable y i and independent

More information

1: a b c d e 2: a b c d e 3: a b c d e 4: a b c d e 5: a b c d e. 6: a b c d e 7: a b c d e 8: a b c d e 9: a b c d e 10: a b c d e

1: a b c d e 2: a b c d e 3: a b c d e 4: a b c d e 5: a b c d e. 6: a b c d e 7: a b c d e 8: a b c d e 9: a b c d e 10: a b c d e Economics 102: Analysis of Economic Data Cameron Spring 2016 Department of Economics, U.C.-Davis Final Exam (A) Tuesday June 7 Compulsory. Closed book. Total of 58 points and worth 45% of course grade.

More information

Lecture 8: Instrumental Variables Estimation

Lecture 8: Instrumental Variables Estimation Lecture Notes on Advanced Econometrics Lecture 8: Instrumental Variables Estimation Endogenous Variables Consider a population model: y α y + β + β x + β x +... + β x + u i i i i k ik i Takashi Yamano

More information

The Regression Tool. Yona Rubinstein. July Yona Rubinstein (LSE) The Regression Tool 07/16 1 / 35

The Regression Tool. Yona Rubinstein. July Yona Rubinstein (LSE) The Regression Tool 07/16 1 / 35 The Regression Tool Yona Rubinstein July 2016 Yona Rubinstein (LSE) The Regression Tool 07/16 1 / 35 Regressions Regression analysis is one of the most commonly used statistical techniques in social and

More information

Regression with a Single Regressor: Hypothesis Tests and Confidence Intervals

Regression with a Single Regressor: Hypothesis Tests and Confidence Intervals Regression with a Single Regressor: Hypothesis Tests and Confidence Intervals (SW Chapter 5) Outline. The standard error of ˆ. Hypothesis tests concerning β 3. Confidence intervals for β 4. Regression

More information

Lecture 3: Multiple Regression

Lecture 3: Multiple Regression Lecture 3: Multiple Regression R.G. Pierse 1 The General Linear Model Suppose that we have k explanatory variables Y i = β 1 + β X i + β 3 X 3i + + β k X ki + u i, i = 1,, n (1.1) or Y i = β j X ji + u

More information

OLS, MLE and related topics. Primer.

OLS, MLE and related topics. Primer. OLS, MLE and related topics. Primer. Katarzyna Bech Week 1 () Week 1 1 / 88 Classical Linear Regression Model (CLRM) The model: y = X β + ɛ, and the assumptions: A1 The true model is y = X β + ɛ. A2 E

More information

ECON2228 Notes 7. Christopher F Baum. Boston College Economics. cfb (BC Econ) ECON2228 Notes / 41

ECON2228 Notes 7. Christopher F Baum. Boston College Economics. cfb (BC Econ) ECON2228 Notes / 41 ECON2228 Notes 7 Christopher F Baum Boston College Economics 2014 2015 cfb (BC Econ) ECON2228 Notes 6 2014 2015 1 / 41 Chapter 8: Heteroskedasticity In laying out the standard regression model, we made

More information

ECON2228 Notes 10. Christopher F Baum. Boston College Economics. cfb (BC Econ) ECON2228 Notes / 48

ECON2228 Notes 10. Christopher F Baum. Boston College Economics. cfb (BC Econ) ECON2228 Notes / 48 ECON2228 Notes 10 Christopher F Baum Boston College Economics 2014 2015 cfb (BC Econ) ECON2228 Notes 10 2014 2015 1 / 48 Serial correlation and heteroskedasticity in time series regressions Chapter 12:

More information

Robust Inference with Clustered Errors

Robust Inference with Clustered Errors Robust nference with Clustered Errors Colin Cameron Univ. of California - Davis Keynote address at The 8th Annual Health Econometrics Workshop, University of Colorado Denver, Anschutz Medical Campus..

More information

The Case Against JIVE

The Case Against JIVE The Case Against JIVE Related literature, Two comments and One reply PhD. student Freddy Rojas Cama Econometrics Theory II Rutgers University November 14th, 2011 Literature 1 Literature 2 Key de nitions

More information

Simple Linear Regression: The Model

Simple Linear Regression: The Model Simple Linear Regression: The Model task: quantifying the effect of change X in X on Y, with some constant β 1 : Y = β 1 X, linear relationship between X and Y, however, relationship subject to a random

More information

Exercises Chapter 4 Statistical Hypothesis Testing

Exercises Chapter 4 Statistical Hypothesis Testing Exercises Chapter 4 Statistical Hypothesis Testing Advanced Econometrics - HEC Lausanne Christophe Hurlin University of Orléans December 5, 013 Christophe Hurlin (University of Orléans) Advanced Econometrics

More information

Measurement Error. Often a data set will contain imperfect measures of the data we would ideally like.

Measurement Error. Often a data set will contain imperfect measures of the data we would ideally like. Measurement Error Often a data set will contain imperfect measures of the data we would ideally like. Aggregate Data: (GDP, Consumption, Investment are only best guesses of theoretical counterparts and

More information

ECO220Y Simple Regression: Testing the Slope

ECO220Y Simple Regression: Testing the Slope ECO220Y Simple Regression: Testing the Slope Readings: Chapter 18 (Sections 18.3-18.5) Winter 2012 Lecture 19 (Winter 2012) Simple Regression Lecture 19 1 / 32 Simple Regression Model y i = β 0 + β 1 x

More information

Econometrics II Censoring & Truncation. May 5, 2011

Econometrics II Censoring & Truncation. May 5, 2011 Econometrics II Censoring & Truncation Måns Söderbom May 5, 2011 1 Censored and Truncated Models Recall that a corner solution is an actual economic outcome, e.g. zero expenditure on health by a household

More information

A Course on Advanced Econometrics

A Course on Advanced Econometrics A Course on Advanced Econometrics Yongmiao Hong The Ernest S. Liu Professor of Economics & International Studies Cornell University Course Introduction: Modern economies are full of uncertainties and risk.

More information