<?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: PROC PHREG - with CLASS statement in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-PHREG-with-CLASS-statement/m-p/575188#M28254</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/282263"&gt;@MTeck&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the case of a dichotomous explanatory variable with values 0 and 1 (like &lt;FONT face="courier new,courier"&gt;exposure&lt;/FONT&gt; in your data) the results with vs. without a CLASS statement are essentially the same. However, it can happen (and it did in your example) that the CLASS statement uses level '1' of that explanatory variable as the reference level so that the sign of the corresponding parameter estimate changes and the inverse hazard ratio and confidence limits are computed,&amp;nbsp;here: the hazard ratio of "no exposure" vs. "exposure."&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would use the CLASS statement (because &lt;FONT face="courier new,courier"&gt;exposure&lt;/FONT&gt; &lt;EM&gt;is&lt;/EM&gt; a classification variable) &lt;EM&gt;and&lt;/EM&gt; explicitly specify the reference level so that the intended results are clear. If variable &lt;FONT face="courier new,courier"&gt;exposure&lt;/FONT&gt; is not formatted:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;class exposure(ref='0');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;If variable &lt;FONT face="courier new,courier"&gt;exposure&lt;/FONT&gt; is formatted and the formatted value of &lt;FONT face="courier new,courier"&gt;exposure=0&lt;/FONT&gt; is &lt;FONT face="courier new,courier"&gt;'no'&lt;/FONT&gt;:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;class exposure(ref='no');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or, to avoid hardcoding of formatted values:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;class exposure(ref=first) / order=internal;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(Among the &lt;EM&gt;internal&lt;/EM&gt; values of &lt;FONT face="courier new,courier"&gt;exposure&lt;/FONT&gt;, 0 and 1, 0 is the &lt;EM&gt;first&lt;/EM&gt;, regardless of formats. See the &lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_phreg_syntax06.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en" target="_blank" rel="noopener"&gt;documentation&lt;/A&gt; for more details.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 21 Jul 2019 09:22:38 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2019-07-21T09:22:38Z</dc:date>
    <item>
      <title>PROC PHREG - with CLASS statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-PHREG-with-CLASS-statement/m-p/575182#M28252</link>
      <description>&lt;P&gt;i am wondering either i add "CLASS" statement or&amp;nbsp;not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am trying to run Cox-regression model, so i made this code.&lt;/P&gt;&lt;P&gt;and what i need is&amp;nbsp; the hard ratios for outcome on exposure.&lt;/P&gt;&lt;P&gt;exposure(0=no exposure, 1= yes exposure)&amp;nbsp;and outcome(0=no outcome, 1= yes outcome) variable are all binary.&lt;/P&gt;&lt;P&gt;Can i add class statement to want to see hazard ratios on exposure&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc phreg data=episode;&lt;/P&gt;&lt;P&gt;/*class exposure*/&lt;BR /&gt;model period*outcome(0)=exposure / rl;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My output is per individual,&lt;/P&gt;&lt;P&gt;1) class statement&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;DF&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Parameter&lt;/P&gt;&lt;P&gt;Estimate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;-1.45709&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Standard&lt;/P&gt;&lt;P&gt;Error&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;0.15452&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Chi-Square&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;88.9231&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;Pr&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;nbsp;ChiSq&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&amp;lt;.0001&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Hazard&lt;/P&gt;&lt;P&gt;Ratio&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;0.233&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;95%&amp;nbsp;Hazard&amp;nbsp;Ratio&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;0.172&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;ConfidenceLimit&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;0.315&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) non class statement&lt;/P&gt;&lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;DF&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Parameter&lt;/P&gt;&lt;P&gt;Estimate&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Standard&lt;/P&gt;&lt;P&gt;Error&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;Chi-Square&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;Pr&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;nbsp;ChiSq&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Hazard&lt;/P&gt;&lt;P&gt;Ratio&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;95% Hazard Ratio&lt;/TD&gt;&lt;TD&gt;ConfidenceLimit&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1.45709&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;0.15452&amp;nbsp;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;88.9231&lt;/TD&gt;&lt;TD&gt;&amp;lt;.0001&lt;/TD&gt;&lt;TD&gt;4.293&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;3.172&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;5.812&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Sun, 21 Jul 2019 06:02:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-PHREG-with-CLASS-statement/m-p/575182#M28252</guid>
      <dc:creator>MTeck</dc:creator>
      <dc:date>2019-07-21T06:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: PROC PHREG - with CLASS statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-PHREG-with-CLASS-statement/m-p/575188#M28254</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/282263"&gt;@MTeck&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the case of a dichotomous explanatory variable with values 0 and 1 (like &lt;FONT face="courier new,courier"&gt;exposure&lt;/FONT&gt; in your data) the results with vs. without a CLASS statement are essentially the same. However, it can happen (and it did in your example) that the CLASS statement uses level '1' of that explanatory variable as the reference level so that the sign of the corresponding parameter estimate changes and the inverse hazard ratio and confidence limits are computed,&amp;nbsp;here: the hazard ratio of "no exposure" vs. "exposure."&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would use the CLASS statement (because &lt;FONT face="courier new,courier"&gt;exposure&lt;/FONT&gt; &lt;EM&gt;is&lt;/EM&gt; a classification variable) &lt;EM&gt;and&lt;/EM&gt; explicitly specify the reference level so that the intended results are clear. If variable &lt;FONT face="courier new,courier"&gt;exposure&lt;/FONT&gt; is not formatted:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;class exposure(ref='0');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;If variable &lt;FONT face="courier new,courier"&gt;exposure&lt;/FONT&gt; is formatted and the formatted value of &lt;FONT face="courier new,courier"&gt;exposure=0&lt;/FONT&gt; is &lt;FONT face="courier new,courier"&gt;'no'&lt;/FONT&gt;:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;class exposure(ref='no');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or, to avoid hardcoding of formatted values:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;class exposure(ref=first) / order=internal;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(Among the &lt;EM&gt;internal&lt;/EM&gt; values of &lt;FONT face="courier new,courier"&gt;exposure&lt;/FONT&gt;, 0 and 1, 0 is the &lt;EM&gt;first&lt;/EM&gt;, regardless of formats. See the &lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_phreg_syntax06.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en" target="_blank" rel="noopener"&gt;documentation&lt;/A&gt; for more details.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jul 2019 09:22:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-PHREG-with-CLASS-statement/m-p/575188#M28254</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2019-07-21T09:22:38Z</dc:date>
    </item>
  </channel>
</rss>

