proc sgplot data=pande_app4_w_bad;
vbar Selskapspolicy / response=Bad_6m stat=mean DATALABEL
barwidth=0.6 fillattrs=graphdata1 ;
yaxis grid display=(nolabel);
xaxis display=(nolabel);
vbar Selskapspolicy / response=Bad_12m stat=mean DATALABEL
barwidth=0.4 fillattrs=graphdata2 ;
yaxis grid display=(nolabel);
xaxis display=(nolabel);
run;
I am not getting this as neat as I want to side by side...Anyone?
If you want the blue and red bars to be placed side by side, you have two options.
If you want the blue and red bars to be placed side by side, you have two options.
Yeah I want to use the Group option, but found it hard to implement as my data is of the type
reponsecolumn1 | responsecolumn2 |
1 | 1 |
0 | 1 |
0 | 0 |
1 | 0 |
How do I get it to a one response column and a classifier?
You can use PROC TRANSPOSE. if you have data set "Response" with Cat, Response1 and Response2, you can use the following. The response column names will show up as group values.
proc transpose data=response out=groups;
by cat;
run;
For a simple case like yours, I use a simple data step:
data groups;
keep Cat Group Response;
set response;
Group=1; Response=response1; output;
Group=2; Response=response2; output;
run;
Here is an article by Rick on this topic.
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.
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.