| 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 |
|
| 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;
>
|