<?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 not recognizing reference category in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-phreg-not-recognizing-reference-category/m-p/509390#M136945</link>
    <description>&lt;P&gt;Thank you for your response, ballardw! Sorry, there was a typo in my original post. My code did use (ref='0'), and it works for all my other categorical variables (not listed here). Additionally, I ran frequency tables to make sure that the category does exist. For some reason these specific 4 variables are giving me trouble.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have just made edits to my post after reading your response. Thanks again!&lt;/P&gt;</description>
    <pubDate>Thu, 01 Nov 2018 01:13:29 GMT</pubDate>
    <dc:creator>TL93</dc:creator>
    <dc:date>2018-11-01T01:13:29Z</dc:date>
    <item>
      <title>proc phreg not recognizing reference category</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-phreg-not-recognizing-reference-category/m-p/509355#M136923</link>
      <description>&lt;P&gt;Hi SAS Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am running proc phreg to predict the incidence of cancer, based on socio-demographic variables:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc phreg data=&amp;lt;data_name&amp;gt;;
class immigrant (ref='0') ysmcat (ref='0') ind (ref='0') occ (ref='0') /param=reference;
model duration*status_cancer(0)=immigrant ysmcat ind occ /rl ties=efron;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;*note: I have quite a few more predictor variables but these four are the ones giving me trouble&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ysmcat = years since migration; categories 0 to 6;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0=non-immigrants (reference group); 1=0 years, 2=1-5 years, and so on.&lt;/P&gt;&lt;P&gt;occ = occupation; categories 0 to 5;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0=no occupation (reference group); 1=occupation group 1, and so on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My issue is highlighted in the following photo of my output:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="proc phreg issue.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24545i53CF9A89CE15697C/image-size/large?v=v2&amp;amp;px=999" role="button" title="proc phreg issue.png" alt="proc phreg issue.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting periods for the last category of the ysmcat and occ variables. Furthermore, the degrees of freedom is 0; I'm assuming that SAS is treating these categories as the reference group, even though I specified using category=0 as the reference group. Category 0 for both variables are not present in the model. When I run a frequency table, it shows that all categories are coded correctly, even the 0 category.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought this issue might be caused by the&amp;nbsp;&lt;EM&gt;immigrant&lt;/EM&gt; variable, for ysmcat. So I dropped immigrant from the regression and lo and behold, the ysmcat was fine. Same goes for occ when I drop&amp;nbsp;&lt;EM&gt;ind&lt;/EM&gt; from the model. I have a feeling it has something to do with multicollinearity, or the overlap in reference groups for these variables but I cannot explain it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help me explain what is going on and how to rectify the issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much! More info on these four variables below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;immigrant&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;0=not an immigrant;&amp;nbsp; &amp;nbsp; 1=immigrant&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ysmcat&amp;nbsp;&lt;/STRONG&gt;(years since migration cat)&lt;/P&gt;&lt;P&gt;0=not an immigrant;&amp;nbsp; &amp;nbsp; 1=0 years;&amp;nbsp; &amp;nbsp; 2=1-5 years;&amp;nbsp; &amp;nbsp; 3=6-10 years;&amp;nbsp; &amp;nbsp; 4=year_range;&amp;nbsp; &amp;nbsp; 5=year_range;&amp;nbsp; &amp;nbsp; 6=year_range&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;occ&lt;/STRONG&gt; (occupation)&lt;/P&gt;&lt;P&gt;0=no occupation;&amp;nbsp; &amp;nbsp; 1=management;&amp;nbsp; &amp;nbsp; 2=professional;&amp;nbsp; &amp;nbsp; 3=occ_cat;&amp;nbsp; &amp;nbsp; 4=occ_cat;&amp;nbsp; &amp;nbsp; 5=occ_cat&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ind&lt;/STRONG&gt; (industry)&lt;/P&gt;&lt;P&gt;0=no industry;&amp;nbsp; &amp;nbsp; 1=primary;&amp;nbsp; &amp;nbsp; 2=manufacturing;&amp;nbsp; &amp;nbsp; 3=construction;&amp;nbsp; &amp;nbsp; 4=ind_cat;&amp;nbsp; &amp;nbsp; 5=ind_cat;&amp;nbsp; &amp;nbsp; 6=ind_cat;&amp;nbsp; &amp;nbsp; 7=ind_cat;&amp;nbsp; &amp;nbsp; 8=ind_cat&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;immigrant 0 is equal to ysmcat 0 (since it is capturing all non-immigrants)&lt;/P&gt;&lt;P&gt;occ 0 is equal to ind 0 (since it is capturing all those who are jobless)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again, thank you for your time.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 01:10:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-phreg-not-recognizing-reference-category/m-p/509355#M136923</guid>
      <dc:creator>TL93</dc:creator>
      <dc:date>2018-11-01T01:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: proc phreg not recognizing reference category</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-phreg-not-recognizing-reference-category/m-p/509364#M136926</link>
      <description>&lt;P&gt;one thing the proper syntax is (ref&lt;STRONG&gt;=&lt;/STRONG&gt;'0').&lt;/P&gt;
