<?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: Fitting length of stay at hospital / right censored data to Cox PH model / proc phreg in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Fitting-length-of-stay-at-hospital-right-censored-data-to-Cox-PH/m-p/638530#M189889</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15363"&gt;@SteveDenham&lt;/a&gt;&amp;nbsp;Please take a look.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Statistical-Procedures/Continous-outcome-variable-and-Categorical-independent-variable/td-p/207585" target="_blank"&gt;https://communities.sas.com/t5/Statistical-Procedures/Continous-outcome-variable-and-Categorical-independent-variable/td-p/207585&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this blog, Steve suggested &lt;SPAN&gt;Cox proportional hazards regression, with time to exit from hospital as a left-truncated/right censored variable, and fit it as in Example 73.3 Modeling with Categorical Predictors in the SAS/STAT13.2 documentation for PROC PHREG. But I'm still trying to understand what is and how to create a censoring variable in the context of a length of stay at hospital.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Apr 2020 01:07:33 GMT</pubDate>
    <dc:creator>Cruise</dc:creator>
    <dc:date>2020-04-09T01:07:33Z</dc:date>
    <item>
      <title>Fitting length of stay at hospital / right censored data to Cox PH model / proc phreg</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fitting-length-of-stay-at-hospital-right-censored-data-to-Cox-PH/m-p/638529#M189888</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I performed Cox-PH model to assess the survival of patients deceased at hospital by few categorical variables. Now I'd like to assess the length of stay at hospital among patients by the same categorical variables who are released from hospital and still staying at hospital (isolated). So this switches the gear to a right-censored data and I'm trying to understand how to define the censoring in data step and proc phreg?&amp;nbsp; I calculated the length of stay as shown below for both status of patients: isolated at hospital and released from hospital.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data length_stay; set have; 
