I created a forest plot with multiple rows for a data set with several outcomes. For another task, I wish to have several needle plots for each level of a variable GROUP. The do I need multiple LAYOUT statements:
layout overlay ;
needleplot x = AA
y = HLA_y1
/ group = HLA_BindingLevel1
index = HLA_binding1
lineattrs = ( pattern = solid )
;
endlayout ;
layout overlay ;
needleplot x = AA
y = HLA_y2
/ group = HLA_BindingLevel2
index = HLA_binding2
lineattrs = ( pattern = solid )
;
endlayout ;
or am I missing something and I should be able to concatenate the data into rows instead of columns and have one such statement:
layout overlay ;
needleplot x = AA
y = HLA_y
/ group = HLA_BindingLevel
index = HLA_binding
lineattrs = ( pattern = solid )
;
endlayout ;
I want to include AXISTABle statements, too, to provide summary details such as the name of the row and the number of needles above a threshold.
Thank you,
Kevin
My first approach if I needed similar plots for each level of a variable would be to get the plot working for one level and then sort the data by the variables that are needed for each level and use a BY statement;
proc sgrender data=have template=templatename;
by levelvar;
<other options>;
run;
With the disclaimer that I have not tested your code, I need the needleplot stacked for comparison. A draft is attached. For the GMAP version of these maps, I stacked 40 different rows.
This graph was created with multiple LAYOUT statements.
Thank you,
Kevin
You have a couple of options for the basic graph. One would be DATAPANEL:
layout datapanel classvars=(classificationvariable) / ROWS=3
<other datapanel options>;
layout prototype;
<needleplot stuff goes here>
endlayout;
endlayout;
You can actually specify numbers of rows and columns to get side-by-side and stacked. By default each panel of the graph will have a header like "ClassificationVariable= Level of Variable" and will display the formatted value if you specify a format.
To provide number of needles it may be easiest to presummarize the data and have a variable with one value per classification level with the value and use an INSET option on the datapanel statement and INSETOPTS to control where in the plot it appears.
If you have lots of rows you will also likely have to increase the amount of space available to display everything by adjusting the ODS height option:
ods graphics /height=15in; or similar.
If you have exactly 2 classification variables you could use DATALATTICE.
OhOh. It is about ODS Graphics, Plz post it at
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.