<?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: ERROR ..... BINOMIAL LEVEL= value in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/ERROR-BINOMIAL-LEVEL-value/m-p/605257#M29396</link>
    <description>&lt;P&gt;program works except for some combinations.&lt;/P&gt;&lt;P&gt;i'm trying to find a way for SAS to compute freq for valid combinations without using the WHERE CLAUSE 16 times&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Nov 2019 00:19:31 GMT</pubDate>
    <dc:creator>malls</dc:creator>
    <dc:date>2019-11-19T00:19:31Z</dc:date>
    <item>
      <title>ERROR ..... BINOMIAL LEVEL= value</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/ERROR-BINOMIAL-LEVEL-value/m-p/605249#M29394</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to generate frequencies binomial CI for my response data using below code.&lt;/P&gt;&lt;P&gt;Sadly i'm getting errors when i have only one category(resp='0') in response variable for some categories of by variable.&lt;/P&gt;&lt;P&gt;Can anyone help me with this please ?&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sort data=wis.liv OUT= wis.liv_freq; by lev cph ; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods output Binomial=Binomial;&lt;/P&gt;&lt;P&gt;proc freq data = wis.liv_freq;&lt;/P&gt;&lt;P&gt;tables SURG / binomial(level=2);&lt;/P&gt;&lt;P&gt;by lev cph;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: The BINOMIAL LEV= value is greater than the number of levs for variable SURG.&lt;/P&gt;&lt;P&gt;NOTE: The above message was for the following BY group:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lev=1 cph=h2&lt;/P&gt;&lt;P&gt;ERROR: The BINOMIAL LEV= value is greater than the number of levs for variable SURG.&lt;/P&gt;&lt;P&gt;NOTE: The above message was for the following BY group:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lev=1 cph=h3&lt;/P&gt;&lt;P&gt;ERROR: The BINOMIAL LEV= value is greater than the number of levs for variable SURG.&lt;/P&gt;&lt;P&gt;NOTE: The above message was for the following BY group:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lev=2 cph=h4&lt;/P&gt;&lt;P&gt;ERROR: The BINOMIAL LEV= value is greater than the number of levs for variable SURG.&lt;/P&gt;&lt;P&gt;NOTE: The above message was for the following BY group:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lev=2 cph=h7&lt;/P&gt;&lt;P&gt;ERROR: The BINOMIAL LEV= value is greater than the number of levs for variable SURG.&lt;/P&gt;&lt;P&gt;NOTE: The above message was for the following BY group:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lev=3 cph=h12&lt;/P&gt;&lt;P&gt;ERROR: The BINOMIAL LEV= value is greater than the number of levs for variable SURG.&lt;/P&gt;&lt;P&gt;NOTE: The above message was for the following BY group:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lev=3 cph=h13&lt;/P&gt;&lt;P&gt;ERROR: The BINOMIAL LEV= value is greater than the number of levs for variable SURG.&lt;/P&gt;&lt;P&gt;NOTE: The above message was for the following BY group:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lev=3 cph=h19&lt;/P&gt;&lt;P&gt;ERROR: The BINOMIAL LEV= value is greater than the number of levs for variable SURG.&lt;/P&gt;&lt;P&gt;NOTE: The above message was for the following BY group:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lev=3 cph=h22&lt;/P&gt;&lt;P&gt;ERROR: The BINOMIAL LEV= value is greater than the number of levs for variable SURG.&lt;/P&gt;&lt;P&gt;NOTE: The above message was for the following BY group:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lev=3 cph=h23&lt;/P&gt;&lt;P&gt;ERROR: The BINOMIAL LEV= value is greater than the number of levs for variable SURG.&lt;/P&gt;&lt;P&gt;NOTE: The above message was for the following BY group:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lev=3 cph=h24&lt;/P&gt;&lt;P&gt;ERROR: The BINOMIAL LEV= value is greater than the number of levs for variable SURG.&lt;/P&gt;&lt;P&gt;NOTE: The above message was for the following BY group:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lev=3 cph=h25&lt;/P&gt;&lt;P&gt;ERROR: The BINOMIAL LEV= value is greater than the number of levs for variable SURG.&lt;/P&gt;&lt;P&gt;NOTE: The above message was for the following BY group:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lev=3 cph=h27&lt;/P&gt;&lt;P&gt;ERROR: The BINOMIAL LEV= value is greater than the number of levs for variable SURG.&lt;/P&gt;&lt;P&gt;NOTE: The above message was for the following BY group:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lev=3 cph=h29&lt;/P&gt;&lt;P&gt;ERROR: The BINOMIAL LEV= value is greater than the number of levs for variable SURG.&lt;/P&gt;&lt;P&gt;NOTE: The above message was for the following BY group:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lev=4 cph=h39&lt;/P&gt;&lt;P&gt;ERROR: The BINOMIAL LEV= value is greater than the number of levs for variable SURG.&lt;/P&gt;&lt;P&gt;NOTE: The above message was for the following BY group:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lev=4 cph=h51&lt;/P&gt;&lt;P&gt;ERROR: The BINOMIAL LEV= value is greater than the number of levs for variable SURG.&lt;/P&gt;&lt;P&gt;NOTE: The above message was for the following BY group:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lev=4 cph=h58&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/P&gt;&lt;P&gt;WARNING: The data set WORK.BINOMIAL may be incomplete.&amp;nbsp; When this step was stopped there were 16&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; observations and 7 variables.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 23:46:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/ERROR-BINOMIAL-LEVEL-value/m-p/605249#M29394</guid>
      <dc:creator>malls</dc:creator>
      <dc:date>2019-11-18T23:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR ..... BINOMIAL LEVEL= value</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/ERROR-BINOMIAL-LEVEL-value/m-p/605255#M29395</link>
      <description>&lt;P&gt;You can't compute anything from data where your variable SURG takes on only the value '0' and no other value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2019 00:16:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/ERROR-BINOMIAL-LEVEL-value/m-p/605255#M29395</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-11-19T00:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR ..... BINOMIAL LEVEL= value</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/ERROR-BINOMIAL-LEVEL-value/m-p/605257#M29396</link>
      <description>&lt;P&gt;program works except for some combinations.&lt;/P&gt;&lt;P&gt;i'm trying to find a way for SAS to compute freq for valid combinations without using the WHERE CLAUSE 16 times&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2019 00:19:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/ERROR-BINOMIAL-LEVEL-value/m-p/605257#M29396</guid>
      <dc:creator>malls</dc:creator>
      <dc:date>2019-11-19T00:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR ..... BINOMIAL LEVEL= value</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/ERROR-BINOMIAL-LEVEL-value/m-p/605260#M29397</link>
      <description>&lt;P&gt;You would have to weed out these levels where there is only one value in a data step (or PROC) before your run PROC FREQ.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2019 00:24:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/ERROR-BINOMIAL-LEVEL-value/m-p/605260#M29397</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-11-19T00:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR ..... BINOMIAL LEVEL= value</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/ERROR-BINOMIAL-LEVEL-value/m-p/605261#M29398</link>
      <description>&lt;P&gt;many thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;i'll try this&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2019 00:27:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/ERROR-BINOMIAL-LEVEL-value/m-p/605261#M29398</guid>
      <dc:creator>malls</dc:creator>
      <dc:date>2019-11-19T00:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR ..... BINOMIAL LEVEL= value</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/ERROR-BINOMIAL-LEVEL-value/m-p/605372#M29402</link>
      <description>&lt;P&gt;A suggestion would be to take advantage of the WEIGHT statement with the ZEROS option.&amp;nbsp; You could begin by taking your existing data set and assigning a count of 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data wis.liv_freq;&lt;/P&gt;
