0
votes

I have a dataset with a dummy variable showing how many participants were in both classes. Now I want to show the percentage of people taking only the last class. I have the before mentioned dummy variable (0 for participating in both and 1 for participating only in the last). I am not interested in both the percentages, only the last.

I want to only print the one where the dummy is 1. Is this even possible?

I have the following

proc tabulate data=compare missing;
class diff10;
table diff10*reppctn ;
run;
1
For 0/1 indicator variables the MEAN=proportion and SUM=count.data _null_

1 Answers

0
votes

Perhaps this example will help.

data dummy;
   do i = 1 to 10;
      dummy=rantbl(8787,.2)-1;
      output;
      end;
   run;
proc print;
   run;
proc tabulate;
   var dummy;
   tables dummy=' '*(sum='Count'*f=3. mean='%'*f=percent.);
   run; 

enter image description here