<?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 How to estimate the n-year hazarad ratio from PROC PHREG? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-estimate-the-n-year-hazarad-ratio-from-PROC-PHREG/m-p/620189#M29863</link>
    <description>&lt;P&gt;Dear SAS community:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the sample data publicly available at:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://stats.idre.ucla.edu/wp-content/uploads/2016/02/whas500.sas7bdat" target="_blank"&gt;https://stats.idre.ucla.edu/wp-content/uploads/2016/02/whas500.sas7bdat&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The tutorial is found here along with a description of the data set: &lt;A href="https://stats.idre.ucla.edu/sas/seminars/sas-survival/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/seminars/sas-survival/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;lenfol: length of followup, terminated either by death or censoring. The outcome in this study.&lt;/LI&gt;&lt;LI&gt;fstat: the censoring variable, loss to followup=0, death=1&lt;/LI&gt;&lt;LI&gt;age: age at hospitalization&lt;/LI&gt;&lt;LI&gt;bmi: body mass index&lt;/LI&gt;&lt;LI&gt;hr: initial heart rate&lt;/LI&gt;&lt;LI&gt;gender: males=0, females=1&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached the data to this post for convenience.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I believe the units of follow-up are days, but for the sake of my question, let's instead assume that the units of follow-up are years. If this were the case, the minimum follow-up time captured by the LENFOL variable is 1 year and the maximum is 2358 years.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My understanding of Cox PH regression is that while the Hazard function may vary over time, the HAZARDRATIO&amp;nbsp; is supposed to remain constant.&amp;nbsp; Please correct me if i am wrong, but this implies that&amp;nbsp; HAZARDRATIO at year =1 is equal to the HAZARDRATIO at year =2358 when estimating the HAZARDRATIO from the entire length of follow-up (2358 years in this study).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I wanted to estimate the 5-year HAZARDRATIO (ie, assuming the study ended at year=5), could the PHREG procedure return for me the HAZARDRATIO assuming that the length of follow-up ended at year 5 instead of the actual full length of the study (2358 years in this case)? For example, say I wanted to estimate the association between death and gender, I used the following SAS code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname ucla "C:\&amp;lt;FILEPATH&amp;gt;";

data ucla_surv;
set ucla.whas500;
run;


proc phreg data=ucla_surv;
model lenfol*fstat(0) = gender/ties=efron;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This results in a HAZARDRATIO (HR) estimate over the entire length of follow-up.&amp;nbsp; Could my code be modified to estimate the 5-year HR as I mentioned above (study artificially ends at year=5)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Related, would it be appropriate to create a new LENFOL variable that truncates the data at year 5 and execute the model with these new&amp;nbsp; variables as follows:?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ucla_surv_5yr;
set ucla_surv;

label 
	lenfol5="5-year follow-up"
	fstat5="Event indicator for 5-year FU; 1=death,0=censor"
	;
if lenfol &amp;lt;5 then do;
fstat5=fstat;
lenfol5=lenfol;
end;
else do;
fstat5=0;
lenfol5=5;
end;
run;

proc phreg data=ucla_surv;
model lenfol*fstat(0) = gender/ties=efron;
title "HR over entire study FU";
ods select ParameterEstimates;
run;
title;

