- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I need to make a simple bar graph that looks like this:
sample data:
order (num) | var2 (char) | var3 (char) | var4 (num) |
1 | No Symptoms | screening | 23 |
1 | Symptoms1 | screening | 244 |
1 | Symptoms 2 | screening | 25 |
2 | No Symptoms | visit 20 | 50 |
2 | Symptoms1 | visit 20 | 70 |
2 | Symptoms 2 | visit 20 | 30 |
3 | No Symptoms | screening | 23 |
3 | Symptoms1 | screening | 244 |
3 | Symptoms 2 | screening | 25 |
4 | No Symptoms | visit 20 | 50 |
4 | Symptoms1 | visit 20 | 70 |
4 | Symptoms 2 | visit 20 | 30 |
1 |
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
/*
Here is an example
*/
title;
proc sgplot data=sashelp.heart;
vbar bp_status/response=weight group=sex groupdisplay=cluster;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Please share what you have tried with any messages from the log. You can use the Insert Code "</>" icon when posting code or log messages.
Thanks & kind regards,
Amir.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
/*
Here is an example
*/
title;
proc sgplot data=sashelp.heart;
vbar bp_status/response=weight group=sex groupdisplay=cluster;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Since the example "data" has nothing that appears in the example picture you have to walk us through the role of each variable and how it is supposed to be used in the graph. Especially what your Var4 represents. You show an example graph where bar height represents percentages. If the value of Var4 is a percentage then 244 is an odd value, not impossible but appears odd.
I believe you have been on this forum long enough to know that example data should be in form of working data step code so we don't have to make guesses about actual variable names and types.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
hi,
Prefer vbarbasic of proc sgplot over the old vbar. You will have more features, flexibility and you will be able to compute your statistics with proc freq or so before plotting them.