&lt;P&gt;You state&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Category 0 for both variables &lt;STRONG&gt;are not present&lt;/STRONG&gt; in the model.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Since you use a category that &lt;STRONG&gt;does not exist&lt;/STRONG&gt; then the system defaults to the Default value of Ref which is LAST or the largest value.&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;HR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 22:01:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-phreg-not-recognizing-reference-category/m-p/509364#M136926</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-31T22:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: proc phreg not recognizing reference category</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-phreg-not-recognizing-reference-category/m-p/509367#M136929</link>
      <description>&lt;P&gt;I believe Ref needs to be the formatted value as well, ie ref=‘no industry’ not the 0 value. &lt;BR /&gt;&lt;BR /&gt;REF=’level’ | keyword&lt;BR /&gt;specifies the reference level for PARAM=EFFECT, PARAM=REFERENCE, and their orthogonalizations. For PARAM=GLM, the REF= option specifies a level of the classification variable to be put at the end of the list of levels. This level thus corresponds to the reference level in the usual interpretation of the linear estimates with a singular parameterization.&lt;BR /&gt;&lt;BR /&gt;For an individual variable REF= option (but not for a global REF= option), you can specify the level of the variable to use as the reference level. &lt;STRONG&gt;Specify the formatted value of the variable if a format is assigned. For a global or individual variable REF= option, you can use one of the following keywords. The default is REF=LAST.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetVersion=14.3&amp;amp;docsetTarget=statug_phreg_syntax06.htm&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?docsetId=statug&amp;amp;docsetVersion=14.3&amp;amp;docsetTarget=statug_phreg_syntax06.htm&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 22:19:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-phreg-not-recognizing-reference-category/m-p/509367#M136929</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-31T22:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: proc phreg not recognizing reference category</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-phreg-not-recognizing-reference-category/m-p/509372#M136930</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/227543"&gt;@TL93&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think the reason (in both cases) is the linear dependence of the design variables (see table "Class Level Information" in the output): The last design variable can be expressed as a linear combination of the other design variables because&amp;nbsp;the "0" categories of&amp;nbsp;OCC and&amp;nbsp;IND coincide (and analogously for IMMIGRANT and YSMCAT).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example with two variables a, b, each with categories 0, 1, 2, a=0 &amp;lt;==&amp;gt; b=0, and design variables a1, a2, b1, b2 for a=1, a=2, etc.: &lt;STRONG&gt;b2=a1+a2-b1&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, the effect of the last design variable is already "absorbed" by the preceding design variables. (You've "run out of degrees of freedom".) You can decide which of the two variables (e.g.&amp;nbsp; OCC or IND) is affected by changing the order of the two in the MODEL statement (&lt;FONT face="courier new,courier"&gt;occ ind&lt;/FONT&gt;&amp;nbsp; vs. &lt;FONT face="courier new,courier"&gt;ind occ&lt;/FONT&gt;).&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 23:14:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-phreg-not-recognizing-reference-category/m-p/509372#M136930</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-10-31T23:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: proc phreg not recognizing reference category</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-phreg-not-recognizing-reference-category/m-p/509390#M136945</link>
      <description>&lt;P&gt;Thank you for your response, ballardw! Sorry, there was a typo in my original post. My code did use (ref='0'), and it works for all my other categorical variables (not listed here). Additionally, I ran frequency tables to make sure that the category does exist. For some reason these specific 4 variables are giving me trouble.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have just made edits to my post after reading your response. Thanks again!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 01:13:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-phreg-not-recognizing-reference-category/m-p/509390#M136945</guid>
      <dc:creator>TL93</dc:creator>
      <dc:date>2018-11-01T01:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: proc phreg not recognizing reference category</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-phreg-not-recognizing-reference-category/m-p/509392#M136947</link>
      <description>&lt;P&gt;Thank you, FreelanceReinhard! That was very informative. Yes, I have a feeling this is more a statistical issue than a programming issue but I wanted to get everyone else's insight as well. When I change the order of immigrant and ysmcat so that ysmcat comes first, it is the immigrant variable that has issues. I have yet to switch the order for occ and ind.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I might try a couple other things (like what Reeza mentioned above) before I consider dropping immigrant and occ (or ind) from my models.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Take care!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 01:21:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-phreg-not-recognizing-reference-category/m-p/509392#M136947</guid>
      <dc:creator>TL93</dc:creator>
      <dc:date>2018-11-01T01:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: proc phreg not recognizing reference category</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-phreg-not-recognizing-reference-category/m-p/509397#M136948</link>
      <description>If you're referring to the fact that one level is always missing when dummy coding, that's the nature of dummy coding. It's also why you create N-1 levels of a dummy variable when dummy coding. To fit a full model, I don't think you can use the referential coding and then you need to interpret the coefficients differently and your hypothesis is different. It gets asked pretty regularly on here, usually under Statistics. I think someone (Paige Miller or PGSTATs) has an example of how to get all estimates but that's beyond me at the moment since it's my bed time.</description>
      <pubDate>Thu, 01 Nov 2018 01:43:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-phreg-not-recognizing-reference-category/m-p/509397#M136948</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-11-01T01:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: proc phreg not recognizing reference category</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-phreg-not-recognizing-reference-category/m-p/509431#M136961</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/227543"&gt;@TL93&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I might try a couple other things (like what Reeza mentioned above) before I consider dropping immigrant and occ (or ind) from my models.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I don't think the (necessarily) missing estimate for &lt;EM&gt;one&amp;nbsp;of several&lt;/EM&gt; non-reference categories of OCC or IND is a reason for dropping either variable. The only redundant variable is IMMIGRANT because its value is &lt;EM&gt;completely&lt;/EM&gt; determined by the value of YSMCAT. So, the decision would be to use &lt;EM&gt;either&lt;/EM&gt; IMMIGRANT &lt;EM&gt;or&lt;/EM&gt;&amp;nbsp;YSMCAT with its refined categories in the model (provided they are significant).&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 09:29:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-phreg-not-recognizing-reference-category/m-p/509431#M136961</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-11-01T09:29:09Z</dc:date>
    </item>
  </channel>
</rss>

