下面是我的code.
proc sql;
create table N_old_cdw as
select 2006 as year, count(unique(baseid))as C1
from Cdw06_old;
quit; *8275;
* Elderly(65+)community-dwellers with 1+ MH;
** N with 1+ MH;
data cdw06_old_mh ;
set Cdw06_old ( where=( MH=1)) ;
by baseid ;
if (first.baseid ne 1 or last.baseid ne 1) then output ;
run ; *1931 duplicate patients with 1+ MH claim;
** 2, Unique Elderly community-dwellers with 1+ MH claim;
proc sql;
create table N_g1mh as
select 2006 as year,count(unique(baseid)) as C2
from cdw06_old_mh;
quit; *301 unique elderly community-dwellers patients with 1+ MH claim;
** 3, Unique Elderly community-dwellers with 1+ MH claim and >20% copay;
proc sql;
create table N_g1mh_hicopay as
select count(unique(baseid)) as C3
from cdw06_old_mh
where coinrate>0.2;
quit; * 6 patiens with 1+ MH claim and >20% copay;
data all;
set N_old_cdw(keep=C1) N_g1MH(keep=C2) N_g1MH_hicopay(keep=C3);
run;
结果表格 all 是3行的, 麻烦哪位有好的想法实现我要的表格,作者: shiyiming 时间: 2011-10-21 22:17 标题: Re: excel 表格生成问题? 谢谢各位的时间,已经找到解决办法。作者: shiyiming 时间: 2011-10-21 23:34 标题: Re: excel 表格生成问题? [code:1qm5ys94]proc sql;
create table final as
select c1,c2,c3 from N_old_cdw, N_g1MH,N_g1MH_hicopay;
quit;[/code:1qm5ys94]