proc sql;
select sex ,count(sex) as frq'number of subjects' from sasuser.demo
group by sex;
quit;
proc sql;
select case when sex='F' then 'female' else 'male' end as sex,
count(sex) as frq 'number of subjects' from sasuser.demo
group by sex;
quit;
data ae1;
infile 'C:\Documents and Settings\mobileclub\Desktop\source\DLM/adevents.txt';
input gno $ pid visit ae $;
run;
proc sql;
select ae,count(ae) as frq from ae1
group by ae;
quit;
proc sql;
select ae 'reaction type', count (ae)
as frq 'no of sub' from ae1
group by ae having ae ne 'null';
quit;
proc sql;
create view ae2 as select * from ae1
where ae ne 'null';
quit;
proc sql;
select visit,count(visit) as frq from ae1
group by visit;
quit;
proc sql;
select visit, ae,count(ae) as frq 'no of sub' from ae1
group by visit ,ae having ae ne 'null';
quit;
proc sql;
select pid,count(pid) as frq from ae1
group by pid;
quit;
proc sql;
select case when visit=1 then 'visit1'
when visit=2 then 'visit2'
else 'visit3' end as visit,ae,count(ae) as frq from ae1
group by visit,ae having ae ne 'nul' order by visit;
quit;
No comments:
Post a Comment