Desktop productivity for business analysts and programmers

Macro in EG

Reply
Contributor
Posts: 21

Macro in EG

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

Trusted Advisor
Posts: 1,050

Re: Macro in EG

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

Grand Advisor
Posts: 17,290

Re: Macro in EG

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. 

Contributor
Posts: 21

Re: Macro in EG

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?
Grand Advisor
Posts: 17,290

Re: Macro in EG


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. 

 

 

Contributor
Posts: 21

Re: Macro in EG

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 .
Ask a Question
Discussion stats
  • 5 replies
  • 307 views
  • 0 likes
  • 3 in conversation