<?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: SAS procedure in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-genmod/m-p/761023#M240741</link>
    <description>&lt;P&gt;Any chance you typed a capitol "o" instead of zero (or vice versa).&lt;/P&gt;
&lt;P&gt;What is the format assigned to that variable?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that variable is character you may also need to check to see if the values have leading blanks. Most of the output tables will justify the text hiding the leading space but the reference value wants the actual level.&lt;/P&gt;
&lt;P&gt;Or perhaps just use the keyword First instead of a level .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To see what I am talking about run the code below:&lt;/P&gt;
&lt;PRE&gt;data example;
   x="    0";
run;

proc freq data=example;
   tables x;
run;&lt;/PRE&gt;
&lt;P&gt;The single value of X actually has several leading blanks. In the output for Proc Freq the blanks have been "justified" away and not visible.&lt;/P&gt;</description>
    <pubDate>Wed, 11 Aug 2021 22:53:42 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-08-11T22:53:42Z</dc:date>
    <item>
      <title>proc genmod</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-genmod/m-p/761018#M240737</link>
      <description>&lt;P&gt;I do not know what is wrong with my code:&lt;/P&gt;
&lt;P&gt;Below is the distribution of deposi:&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Freq: One-Way Frequencies" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r b header" scope="col"&gt;deposi&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Frequency&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Percent&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Cumulative&lt;BR /&gt;Frequency&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Cumulative&lt;BR /&gt;Percent&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;0&lt;/TH&gt;
&lt;TD class="r data"&gt;498&lt;/TD&gt;
&lt;TD class="r data"&gt;59.50&lt;/TD&gt;
&lt;TD class="r data"&gt;498&lt;/TD&gt;
&lt;TD class="r data"&gt;59.50&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="r data"&gt;239&lt;/TD&gt;
&lt;TD class="r data"&gt;28.55&lt;/TD&gt;
&lt;TD class="r data"&gt;737&lt;/TD&gt;
&lt;TD class="r data"&gt;88.05&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;2&lt;/TH&gt;
&lt;TD class="r data"&gt;100&lt;/TD&gt;
&lt;TD class="r data"&gt;11.95&lt;/TD&gt;
&lt;TD class="r data"&gt;837&lt;/TD&gt;
&lt;TD class="r data"&gt;100.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I fitted the SAS procedure below and had the error&lt;/P&gt;
&lt;P&gt;proc genmod data=stroke;&lt;BR /&gt;class gender(ref="0") race_ethnic(ref="0") deposi(ref="0") pay_source(ref="0") cmg_tier(ref="a") ;&lt;BR /&gt;model mrs_discharge= age gender race_ethnic deposi pay_source cmg_tier report_cmg weight_cmg expected_los/dist=gamma link=log type3;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR: Invalid reference value for &lt;STRONG&gt;deposi.&lt;/STRONG&gt;&lt;BR /&gt;ERROR: No valid observations due to invalid or missing values in the response, explanatory, offset,&lt;BR /&gt;frequency, or weight variable.&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE GENMOD used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Aug 2021 03:01:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-genmod/m-p/761018#M240737</guid>
      <dc:creator>desireatem</dc:creator>
      <dc:date>2021-08-12T03:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: SAS procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-genmod/m-p/761019#M240738</link>
      <description>&lt;P&gt;Whenever you get an error in the log, SHOW US THE LOG. That is, show us the entire log, 100% of it, with nothing chopped out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do not show us error messages disconnected from the code. Do not pick and choose parts&amp;nbsp; of the log to show us and then not show us other parts.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2021 21:13:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-genmod/m-p/761019#M240738</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-08-11T21:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: SAS procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-genmod/m-p/761023#M240741</link>
      <description>&lt;P&gt;Any chance you typed a capitol "o" instead of zero (or vice versa).&lt;/P&gt;
&lt;P&gt;What is the format assigned to that variable?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that variable is character you may also need to check to see if the values have leading blanks. Most of the output tables will justify the text hiding the leading space but the reference value wants the actual level.&lt;/P&gt;
&lt;P&gt;Or perhaps just use the keyword First instead of a level .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To see what I am talking about run the code below:&lt;/P&gt;
&lt;PRE&gt;data example;
   x="    0";
run;

proc freq data=example;
   tables x;
