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
- /
- General Programming
- /
- Modify outmodel = dataset in Proc logistic

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
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-22-2015 12:00 PM

Hi,

In my modeling process, I created a model fitting result by using outmodel = FIT in proc logistic,

and later on use inmodel = FIT to generate prediction.

Now I want to modify this fiting result, called FIT, to add a new level of a categorical variable.

For example, in outmodel= step, a categorical variable, CAT has three level,

AAA, BBB and CCC, with fitted coefficient, 0, 2 and 4, respectively. Now in the inmodel = step,

I have another level, DDD, I want to set its cofficient as 5. How do I manually add another level of category

to this variable CAT in the fit result FIT?

Fit looks like:

_TYPE_ | _NAME_ | _CATEGORY_ | _NAMEIDX_ | _CATIDX_ | _MISC_ |

L | 0 | ||||

M | NYYNYNNN | ||||

G | VINTAGE | 1985 | 0 | 0 | 1 |

G | VINTAGE | 1986 | 0 | 1 | 1 |

G | VINTAGE | 1987 | 0 | 2 | 1 |

G | VINTAGE | 1988 | 0 | 3 | 1 |

G | VINTAGE | 1989 | 0 | 4 | 1 |

with many rows following.

Also, how do I locate the coefficient of a level of a categorical variable in the FIT dataset?

Thanks!

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

01-22-2015 03:19 PM

Can you post a sample of your proc logistic code? Your categorical variable depends on how you coded it in the class statement.

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

01-22-2015 08:44 PM

for example:

proc logistic data= XXX outmodel = FIT;

class vintage (ref="2000",param=REF);

model response = vintage + age;

run;

I am not sure if it is ok to post original formula here since the variable is self-explanatory and might be confidential.

If full function is needed for you to explain the table, I can do some camouflage.

Thank you.

Best

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

01-22-2015 11:28 PM

From the documentation:

OUTMODEL=SAS-data-set

specifies the name of the SAS data set that contains the information about the fitted model. This data set contains sufficient information to score new data without having to refit the model. It is solely used as the input to the INMODEL= option in a subsequent PROC LOGISTIC call. The OUTMODEL= option is not available with the STRATA statement.

Information in this data set is stored in a very compact form, so you should not modify it manually.

What version of SAS are you on? If 9.4 look at the CODE statement, that might be easier to modify to score new data.

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

01-24-2015 09:30 AM

I am using 9.3.

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

01-24-2015 01:45 PM

Ok you could use the ODS table parameter estimates but you would "manually" have to calculate your estimates.

Here's one way to manually create the predictions and you could modify the formula.

You should also try posting to the SAS Statistical Forum and see if someone from SAS can comment on the OUTMODEL dataset.

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

01-24-2015 01:52 PM

Thank you Reeza.

Actually I tried outest or ods output before. But manually calculate estimate leaves too much possibility of human error.

It is also not convenient if I change the model or variable name.

Thanks for the link. I'll look into that.

Currently my thought is make the new level of cat variable the same as one of the current level, but add another indicator.

When SAS finishes calculating, I'll manually subtract the old level coefficients from the log odd ratio, and add the new level coefficients.