<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Standardized survival curve in PROC PHREG in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Standardized-survival-curve-in-PROC-PHREG/m-p/783393#M38472</link>
    <description>&lt;P&gt;I don't know which will give what you want, but I think that if you add 'female' and 'black' to your CLASS statement, the results should automatically handle the categorical nature of the variables.&amp;nbsp; It may be that this will give separate curves for each row in the 2x2 design (female x black), with the curves adjusted to the mean value within each row.&amp;nbsp; It would probably require fitting the interaction term to get separate curves for each cell.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I am just sort of spitballing on this one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
    <pubDate>Wed, 01 Dec 2021 14:56:53 GMT</pubDate>
    <dc:creator>SteveDenham</dc:creator>
    <dc:date>2021-12-01T14:56:53Z</dc:date>
    <item>
      <title>Standardized survival curve in PROC PHREG</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Standardized-survival-curve-in-PROC-PHREG/m-p/783252#M38466</link>
      <description>&lt;P&gt;Hi, I have a question regarding estimating standardized survival curves in PROC PHREG. I want to explore the effect of a treatment (trt = 1 or 0), adjusting for some covariates in the Cox model, and then estimate the survival curves for each treatment, which adjusted (standardized) for covariates in the model. I tried to use BASELINE statement to do this, because I knew that we can get the survival curve for a specific set of covariates from this statement. This is the sample code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc phreg data=sampledata;
	model time*event(0) = trt age bmi female black;
run;&lt;/PRE&gt;&lt;P&gt;trt is treatment (0 or 1), age and bmi are continuous variables, and female and black are binary variables. I found that there are two ways to estimate the survival curves from the baseline statment.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first one is to input a set of mean value for covariates in the model to the "covariates=" option:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc phreg data=sampledata;
	model time*event(0) = trt age bmi female black;
	baseline out=pred covariates=bsl_cov survival = _all_ /  rowid=trt;
run;&lt;/PRE&gt;&lt;P&gt;Data set "bsl_cov" has two observations: trt = 1 with mean values for all other covariates; trt = 0 with mean values for all other covariates. By doing this, I can get a survival curve for each treatment.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The second method is to use the "Direct adjusted survival curve", which uses "DIRADJ" option in baseline statement. According to the SAS official document,&lt;SPAN&gt;&amp;nbsp;direct adjusted survival curve is "&lt;STRONG&gt;computed for each value of&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN class=""&gt;variable&lt;/SPAN&gt;&amp;nbsp;in the input data. The&amp;nbsp;&lt;SPAN class=""&gt;variable&lt;/SPAN&gt;&amp;nbsp;does not have to be a variable in the COVARIATES= data set. Each direct adjusted survival curve is the average of the survival curves of all individuals in the COVARIATES= data set with their value of&amp;nbsp;&lt;SPAN class=""&gt;variable&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;&amp;nbsp;set to a specific value&lt;/STRONG&gt;". The code will be like:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;proc phreg data=sampledata;&lt;BR /&gt;        class trt;
	model time*event(0) = trt age bmi female black;&lt;BR /&gt;        baseline out=pred covariates=sampledata / group=trt diradj;
run;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Here, "sampledata" in baseline statement is the input dataset for PHREG which included observations for all patients.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My main question is, if I want to get the survival curves standardized for covariates, which method should I use? What is the essential difference between two methods? If I use the first method, does it make sense to use the mean of binary variable for the covariates dataset?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 19:20:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Standardized-survival-curve-in-PROC-PHREG/m-p/783252#M38466</guid>
      <dc:creator>Chaupak</dc:creator>
      <dc:date>2021-11-30T19:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: Standardized survival curve in PROC PHREG</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Standardized-survival-curve-in-PROC-PHREG/m-p/783393#M38472</link>
      <description>&lt;P&gt;I don't know which will give what you want, but I think that if you add 'female' and 'black' to your CLASS statement, the results should automatically handle the categorical nature of the variables.&amp;nbsp; It may be that this will give separate curves for each row in the 2x2 design (female x black), with the curves adjusted to the mean value within each row.&amp;nbsp; It would probably require fitting the interaction term to get separate curves for each cell.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I am just sort of spitballing on this one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 14:56:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Standardized-survival-curve-in-PROC-PHREG/m-p/783393#M38472</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2021-12-01T14:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: Standardized survival curve in PROC PHREG</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Standardized-survival-curve-in-PROC-PHREG/m-p/783482#M38476</link>
      <description>&lt;P&gt;Thanks. I checked the official guide and I need to specify the value of female and black in the covariate dataset. In the stratified analysis, it seems like I do need an interaction term.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 22:55:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Standardized-survival-curve-in-PROC-PHREG/m-p/783482#M38476</guid>
      <dc:creator>Chaupak</dc:creator>
      <dc:date>2021-12-01T22:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: Standardized survival curve in PROC PHREG</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Standardized-survival-curve-in-PROC-PHREG/m-p/983359#M49216</link>
      <description>&lt;P&gt;1.&amp;nbsp; the questioner is correct that the data set used for the covariates= needs to have all the variables in the model.&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; for a binary variable, whether you use it as a 'class' or as an indicator (0/1 or 1/2) is irrelevant.&amp;nbsp; just make sure you know what you did.&lt;/P&gt;&lt;P&gt;3.&amp;nbsp; the problems with specifying a 'covariates=' data set are that&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; (a) the distributions of the covariate values could be different across the exposures.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; (b) specifying a single set of covariate values may lead to a misleading result.&amp;nbsp; you might get a different ordering of the curves if you chose other value.&amp;nbsp; this is a characteristic of the nonlinearity (specifically log-linear) of the model.&amp;nbsp; the mean/median of the survival is not the survival of the mean/median.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Feb 2026 18:16:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Standardized-survival-curve-in-PROC-PHREG/m-p/983359#M49216</guid>
      <dc:creator>ehertzmark</dc:creator>
      <dc:date>2026-02-11T18:16:54Z</dc:date>
    </item>
  </channel>
</rss>