run;&lt;/PRE&gt;
&lt;P&gt;The single value of X actually has several leading blanks. In the output for Proc Freq the blanks have been "justified" away and not visible.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2021 22:53:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-genmod/m-p/761023#M240741</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-08-11T22:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: SAS procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-genmod/m-p/761026#M240744</link>
      <description>&lt;P&gt;1204 proc genmod data=stroke;&lt;BR /&gt;1205 class gender(ref="0") ert(ref="0") race_ethnic(ref="0") deposi(ref="0") pay_source(ref="0")&lt;BR /&gt;1205! cmg_tier(ref="a") ;&lt;BR /&gt;1206 model mrs_discharge= age gender race_ethnic deposi ert*deposi pay_source cmg_tier report_cmg&lt;BR /&gt;1206! weight_cmg expected_los/dist=gamma link=log type3;&lt;BR /&gt;1207 run;&lt;/P&gt;
&lt;P&gt;ERROR: Invalid reference value for deposi.&lt;BR /&gt;ERROR: No valid observations due to invalid or missing values in the response, explanatory, offset,&lt;BR /&gt;frequency, or weight variable.&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE GENMOD used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2021 21:56:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-genmod/m-p/761026#M240744</guid>
      <dc:creator>desireatem</dc:creator>
      <dc:date>2021-08-11T21:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: SAS procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-genmod/m-p/761049#M240755</link>
      <description>One of the variables in the model has too many missing values. &lt;BR /&gt;See how you can figure that out here:&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/iml/2016/04/18/patterns-of-missing-data-in-sas.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2016/04/18/patterns-of-missing-data-in-sas.html&lt;/A&gt;</description>
      <pubDate>Thu, 12 Aug 2021 01:07:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-genmod/m-p/761049#M240755</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-08-12T01:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: proc genmod</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-genmod/m-p/761112#M240786</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/40563"&gt;@desireatem&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To check your data for all three potential issues mentioned by &lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884" target="_blank" rel="noopener"&gt;ballardw&lt;/A&gt; and &lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879" target="_blank" rel="noopener"&gt;Reeza&lt;/A&gt;, i.e.,&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;unformatted or inappropriately formatted reference level for formatted variable&amp;nbsp;&lt;FONT face="courier new,courier"&gt;deposi&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;hidden character(s) in the reference value of variable&amp;nbsp;&lt;FONT face="courier new,courier"&gt;deposi&lt;/FONT&gt;&amp;nbsp;or its format label (leading or trailing blanks would not matter, though)&lt;/LI&gt;
&lt;LI&gt;missing values of one or more other predictor variables in the observations with &lt;FONT face="courier new,courier"&gt;deposi&lt;/FONT&gt;=&lt;EM&gt;reference value&lt;/EM&gt;&amp;nbsp;(missing values in the dependent variable are largely tolerated),&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;you could run this DATA step and post the log, in particular the values of &lt;FONT face="courier new,courier"&gt;_c1&lt;/FONT&gt;, &lt;FONT face="courier new,courier"&gt;_c2&lt;/FONT&gt;, ..., if any:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
array _c[5] $16 (5*' ');
set stroke end=last;
where cmiss(age, gender, race_ethnic, pay_source, cmg_tier, report_cmg, weight_cmg, expected_los)=0;
if vvalue(deposi) ~in: _c &amp;amp; i&amp;lt;dim(_c) then do;
  i+1;
  _c[i]=vvalue(deposi);
end;
if last;
put (_c[*])(=$hex32. /);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Aug 2021 10:32:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-genmod/m-p/761112#M240786</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2021-08-12T10:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: proc genmod</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-genmod/m-p/761129#M240794</link>
      <description>As Reeza pointed out , you have too many variables be missing. which conduct to "deposi" doesn't have value 0 .</description>
      <pubDate>Thu, 12 Aug 2021 12:46:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-genmod/m-p/761129#M240794</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-08-12T12:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: SAS procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-genmod/m-p/761709#M241060</link>
      <description>&lt;P&gt;Thank you but there is less than 10 % missing.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Aug 2021 22:17:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-genmod/m-p/761709#M241060</guid>
      <dc:creator>desireatem</dc:creator>
      <dc:date>2021-08-15T22:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: proc genmod</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-genmod/m-p/761711#M241062</link>
      <description>&lt;P&gt;&lt;BR /&gt;366 data _null_;&lt;BR /&gt;367 array _c[5] $16 (5*' ');&lt;BR /&gt;368 set stroke end=last;&lt;BR /&gt;369 where cmiss(age, gender, race_ethnic, pay_source, cmg_tier, report_cmg, weight_cmg,&lt;BR /&gt;369! expected_los)=0;&lt;BR /&gt;370 if vvalue(deposi) ~in: _c &amp;amp; i&amp;lt;dim(_c) then do;&lt;BR /&gt;371 i+1;&lt;BR /&gt;372 _c[i]=vvalue(deposi);&lt;BR /&gt;373 end;&lt;BR /&gt;374 if last;&lt;BR /&gt;375 put (_c[*])(=$hex32. /);&lt;BR /&gt;376 run;&lt;/P&gt;
