{"id":553,"date":"2015-08-01T12:52:08","date_gmt":"2015-08-01T11:52:08","guid":{"rendered":"http:\/\/pcool.dyndns.org:8080\/statsbook\/?page_id=553"},"modified":"2025-07-01T21:27:59","modified_gmt":"2025-07-01T20:27:59","slug":"forest-plot","status":"publish","type":"page","link":"https:\/\/pcool.dyndns.org\/index.php\/forest-plot\/","title":{"rendered":"Forest Plot"},"content":{"rendered":"\n<p>Forest plots are commonly used to illustrate the result of a meta-analysis graphically.<\/p>\n\n\n\n<p>Download the <a href=\"https:\/\/pcool.dyndns.org:\/wp-content\/data_files\/plottranexamic.rda\" target=\"_blank\" rel=\"noreferrer noopener\">plottranexamic.rda<\/a> dataset<sup class='sup-ref-note' id='note-zotero-ref-p553-r1-o1'><a class='sup-ref-note' href='#zotero-ref-p553-r1'>1<\/a><\/sup> for this example <a href=\"http:\/\/www.bmj.com\/content\/344\/bmj.e3054\" target=\"_blank\" rel=\"noopener\">http:\/\/www.bmj.com\/content\/344\/bmj.e3054<\/a>.<\/p>\n\n\n\n<p>This data set was also used to create a <a href=\"https:\/\/pcool.dyndns.org\/index.php\/funnel-plot\/\" data-type=\"page\" data-id=\"550\">funnel plot<\/a> to illustrate possible publication bias.<\/p>\n\n\n\n<p>The data frame tranexamic contains the data of 87 studies and has five variables: Trial (author and year), TxE (number of events in the treatment group), TxN (number of observations in the treatment group), ControlE (number of events in the control group) and ControlN (number of events in the control group). The show the data:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><em><span style=\"color: #ff0000;\">tranexamic<\/span><\/em><\/code><\/pre>\n\n\n\n<p class=\"is-style-text-annotation is-style-text-annotation--1\">output omitted for brevity<\/p>\n\n\n\n<p>The rmeta package<sup class='sup-ref-note' id='note-zotero-ref-p553-r2-o1'><a class='sup-ref-note' href='#zotero-ref-p553-r2'>2<\/a><\/sup> should be <a href=\"https:\/\/pcool.dyndns.org\/index.php\/packages\/\" data-type=\"page\" data-id=\"22\">installed<\/a> to perform the analysis and create the plot:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><em><span style=\"color: #ff0000;\">library(rmeta)<\/span><\/em>\n<em><span style=\"color: #ff0000;\">metatran &lt;-meta.MH(TxN, ControlN, TxE, ControlE, data=tranexamic, names=Trial)<\/span><\/em>\n<span style=\"color: #ff0000;\">metatran<\/span>\n<em><mark style=\"background-color:rgba(0, 0, 0, 0);color:#3306ee\" class=\"has-inline-color\">Fixed effects ( Mantel-Haenszel ) Meta-Analysis\nCall: meta.MH(ntrt = TxN, nctrl = ControlN, ptrt = TxE, pctrl = ControlE, \n    names = Trial, data = tranexamic)\nMantel-Haenszel OR =0.41    95% CI ( 0.37, 0.46 )\nTest for heterogeneity: X^2( 75 ) = 129.01 ( p-value 1e-04 )<\/mark><\/em><\/code><\/pre>\n\n\n\n<p>A more detailed analysis can be obtained:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><em><span style=\"color: #ff0000;\">summary(metatran)<\/span><\/em>\n<em><mark style=\"background-color:rgba(0, 0, 0, 0);color:#3406f6\" class=\"has-inline-color\">Fixed effects ( Mantel-Haenszel ) meta-analysis\nCall: meta.MH(ntrt = TxN, nctrl = ControlN, ptrt = TxE, pctrl = ControlE, \n    names = Trial, data = tranexamic)\n------------------------------------\n                        OR (lower  95% upper)\nRybo 1972              NaN    0.00        NaN\nHorrow 991            0.84    0.33       2.11\n.....\n.....\nCrescenti 2011        0.42    0.24       0.75\nKulkarni 2011         0.80    0.42       1.51\n------------------------------------\nMantel-Haenszel OR =0.41 95% CI ( 0.37,0.46 )\nTest for heterogeneity: X^2( 75 ) = 129.01 ( p-value 1e-04 )<\/mark><\/em><\/code><\/pre>\n\n\n\n<p>When different studies show different results, this can be due to chance (study homogeneity) or genuine differences (study heterogeneity). The Chi squared thest for hetetogeneity is significant<sup class='sup-ref-note' id='note-zotero-ref-p553-r3-o1'><a class='sup-ref-note' href='#zotero-ref-p553-r3'>3<\/a><\/sup>. Overall, the odds ratio (Mantel Haenszel method) is 0.41 favouring treatment with tranexamic acid.<\/p>\n\n\n\n<p>To show the plot:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><em><span style=\"color: #ff0000;\">plot(metatran)<\/span><\/em><\/code><\/pre>\n\n\n\n<p>This creates a large (scalable) plot. That has been omitted for brevity. To show a plot based on studies 10 to 25:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><span style=\"color: #ff0000;\"><em>metatran2 &lt;-meta.MH(TxN, ControlN, TxE, ControlE, data=tranexamic, names=Trial, subset=c(10:25))<\/em><\/span>\n<span style=\"color: #ff0000;\"><em>metatran2<\/em><\/span>\n<em><mark style=\"background-color:rgba(0, 0, 0, 0);color:#2e08f4\" class=\"has-inline-color\">Fixed effects ( Mantel-Haenszel ) Meta-Analysis\nCall: meta.MH(ntrt = TxN, nctrl = ControlN, ptrt = TxE, pctrl = ControlE, \n    names = Trial, data = tranexamic, subset = c(10:25))\nMantel-Haenszel OR =0.34    95% CI ( 0.26, 0.45 )\nTest for heterogeneity: X^2( 14 ) = 40.95 ( p-value 2e-04 )<\/mark><\/em><\/code><\/pre>\n\n\n\n<p>A more detailed analysis can be obtained by:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><em><mark style=\"background-color:rgba(0, 0, 0, 0);color:#f00a19\" class=\"has-inline-color\">summary(metatran2)<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0);color:#560af0\" class=\"has-inline-color\">\nFixed effects ( Mantel-Haenszel ) meta-analysis\nCall: meta.MH(ntrt = TxN, nctrl = ControlN, ptrt = TxE, pctrl = ControlE, \n    names = Trial, data = tranexamic, subset = c(10:25))\n------------------------------------\n                        OR (lower  95% upper)\nHiippala 1995         0.17    0.02       1.67\nKatsaros 1996         0.35    0.16       0.74\nZonis l996            0.06    0.01       0.74\nBenoni 1996           0.18    0.07       0.48\nShore-Lesserson 1996  0.12    0.01       1.14\nMenichetti 1996       0.33    0.10       1.13\nKatoh 1997            0.27    0.09       0.79\nHiippala 1997         0.09    0.03       0.31\nPinosky 1997          1.36    0.39       4.79\nBrown 1997            0.21    0.08       0.55\nHardy 1998            1.26    0.52       3.05\nMisfeld 1998           NaN    0.00        NaN\nSorin 1999            0.06    0.01       0.36\nJansen 1999           0.06    0.01       0.36\nNuttall 2000          0.52    0.22       1.24\nBenoni 2000           3.07    0.75      12.59\n------------------------------------\nMantel-Haenszel OR =0.34 95% CI ( 0.26,0.45 )\nTest for heterogeneity: X^2( 14 ) = 40.95 ( p-value 2e-04 )<\/mark><\/em><\/code><\/pre>\n\n\n\n<p>This meta-analysis only includes studies 10 to 25 and the overall odds ratio is 0.34 favouring treatment with tranexamic acid.<\/p>\n\n\n\n<p>The plot containing the meta-analysis of study 10 to 25:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><em><span style=\"color: #ff0000;\">plot(metatran2)<\/span><\/em><\/code><\/pre>\n\n\n\n<p>To add a title and indicate odds ratios that favour treatment or control group:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><em><span style=\"color: #ff0000;\">title(main='Forest Plot Meta Analysis Tranexamic Acid')<\/span><\/em>\n<em><span style=\"color: #ff0000;\">text(3,-21,\"Favour Control\")<\/span><\/em>\n<em><span style=\"color: #ff0000;\">text(0.3,-21,\"Favour Treatment\")<\/span><\/em><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"765\" src=\"https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/forestplot-1024x765.png\" alt=\"\" class=\"wp-image-3146\" srcset=\"https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/forestplot-1024x765.png 1024w, https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/forestplot-300x224.png 300w, https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/forestplot-768x574.png 768w, https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/forestplot-1536x1147.png 1536w, https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/forestplot-2048x1530.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The large diamond at the bottom of the plot indicates the overall effect (odds ratio 0.34); favouring treatment with tranexamic acid. Individual studies are indicated on the y-axis. The effect of each study is indicated by a black rectangle. The vertical dotted reference line, indicates no effect (odds ratio 1.0). The larger the weight of the individual study, the larger the size of the rectangle. Studies with more weight have more patients and consequently narrower confidence intervals (indicated by the horizontal grey lines). The studies with wider confidence intervals contribute less to the overall effect and have smaller rectangles<sup class='sup-ref-note' id='note-zotero-ref-p553-r4-o1'><a class='sup-ref-note' href='#zotero-ref-p553-r4'>4<\/a><\/sup>. Overall, 12 studies favoured treatment with tranexamic acid and 3 didn&#8217;t.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Forest plots are commonly used to illustrate the result of a meta-analysis graphically. Download the plottranexamic.rda dataset for this example http:\/\/www.bmj.com\/content\/344\/bmj.e3054. This data set was also used to create a funnel plot to illustrate possible publication bias. The data frame tranexamic contains the data of 87 studies and has five variables: Trial (author and year), [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"footnotes":""},"class_list":["post-553","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/pages\/553","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/comments?post=553"}],"version-history":[{"count":1,"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/pages\/553\/revisions"}],"predecessor-version":[{"id":4751,"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/pages\/553\/revisions\/4751"}],"wp:attachment":[{"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/media?parent=553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}