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
- /
- Analytics
- /
- Stat Procs
- /
- PHREG scoring in production

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

08-03-2016 11:08 AM

I have developed a COX model using SAS proc phreg procedure. I know how to score using the covariate using the proc procedure. How do I translate the model to simple sas code? if that is possible, then I would like to code it up in python so that it can be implemented on production platform.

Thanks,

Pradeep

Accepted Solutions

Solution

08-03-2016
11:41 AM

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

08-03-2016 11:19 AM

The PHREG procedure supports the STORE statement, so I would use that statement to create an item store that contains the model. You can then use PROC PLM to score the model (use the SCORE statement in PROC PLM). This is shown about halfway through the article "Techniques for scoring a regression model in SAS."

If you prefer, the PLM procedure also supports the CODE statement (as described in the last section of the article), which you can use to write DATA step code that scores the model.

All Replies

Solution

08-03-2016
11:41 AM

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

08-03-2016 11:19 AM

The PHREG procedure supports the STORE statement, so I would use that statement to create an item store that contains the model. You can then use PROC PLM to score the model (use the SCORE statement in PROC PLM). This is shown about halfway through the article "Techniques for scoring a regression model in SAS."

If you prefer, the PLM procedure also supports the CODE statement (as described in the last section of the article), which you can use to write DATA step code that scores the model.

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

08-03-2016 11:42 AM

Thanks for posting the solution.

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

08-03-2016 12:50 PM

Is there any differnece in scoring a model between PROC SCORE and SCORE statement in PROC PLM?

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

08-03-2016 01:20 PM

They will both give the same predicted values, but they work a little differently.

PROC SCORE uses parameter estimates that were saved to a SAS data set by the OUTEST= option of a regression procedure. PROC SCORE can be used to evaluate simple linear models. The syntax is extremely simple and the functionality is limited to forming predicted values.

In contrast, PROC PLM reads a model that was saved to an item store. It can score more complicated models, such as generalized linear models, mixed models, and survey regression models. In addition to scoring, PROC PLM supports many other post-modeling analyses, such as effect plots and custom hypothesis tests by using the ESTIMATE or LSMESTIMATE statements.

PROC SCORE is an older procedure. You can think of PROC PLM as "PROC SCORE on steroids"!

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

05-25-2017 10:41 AM

I too would like to see the equation needed to calculate predicted survival times from a Cox Proportional Hazards model I fit using PROC PHREG. I did not find the CODE statement to be an option here. PROC PHREG does not seem to support the CODE statement, only the STORE option. Can you confirm whether CODE is an option with Cox Proportional Hazards models as a way to see the formula needed to calcualte predicted survival times? Thanks!

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

05-25-2017 11:06 AM

right. You can use the STORE statement to save the model, then use the CODE statement or the SCORE statement in PROC PLM to score the model.

See the examples in the article "Techniques for scoring a regression model in SAS," which covers both statements.