&lt;P&gt;_c1=20202020202020202020203120202020&lt;BR /&gt;_c2=20202020202020202020202020202020&lt;BR /&gt;_c3=20202020202020202020202020202020&lt;BR /&gt;_c4=20202020202020202020202020202020&lt;BR /&gt;_c5=20202020202020202020202020202020&lt;BR /&gt;NOTE: There were 230 observations read from the data set WORK.STROKE.&lt;BR /&gt;WHERE CMISS(age, gender, race_ethnic, pay_source, cmg_tier, report_cmg, weight_cmg,&lt;BR /&gt;expected_los)=0;&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;</description>
      <pubDate>Sun, 15 Aug 2021 22:37:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-genmod/m-p/761711#M241062</guid>
      <dc:creator>desireatem</dc:creator>
      <dc:date>2021-08-15T22:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: proc genmod</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-genmod/m-p/761752#M241087</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/40563"&gt;@desireatem&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;BR /&gt;_c1=20202020202020202020203120202020&lt;BR /&gt;_c2=20202020202020202020202020202020&lt;BR /&gt;_c3=20202020202020202020202020202020&lt;BR /&gt;_c4=20202020202020202020202020202020&lt;BR /&gt;_c5=20202020202020202020202020202020&lt;BR /&gt;NOTE: There were 230 observations read from the data set WORK.STROKE.&lt;BR /&gt;WHERE CMISS(age, gender, race_ethnic, pay_source, cmg_tier, report_cmg, weight_cmg,&lt;BR /&gt;expected_los)=0;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Thanks for this helpful information. So, the third bullet point of my list of potential issues described what happened: Missing values of one or more other predictor variables in the observations with&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;deposi=0&lt;/FONT&gt; have made&amp;nbsp;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;ref="0"&lt;/FONT&gt; an invalid reference level specification for &lt;FONT face="courier new,courier"&gt;deposi&lt;/FONT&gt;. The values of &lt;FONT face="courier new,courier"&gt;_c1&lt;/FONT&gt;, ..., &lt;FONT face="courier new,courier"&gt;_c5&lt;/FONT&gt; indicate that &lt;EM&gt;all&lt;/EM&gt; observations used in the analysis have &lt;FONT face="courier new,courier"&gt;deposi=&lt;FONT size="4"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;. Therefore, &lt;FONT face="courier new,courier"&gt;ref="&lt;STRONG&gt;1&lt;/STRONG&gt;"&lt;/FONT&gt; is the only possible reference value for &lt;FONT face="courier new,courier"&gt;deposi&lt;/FONT&gt;. But even this is actually useless because the parameter estimate of the &lt;EM&gt;constant&lt;/EM&gt; variable &lt;FONT face="courier new,courier"&gt;deposi&lt;/FONT&gt; will be zero, i.e., you can &lt;EM&gt;remove&lt;/EM&gt; &lt;FONT face="courier new,courier"&gt;deposi&lt;/FONT&gt; from the CLASS and MODEL statements without losing more information.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Given that 72.5% of the 837 observations in &lt;FONT face="courier new,courier"&gt;work.stroke&lt;/FONT&gt; (with non-missing &lt;FONT face="courier new,courier"&gt;deposi&lt;/FONT&gt;) have been excluded because of missing values in&amp;nbsp;&lt;FONT face="courier new,courier"&gt;age, gender, race_ethnic, pay_source, cmg_tier, report_cmg, weight_cmg&lt;/FONT&gt; and/or &lt;FONT face="courier new,courier"&gt;expected_los&lt;/FONT&gt;, you should check if&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;SPAN&gt;that many values are &lt;EM&gt;correctly&lt;/EM&gt; missing&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;most of the missing values are from a single variable (or from only two, ...) -- &lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879" target="_blank" rel="noopener"&gt;Reeza&lt;/A&gt;'s suggestion will be helpful for this&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;you can remove those largely missing variables from the model or impute their missing values.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;SPAN&gt;Otherwise, you won't get a very useful model from PROC GENMOD as it would be based on a relatively small, not representative subset of your analysis dataset, disregarding information (e.g., about the relationship between &lt;FONT face="courier new,courier"&gt;deposi&lt;/FONT&gt; and&amp;nbsp;&lt;FONT face="courier new,courier"&gt;mrs_discharge&lt;/FONT&gt;) which you could gain from the rest of the dataset.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Aug 2021 08:43:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-genmod/m-p/761752#M241087</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2021-08-16T08:43:39Z</dc:date>
    </item>
  </channel>
</rss>

