BookmarkSubscribeRSS Feed
Uriel26
Calcite | Level 5
Alguien podría ayudarme, quiero hacer una gráfica horizontal que me permita manejar dos conjuntos de datos en la misma gráfica,por ejemplo quiero tener alturas, diámetros y que estén en función de número de sitio
1 REPLY 1
Rick_SAS
SAS Super FREQ

You need to merge the data and convert it to "long" format:

data Heights;
input site height;
datalines;
1 10
2 12
3 17
4 6
;

data Diameters;
input site diameter;
datalines;
1 3.4
2 5.6
3 12.1
4 8.3
;

/* merge data and convert from wide to long format */
data Want;
merge Heights Diameters;
by site;
Group = "Height  "; Value = Height;   output;
Group = "Diameter"; Value = Diameter; output;
run;

proc sgplot data=Want;
hbarparm category=site response=Value / group=Group groupdisplay=cluster;
run;

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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