要求多少[b:g5svncwp]病人[/b:g5svncwp]有1个以上的mental health claim?
每行数据是每次的claim.
程序1,
data cdw_old_mh&year ;
set Cdw_old&year ( where=( MH=1)) ;
by baseid ;
if (first.baseid ne 1 or last.baseid ne 1) then output ;
run ;
** 112, Unique Elderly community-dwellers with 1+ MH claim;
proc sql;
create table old_g1mh as
select &year as year,count(unique(baseid)) as old_g1MH
from cdw_old_mh&year;
quit;
程序2,
data old_g1_all&year;
set Cdw_old&year ;
by baseid ;
if (first.baseid ne 1 or last.baseid ne 1) then output ;
run ;
proc sql;
create table old_g1_mh as
select &year as year,count(unique(baseid)) as old_g1_MH
from old_g1_all&year
where mh=1;
quit;