BookmarkSubscribeRSS Feed
Ashwini_uci
Obsidian | Level 7

ANy ideas about how to  create a forest plot in SAS? or in Excel?

Here is the data that i have to plot the forest plot

This is how my plot looks like..

20 REPLIES 20
Ashwini_uci
Obsidian | Level 7

Thanks Rick for this, it helps. Is there also a way in Excel to do the forest plot?

Reeza
Super User

You need to calculate the data for the forest plot in Excel.

Basically, you create a scatterplot with error bars (google this and you'll find a lot of examples and detailed instructions). And add a reference line at 1 manually or with another series.

http://www.stattools.net/ForestPlot_Exp.php

About halfway down the page.

Ashwini_uci
Obsidian | Level 7

Thanks Reeza for your response, Yes, I do have the data and i have already viisted the link that you have given here. I was stuck at the log scale conversion step and couldnot prooceed further, so still trying to look up for more help..

Reeza
Super User

What version of Excel do you have? In 2003 you right click your x axis>Format Axis>Scale at the bottom is the check box for log scale.

This depends on what the scale of your data is.

You can alos modify where the line is by changing the Value(Y) axis Crosses at in the same dialog box to 1 if you're doing OR plots.

Another and better option if your comparing OR's from SAS in my opinion is turning on ODS graphics for proc logistics. The default procedure will produce something similar to a forest plot. Obviously this isn't appropriate if you're doing a meta analysis.

Ashwini_uci
Obsidian | Level 7

I have attached the data in the original post now. Please have a look at it.. somehow , the graph only  hows UCL and OR. and shows LCL only for one data point. Somehting is wrong there.

Mine is windows XP, excel 2003 , .

Ashwini_uci
Obsidian | Level 7

now i have attached the file in which you  can see how it looks like.. i tried it again, biut not sure why it is vertical and ot horizontal..

Any idea?

Reeza
Super User

Create a scatter plot of ONLY your OR and have the Y values be 1/2/3 etc, some count that puts them in the order you want to display and the OR along the X axis.

Change your graph to not show any gridlines, except the one at y=1

Calculate the +/- values for each arm (based on the CI you already have).

Add x error bars individually for each point based on the +/- bars

Right click on the error bars and format them to not have the end points.

A very very manual process in my opinion which is why SAS and SGPLOT are useful

Ashwini_uci
Obsidian | Level 7

Okay I understadn until step3.

For step 4, how do i add x error bars...not sure of that.

I have got 3 different ORs (with CI) after running 3 different Proc logistics. So even if i want to create the forest plot in SAS, how do i do that by turning on ODS graphic whie running any one of the proc logistic?

Reeza
Super User

Right click points and Format Data Series, one of the tabs is X error bars.

Ashwini_uci
Obsidian | Level 7

Great Reeza,.. this seems to work. I am almost there BUT NOW .. it is not letting me select one point at a time, I have 3 diff ORs with  diff LCL and UCL. I am not able to select each point at a time and enter its LCL and UCL.. How do i do that?

And at what point should I change the scale to log scale.?

Ashwini_uci
Obsidian | Level 7

Thanks som much Reeza, for helping me with this. But i have had any success yet to create this forest plot.  Its just not letting me  select each point at a time and enter its LCL and UCL.. How do i do that?

And at what point should I change the scale to log scale.?

Appreciate if you cvould guide me with this until its completion..

Ashwini_uci
Obsidian | Level 7

**Have NOT had any success yet...

Reeza
Super User

Here's an example.

I only have Excel 2010 at home so hopefully it works.

Good luck.

sas-innovate-2024.png

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.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 20 replies
  • 5739 views
  • 0 likes
  • 5 in conversation