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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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