proc phreg data=ucla_surv_5yr;
model lenfol5*fstat5(0) = gender/ties=efron;
title "HR over 5 years of FU";
ods select ParameterEstimates;
run;
title;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;One can see from the output that the HR estimate has changed: over the entire follow-up period, the HR for death modeled against gender was 1.465 while at 5-year FU the estimate was 1.363.&amp;nbsp; Because of the truncation though, the 5-year estimate is less precise.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I welcome any thoughts about my approach from the SAS community.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks very much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jan 2020 14:59:33 GMT</pubDate>
    <dc:creator>Varrelle</dc:creator>
    <dc:date>2020-01-27T14:59:33Z</dc:date>
    <item>
      <title>How to estimate the n-year hazarad ratio from PROC PHREG?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-estimate-the-n-year-hazarad-ratio-from-PROC-PHREG/m-p/620189#M29863</link>
      <description>&lt;P&gt;Dear SAS community:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the sample data publicly available at:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://stats.idre.ucla.edu/wp-content/uploads/2016/02/whas500.sas7bdat" target="_blank"&gt;https://stats.idre.ucla.edu/wp-content/uploads/2016/02/whas500.sas7bdat&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The tutorial is found here along with a description of the data set: &lt;A href="https://stats.idre.ucla.edu/sas/seminars/sas-survival/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/seminars/sas-survival/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;lenfol: length of followup, terminated either by death or censoring. The outcome in this study.&lt;/LI&gt;&lt;LI&gt;fstat: the censoring variable, loss to followup=0, death=1&lt;/LI&gt;&lt;LI&gt;age: age at hospitalization&lt;/LI&gt;&lt;LI&gt;bmi: body mass index&lt;/LI&gt;&lt;LI&gt;hr: initial heart rate&lt;/LI&gt;&lt;LI&gt;gender: males=0, females=1&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached the data to this post for convenience.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I believe the units of follow-up are days, but for the sake of my question, let's instead assume that the units of follow-up are years. If this were the case, the minimum follow-up time captured by the LENFOL variable is 1 year and the maximum is 2358 years.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My understanding of Cox PH regression is that while the Hazard function may vary over time, the HAZARDRATIO&amp;nbsp; is supposed to remain constant.&amp;nbsp; Please correct me if i am wrong, but this implies that&amp;nbsp; HAZARDRATIO at year =1 is equal to the HAZARDRATIO at year =2358 when estimating the HAZARDRATIO from the entire length of follow-up (2358 years in this study).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I wanted to estimate the 5-year HAZARDRATIO (ie, assuming the study ended at year=5), could the PHREG procedure return for me the HAZARDRATIO assuming that the length of follow-up ended at year 5 instead of the actual full length of the study (2358 years in this case)? For example, say I wanted to estimate the association between death and gender, I used the following SAS code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname ucla "C:\&amp;lt;FILEPATH&amp;gt;";

data ucla_surv;
set ucla.whas500;
run;


proc phreg data=ucla_surv;
model lenfol*fstat(0) = gender/ties=efron;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This results in a HAZARDRATIO (HR) estimate over the entire length of follow-up.&amp;nbsp; Could my code be modified to estimate the 5-year HR as I mentioned above (study artificially ends at year=5)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Related, would it be appropriate to create a new LENFOL variable that truncates the data at year 5 and execute the model with these new&amp;nbsp; variables as follows:?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ucla_surv_5yr;
set ucla_surv;

label 
	lenfol5="5-year follow-up"
	fstat5="Event indicator for 5-year FU; 1=death,0=censor"
	;
if lenfol &amp;lt;5 then do;
fstat5=fstat;
lenfol5=lenfol;
end;
else do;
fstat5=0;
lenfol5=5;
end;
run;

proc phreg data=ucla_surv;
model lenfol*fstat(0) = gender/ties=efron;
title "HR over entire study FU";
ods select ParameterEstimates;
run;
title;

proc phreg data=ucla_surv_5yr;
model lenfol5*fstat5(0) = gender/ties=efron;
title "HR over 5 years of FU";
ods select ParameterEstimates;
run;
title;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;One can see from the output that the HR estimate has changed: over the entire follow-up period, the HR for death modeled against gender was 1.465 while at 5-year FU the estimate was 1.363.&amp;nbsp; Because of the truncation though, the 5-year estimate is less precise.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I welcome any thoughts about my approach from the SAS community.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks very much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 14:59:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-estimate-the-n-year-hazarad-ratio-from-PROC-PHREG/m-p/620189#M29863</guid>
      <dc:creator>Varrelle</dc:creator>
      <dc:date>2020-01-27T14:59:33Z</dc:date>
    </item>
  </channel>
</rss>

