- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 03-23-2021 08:06 PM
(2234 views)
How can i draw following graph using sas? Any ideas would be appreciated. 001, 002 are patient numbers, the colored lines are a criterial presenting for each patient.
6 REPLIES 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Something like a grouped barchart?
See example: https://robslink.com/SAS/democd17/fruit_info.htm
Best regards, Jos
See example: https://robslink.com/SAS/democd17/fruit_info.htm
Best regards, Jos
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
A "Needle" plot: SAS Help Center: Syntax: PROC SGPLOT NEEDLE Statement. I've implemented graphs like this using a scatter plot; using points, which I make small or invisible, then I use error bars, without "feet", with the same size as the y coordinate.
The colors look random. Would you be assigning colors to the needles based on your given data?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi : Thanks for the solutions. I have too many subjects in the data, is there any way I can limit the number of subjects per page and create a multi page report.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
data have;
set sashelp.heart;
id+1;
if _n_=4 then stop;
keep diastolic height weight id;
format id z3.;
run;
proc transpose data=have out=want;
by id;
var diastolic height weight;
run;
data want;
set want;
col1=-col1;
run;
proc sgplot data=want;
needle x=id y=col1/group=_name_ groupdisplay=cluster clusterwidth=0.2 x2axis;
x2axis type=discrete valuesformat=z3.;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
thanks for the quick response appreciate it , instead of needle , how can we use the bar
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
data have;
set sashelp.heart;
id+1;
if _n_=4 then stop;
keep diastolic height weight id;
format id z3.;
run;
proc transpose data=have out=want;
by id;
var diastolic height weight;
run;
data want;
set want;
col1=-col1;
run;
proc sgplot data=want;
vbar id/response=col1 group=_name_ groupdisplay=cluster clusterwidth=0.2 x2axis;
x2axis type=discrete valuesformat=z2.;
run;