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;
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
Hi,
you can just use
level="1" even if it is numerical.
In this way it works.
Andrea Nizzardo
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.