{"id":550,"date":"2015-08-01T12:51:58","date_gmt":"2015-08-01T11:51:58","guid":{"rendered":"http:\/\/pcool.dyndns.org:8080\/statsbook\/?page_id=550"},"modified":"2025-07-01T21:17:33","modified_gmt":"2025-07-01T20:17:33","slug":"funnel-plot","status":"publish","type":"page","link":"https:\/\/pcool.dyndns.org\/index.php\/funnel-plot\/","title":{"rendered":"Funnel Plot"},"content":{"rendered":"\n<p>There are two types of funnel plot used in the scientific literature. One is used to check for the presence of publication bias in a meta-analysis. The other is used to compare institutional performance.<\/p>\n\n\n\n<p><strong>Funnelplot to check for publication bias<sup class='sup-ref-note' id='note-zotero-ref-p550-r1-o1'><a class='sup-ref-note' href='#zotero-ref-p550-r1'>1<\/a><\/sup>:<\/strong><\/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 for this example<sup class='sup-ref-note' id='note-zotero-ref-p550-r2-o1'><a class='sup-ref-note' href='#zotero-ref-p550-r2'>2<\/a><\/sup><\/p>\n\n\n\n<p><a href=\"http:\/\/www.bmj.com\/content\/344\/bmj.e3054\" target=\"_blank\" rel=\"noopener\">http:\/\/www.bmj.com\/content\/344\/bmj.e3054<\/a><sup class='sup-ref-note' id='note-zotero-ref-p550-r3-o1'><a class='sup-ref-note' href='#zotero-ref-p550-r3'>3<\/a><\/sup><\/p>\n\n\n\n<p>The data frame is called tranexamic and contains the details of 87 studies included in the meta-analysis. The data can be seen by entering:<\/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 variables are: Trial (authors and date of the trial), 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 observations in the control group).<\/p>\n\n\n\n<p>To create a funnel plot the meta package<sup class='sup-ref-note' id='note-zotero-ref-p550-r4-o1'><a class='sup-ref-note' href='#zotero-ref-p550-r4'>4<\/a><\/sup> should be <a href=\"https:\/\/pcool.dyndns.org\/index.php\/packages\/\" data-type=\"page\" data-id=\"22\">installed<\/a>. To perform meta-analysis, using the <strong>fixed<\/strong> and <strong>random<\/strong> effects models, showing the odds ratio:<\/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:#f60404\" class=\"has-inline-color\">library(meta)\nmetatranexamic&lt;-metabin(TxE,TxN,ControlE,ControlN,data=tranexamic,sm=\"OR\")<\/mark><\/em><\/code><\/pre>\n\n\n\n<p>To show the details of the analysis:<\/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\">metatranexamic<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0);color:#090cf0\" class=\"has-inline-color\">\nNumber of studies: k = 87\nNumber of observations: o = 8110 (o.e = 4209, o.c = 3901)\nNumber of events: e = 2505\n\n                         OR           95%-CI      z  p-value\nCommon effect model  0.4113 &#091;0.3679; 0.4597] -15.64 &lt; 0.0001\nRandom effects model 0.4016 &#091;0.3388; 0.4759] -10.52 &lt; 0.0001\n\nQuantifying heterogeneity (with 95%-CIs):\n tau^2 = 0.2344 &#091;0.1218; 0.6578]; tau = 0.4841 &#091;0.3490; 0.8111]\n I^2 = 43.2% &#091;26.6%; 56.0%]; H = 1.33 &#091;1.17; 1.51]\n\nTest of heterogeneity:\n      Q d.f.  p-value\n 151.31   86 &lt; 0.0001\n\nDetails of meta-analysis methods:\n- Mantel-Haenszel method (common effect model)\n- Inverse variance method (random effects model)\n- Restricted maximum-likelihood estimator for tau^2\n- Q-Profile method for confidence interval of tau^2 and tau\n- Calculation of I^2 based on Q\n- Continuity correction of 0.5 in studies with zero cell frequencies<\/mark><\/em><\/code><\/pre>\n\n\n\n<p>Both, the fixed and random effects model show a significantly different odds ratio (p&lt;0.0001). When different studies show different results, this can be due to chance (study homogeneity) or genuine differences (study heterogeneity). The value of I squared<sup class='sup-ref-note' id='note-zotero-ref-p550-r5-o1'><a class='sup-ref-note' href='#zotero-ref-p550-r5'>5<\/a><\/sup> shows moderate heterogeneity (44%) with a significant p value.<\/p>\n\n\n\n<p>To show the funnel plot with an appropriate title:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><em><span style=\"color: #ff0000;\">funnel(metatranexamic)<\/span><\/em>\n<em><span style=\"color: #ff0000;\">title(main='Meta Analysis Tranexamic Acid')<\/span><\/em><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/tranexamicplot-1024x768.png\" alt=\"\" class=\"wp-image-3829\" srcset=\"https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/tranexamicplot-1024x768.png 1024w, https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/tranexamicplot-300x225.png 300w, https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/tranexamicplot-768x576.png 768w, https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/tranexamicplot.png 1355w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The plot shows an an overall odds ratio of approximately 0.5, favouring treatment with tranexamic acid.<\/p>\n\n\n\n<p>Please note that the vertical axis has a reverse scale, so the larger studies (with a smaller standard error) are on the top of the graph and the smaller studies are at the bottom of the graph. The odds ratio scale (horizontal) is logarithmic. An odds ratio of less than 1.0 indicates a positive (less bleeding) effect of tranexamic acid and an odds ratio larger than 1.0 suggests no effect. Without publication bias, the plot is pyramid shaped. A skewed plot indicates publication bias. In this plot, there are equal number of larger studies with a positive or negative effect. However, all smaller studies (lower part of the plot) show a positive effect (OR &lt; 1) of tranexamic acid (there are no studies in the lower (right) part that have an odds ratio &gt; 1.0). This indicates publication bias of smaller studies; only smaller studies that showed a positive effect of tranexamic acid were published.<\/p>\n\n\n\n<p><strong>Funnelplot to compare institutional performance<sup class='sup-ref-note' id='note-zotero-ref-p550-r6-o1'><a class='sup-ref-note' href='#zotero-ref-p550-r6'>6<\/a><\/sup><sup class='sup-ref-note' id='note-zotero-ref-p550-r7-o1'><a class='sup-ref-note' href='#zotero-ref-p550-r7'>7<\/a><\/sup>:<\/strong><\/p>\n\n\n\n<p>A different type of funnel plot can be used to compare institutional or surgical performance. The National Joint Registry <sup class='sup-ref-note' id='note-zotero-ref-p550-r8-o1'><a class='sup-ref-note' href='#zotero-ref-p550-r8'>8<\/a><\/sup> has used these plots to show differences in standardised mortality rate between surgeons and institutions.<\/p>\n\n\n\n<p>Download the <a href=\"https:\/\/pcool.dyndns.org:\/wp-content\/data_files\/plotfunnelhip.rda\" target=\"_blank\" rel=\"noreferrer noopener\">plotfunnelhip.rda<\/a> dataset for this example. To create this type of funnel plot, the package &#8216;berryFunctions&#8217; <sup class='sup-ref-note' id='note-zotero-ref-p550-r9-o1'><a class='sup-ref-note' href='#zotero-ref-p550-r9'>9<\/a><\/sup> should be <a href=\"https:\/\/pcool.dyndns.org\/index.php\/packages\/\" data-type=\"page\" data-id=\"22\">installed<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><em><span style=\"color: #ff0000;\">library(berryFunctions)<\/span><\/em><\/code><\/pre>\n\n\n\n<p>The data frame is called plotfunnelhip and has the variables: surgeon, cases (number of cases) and revisions (number of revisions).&nbsp; To show the data frame:<\/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:#f50717\" class=\"has-inline-color\">plotfunnelhip<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0);color:#3507f5\" class=\"has-inline-color\">\n   surgeon cases revisions\n1        1    49        15\n2        2     9         3\n3        3   128         8\n4        4    53         3\n5        5   321        24\n6        6   256        26\n7        7   125         9\n8        8    51         5\n9        9    48         6\n10      10    60         5<\/mark><\/em><\/code><\/pre>\n\n\n\n<p>To create the funnel plot:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><em><span style=\"color: #ff0000;\">funnelPlot(plotfunnelhip$revisions, plotfunnelhip$cases, xlab='Number of Hip Replacements', ylab='Percentage Revisions (%)', main='Funnel Plot THR')<\/span> <\/em><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/funnelplot-1024x768.png\" alt=\"\" class=\"wp-image-3187\" srcset=\"https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/funnelplot-1024x768.png 1024w, https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/funnelplot-300x225.png 300w, https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/funnelplot-768x576.png 768w, https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/funnelplot.png 1355w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The horizontal orange line indicates the mean number of revisions (13%). The &#8216;funnel&#8217; is created by the confidence intervals as indicated. The more procedures a surgeon does, the smaller the standard error (and the narrower the funnel).<\/p>\n\n\n\n<p>In this plot, most (8) surgeons are below the mean. However, two surgeons are well above the mean; one almost two standard deviations and one more than three standard deviations. There may well be a very valid reason why one surgeon has a revision rate more than three standard deviations above the mean, but this would require further evaluation.<\/p>\n\n\n\n<p>To find the mean:<\/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:#f7051e\" class=\"has-inline-color\">percentage &lt;- 100*plotfunnelhip$revisions\/plotfunnelhip$cases\nmean(percentage)<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0);color:#2d06f8\" class=\"has-inline-color\">\n&#091;1] 13.13261<\/mark><\/em><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>There are two types of funnel plot used in the scientific literature. One is used to check for the presence of publication bias in a meta-analysis. The other is used to compare institutional performance. Funnelplot to check for publication bias: Download the plottranexamic.rda dataset for this example http:\/\/www.bmj.com\/content\/344\/bmj.e3054 The data frame is called tranexamic and [&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-550","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/pages\/550","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=550"}],"version-history":[{"count":2,"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/pages\/550\/revisions"}],"predecessor-version":[{"id":4749,"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/pages\/550\/revisions\/4749"}],"wp:attachment":[{"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/media?parent=550"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}