| Date: | Tue, 12 Dec 2006 13:45:19 -0800 |
| Reply-To: | Wei ZOU <wzou@UCDAVIS.EDU> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
|
| From: | Wei ZOU <wzou@UCDAVIS.EDU> |
| Organization: | University of California, Davis |
| Subject: | Re: Transpose columns to rows in SAS? |
|
| In-Reply-To: | <457E0615.1050406@ucdavis.edu> |
| Content-Type: | text/plain; charset=ISO-8859-1; format=flowed |
Thank you all for your timely reply. I have been trying to analyze
liquid chromatography-mass spectrometry data sets. Typical results are
peak height (measured on mass spectrometry) at certain elution time
points (measured on liquid chromatography).
Sometimes there are many peaks at different time points, so the original
dataset has many rows. But my purpose is to compare peaks among
subjects/samples, which are columns in the original dataset. In other
words, I want do ANOVA or PCA etc along the rows but not along the
columns. That's the basic reason I want to transpose the dataset.
For example,
I want to compare height 1 and height 2 from row 1 to 6. In real world,
the rows can reach 1000 to 100,000. The columns can reach 10-100,
sometimes 1000 if sample size is huge.
id time height1 height2
1 100 1011 300
2 200 111 100
3 300 4222 1000
4 400 3502 3000
5 500 100 90
6 600 300 250
I am glad to jump into this warmhearted list.:)
Best regards,
Wei
Wei ZOU wrote:
> Hello, all:
>
> I am trying to change my data columns to data rows, i.e., variables <->
> cases. In Excel it is called "transpose". Since My data set is big,
> Excel cannot process it. Could you please tell me if I can do this using
> SAS Transpose in Analyst or code?
>
> An illustration of my original data set:
> id time height
> 1 100 1011
> 2 200 111
> 3 300 4222
> 4 400 3502
> 5 500 100
> 6 600 300
>
> I want to transpose it to
> var1 var2 var3 var4 var5 var6
> time
> height
>
> Thanks a lot in advance.
>
>
> Best regards,
>
> Wei
|