BookmarkSubscribeRSS Feed
Junyong
Pyrite | Level 9

Suppose there is a regression.

data have;
do t=1 to 5000;
x=rannor(1);
w=rannor(1);
y=x+w+rannor(1);
output;
end;
run;

PROC REG easily estimates the following three regressions.

proc reg;
model y=x;
model y=w;
model y=x w;
quit;

But I need to use a Newey–West standard error, i.e. PROC MODEL. I tried the following, which didn't work correctly.

proc model;
y=a+b*x;
fit y/gmm kernel=(bart,2,0) vardef=n;
y=c+d*w;
fit y/gmm kernel=(bart,2,0) vardef=n;
y=e+f*x+g*w;
fit y/gmm kernel=(bart,2,0) vardef=n;
quit;

Should one repeat PROC MODEL thrice to estimate the three regressions?

1 REPLY 1

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 622 views
  • 0 likes
  • 2 in conversation