<?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: Hazard function for Weibull distribution in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Hazard-function-for-Weibull-distribution/m-p/848259#M42018</link>
    <description>&lt;P&gt;To calculate the hazard function estimate for a categorical variable using the Weibull distribution in SAS, you can use the &lt;CODE&gt;PROC LIFEREG&lt;/CODE&gt; procedure. The &lt;CODE&gt;PROC LIFEREG&lt;/CODE&gt; procedure allows you to fit a parametric survival model to your data, and then use the fitted model to estimate the hazard function for different groups of subjects.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your case, you want to calculate the hazard function for patients with large tumors (tumt = 0). To do this, you can use the &lt;CODE&gt;PROC LIFEREG&lt;/CODE&gt; statement to fit a Weibull model to your data, and then use the &lt;CODE&gt;HAZARD&lt;/CODE&gt; option in the &lt;CODE&gt;MODEL&lt;/CODE&gt; statement to request that the procedure estimate the hazard function for each level of the &lt;CODE&gt;tumt&lt;/CODE&gt; variable. Here is an example of how you might do this in SAS:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC LIFEREG DATA=Cancer;
  CLASS tumt;
  MODEL survdays*dead(0) = treat tumt / DIST=WEIBULL HAZARD;
  PROBPLOT;
  INSET;
RUN;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In this example, the &lt;CODE&gt;PROC LIFEREG&lt;/CODE&gt; statement specifies that you want to fit a Weibull model to the data in the &lt;CODE&gt;Cancer&lt;/CODE&gt; dataset. The &lt;CODE&gt;CLASS&lt;/CODE&gt; statement indicates that the &lt;CODE&gt;tumt&lt;/CODE&gt; variable is a categorical variable, and the &lt;CODE&gt;MODEL&lt;/CODE&gt; statement specifies the model that you want to fit. The &lt;CODE&gt;HAZARD&lt;/CODE&gt; option in the &lt;CODE&gt;MODEL&lt;/CODE&gt; statement tells SAS to estimate the hazard function for each level of the &lt;CODE&gt;tumt&lt;/CODE&gt; variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After running this code, you can use the &lt;CODE&gt;PROBPLOT&lt;/CODE&gt; and &lt;CODE&gt;INSET&lt;/CODE&gt; statements to create a probability plot that shows the estimated hazard functions for each level of the &lt;CODE&gt;tumt&lt;/CODE&gt; variable. You can then use this plot to compare the hazard functions for different tumor types and identify any differences in the hazard of death for patients with different tumor types.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, you can use the &lt;CODE&gt;PROC LIFETEST&lt;/CODE&gt; procedure to calculate the hazard function for a specific group of subjects. For example, if you want to calculate the hazard function for patients with large tumors (tumt = 0), you could use the following code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC LIFETEST DATA=Cancer;
  TIME survdays*dead(0);
  STRATA tumt;
  TEST / HAZARD;
