<?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: Creating censoring and time variable for cox-proportional hazard model in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Creating-censoring-and-time-variable-for-cox-proportional-hazard/m-p/918705#M41130</link>
    <description>&lt;P&gt;You already have a censor variable.&amp;nbsp; If CVD_OVERAL=1 then the disease was diagnosed on MIN_DIAG_DT, i.e. the participant was &lt;STRONG&gt;&lt;EM&gt;not censored&lt;/EM&gt;&lt;/STRONG&gt; prior to diagnosis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If CVD_OVERAL=0 then the individual was censored, either at DEATH_DATE_DC or end-of-study (01jan2023).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the proportional hazards procedure needs the censor variable to be 1 for censored, 0 otherwise, just subtract cvd_overal from 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As to time, you want the number of months from infant_dob to the minimum of three date variables: min_diag_dt, date of death, or 1/1/2023.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set censor;

  censor=1-cvd_overal;

  death_date=input(death_date_dc,yymmdd10.);   
  format death_date yymmdd10.;

  time_in_months=intck('month',infant_dob,min(death_date,min_diag_dt,"01jan2023"d));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The &lt;EM&gt;&lt;STRONG&gt;time_in_months&lt;/STRONG&gt;&lt;/EM&gt; variable is just the number of calendar-month-boundaries crossed (so a value of 1 could be just a single day, up to 31 days).&amp;nbsp; That is the default behavior of the INTCK function.&amp;nbsp; And of course, you should use 01jan2023 as end-of-study only if it was possible for there to be a diagnosis, or death, recorded for that date.&amp;nbsp; But if you really could not get a diagnosis later than 31dec2022, I suspect you should use that date as end-of-study.&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>Sat, 02 Mar 2024 23:36:27 GMT</pubDate>
    <dc:creator>mkeintz</dc:creator>
    <dc:date>2024-03-02T23:36:27Z</dc:date>
    <item>
      <title>Creating censoring and time variable for cox-proportional hazard model</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-censoring-and-time-variable-for-cox-proportional-hazard/m-p/918695#M41126</link>
      <description>&lt;P&gt;Hello everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am newly working on longitudinal data and I have a question.&lt;/P&gt;&lt;P&gt;I am interested in the development of CVD. Follow-up began the day when a mother delivered a baby (infant_dob). Participants were either determined to have developed CVD (CVD_Overal) or censored at the time of death (DEATH_DATE_DC) or end of follow-up (1/1/2023), WHICEVER occurred first.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create two variables; censor and time. For the censoring variable, I want to create variable "censor": 1=yes, 0=no. For time, I want to create variable "Time" that will start from the baby's date of birth (infant_dob) until development of CVD (min_diag_dt) or censoring (death [DEATH_DATE_DC] or end of follow up (1/1/2023) in MONTHS.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I greatly appreciate if you can help me create these variables. I have attached the data below.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Mar 2024 19:43:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-censoring-and-time-variable-for-cox-proportional-hazard/m-p/918695#M41126</guid>
      <dc:creator>Dissertator</dc:creator>
      <dc:date>2024-03-02T19:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: Creating censoring and time variable for cox-proportional hazard model</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-censoring-and-time-variable-for-cox-proportional-hazard/m-p/918705#M41130</link>
      <description>&lt;P&gt;You already have a censor variable.&amp;nbsp; If CVD_OVERAL=1 then the disease was diagnosed on MIN_DIAG_DT, i.e. the participant was &lt;STRONG&gt;&lt;EM&gt;not censored&lt;/EM&gt;&lt;/STRONG&gt; prior to diagnosis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If CVD_OVERAL=0 then the individual was censored, either at DEATH_DATE_DC or end-of-study (01jan2023).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the proportional hazards procedure needs the censor variable to be 1 for censored, 0 otherwise, just subtract cvd_overal from 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As to time, you want the number of months from infant_dob to the minimum of three date variables: min_diag_dt, date of death, or 1/1/2023.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set censor;

  censor=1-cvd_overal;

  death_date=input(death_date_dc,yymmdd10.);   
  format death_date yymmdd10.;

  time_in_months=intck('month',infant_dob,min(death_date,min_diag_dt,"01jan2023"d));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The &lt;EM&gt;&lt;STRONG&gt;time_in_months&lt;/STRONG&gt;&lt;/EM&gt; variable is just the number of calendar-month-boundaries crossed (so a value of 1 could be just a single day, up to 31 days).&amp;nbsp; That is the default behavior of the INTCK function.&amp;nbsp; And of course, you should use 01jan2023 as end-of-study only if it was possible for there to be a diagnosis, or death, recorded for that date.&amp;nbsp; But if you really could not get a diagnosis later than 31dec2022, I suspect you should use that date as end-of-study.&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>Sat, 02 Mar 2024 23:36:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-censoring-and-time-variable-for-cox-proportional-hazard/m-p/918705#M41130</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2024-03-02T23:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Creating censoring and time variable for cox-proportional hazard model</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-censoring-and-time-variable-for-cox-proportional-hazard/m-p/918830#M41146</link>
      <description>&lt;P&gt;Thank you for your prompt response. It works.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2024 14:24:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-censoring-and-time-variable-for-cox-proportional-hazard/m-p/918830#M41146</guid>
      <dc:creator>Dissertator</dc:creator>
      <dc:date>2024-03-04T14:24:11Z</dc:date>
    </item>
  </channel>
</rss>

