turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- exact binomial CI

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-03-2017 12:44 PM

Hi,

I am trying to calculate binomial CI for my efficacy data using below code. But it is throwing error when we have only one category(resp='0') in response variable for a particular category of by variable. As i am using LEVEL=2 option its throwing error. Let me know how to handle this.

proc freq data=dsin1;

by viswin leg_sort ;

tables &G_A_RESPVAR/ binomial (level=2);

exact binomial;

ods output OneWayFreqs=freqs

BinomialProp=Exttst(where=(name1 in("XL_BIN", "XU_BIN")));

run;

Thanks,

Ravi.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SSN_Ravi

04-03-2017 01:23 PM

It really helps to show the code and error from the log. Best is to post it in a code box using the {i} menu icon in the forum as the main message windows will reformat text and many error messages include indicators as to the issue that get moved.

In general all confidence intervals require some variability in the data or you get a 0 width interval. It may be that you want to exclude the specific case(s) with only one response level from the analysis

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to ballardw

04-03-2017 04:00 PM

Here is the error message

ERROR: The BINOMIAL LEVEL= value is greater than the number of levels for variable RESPSD1.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SSN_Ravi

04-03-2017 05:37 PM

Maybe if we create a similar example it will help:

data example; input x ; datalines; 1 1 1 1 1 ; proc freq data=example; tables x /binomial(level=2); exact binomial; run;

Generates that error. It is an error. In your case it may well only occur for some combinations of your by variables. Find out which combination (or combinations). Then using a WHERE clause do not use the analysis for those combinations. Note that for those combinations you will output similar to that generated by:

proc freq data=example; tables x /binomial(level=1); exact binomial; run;

So run the code with the correct level only for those combinations.

Suppose you determine that the combination viswin=3 leg_sort=5 is the only combination with this problem then:

proc freq data=dsin1; by viswin leg_sort ; where viswin ne 3 and leg_sort ne 5; tables &G_A_RESPVAR/ binomial (level=2); exact binomial; ods output OneWayFreqs=freqs BinomialProp=Exttst(where=(name1 in("XL_BIN", "XU_BIN"))); run; proc freq data=dsin1; by viswin leg_sort ; where viswin = 3 and leg_sort = 5; tables &G_A_RESPVAR/ binomial (level=1); exact binomial; ods output OneWayFreqs=freqs1Level BinomialProp=Exttst1Level(where=(name1 in("XL_BIN", "XU_BIN"))); run;

Of course if you have many combinations of the by variables with this issue then you may want to rethink things in general.