Hi to everybody, I try to understand the final code of table 3 to understand the porcentage, the code use a condition n(_1,t1)=.2 then.... , please check below the right expression, but I would like to understand this " if condition n(_1,t1)=2 ", why 2?...and how can I found it in the SAS biobiography. Thanks in advance. V Here you are the code below, please run the code, and I want to understand the if condition n in (data total3), the way to calculate the porcentagey to calculate the: data new; input subjid trt fday tday; datalines; 1 1 1 5 2 1 . 4 2 1 . 3 3 1 1 -4 3 2 1 5 4 2 1 2 4 1 1 5 ; run; proc sql; create table total as select count(distinct subjid) as n, trt 'Treatment', 'number of subjects A' as col0 from new where fday ne . group by trt; quit; proc transpose data=total out=totalt; by col0; id trt; var n; run; proc sql; create table total2 as select count(distinct subjid) as n, trt 'Treatment', 'number of subjects B' as col0 from new where fday ne . and tday le 0 group by trt; quit; proc transpose data=total2 out=total2t; by col0; id trt; var n; run; data total3; length trt1 trt2 $12; merge totalt (rename=(_1=t1 _2=t2)) total2t; if n(_1,t1)=2 then trt1=put(_1,3.)||' ('||put((100*(_1/t1)),5.2)||'%)'; else trt1=' 0'; if n(_2,t2)=2 then trt2=put(_2,3.)||' ('||put((100*(_2/t2)),5.2)||'%)'; else trt2=' 0'; run;
... View more