RUN;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In this code, the &lt;CODE&gt;PROC LIFETEST&lt;/CODE&gt; statement specifies that you want to perform a survival analysis on the data in the &lt;CODE&gt;Cancer&lt;/CODE&gt; dataset. The &lt;CODE&gt;TIME&lt;/CODE&gt; statement indicates the time-to-event variable and the event variable, and the &lt;CODE&gt;STRATA&lt;/CODE&gt; statement indicates that you want to stratify the data by the &lt;CODE&gt;tumt&lt;/CODE&gt; variable. The &lt;CODE&gt;TEST&lt;/CODE&gt; statement specifies that you want to calculate the hazard function for each stratum (i.e. for each level of the &lt;CODE&gt;tumt&lt;/CODE&gt; variable).&lt;/P&gt;
&lt;P&gt;I hope this helps! Let me know if you have any other questions.&lt;/P&gt;</description>
    <pubDate>Wed, 07 Dec 2022 02:05:23 GMT</pubDate>
    <dc:creator>webart999ARM</dc:creator>
    <dc:date>2022-12-07T02:05:23Z</dc:date>
    <item>
      <title>Hazard function for Weibull distribution</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Hazard-function-for-Weibull-distribution/m-p/847467#M41992</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;How do I find the hazard function estimate for a categorical variable using weibull distribution.&lt;/P&gt;&lt;P&gt;My categorical variable is&amp;nbsp;categorical variable is Tumt:&amp;nbsp;&lt;SPAN&gt;0=large,1=squamous,2=small,3=adeno&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I want hazard function for patients with large tumors (large =0).&lt;/P&gt;&lt;P&gt;I see that proc lifereg can be used to calculate weibull distribution but I don't know how to get the hazard function for a specific categorical variable or can I use proc lifetest? if yes how do I code it pls.&lt;/P&gt;&lt;P&gt;This is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc lifereg data=Cancer ;&lt;BR /&gt;class tumt ;&lt;BR /&gt;model survdays*dead(0) = treat&amp;nbsp; tumt / dist=Weibull;&lt;BR /&gt;probplot;&lt;BR /&gt;inset;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 16:32:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Hazard-function-for-Weibull-distribution/m-p/847467#M41992</guid>
      <dc:creator>CathyVI</dc:creator>
      <dc:date>2022-12-02T16:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: Hazard function for Weibull distribution</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Hazard-function-for-Weibull-distribution/m-p/848259#M42018</link>
      <description>&lt;P&gt;To calculate the hazard function estimate for a categorical variable using the Weibull distribution in SAS, you can use the &lt;CODE&gt;PROC LIFEREG&lt;/CODE&gt; procedure. The &lt;CODE&gt;PROC LIFEREG&lt;/CODE&gt; procedure allows you to fit a parametric survival model to your data, and then use the fitted model to estimate the hazard function for different groups of subjects.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your case, you want to calculate the hazard function for patients with large tumors (tumt = 0). To do this, you can use the &lt;CODE&gt;PROC LIFEREG&lt;/CODE&gt; statement to fit a Weibull model to your data, and then use the &lt;CODE&gt;HAZARD&lt;/CODE&gt; option in the &lt;CODE&gt;MODEL&lt;/CODE&gt; statement to request that the procedure estimate the hazard function for each level of the &lt;CODE&gt;tumt&lt;/CODE&gt; variable. Here is an example of how you might do this in SAS:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC LIFEREG DATA=Cancer;
  CLASS tumt;
  MODEL survdays*dead(0) = treat tumt / DIST=WEIBULL HAZARD;
  PROBPLOT;
  INSET;
RUN;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In this example, the &lt;CODE&gt;PROC LIFEREG&lt;/CODE&gt; statement specifies that you want to fit a Weibull model to the data in the &lt;CODE&gt;Cancer&lt;/CODE&gt; dataset. The &lt;CODE&gt;CLASS&lt;/CODE&gt; statement indicates that the &lt;CODE&gt;tumt&lt;/CODE&gt; variable is a categorical variable, and the &lt;CODE&gt;MODEL&lt;/CODE&gt; statement specifies the model that you want to fit. The &lt;CODE&gt;HAZARD&lt;/CODE&gt; option in the &lt;CODE&gt;MODEL&lt;/CODE&gt; statement tells SAS to estimate the hazard function for each level of the &lt;CODE&gt;tumt&lt;/CODE&gt; variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After running this code, you can use the &lt;CODE&gt;PROBPLOT&lt;/CODE&gt; and &lt;CODE&gt;INSET&lt;/CODE&gt; statements to create a probability plot that shows the estimated hazard functions for each level of the &lt;CODE&gt;tumt&lt;/CODE&gt; variable. You can then use this plot to compare the hazard functions for different tumor types and identify any differences in the hazard of death for patients with different tumor types.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, you can use the &lt;CODE&gt;PROC LIFETEST&lt;/CODE&gt; procedure to calculate the hazard function for a specific group of subjects. For example, if you want to calculate the hazard function for patients with large tumors (tumt = 0), you could use the following code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC LIFETEST DATA=Cancer;
  TIME survdays*dead(0);
  STRATA tumt;
  TEST / HAZARD;
RUN;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In this code, the &lt;CODE&gt;PROC LIFETEST&lt;/CODE&gt; statement specifies that you want to perform a survival analysis on the data in the &lt;CODE&gt;Cancer&lt;/CODE&gt; dataset. The &lt;CODE&gt;TIME&lt;/CODE&gt; statement indicates the time-to-event variable and the event variable, and the &lt;CODE&gt;STRATA&lt;/CODE&gt; statement indicates that you want to stratify the data by the &lt;CODE&gt;tumt&lt;/CODE&gt; variable. The &lt;CODE&gt;TEST&lt;/CODE&gt; statement specifies that you want to calculate the hazard function for each stratum (i.e. for each level of the &lt;CODE&gt;tumt&lt;/CODE&gt; variable).&lt;/P&gt;
&lt;P&gt;I hope this helps! Let me know if you have any other questions.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2022 02:05:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Hazard-function-for-Weibull-distribution/m-p/848259#M42018</guid>
      <dc:creator>webart999ARM</dc:creator>
      <dc:date>2022-12-07T02:05:23Z</dc:date>
    </item>
  </channel>
</rss>

