BookmarkSubscribeRSS Feed
ashleyazar
Calcite | Level 5

Hi,

 

I have a response variable codes as 1="Respnse" and 0 ="Non-Response". If i use level=0, i get an error stating that the level should be a positive integer. How do i get the proportion of non-responders?

 

 

 

%if %str(&tabnum)=%str(1049.1.1) /*or %str(&tabnum)=%str(1049.1.2)*/ or %str(&tabnum)=%str(1049.1.5) %then %do;

 

proc freq data=dsin;

BY &byvar viswin efques leg_sort;

tables  &value / binomial (level=1);

where not missing(remiss);

exact binomial;

ods output OneWayFreqs=freqs BinomialProp=ExactBiCI(where=(name1 in("XL_BIN", "XU_BIN")));

run;

 

%end;

%else %do;

 

2 REPLIES 2
SteveDenham
Jade | Level 19

The LEVEL= option refers to the variable level (or order), not to the actual value itself.  If you use LEVEL=1, it will give you the proportion of Non-responders (=0).  Compare it to LEVEL=2, which should give the number of responders (=1).

 

Steve Denham

Nizzo16
Calcite | Level 5

Hi, 

you can just use 

 

level="1"  even if it is numerical. 

 

In this way it works. 

 

Andrea Nizzardo

 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 16723 views
  • 0 likes
  • 3 in conversation