<?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 proc phreg - ERROR: Invalid reference value for ... in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/proc-phreg-ERROR-Invalid-reference-value-for/m-p/690588#M33282</link>
    <description>&lt;P&gt;!!!URGENT!!!&lt;BR /&gt;&lt;BR /&gt;Hi People,&lt;/P&gt;&lt;P&gt;I have an&amp;nbsp;&lt;FONT face="arial black,avant garde"&gt;error: Invalid reference value for FLAG&lt;/FONT&gt;&amp;nbsp; after running the below code.&lt;BR /&gt;One of my input datasets has only value 0, I think that brings an issue.&lt;BR /&gt;How can I handle that?&lt;BR /&gt;If anybody has any idea please tell me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods output parameterestimates = hzd&amp;amp;trtn.;
proc phreg data=hazard;
  class flag(ref="1");
  model aval*cnsr1(1)=flag / rl;
run;
ods output close;&lt;/CODE&gt;&lt;/PRE&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0e9e998e-d5eb-4e80-97e3-360930651dd6.jpg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50509i44D4C7781AD9629D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="0e9e998e-d5eb-4e80-97e3-360930651dd6.jpg" alt="0e9e998e-d5eb-4e80-97e3-360930651dd6.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Kind Regards&lt;BR /&gt;Artur&lt;BR /&gt;-------------------&lt;/P&gt;&lt;P&gt;UPDATE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I removed the error.&lt;BR /&gt;Now I have only following warning&lt;/P&gt;&lt;PRE&gt;Output 'parameterestimates' was not created.  Make sure that the output object name, label, or path is spelled correctly.  Also, verify that the
         appropriate procedure options are used to produce the requested output object.  For example, verify that the NOPRINT option is not used.&lt;/PRE&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Oct 2020 22:35:57 GMT</pubDate>
    <dc:creator>webart999ARM</dc:creator>
    <dc:date>2020-10-09T22:35:57Z</dc:date>
    <item>
      <title>proc phreg - ERROR: Invalid reference value for ...</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-phreg-ERROR-Invalid-reference-value-for/m-p/690588#M33282</link>
      <description>&lt;P&gt;!!!URGENT!!!&lt;BR /&gt;&lt;BR /&gt;Hi People,&lt;/P&gt;&lt;P&gt;I have an&amp;nbsp;&lt;FONT face="arial black,avant garde"&gt;error: Invalid reference value for FLAG&lt;/FONT&gt;&amp;nbsp; after running the below code.&lt;BR /&gt;One of my input datasets has only value 0, I think that brings an issue.&lt;BR /&gt;How can I handle that?&lt;BR /&gt;If anybody has any idea please tell me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods output parameterestimates = hzd&amp;amp;trtn.;
proc phreg data=hazard;
  class flag(ref="1");
  model aval*cnsr1(1)=flag / rl;
run;
ods output close;&lt;/CODE&gt;&lt;/PRE&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0e9e998e-d5eb-4e80-97e3-360930651dd6.jpg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50509i44D4C7781AD9629D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="0e9e998e-d5eb-4e80-97e3-360930651dd6.jpg" alt="0e9e998e-d5eb-4e80-97e3-360930651dd6.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Kind Regards&lt;BR /&gt;Artur&lt;BR /&gt;-------------------&lt;/P&gt;&lt;P&gt;UPDATE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I removed the error.&lt;BR /&gt;Now I have only following warning&lt;/P&gt;&lt;PRE&gt;Output 'parameterestimates' was not created.  Make sure that the output object name, label, or path is spelled correctly.  Also, verify that the
         appropriate procedure options are used to produce the requested output object.  For example, verify that the NOPRINT option is not used.&lt;/PRE&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Oct 2020 22:35:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-phreg-ERROR-Invalid-reference-value-for/m-p/690588#M33282</guid>
      <dc:creator>webart999ARM</dc:creator>
      <dc:date>2020-10-09T22:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Invalid reference value for ...</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-phreg-ERROR-Invalid-reference-value-for/m-p/690589#M33283</link>
      <description>&lt;P&gt;If one of your data sets only has a value of 0 for FLAG, then that is the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can you handle this? How do you want to handle this?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Oct 2020 21:34:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-phreg-ERROR-Invalid-reference-value-for/m-p/690589#M33283</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-10-09T21:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid reference value for ...</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-phreg-ERROR-Invalid-reference-value-for/m-p/690590#M33284</link>
      <description>&lt;P&gt;Please post log entries by copy from the log and paste into a code box opened on the forum with the &amp;lt;/&amp;gt;. Include the code for the procedure with any notes from the log.&lt;/P&gt;
&lt;P&gt;If you are running this in the body of a macro then set Options MPRINT so the generated code can appear with the messages.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your variable does not have the specified value as ref on the class statement, yes that will be a problem.&lt;/P&gt;
&lt;P&gt;Solution: make sure the value exists in the data.&lt;/P&gt;
&lt;P&gt;OR&lt;/P&gt;
&lt;P&gt;Use a reference value that does exist in the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your only independent variable has only one value you aren't going to get much of a useable model anyway.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Oct 2020 21:36:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-phreg-ERROR-Invalid-reference-value-for/m-p/690590#M33284</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-10-09T21:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Invalid reference value for ...</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-phreg-ERROR-Invalid-reference-value-for/m-p/690591#M33285</link>
      <description>&lt;P&gt;I have no idea.&lt;BR /&gt;For example, why it couldn't be ignored by phreg, I need to consider only 1.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Oct 2020 21:36:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-phreg-ERROR-Invalid-reference-value-for/m-p/690591#M33285</guid>
      <dc:creator>webart999ARM</dc:creator>
      <dc:date>2020-10-09T21:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: proc phreg - ERROR: Invalid reference value for ...</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-phreg-ERROR-Invalid-reference-value-for/m-p/690593#M33287</link>
      <description>Here is the problem,&lt;BR /&gt;A macro that is generated pull to preg procedure multiple datasets, one of them has a flag variable with only 0 values.&lt;BR /&gt;Maybe somehow I can dynamically check and use the datasets with only 1 value? Or just ignore that one dataset which as value 0 only?</description>
      <pubDate>Fri, 09 Oct 2020 21:45:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-phreg-ERROR-Invalid-reference-value-for/m-p/690593#M33287</guid>
      <dc:creator>webart999ARM</dc:creator>
      <dc:date>2020-10-09T21:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: proc phreg - ERROR: Invalid reference value for ...</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-phreg-ERROR-Invalid-reference-value-for/m-p/690660#M33293</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/268199"&gt;@webart999ARM&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Here is the problem,&lt;BR /&gt;A macro that is generated pull to preg procedure multiple datasets, one of them has a flag variable with only 0 values.&lt;BR /&gt;Maybe somehow I can dynamically check and use the datasets with only 1 value? Or just ignore that one dataset which as value 0 only?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So clearly, you have some macro language in use, looking to perform PROC PHREG on data set hzd&amp;amp;trtn. Thus, in your macro, before PROC PHREG, you need to check to see that there are at least two distinct levels of FLAG. One way to do this is to use the &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=statug&amp;amp;docsetTarget=statug_freq_syntax01.htm&amp;amp;locale=en#statug.freq.freqnlevels" target="_self"&gt;NLEVELS&lt;/A&gt; option of PROC FREQ, and if there is only one level, then don't perform PROC PHREG.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Oct 2020 11:09:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-phreg-ERROR-Invalid-reference-value-for/m-p/690660#M33293</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-10-10T11:09:36Z</dc:date>
    </item>
  </channel>
</rss>