if state='released' then do;
length_stay=released_date-confirmed_date; end;
if state='isolated' then do;  
length_stay=22004-confirmed_date; end; 
miss_length=length_stay=.;  
if length_stay in (. -1 -7) then delete;  
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Table below shows the range of the length of stay of patients in the data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="length_stay.png" style="width: 342px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/38064i2A8CC588EFE14F81/image-size/large?v=v2&amp;amp;px=999" role="button" title="length_stay.png" alt="length_stay.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;So now, what is the censoring variable for the length of stay in terms of defining in a datastep? which is the equivalent of vital_status that I used in the survival analysis for the deceased patients? And how this changes the components of my proc phreg?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc phreg data=length_stay;
class sex1(ref='1') agel(ref='2') comorb(ref='0')/
param=ref order=internal;
model length_stay*'WHAT IS HERE?'= sex1 comorb agel/ties=Efron rl;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thank you for your time indeed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 22:31:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fitting-length-of-stay-at-hospital-right-censored-data-to-Cox-PH/m-p/638529#M189888</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2020-04-08T22:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: Fitting length of stay at hospital / right censored data to Cox PH model / proc phreg</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fitting-length-of-stay-at-hospital-right-censored-data-to-Cox-PH/m-p/638530#M189889</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15363"&gt;@SteveDenham&lt;/a&gt;&amp;nbsp;Please take a look.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Statistical-Procedures/Continous-outcome-variable-and-Categorical-independent-variable/td-p/207585" target="_blank"&gt;https://communities.sas.com/t5/Statistical-Procedures/Continous-outcome-variable-and-Categorical-independent-variable/td-p/207585&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this blog, Steve suggested &lt;SPAN&gt;Cox proportional hazards regression, with time to exit from hospital as a left-truncated/right censored variable, and fit it as in Example 73.3 Modeling with Categorical Predictors in the SAS/STAT13.2 documentation for PROC PHREG. But I'm still trying to understand what is and how to create a censoring variable in the context of a length of stay at hospital.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Apr 2020 01:07:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fitting-length-of-stay-at-hospital-right-censored-data-to-Cox-PH/m-p/638530#M189889</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2020-04-09T01:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: Fitting length of stay at hospital / right censored data to Cox PH model / proc phreg</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fitting-length-of-stay-at-hospital-right-censored-data-to-Cox-PH/m-p/638620#M189921</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/132289"&gt;@Cruise&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As a start, I would define&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;status=(state='released');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and use in the PROC PHREG step&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;model length_stay*status(0) = ...&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Apr 2020 09:13:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fitting-length-of-stay-at-hospital-right-censored-data-to-Cox-PH/m-p/638620#M189921</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-04-09T09:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: Fitting length of stay at hospital / right censored data to Cox PH model / proc phreg</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fitting-length-of-stay-at-hospital-right-censored-data-to-Cox-PH/m-p/638674#M189932</link>
      <description>Thanks for the starting point. I greatly appreciate it. Variable state has there levels: isolated(still at hospital), released and deceased at hospital. 1. Would you agree if I use today's date as a censoring date for the patients still at hospital? 2. Should I include patients deceased at hospital in the length of stay analysis. If I leave them in the data I will use the date of death as the end of their stay at hospital. I suspect deceased patients are different from the rest in terms of the categorical variables I will have in the model: age, gender and co-morbidity status.</description>
      <pubDate>Thu, 09 Apr 2020 14:13:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fitting-length-of-stay-at-hospital-right-censored-data-to-Cox-PH/m-p/638674#M189932</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2020-04-09T14:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: Fitting length of stay at hospital / right censored data to Cox PH model / proc phreg</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fitting-length-of-stay-at-hospital-right-censored-data-to-Cox-PH/m-p/638710#M189941</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/132289"&gt;@Cruise&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;1. Would you agree if I use today's date as a censoring date for the patients still at hospital?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you do your analysis "today" and you know "today's" status of the patients, then this should be fine. For a Cox PH model the addition of a constant amount of time to all survival times is irrelevant.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;2. Should I include patients deceased at hospital in the length of stay analysis.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes, I would include them because they contribute relevant information. Also, when you apply the results of your analysis to future patients, you cannot know in advance if they will die during their stay at hospital.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;If I leave them in the data I will use the date of death as the end of their stay at hospital. I suspect deceased patients are different from the rest in terms of the categorical variables I will have in the model: age, gender and co-morbidity status.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I would rather treat deceased patients as &lt;EM&gt;censored&lt;/EM&gt; at their date of death. Otherwise, factors increasing the hazard of death (such as severe comorbidities) and factors increasing the "hazard" of discharge (like no comorbidities) would be mixed up in the model. (See also&amp;nbsp;&lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_phreg_details17.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en" target="_blank" rel="noopener"&gt;Analysis of Competing-Risks Data&lt;/A&gt;.)&lt;/P&gt;</description>
      <pubDate>Thu, 09 Apr 2020 15:32:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fitting-length-of-stay-at-hospital-right-censored-data-to-Cox-PH/m-p/638710#M189941</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-04-09T15:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: Fitting length of stay at hospital / right censored data to Cox PH model / proc phreg</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fitting-length-of-stay-at-hospital-right-censored-data-to-Cox-PH/m-p/638721#M189946</link>
      <description>Thanks for the resource. Treating deceased patients as censored at their date of death means that treating the censoring indicator as: status=(state in ('released', 'deceased');&lt;BR /&gt;Am I getting it right, you think?</description>
      <pubDate>Thu, 09 Apr 2020 16:07:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fitting-length-of-stay-at-hospital-right-censored-data-to-Cox-PH/m-p/638721#M189946</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2020-04-09T16:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: Fitting length of stay at hospital / right censored data to Cox PH model / proc phreg</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fitting-length-of-stay-at-hospital-right-censored-data-to-Cox-PH/m-p/638726#M189950</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/132289"&gt;@Cruise&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Treating deceased patients as censored at their date of death means that treating the censoring indicator as: status=(state in ('released', 'deceased');&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No, this would treat them as not censored. There's no need to modify the definition of &lt;FONT face="courier new,courier"&gt;status&lt;/FONT&gt; I suggested earlier. Both 'isolated' and 'deceased' cases will then get status=0, which means 'censored', as desired.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Apr 2020 16:37:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fitting-length-of-stay-at-hospital-right-censored-data-to-Cox-PH/m-p/638726#M189950</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-04-09T16:37:05Z</dc:date>
    </item>
  </channel>
</rss>

