BookmarkSubscribeRSS Feed
cmy
Calcite | Level 5 cmy
Calcite | Level 5

 

I ran a cross-sectional regression (across 500 stocks) for a particular month. It is repeated for other 60 months (say yymonth is 201001-201512). Then, the average (across time) coefficients are calculated.

 

proc reg data=a outest=b tableout noprint;

model y =   x1 x2 x3    /  adjrsq ;

  output out=RES r=rRESID;

by yymonth;

 

Now I need to run proc syslin SUR grouping all the 60 months together. 

Does anyone know how to 'choose' a month's data into each model equation? I think the code goes like this: 

 

proc syslin data = a sur;
model1: model y = x1 x2 x3; <----this one include only 2010Jan

model2: model y = x1 x2 x3; <----this one include only 2010Feb

...

model60: model y = x1 x2 x3; <----this one include only 2015Dec

run;

 

Thanks for your help!!

 

1 REPLY 1
SteveDenham
Jade | Level 19

Wouldn't a BY statement be sufficient to accomplish this?  In fact, the same BY statement that you used in PROC REG looks like it ought to work.

 

Steve Denham

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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