| Date: | Thu, 25 Aug 2011 21:43:49 -0500 |
| Reply-To: | "Data _null_;" <iebupdte@GMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | "Data _null_;" <iebupdte@GMAIL.COM> |
| Subject: | Re: AE table help |
|
| In-Reply-To: | <CAPo+gguVYVOPxDvcO9MaDpv97NzqxnjiCMHhqMxbz4r4-VhH3Q@mail.gmail.com> |
| Content-Type: | text/plain; charset=ISO-8859-1 |
Something like this to address events and incidence and percent
incidence. Replace AE in the code below with AEPREF and AESOC. This
does not address many other issues descending freq for output and
possibly SEX dependent denominator.
* events per subject;
proc summary data=ae nway;
class usubjid trtgrp ae;
output out=ae1(drop=_type_ rename=_freq_=events);
run;
* events and incidence;
Proc summary data=ae1 nway;
class ae trtgrp;
output out=ae2(drop=_type_ rename=_freq_=incidence) sum(events)=;
run;
* bign;
proc summary data=trt nway;
class trtgrp;
output out=bign(drop=_type_ rename=_freq_=bign index=(trtgrp));
run;
* percent incidence;
data ae2;
set ae2;
set bign key=trtgrp/unique;
pct = incidence/bign;
run;
On Thu, Aug 25, 2011 at 8:53 PM, SAS_learner <proccontents@gmail.com> wrote:
> Thanks Mary,
>
> would it be possible possible by proc means atleast ??
>
>
>
> On Thu, Aug 25, 2011 at 7:28 PM, Mary Rosenbloom <
> mary.rosenbloom.sas@gmail.com> wrote:
>
>> Phani,
>>
>> So if I am understanding correctly you want to get the number of events and
>> also the number of patients with events out of PROC FREQ within the same
>> call? I have never been able to do that myself without pre-processing the
>> data. Perhaps you could use a data step to get a count of events per
>> patient and then a binary variable indicating whether or not the patient had
>> at least one event, then limiting the dataset to one record per patient.
>> Then you could run the two variables (the count variable and the binary
>> indicator variable) though PROC FREQ at the same time. However, you would
>> need to do this one event at a time, so would probably want to use a macro.
>>
>> I'm looking forward to hearing others ideas, which will probably be more
>> ellegant.
>>
>> Cheers,
>> Mary R.
>>
>> On Thu, Aug 25, 2011 at 4:12 PM, SAS_learner <proccontents@gmail.com>wrote:
>>
>>> Hello all,
>>>
>>> I am doing a simple AE table where I want
>>>
>>>
>>> Placebo (n=xx)
>>> LY 3 mg (n=xx)
>>> preferred term # events incidence
>>> # events incidence
>>> Infections and Infestations
>>> Appendicitis
>>> Bronchitis
>>>
>>> I am planning to use the following proc freq code , I know I am getting
>>> #events count right in pt_term_count table , but how to get the incidence
>>> values using the proc freq. I think I can use proc sql distinct (usubjid)
>>> would give me what I want right but curious if there way to get in Proc
>>> freq
>>> step ??
>>>
>>> Proc freq data = event_count ;
>>> by trtsort;
>>> tables Socterm * pterm /out = pt_term_count ;
>>> tables pterm * Usubjid /list out = pt_term_subjid ;
>>> run;
>>>
>>> Thanks
>>> Phani
>>>
>>
>>
>
|