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

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 811 views
  • 0 likes
  • 2 in conversation