由买买提看人间百态

topics

全部话题 - 话题: drugdesc
(共0页)
s******r
发帖数: 1524
1
来自主题: Statistics版 - sas help
proc sql;
select id, count(distinct DRUGDESC)-1 as drugedesc_ind
from test
where DRUGDESC in ('ATORVASTATIN','SIMVASTATIN')
group by id;
quit;run;
proc sql;
select distinct a.id,
case when a.rxdate < b.rxdate then 1 else 0 end as indx
from test a inner join test b
on a.id=b.id
where a.DRUGDESC='ATORVASTATIN' and b.DRUGDESC='SIMVASTATIN';quit;run;
l***y
发帖数: 4671
2
实验了一下,没 work:
private void populateDrugList(){
DefaultListModel tmpModel = new DefaultListModel();
if (SharedData.drugIDs.size() == SharedData.drugDescs.size()){
for (int i = 0; i < SharedData.drugIDs.size(); i++) {
tmpModel.addElement(SharedData.drugIDs.get(i)+" "+
SharedData.drugDescs.get(i));
}
}
drugList.setModel(tmpModel);
drugList.revalidate();
drugList.repaint();
drugScrollPane.reval... 阅读全帖
t*********e
发帖数: 143
3
来自主题: Statistics版 - sas help
Sas急需帮助
ID RXDATE DRUGDESC DAY_SUPPLY
10001 15DEC2008 ATORVASTATIN 30
10001 14JAN2009 ATORVASTATIN 30
10001 12FEB2009 ATORVASTATIN 30
10003 28FEB2009 SIMVASTATIN 30
10004 28MAR2009 SIMVASTATIN 30
10001 25APR2009 SIMVASTATIN 30
10005 07JUL2009 ATORVASTATIN 30
10005 05AUG2009 ATORVASTATIN 30
10005 03SEP2009 SIMVASTATIN 30
数据里面id是patient id, 现在产生一个table,列出每个patient有没有曾经接受过drugdesc里面2种药品的治疗
最终的结果希望是这样的
ID ATORVASTATIN SIMVASTAT... 阅读全帖
R*********i
发帖数: 7643
4
来自主题: Statistics版 - sas help
Why it has to be sql? :-)
Assuming the variable rxdate is a numeric SAS date variable:
proc sql;
select coalesce(a.oldid1,b.oldid2) as id,
min(a.rxdate) as adate format=date9.,
min(b.rxdate) as sdate format=date9.,
(calculated adate>.) as ATORVASTATIN,
(calculated sdate>.) as SIMVASTATIN,
(. from test(rename=(id=oldid1) where=(drugdesc='ATORVASTATIN')) a full
join
test(rename=(id=oldi... 阅读全帖
(共0页)