BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ADou
Calcite | Level 5

Hi Experts,

 

a1   a2     a3.....a25     x1    x2     x3

Now I have 28 columns of variables as above. I want to run regressions with a1,a2......a25 to be my dependent variables respectively, and x1, x2,x3 to be my independent variables all the time. Is there any simple way to do that without repeating the regression 25 times? Thanks a lot!!

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

If you do this in PROC GLM, and use MANOVA commands, you can get an analysis that takes into account the correlations between the Y-variables (in other words, it provides more information than just running all those individual regressions). Example: https://documentation.sas.com/?docsetId=statug&docsetVersion=15.1&docsetTarget=statug_glm_examples06...

--
Paige Miller

View solution in original post

5 REPLIES 5
PaigeMiller
Diamond | Level 26

@Reeza wrote:

Approaches outlined here:

https://blogs.sas.com/content/iml/2018/04/25/sweep-thousands-of-regressions.html?utm_source=feedburn...


I'd have to say I think this approach is unnecessary.

 

In PROC GLM, you can have all of the 25 dependent variables on the left hand side of the MODEL statement, so one pass through PROC GLM gives you the 25 different regressions. It's not clear to me what is gained by the approach at that link.

--
Paige Miller
PaigeMiller
Diamond | Level 26

If you do this in PROC GLM, and use MANOVA commands, you can get an analysis that takes into account the correlations between the Y-variables (in other words, it provides more information than just running all those individual regressions). Example: https://documentation.sas.com/?docsetId=statug&docsetVersion=15.1&docsetTarget=statug_glm_examples06...

--
Paige Miller
ADou
Calcite | Level 5

Thanks! I don't need the correlations among all the dependent variables, just want to run the OLS regression for each dependent variable(a1.....a25). So could you give me a code sample to do this?

PaigeMiller
Diamond | Level 26

The link I provided in my first reply contains sample code.

--
Paige Miller

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!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 5 replies
  • 784 views
  • 2 likes
  • 3 in conversation