Suppose I do the following:
proc phreg data = new; model time*censor(0) = x y; run;
Also suppose $x$ is a binary variable and $y$ is a continuous variable. How would I plot the survival function for $x = 1$ and $y = 100$ (for example) in SAS?
Best Answer
From the help files of phreg (assuming neither X or Y in your example are time varying):
ods graphics on; proc phreg data=Myeloma plots(overlay)=survival; model Time*VStatus(0)=LogBUN HGB; baseline covariates=Inrisks out=Pred1 survival=_all_ / rowid=Id; run; ods graphics off;
The COVARIATES= option in the BASELINE statement specifies the data set that contains the set of covariates of interest. The PLOTS= option in the PROC PHREG statement creates the survivor plot. The OVERLAY suboption overlays the two curves in the same plot. If the OVERLAY suboption is not specified, each curve is displayed in a separate plot. The ROWID= option in the BASELINE statement specifies that the values of the variable Id in the COVARIATES= data set be used to identify the curves in the plot. The SURVIVAL=ALL option in the BASELINE statement requests that the estimated survivor function, standard error, and lower and upper confidence limits for the survivor function be output into the SAS data set specified in the OUT= option. The survival Plot (Output 64.8.1) contains two curves, one for each of row of covariates in the data set Inrisks.
Similar Posts:
- Solved – How to interpret a Cox hazard model survival curve
- Solved – How to interpret a Cox hazard model survival curve
- Solved – SAS Code for Survival Analysis
- Solved – Floating Point Overflow while computing the Kaplan-Meier estimator in SAS
- Solved – Objective test for proportionality assumption in Cox Regression Model (SAS)