SAS pp 223-229 - AN AUTOCORRELATED ERROR MODEL Learning...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
AN AUTOCORRELATED ERROR MODEL Learning SAS: A Computer Handbook for Econometrics R. Carter Hill CHAPTER 16 An Autocorrelated Error Model Autocorrelation in the errors of a linear regression model, like heteroskedastic errors, make least squares estimator inefficient relative to generalized estimator. In Sections 16.1-16.3 this Chapter we develop estimator when follow a first order autoregressive process, which is often abbreviated as AR( 1). The Durbin-Watson (DW) test for autocorrelation presented Section 16.5. 16.6 presents modifications forecasting procedures when present. The SAS procedure PROC REG can be used obtain estimates if it applied to transformed data. WithinPROC REG the MODEL statement option DW produces the Durbin-Watson statistic. SAS also contains a powerful procedure, PROC AUTOREG, documented the SAS/ETS User's Guide, estimating regression models with autocorrelation. A PROC IML appendix provided illustrate one iterative estimation procedure, the Cochrane- Orcutt technique. 16.3 Generalized Least Squares Estimation of an Autocorrelated Model Data on area devoted production sugar cane in Bangladesh, and pr ices sugar cane and jute, are given in Table 16. 1. The parameter in Equation 16.3.22. Read data, and form logarithmic transformations data used statistical model. data sugar; infile'table16.1'; input a ps pj; y = log(a); x2 = log(ps/pj); Obtain using PROC REG. Output residuals to a SAS set, EHATDAT, subsequent use. proc reg; ols:model y = x2; output out=ehatdat r=ehat; The p 16.3.21 from the model e = p e _ + error t t 1 223
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
t-l AN AUTOCORRELATED ERROR MODEL To use PROC REG for estimating p we must created the la.gged variable e . The SAS function LAG creates a one-period lag. Create the lagged values of least squares residuals using a DATA statement. data rhohat; set ehatdat; ehatl = lag(ehat); PROC REG can be used to estimate p. The NOINT option must be used with model statement prevent an intercept variable from being included. proc reg; rhohat:model ehat=ehatl/noint; Using value p = 0.4501 we can transform as shown in Equations 16.3.11. Use the LAG function create lagged of y and x . 2 trans; sugar; rhohat = 0.4501; ylagl = lag(y); x21agl = lag(x2); ystar = y - rhohat*ylagl; x2star = x2 - rhohat*x21agl; Equation 13.3.11 shows that first column the X matrix is not a column of ones. The variable must also be transformed. int = 1 - The first observation requires a observations. Use an IF-THEN observation and make appropriate transformation. diff DO erent -END transformation than isolate rest if _n_ = 1 then do; = sqrt(1 - rhohat**2)*y; = sqrt(1 - rhohat**2)*x2; = sqrt(1 - rhohat**2); end; Use the SAS statement KEEP indicate only the transformed variables are to be kept, and then print using PROC PRINT. Compare first 4 transformed
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 7

SAS pp 223-229 - AN AUTOCORRELATED ERROR MODEL Learning...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online