Date: Tue, 27 Feb 2007 12:16:36 -0800
Reply-To: Jeanina Worden <jworden@PDD.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jeanina Worden <jworden@PDD.NET>
Subject: Re: Proc transpose help (SAS/QC preparation)
Content-Type: text/plain; charset="iso-8859-1"
It looks like your first transpose is using three variables (XSN) in your VAR statement. It might be easier to do one tranpose for each variable:
proc transpose data=old out=new;
var X;
by Population;
run;
proc transpose data=old out=new;
var S;
by Population;
run;
proc transpose data=old out=new;
var S;
by Population;
run;
Then merge them together by the population...
The only way I know how to add stuff to the variable name is to use the PREFIX= or an ID _NAME_...but both will add the IDs to the beginning.
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of
Wainwright, Andrea
Sent: Tuesday, February 27, 2007 12:00 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Proc transpose help (SAS/QC preparation)
At least I think I need transpose.
I've got a dataset like the following:
Population _name_ var1 var2 var3 var4...
A X 1 2 5 8
A S 2 3 1 1
A N 5 6 7 5
B X 7 2 3 9
B S 9 7 9 3
B N 3 3 2 6
C X 6 9 7 2
C S 1 1 5 9
C N 8 2 8 8
(Yes, I've already done one transpose to get the var1-varN across the
top)
And what I want is:
Population var1X var1S var1N var2X var2S var2N ...
A 1 2 5 2 3 6
B 7 9 3 2 7 3
C 6 1 8 9 1 2
So how do I append the value of _NAME_ to the variable while doing the
transpose?
For the QC tie-in, I'm building my HISTORY dataset. X is the mean, S is
the standard deviation, and N is the nobs.
The information contained in this e-mail is confidential and/or proprietary
to Capital One and/or its affiliates. The information transmitted herewith
is intended only for use by the individual or entity to which it is
addressed. If the reader of this message is not the intended recipient,
you are hereby notified that any review, retransmission, dissemination,
distribution, copying or other use of, or taking of any action in reliance
upon this information is strictly prohibited. If you have received this
communication in error, please contact the sender and delete the material
from your computer.