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 .

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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