BookmarkSubscribeRSS Feed
ADou
Calcite | Level 5

Hi experts,

 

As in my txt file, I want to regress R1 on R2 in the group of permno. And for each permno, I wanna get the coefficient of its regression. Is it possible to get a set of the coefficients corresponding to each permno? Thanks a lot!!

5 REPLIES 5
Reeza
Super User
Add the variable you want to have it into your BY statement? Have you tried adding a BY statement to your model?
ADou
Calcite | Level 5

Yes, I tried the codes below, but my system always crash when I run this step. 

proc reg data=reg;
model ret1=ret2;
by permno;
run;

Reeza
Super User
Do you get an error message of some kind? Try putting the BY statement before the MODEL, and you need to have a QUIT instead of RUN.
ADou
Calcite | Level 5

I put the BY before model, but the system still crash again. And it seems it creates only the report, not a collection of the coefficients.

Reeza
Super User
I would actually turn off output. You haven't specified anything in the output to capture the output, so no output would be captured.
https://blogs.sas.com/content/iml/2017/02/13/run-1000-regressions.html

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 5 replies
  • 4145 views
  • 0 likes
  • 2 in conversation