Data visualization with SAS programming

bar chart to display two different groups in the x-axis

Accepted Solution Solved
Reply
Contributor
Posts: 20
Accepted Solution

bar chart to display two different groups in the x-axis

Hi, 

I have a data with three columns, one distinguish two different population and other variable is ID and probability values.  Need to plot the probability in the y-axis and the x-axis should have both the id information and different population group information?  Any idea?

 

Thanks

Ram


Accepted Solutions
Solution
Friday
SAS Super FREQ
Posts: 1,139

Re: bar chart to display two different groups in the x-axis

As suggested by Reeza:

 

proc sgplot data=temp;

  vbarparm category=pop response=prob / group=id groupdisplay=cluster;

run;

View solution in original post


All Replies
SAS Super FREQ
Posts: 1,139

Re: bar chart to display two different groups in the x-axis

Please share sample data, a picture. 

What release of SAS do you have?

Contributor
Posts: 20

Re: bar chart to display two different groups in the x-axis

SAS 9.3
For e.g
data temp;
input pop id prob;
datalines;
0 1 .99
0 2 .33
0 3 .45
0 4 .25
1 1 .6
1 2 .94
1 3 .23
1 4 .87
1 5 .93
1 6 .91
;
Solution
Friday
SAS Super FREQ
Posts: 1,139

Re: bar chart to display two different groups in the x-axis

As suggested by Reeza:

 

proc sgplot data=temp;

  vbarparm category=pop response=prob / group=id groupdisplay=cluster;

run;

Super User
Posts: 19,080

Re: bar chart to display two different groups in the x-axis

SGPLOT with VBARPARM or VBAR.

Contributor
Posts: 20

Re: bar chart to display two different groups in the x-axis

Need to differentiate the groups at the x axis (left side one group and right side other group). 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 134 views
  • 0 likes
  • 3 in conversation