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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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