BookmarkSubscribeRSS Feed
Defense
Obsidian | Level 7

I need to do regression analysis on hundreds dataset.  I had get one regression analysis done in one dataset by using EG task.  Is there a way to get hundreds dataset done with regression by using  task or a macro in EG?

Thanks

5 REPLIES 5
TomKari
Onyx | Level 15

Yes and no. You can do it within the Enterprise Guide environment, but not using the "point and click" facilities. You'd need to do some coding in a SAS program window.

 

Do you feel this is something you can tackle? If yes, we're all in a position to give you advice on how to use the SAS macro language to do it. It will probably be less than two dozen lines of code all told.

 

Tom

Reeza
Super User

Yes, with a macro. 

 

How big are your datasets? If they have the same structure/variables you can append them and then run a regression using the BY statement. 

 

You should post your code if you need help with a macro. This sounds pretty basic. 

 

Also, how do you know which datasets need to be processed. 

Defense
Obsidian | Level 7
Thanks all for replying.

Let’s me “refresh” my question:

It is a survey data. Each dataset includes only 12 variables and hundreds obs collected from one survey site. I have 800 sites, means 800 datasets with similar structures I used task, i.e. ("point and click" facilities) to get one site’s regression analysis done. Could I use task ("point and click" facilities) to get all sites done?
Reeza
Super User

@Defense wrote:
Could I use task ("point and click" facilities) to get all sites done?

No. You need to write code for a macro solution. 

 

Yes, if you use the append solution - but you may have to write code to append all the datasets. Your data doesn't sound too big for this method to work. However, your data needs to be identical in terms of variable names and types. The number of observations doesn't matter. 

 

If you combine all the datasets into one, identified by the dataset name, and use that variable in your regression analysis as a BY variable in your task. Again, how do you identify which datasets need to be processed. 

 

If you've processed the data additionally before the regression - query builder or tasks  - you will also need to factor in the BY variable. 

 

 

Defense
Obsidian | Level 7
Thanks for replying.

I will try the both ways, “macro” and “by site", I will input site name as a variable ( the big dataset will be 13 variable, var1 will be the site) when I try to using "by site'.
Thanks again .

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 1836 views
  • 0 likes
  • 3 in conversation