- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Everyone,
I have just started my Graduate degree, and for my meta-analysis course we are using SAS.
I have never used this program, as my preferred STATS program in my undergrad was RStudio.
I have managed to import my data set and generate a table for it in SASuniversity.
I now need to make a funnel plot and forest plot, but do not even know where to start (and our course has no guidelines).
If anyone is able to help me with this, I would be forever grateful! I have attached my data set, and below is my code I used to import and generate a table for the first steps of my homework.
Code:
PROC IMPORT DATAFILE="/folders/myfolders/sasuser.v94/MOZARTlecture4/Mozart_dataset.xlsx"
OUT=WORK.mozart_data
DBMS=XLSX
REPLACE;
RUN;
/** Print the results. **/
PROC PRINT DATA=WORK.mozart_data; RUN;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Start by googling. Sanjay, me, and others have all written extensively about forest plots.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I need a beginners step by step guide.
Are there any books your would recommend?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
My usual approach is to find something similar enough, make sure the example code works and then wrangle my data into the same format the example data used.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Here are a few hints to help you get started:
- The main plotting procedure is PROC SGPLOT.
- The most common way to create a forest plot is to plot the average effect (MD) on the X axis and the study ID (Study_ID ) on the vertical axis. This is done by using the SCATTER statement. So read about the SCATTER statement. STEP 1: Create a scatter plot of these two variables.
- There are two different treatments in the studies. It would be nice to draw them in different colors, right? Look up the GROUP= option on the SCATTER statement. STEP 2: modify the scatter plot so that it displays the two treatments in different colors.
- To incorporate the confidence limits, look up examples of how to use the XERRORLOWER= and XERRORUPPER= options. STEP 3: Modify the scatter plot to incorporate the confidence limits. I do not know what LCL is versus LCL_2, so ask your instructor or a friend how you should create the confidence limits.
- Sometimes in a forest plot, it is useful to plot a reference line at 0 to show which studies had CLs that included 0 ("no difference") as a possible conclusion. You can look up the REFLINE statement to see how to add a reference line at x=0 on the X axis. STEP 4 (optional): Add a reference line at MD=0.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Calling @Rick_SAS for funnel plot.
Rick just wrote a blog about it . Search at
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Making forest plots is generally a tedious process when it comes to actually performing the analysis and putting the data set together. It looks like you've already done this for the most part. From there you can use simple tools like SCATTER, HIGHLOW, and YAXISTABLE in SGPLOT to take care of the heavy lifting. I have a paper/macro that makes forest plots while also automating the analysis, but perhaps you'd be interested in reading about the methods I use (which are a bit more advanced).
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
This blog post has complete code on how you make a Forest plot using data that you have available in SAS as a sample data set. You can then replace the data with your own data:
https://blogs.sas.com/content/graphicallyspeaking/2017/10/22/tips-tricks-segmented-discrete-axis/