BookmarkSubscribeRSS Feed
Renee1
Calcite | Level 5

Hello everyone,

 

I would like to do an analysis with my data. I have 5 predictors variables (all of them independants and continuous) and 6 dependant variables dichotomic (with 2 values :true or false) and i would like to analyse with a linear regression the relationship between 1 predictor and 1 dependant variable at a time. Is there a way to do that without doing 30 different analysis ?

 

Thanks,

RC

 

8 REPLIES 8
paulkaefer
Lapis Lazuli | Level 10

You could write a macro function to do the regression on every pair via a loop. Better than copy/pasting the PROC REG (or other linear regression block) 30 times. You could also output the results to a dataset. Then make it into whatever table you want.

Renee1
Calcite | Level 5
If i'm not using the coding and that i click on analysis, how can i do that ? Is there an option ?
paulkaefer
Lapis Lazuli | Level 10

Well, a benefit of writing code would be to give you the power and control to something that doesn't have an explicit option.

 

I'm not sure how you can do this via the graphical interface.

Renee1
Calcite | Level 5
I have 4 weeks to learn this new language...and analyse a complete project and write a medical article. But I would like to have this "power and control" 😉
paulkaefer
Lapis Lazuli | Level 10

Well the SAS online trainings are great, and interactive! You could finish one or two in a week, if you have the time!

 

I hope Reeza's suggestion helps, and good luck with the project and paper.

Reeza
Super User

Then spend the first week learning SAS. There's two free e-courses available that teach intro to programming and statistics with SAS. 

 

http://support.sas.com/training/tutorial/index.html

See the bottom right hand corner for the links. 

Renee1
Calcite | Level 5
Thanks you for your help !
Reeza
Super User

The GUI doesn't support automating multiple reports like this easily. 

 

If you absolutely don't want to code then here's a way.

 

transpose your data - there's a task for that. 

Make the independent variable a single column and a new variable that indicates the variable. 

 

Y Varname value

1 indep1 20

1 indep2 30

1 indep3 40

2 indep1 20

2 indep2 30

2 indep3 40

 

Then when you run the regression analysis you can put the Varname as your BY variable. Make sure to sort the data on the BY variable first before regression. 

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 8 replies
  • 3622 views
  • 2 likes
  • 3 in conversation