&lt;P&gt;set&amp;nbsp;wis.liv_freq;&lt;/P&gt;
&lt;P&gt;ct=1;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you do that, you could then create a data set that has all the combinations of the BY variables and the SURG variable and assign a count of 0 to each observation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data all;&lt;/P&gt;
&lt;P&gt;do lev=&amp;nbsp; *assign the levels of lev here;&lt;/P&gt;
&lt;P&gt;do cph=...;&lt;/P&gt;
&lt;P&gt;do surg=...;&lt;/P&gt;
&lt;P&gt;ct=0;&lt;/P&gt;
&lt;P&gt;output;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now if you stack those two data sets together and sort them&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data&amp;nbsp;wis.liv_freq2;&lt;/P&gt;
&lt;P&gt;set&amp;nbsp;wis.liv_freq all;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial',sans-serif;"&gt;proc sort data=wis.liv_freq2;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial',sans-serif;"&gt; by lev cph ; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial',sans-serif;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you should be able to use the WEIGHT statement in Proc FREQ.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial',sans-serif;"&gt;proc freq data = wis.liv_freq2;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial',sans-serif;"&gt;weight ct/zeros;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial',sans-serif;"&gt;tables SURG / binomial(level=2);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial',sans-serif;"&gt;by lev cph;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial',sans-serif;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2019 12:51:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/ERROR-BINOMIAL-LEVEL-value/m-p/605372#M29402</guid>
      <dc:creator>SAS_Rob</dc:creator>
      <dc:date>2019-11-19T12:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR ..... BINOMIAL LEVEL= value</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/ERROR-BINOMIAL-LEVEL-value/m-p/605421#M29405</link>
      <description>&lt;P&gt;Both methods works perfectly&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks all&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2019 15:35:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/ERROR-BINOMIAL-LEVEL-value/m-p/605421#M29405</guid>
      <dc:creator>malls</dc:creator>
      <dc:date>2019-11-19T15:35:12Z</dc:date>
    </item>
  </channel>
</rss>

