LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (April 2010, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Sat, 3 Apr 2010 23:44:07 -0400
Reply-To:   art297@NETSCAPE.NET
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Arthur Tabachneck <art297@NETSCAPE.NET>
Subject:   Re: censoring when you have events
Comments:   To: joelleahallak@gmail.com
In-Reply-To:   <45975e22-b442-400f-bc38-d14f4a85505f@h27g2000yqm.googlegroups.com>
Content-Type:   text/plain; charset="utf-8"; format=flowed

jiji,

Post back to the list with an example and showing the results you'd like to see. If you want missing values to negate the sum, simply add the values together rather than using the sum(of sx:) statement. e.g., (sxr+sxl)

Art -----Original Message----- From: jiji <joelleahallak@gmail.com> To: Arthur Tabachneck <art297@netscape.net> Sent: Sat, Apr 3, 2010 9:10 pm Subject: Re: censoring when you have events

On Mar 6, 4:38 pm, art...@NETSCAPE.NET (Arthur Tabachneck) wrote: > jiji, > > I think you are asking how to do something like the following: > > data want (drop=gotone); >  set have; >  by id; >  retain gotone; >  if first.id then gotone=0; >  event=0; >  if gotone eq 0 and sum(of sx:) gt 0 then do; >   event=1; >   gotone=1; >  end; > run; > > HTH, > Art > ------------- > On Mar 5, 5:24 pm, jiji <joelleahal...@gmail.com> wrote: > > > > > Hi, > > > I have a longitidinal dataset with two surgeries (right and left). > > However I want to look at first surgery (event) which will be either > > right or left. > > > the data looks something likes this: > > > ID  visit   sxr  sxl > > 1    1    0    0 > > 1    2    0    1 > > 1    3    1    0 > > 1    4    0    0 > > 2    1    0    0 > > 2    2    0    1 > > 2    3    1    0 > > 3    1    1    0 > > 3    2    0    1 > > 3    3    0    0 > > > How can I create a new variable that selects the first occurence of > > surgery either left or right for each subject. It may look like this: > > > event > > 0 > > 1 > > 0 > > 0 > > 0 > > 1 > > 0 > > 1 > > 0 > > 0 > > > Thank you!!- Hide quoted text - > > - Show quoted text -

Hi Arthur,

Thank you for your response regarding this code. Is there a way to take into consideration the missing data points? In the event, there was one missing (not a 0 nor a 1, in either surgeries)? I tried putting a missing statement but it does not seem to work. where do you think should it go in the code below? Thanks much!!

data want (drop=gotone); > set have; > by id; > retain gotone; > if first.id then gotone=0; > event=0; > if gotone eq 0 and sum(of sx:) gt 0 then do; > event=1; > gotone=1; > end; > run; >


Back to: Top of message | Previous page | Main SAS-L page