BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,

I have a dataset as below

ID VI HGT WGT
10 1 40 100
10 2 41 104
11 2 32 202

I would like to transpose this as hgt and wgt to the left and headers
be unique ID,VI. Basically something like this below should rescue me.
I'm not sure if this is possible.

10-1 10-2 11-2
HGT 40 41 32
WGT 100 104 202


I used basic transposing so far and couldn't find an example for
something like this any where else.

Appreciate your Help...

Regards,
Eddie
2 REPLIES 2
LinusH
Tourmaline | Level 20
To me, it looks more like a report rather something you would like to store i a table.
Maybe you could try PROC TABULATE, it'll let you be quite free on where to put your data in a matrix.

/Linus
Data never sleeps
abdullala
Calcite | Level 5
1. create new variable idvi to concatenate ID and VI, ie a variable with values like 10-1, 11-2
2.proc transpose / var hgt wgt /id idvi

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

New Learning Events in April

 

Join us for two new fee-based courses: Administrative Healthcare Data and SAS via Live Web Monday-Thursday, April 24-27 from 1:00 to 4:30 PM ET each day. And Administrative Healthcare Data and SAS: Hands-On Programming Workshop via Live Web on Friday, April 28 from 9:00 AM to 5:00 PM ET.

LEARN MORE

Discussion stats
  • 2 replies
  • 737 views
  • 0 likes
  • 3 in conversation