Date: Fri, 29 Mar 2002 09:40:58 +0100
Reply-To: Jim Groeneveld <J.Groeneveld@ITGROUPS.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jim Groeneveld <J.Groeneveld@ITGROUPS.COM>
Subject: Re: how to transform this data set? Thanks!
Content-Type: text/plain
Hi Henry,
Yet another method, using a standard PROCedure:
DATA Original;
INPUT x$ y;
CARDS;
A 15
A 5
A 10
B 10
C 5
C 10
;
RUN;
PROC UNIVARIATE DATA=Original NOPRINT;
VAR y; BY x;
OUTPUT OUT=Result SUM=y;
RUN;
PROC PRINT DATA=Result; RUN;
Regards - Jim.
--
Y. (Jim) Groeneveld, MSc IMRO TRAMARKO tel. +31 412 407 070
senior statistician, P.O. Box 1 fax. +31 412 407 080
senior data manager 5350 AA BERGHEM IMRO TRAMARKO: a CRO
J.Groeneveld@ITGroups.com the Netherlands in clinical research
My computer beeps when it complains; I complain when it beeps
Notice of confidentiality: this e-mail may contain confidential information
intended for the addressed recipient only.
If you have received this e-mail in error please delete this e-mail and
please notify the sender so that proper delivery
can be arranged.
> -----Original Message-----
> From: Jinrui Cui [SMTP:jcui@UCLA.EDU]
> Sent: Friday, March 29, 2002 1:14 AM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: how to transform this data set? Thanks!
>
> Hi,
>
> I have a data set (a), how to transfrom it into (b)?
>
> (a) (b)
> ------------- ------------------
> A 15 A 30
> A 5 B 10
> A 10 C 15
> B 10 ------------------
> C 5
> C 10
> -------------
>
> Thanks!
>
> Henry