|
Dear listers,
What I have is data of patients admitted to the ICU in 2006. If I want to know the total amount of days patients stayed on the ICU that year it gives the folowing syntax: COMPUTE DayonIC = XDATE.DATE(adm_ic_disdate - adm_ic_admdate)/(24*60*60). FORMATS DayonIC (F8.0). VARIABLE LABELS Day on IC 'days stayed on ICU'. EXE. FREQUENCIES VARIABLES=DayonIC /FORMAT=NOTABLE /STATISTICS=SUM /ORDER= ANALYSIS . Sum gives me the amount of days. So far so good but now I want to know the total amount of days patients stayed on the ICU for every month that year. Can someone help me with this? Thank's Leo ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
|
Shalom
Here is a syntax that will create data file displaying days stayed in the ICU by month . (the AGGREGATE at the end is in case the same patients was readmitted in the same month ). title 'calculating icu month stay ' . data list / id icu_admdate icu_disdate (f2,2(1x,edate11)) . begin data 1 11-feb-2005 17-apr-2005 1 21-jun-2005 07-sep-2005 2 08-jan-2005 05-jul-2005 3 21-mar-2005 07-sep-2005 end data. compute days=datediff(icu_disdate ,icu_admdate ,'days'). compute day=60*60*24 . loop ii=0 to days . compute seq_date=icu_admdate + (ii * day) . compute monthdays=sum( monthdays,1) . compute month=xdate.month(seq_date ). do if ( xdate.mday(seq_date + day) eq 1 ) or (seq_date eq icu_disdate) . xsave outfile= 'c:\temp\months.sav' / keep= id month monthdays . compute monthdays=0 . end if . end loop . execute . variable labels monthdays 'days stayed on icu for that month ' . dataset name icu . get file= 'c:\temp\months.sav' . aggregate /outfile=* /break= id month /monthdays = sum(monthdays). Hillel Vardi BGU Leo Bakker wrote: > Dear listers, > > What I have is data of patients admitted to the ICU in 2006. > If I want to know the total amount of days patients stayed on the ICU that > year it gives the folowing syntax: > > COMPUTE DayonIC = XDATE.DATE(adm_ic_disdate - adm_ic_admdate)/(24*60*60). > FORMATS DayonIC (F8.0). > VARIABLE LABELS Day on IC 'days stayed on ICU'. > EXE. > > FREQUENCIES > VARIABLES=DayonIC /FORMAT=NOTABLE > /STATISTICS=SUM > /ORDER= ANALYSIS . > > Sum gives me the amount of days. > > So far so good but now I want to know the total amount of days patients > stayed on the ICU for every month that year. > Can someone help me with this? > > Thank's > Leo > > ===================== > To manage your subscription to SPSSX-L, send a message to > [hidden email] (not to SPSSX-L), with no body text except the > command. To leave the list, send the command > SIGNOFF SPSSX-L > For a list of commands to manage subscriptions, send the command > INFO REFCARD > > ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
| Free forum by Nabble | Edit this page |
