Embed
Email

codes

Document Sample

Shared by: xiaoyounan
Categories
Tags
Stats
views:
0
posted:
12/24/2011
language:
pages:
1
The problems of correlated errors (chapter 8)



Code015

option ls=90 ps=75;

title 'Soft Drink Concentrate Sales';

proc reg data=soft;

model y = x / dw; /* D-W statistic */

plot (r. student.)*pred.;

output out=softout p=pred r=resid student=student;

run; quit;

proc gplot data=softout; plot resid*year; run; quit;

proc univariate data=softout normaltest; var student;

qqplot student / normal(mu=0 sigma=1) square; run;







Code016

option ls=90 ps=75;

title 'Toothpaste Market Share';

/* ordinary least squares */

proc reg data=toothpaste;

model y = x / dw;

plot (r. student.)*pred.;

output out=toothpasteout p=pred r=resid student=student;

run; quit;

proc gplot data=toothpasteout; plot resid*period; run; quit;

proc univariate data=toothpasteout normaltest; var student;

qqplot student / normal(mu=0 sigma=1) square; run;

/* Cochrane-Orcutt method */

/* iteration 1 */

data co1; set toothpaste; xstar0=x-.409*lag(x); ystar0=y-.409*lag(y); run;

data co_iter1; set co1 (firstobs=2); run; /* drop the missing values */

proc print data=co_iter1; run;

proc reg data=co_iter1;

model ystar0 = xstar0 / dw;

plot (r. student.)*pred.;

output out=toothpasteout2 p=pred r=resid student=student;

run; quit;

/* equivalent (not rigorously) method to GLS for autoregressive covariance

structure */

proc autoreg data=toothpaste;

model y = x / nlag=1 method=yw;

run;



Related docs
Other docs by xiaoyounan
uses chart
Views: 2  |  Downloads: 0
least_squares_fit_manual
Views: 0  |  Downloads: 0
ENTERING_THE_ROADWAY_AND_BACKING_NOTES
Views: 0  |  Downloads: 0
FFaith presentation
Views: 0  |  Downloads: 0
Ward_Nutritioin
Views: 1  |  Downloads: 0
0604477_Goldburg
Views: 0  |  Downloads: 0
salary-delegation-authority-summary-temporary
Views: 0  |  Downloads: 0
August 2011 _excel format_
Views: 19  |  Downloads: 0
1350 Tally FINANCE
Views: 1  |  Downloads: 0
Ch. 6.3.Martinez
Views: 0  |  Downloads: 0
By registering with docstoc.com you agree to our
privacy policy

You are almost ready to download!

You are almost ready to download!