## Proc Phreg - calc s(t)

Occasional Contributor
Posts: 6

# Proc Phreg - calc s(t)

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".

Super User
Posts: 19,855

## Re: Proc Phreg - calc s(t)

Timelist option on the baseline statement. See the docs.

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

Occasional Contributor
Posts: 6

## Re: Proc Phreg - calc s(t)

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

Super User
Posts: 19,855

## Re: Proc Phreg - calc s(t)

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

Occasional Contributor
Posts: 6

## Re: Proc Phreg - calc s(t)

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.

Super User
Posts: 19,855

## Re: Proc Phreg - calc s(t)

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

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

Occasional Contributor
Posts: 6

## Re: Proc Phreg - calc s(t)

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

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