Date: Wed, 10 Jun 2009 10:26:23 +0200
Reply-To: Marta García-Granero <mgarciagranero@gmail.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Marta García-Granero <mgarciagranero@gmail.com>
Subject: Re: Forest Plots
In-Reply-To: <000801c9e99f$08735da0$195a18e0$@net.au>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
This is the code I use for forest plots in meta-analysis:
* Sample dataset *.
DATA LIST LIST/ trial(F4) year(A5) study(A10) measure semeasur cilow
ciup percwi(5 F8.3).
BEGIN DATA
1 1992 Bréart-Fr .785 .248 .483 1.276 8.878
2 1992 Bréart-Bg .811 .111 .653 1.007 44.598
3 1997 Gagnon .867 .211 .573 1.311 12.237
4 1989 Hodnett .502 .332 .262 .962 4.940
5 1991 Kennell .352 .250 .216 .575 8.694
6 1998 Langer .280 .162 .203 .384 20.654
7 ---- Total .594 .074 .514 .687 100.000
END DATA.
SORT CASES BY trial(D).
VAR LABEL cilow 'Lower 95%CI' /ciup 'Upper 95%CI' /measure 'OR'
/percwi'Weights(%)'.
* GPL code (with thanks to Jon Peck, Viann Beadle and David Matheson) *.
GGRAPH
/GRAPHDATASET NAME="graphdataset" VARIABLES=study ciup cilow measure percwi
MISSING=LISTWISE REPORTMISSING=NO
/GRAPHSPEC SOURCE=INLINE TEMPLATE="C:\Temp\Forest1.sgt".
BEGIN GPL
SOURCE: s=userSource(id("graphdataset"))
DATA: study=col(source(s), name("study"), unit.category())
DATA: ciup=col(source(s), name("ciup"))
DATA: cilow=col(source(s), name("cilow"))
DATA: measure=col(source(s), name("measure"))
DATA: percwi=col(source(s), name("percwi"))
GUIDE: text.title(label("Forest plot"))
SCALE: cat(dim(1))
SCALE: log(dim(2))
COORD: rect(dim(1,2),transpose())
ELEMENT: interval(position(region.spread.range(study*(cilow+ciup))),
shape(shape.line))
ELEMENT: point(position(study*measure), shape(shape.square), size(percwi))
END GPL.
* This is the content of the chart template "Forest1.sgt" (used for some
formatting of the graph)
Copy it, paste into an empty window and save it in C:\Temp with that
name *.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<template SPSS-Version="2.2" selectPath="87 2 30 97 98 12 13 21 900 "
xmlns="http://xml.spss.com/spss/visualization"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xml.spss.com/spss/visualization
http://xml.spss.com/spss/visualization/vizml-template-3.0.xsd">
<setAxisStyle categorical="true" role="x">
<label>Study name</label>
<style color="#000000" stroke-width="0.5pt" visible="true"/>
</setAxisStyle>
<setAxisStyle categorical="false" role="y">
<label> Favours treatment Favours Control</label>
<style color="#000000" stroke-width="0.5pt" visible="true"/>
</setAxisStyle>
<addFrame count="1" type="visualization">
<location bottom="556px" left="0px" right="433px" top="0px"/>
<style color="#ffffff" color2="transparent" number="0" visible="true"/>
<style font-family="SansSerif" font-size="8pt" number="1" pattern="0"
stroke-linecap="butt" text-fit="true" visible="true"/>
</addFrame>
<setErrorBarOptions>
<style color="#000000" color2="#000000" depth="75%" pattern="0"
stroke-width="0.25pt" symbol="line" visible="true" width="0.25pt"/>
</setErrorBarOptions>
<addReferenceLine styleOnly="false" y="1.0" ycategorical="false">
<style stroke-dasharray="3px,2px" visible="true" width="1pt"/>
</addReferenceLine>
<addFrame count="1" styleOnly="true" type="legend">
<style color="transparent" color2="transparent" visible="false"/>
<style color="transparent" color2="transparent" number="0"
visible="false"/>
</addFrame>
<addFrame count="1" styleOnly="true" type="graph">
<style color="transparent" color2="transparent" visible="true"/>
<style color="#f0f0f0" color2="#000000" number="1" visible="true"/>
</addFrame>
<setStyle subtype="simple" type="scatter">
<style color="#000000" color2="#000000" symbol="square" visible="true"/>
</setStyle>
</template>
Paola Chivers wrote:
>
>
>
> Can anyone tell me if I can create a Forest Plot in SPSS? If so I
> would appreciate some help on how.
>
>
>
HTH,
Marta García-Granero
--
For miscellaneous SPSS related statistical stuff, visit:
http://gjyp.nl/marta/
=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD