Hi,
I have 3 variables each having 4 modalities. I would like to represent their histogram aligned along the abscissas in the same graph to visualize. What option or instruction does this?
Thank you
Gick
PROC GCHART data=data;
HBAR symptomes_viraux symptomes_vir_douloureux Maladie_respiratoire /ascending outside=percent;
RUN ;
QUIT;
here is the example
Here are two options. The simplest way is to use PROC SGPLOT, but PROC SGPANEL has some options for paneling the data that might be useful:
data Have;
length Symptoms $16 Group $3;
input Symptoms Group Percent;
datalines;
viraux A 58
viraux B 20
viraux C 12
viraux D 10
vir_douloureux A 64
vir_douloureux B 25
vir_douloureux C 9
vir_douloureux D 2
respiratoire A 57
respiratoire B 23
respiratoire C 14
respiratoire D 6
;
title "An SGPLOT Example";
proc sgplot data=Have;
hbar Symptoms / response=Percent group=Group groupdisplay=cluster
datalabel datalabelpos=data grouporder=descending;
xaxis grid label="Percent";
yaxis reverse;
run;
title "An SGPANEL Example";
proc sgpanel data=Have noautolegend;
panelby Symptoms / novarname layout=rowlattice onepanel rows=3;
hbar Group / response=Percent group=group;
colaxis grid display=(nolabel);;
run;
Here are two options. The simplest way is to use PROC SGPLOT, but PROC SGPANEL has some options for paneling the data that might be useful:
data Have;
length Symptoms $16 Group $3;
input Symptoms Group Percent;
datalines;
viraux A 58
viraux B 20
viraux C 12
viraux D 10
vir_douloureux A 64
vir_douloureux B 25
vir_douloureux C 9
vir_douloureux D 2
respiratoire A 57
respiratoire B 23
respiratoire C 14
respiratoire D 6
;
title "An SGPLOT Example";
proc sgplot data=Have;
hbar Symptoms / response=Percent group=Group groupdisplay=cluster
datalabel datalabelpos=data grouporder=descending;
xaxis grid label="Percent";
yaxis reverse;
run;
title "An SGPANEL Example";
proc sgpanel data=Have noautolegend;
panelby Symptoms / novarname layout=rowlattice onepanel rows=3;
hbar Group / response=Percent group=group;
colaxis grid display=(nolabel);;
run;
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.