BookmarkSubscribeRSS Feed
jgro
Calcite | Level 5

Hi, I want to produce a barchart of Response Rate by group over time and plot Mean result of another variable over time in the same graph. If I try SGPLOT, SAS give me a warming saying that he expect VLINE statement to have a GROUP option as well.

proc sgplot data=ador;

  vbar TPTN / response=xx group=RESP;

  vline x=TPTN y=spepbe / y2axis;

  xaxis display=(nolabel);

  yaxis label='Cumulative Percent of Patients';

run;

Can I do it using Proc template? Can somebody help me?

thanks

Justin

2 REPLIES 2
ballardw
Super User

Proc GBARLINE is designed for this.

DanH_sas
SAS Super FREQ

Based on your YAXIS label, I assume your data is pre-summarized. If so, we have a VBARPARM/hBARPARM that you use instead (assuming you have SAS 9.3 or greater). You would overlay a SERIES with that statement. You code would look something like this:

proc sgplot data=ador;

  vbarparm category=TPTN  response=xx / group=RESP;

  series x=TPTN y=spepbe / y2axis;

  xaxis display=(nolabel);

  yaxis label='Cumulative Percent of Patients';

run;

Hope this helps!

Dan

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 2 replies
  • 1551 views
  • 6 likes
  • 3 in conversation