turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- Base SAS Programming
- /
- 5000 Models and Their AICs?

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

12-08-2011 04:41 PM

I have a dataset which in a simplified view looks like this;

Index Time Var1 Var2 Var3 . . . Var7

1 1 a b c

1 2 d e f

1 3 g h i

1 4 j k l

2 1 m n o

2 2 p q r

2 3 s t u

2 4 v w x

. . . . .

.

.

.

5000

It is hoped that it can be used to develop 5000 different non-liner regression models. I have generated a list of 7 random knot locations between 0 to 60 for 5000 models, these have then been used to calculate a truncated power series where the values are stored under Var1 to Var7.

What I need to know is how to do a proc reg on the values within the rows of data where index = * (i = 1 to 5000) and then obtain the AIC for each model. The LONG way would be to subset 5000 times and do each model individually and then compare AICs. Is there a way to automate this process? *

Many Thanks

Graeme Torrance

University of St. Andrews

Accepted Solutions

Solution

12-08-2011
11:52 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to vilike85

12-08-2011 11:52 PM

You can use " by index ;" to get these 5000 model respectively.

But for the sake of your large number, i recommend to use macro to loop them,

And use "ods ouput" or "ods select" to select AIC statistical estimator, then compare them in a dataset as you wish.

Ksharp

All Replies

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to vilike85

12-08-2011 04:49 PM

Graeme, I'm not sure I understand because you indicated non-linear, but are using proc reg.

Regardless, if you already have the code to accomplish the desired calculations, one way would be to expand the dataset to account for the 5000 different scenarios, and then simply include a by variable.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to art297

12-08-2011 06:25 PM

Hi Art,

Two Things;

1) Sorry the data is linear.... thats why I am using proc reg.

2) Unfortunately I do not have the code on SAS to do the truncation series. Ashamedly I used MS Excel to do the truncated series (because I am a SAS newbie).

I think I understand your suggestion but not sure how that would allow me to build * number of models.*

I'm sorry if this is not much more information.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to vilike85

12-08-2011 06:42 PM

No reason to be ashamed about using Excel. More people do, for various things, than anyone will admit.

You can always import that into Excel and use it to drive the creation of the needed large datafile that will include all of the replicates .. as long as they are identified by a series number.

Then, that series number, can be used as the by variable.

Without knowing exactly what you have, the above are my best guesstimates (and, yes, I used Excel to make the guesstimate .

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to vilike85

12-08-2011 07:26 PM

You might want to look into proc robustreg, using your original data. It can imprelent the truncated power function and knots without preprocessing in Excel. I cannot say your example or problem explanation give me enough information to really be helpful...

Solution

12-08-2011
11:52 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to vilike85

12-08-2011 11:52 PM

You can use " by index ;" to get these 5000 model respectively.

But for the sake of your large number, i recommend to use macro to loop them,

And use "ods ouput" or "ods select" to select AIC statistical estimator, then compare them in a dataset as you wish.

Ksharp