BookmarkSubscribeRSS Feed
dwitiyas
Calcite | Level 5

How do I calculated S(t) at a particular time t using proc phreg.

Proc phreg data = a.input;

model tenure * target (0) =a1 a2 a3/ selection = stepwise ties = efron;

baseline out = out1 covariates = sample survival = s;

run;

I the above example if I pass covariates = sample it gives me survival estimates for all possible values of t present in a.input. My datasets are very huge and I am getting memory error when I try to score. I need to calculated s(30) only for my dataset "sample".

6 REPLIES 6
Reeza
Super User

Timelist option on the baseline statement. See the docs.

SAS/STAT(R) 9.2 User's Guide, Second Edition

dwitiyas
Calcite | Level 5

Isn't this option only for bayesian model.  I am doing a classical model here.

Reeza
Super User

If you run out of memory perhaps scoring by 'hand', a manual calculation in datastep?

dwitiyas
Calcite | Level 5

Yes but I need help on this. I understand I can get Xbeta value and the baseline estimates. I need help with the formula to maunally calc it . My values are not matching with what sas provides.

Reeza
Super User

I'm sure there's many ways to do that, but I don't feel like breaking out my stats book Smiley Happy

How about breaking up your sample dataset and running the whole thing a few times via a macro.

dwitiyas
Calcite | Level 5

That is what I am doing right now Smiley Happy If I get the manual calc for survival estimates I would definitely go that way.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 2320 views
  • 0 likes
  • 2 in conversation