BookmarkSubscribeRSS Feed
podarum
Quartz | Level 8

I'm trying to use trnspose, but may be the wrong procedure.  I'm trying to bring the top variables all into a column.

Have:

Area  Va1  Va2   Va3 ... Va54

NY     3.4    5.3    6.7       2.5

LA     2.3     5.4   5.3        3.7

Want:

Area    Var    Price

NY      Va1     3.4

NY      Va2     5.3

NY      Va3     6.7

...

NY      Va54   2.5

LA       Va1    2.3

LA       Va2    5.4

LA       Va3    5.3

...

LA       Va54  3.7

thanks

1 REPLY 1
art297
Opal | Level 21

You could use proc transpose.  e.g.,

proc transpose data=have

  out=want (rename=(_name_=var col1=price));

  var Va1--Va54;

  by Area notsorted;

run;

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 596 views
  • 0 likes
  • 2 in conversation