Posted by
nina on
Aug 09, 2017; 6:08pm
URL: http://spssx-discussion.165.s1.nabble.com/Forest-plots-or-Errror-bar-charts-in-SPSS-tp1070926p5734630.html
Dear all,
my aim is to produce a forest plot with the study names (string variables) situated along the y-axis
and horizontal error bars. The x-axis will refer to the size of the correlation coefficients of the different studies.
It seems that the syntax pasted below which had been posted previously here does not work for newer versions of SPSS... Specifically, an error message pops up telling me that an "inline graph specification had been here expected" but hadn't been found. Can anybody help me modyfying the syntax? Many thanks in advance!
Best
Nina
***
http://spssx-discussion.1045642.n5.nabble.com/Forest-plots-or-Errror-bar-charts-in-SPSS-td1070926.html***
DATA LIST LIST/ trial(F4) year(A5) study(A10) measure cilow ciup percwi(4 F8.3).
BEGIN DATA
1 "1989" "Hodnett " .502 .262 .962 4.940
2 "1991" "Kennell " .352 .216 .575 8.694
3 "1992" "Bréart-Fr" .785 .483 1.276 8.878
4 "1992" "Bréart-Bg" .811 .653 1.007 44.598
5 "1997" "Gagnon " .867 .573 1.311 12.237
6 "1998" "Langer " .280 .203 .384 20.654
7 " " "Total " .594 .514 .687 100.000
END DATA.
A) Assuming you have SPSS 14:
SORT CASES BY trial(D).
STRING YearAndStudy(A30).
COMPUTE YearAndStudy=CONCAT(RTRIM(year)," ",study).
COMPUTE RefLine=1.
GGRAPH
/GRAPHDATASET NAME="graphdataset" VARIABLES=YearAndStudy ciup cilow measure percwi RefLine
MISSING=LISTWISE REPORTMISSING=NO
/GRAPHSPEC SOURCE=INLINE.