*! version 4.07 David Fisher 15sep2023

Title

forestplot -- Create forest plots from data currently in memory

Syntax

forestplot [ES lci uci] [if] [in] [, options]

Main
eform_option exponentiate effect sizes and confidence limits

effect(string) title for "effect size" column in the output

favours(favours_option) x-axis labelling specific to forest plots

labels(varname) variable containing labels e.g. subgroup headings, heterogeneity info, study names

lcols(varlist) rcols(varlist) display columns of additional data

prefix(prefix) specify that a prefix was previously added to default variable names; see metan

nonames suppress display of study names in left-hand column

nonull null(#) suppress, or override default x-intercept of, null hypothesis line

nooverall nosubgroup nohet suppress display of observations containing overall, subgroup,
or heterogeneity data (see use(varname))

nostats nowt suppress display of effect estimates and/or weights in right-hand columns

xlabel(...) xtick(...) x-axis ticks and labels as described under axis_label_options, but see below

twoway_options other Stata twoway graph options, as appropriate

Advanced
dataid(varname [, newwt]) define groups of observations making up a complete forestplot

double allow column text to run over two lines in the plot

dp(#) number of decimal places with which to format effect sizes, confidence intervals and predictive distributions

leftjustify left-justify all data columns

maxlines(#) maxwidth(#) override the defaults used by forestplot when spreading column title strings over multiple lines

nokeepvars suppress saving of formatted effect-size data in new variable _EFFECT; see saved results

plotid(varname [, list nograph]) define groups of observations in which
to apply specific plot rendition options

rfdist(rflci rfuci) display confidence intervals for predictive distributions
(typically generated by metan or ipdmetan)

useopts use set of forestplot options previously supplied to metan, ipdmetan or ipdover

usestrict check that data is consistent with the interpretation of use(use) as defined in the Description section

Fine-tuning
noadjust suppress "space-saving" adjustment to text/data placement

astext(#) percentage of plot width to be taken up by columns of text

range([numlist] [min] [max]) x-axis limits of data plotting area

cirange([numlist] [min] [max]) x-axis limits of plotted confidence intervals

savedims(matname), usedims(matname) save and load sets of dimensional parameters for forest plot

spacing(#) vertical gap between lines of text in the plot

textsize(#) fine-tune the text size

Plot rendition
plotopts(plot_options) affect rendition of all observations

plot#opts(plot_options) affect rendition of observations in #th plotid group

hlineopts(plot_options) affect rendition of horizontal line above data and below column headings

nlineopts(plot_options) affect rendition of null line

nobox suppress weighted boxes; markers for point estimates only are shown

boxscale(#) box size scaling

nodiamonds replaces pooled-effect diamonds with markers and horizontal lines, similar to individual studies

classic use "classic" set of plot options, as in metan9

interaction use "interaction" set of plot options

where plot may be box, ci, diam, oline, ociline,
point, pci, ppoint, rf or rfciline

and plot_options are marker_options, line_options or area_options as appropriate,
with some additional options as described below.

Description

forestplot creates forest plots from variables containing point estimates and lower/upper confidence limits.
The aggregate-data meta-analysis program metan calls forestplot by default, and passes on any relevant options.
The individual participant data (IPD) meta-analysis programs ipdmetan and ipdover (Fisher 2015) also make use of forestplot.
All these programs can also save datasets with additional information that forestplot recognises (see saved datasets).
Alternatively, forestplot can simply be run on data currently in memory.

If variables ES, lci and uci are not supplied, forestplot will expect to find variables in memory named _ES, _LCI and _UCI.
In either case, these three variables should represent the effect size (point estimate) and lower/upper confidence limits on the interval scale (i.e. not exponentiated).

By default, forestplot will also check for variables named _USE, _WT and _LABELS.
If the dataset in memory was created by metan, ipdmetan or ipdover,
these variables should already exist (see saved datasets).
Otherwise (or if the user wishes not to use these variables), any of options use(use), wgt(wgt) or labels(labels)
may be supplied, containing alternative varnames.

If the option prefix(prefix) is specified, forestplot will instead check for variables named
prefix_ES, prefix_USE and so on; see metan.

The meaning of these variables is as follows:

_USE or use an indicator of the contents of each observation
(study effects, titles, spacing, description of heterogeneity, etc); see below

_WT or wgt observation weights; that is, the relative size of markers in the forest plot

_LABELS or labels labels for the left-most column of the forest plot, usually containing
study names, subgroup titles and heterogeneity details

If neither the default varname or an alternative is found, use and wgt will default to 1 throughout.

The values of _USE or use are interpreted by forestplot in the following way:

0 = subgroup labels (headings); general text

1 = non-missing study estimates

2 = missing study estimates

3 = subgroup pooled effects

4 = heterogeneity information; assumed to be present only in the first left-hand column

5 = overall pooled effect

6 = blank line

7 = prediction interval data

Note that forestplot creates a variable named _EFFECT containing a string-valued concatenation of the (formatted) effect size
and confidence limits, which by default is plotted in a column to the right of the plotted data.
If a variable _EFFECT was previously created by metan (see saved datasets),
then it will be overwritten by forestplot.
Hence, to avoid losing information stored in the existing variable (such as user-inserted p-values), you can specify
the option rcols(_EFFECT) in conjunction with nostats when running forestplot.
This tells forestplot that instead of
creating (and hence overwriting) _EFFECT, it should instead use the existing variable as a standard column of data.
(The weight variable _WT will typically also need to be added to rcols(), along with the nowt option,
to maintain the default ordering of data columns.)
This technique is demonstrated in the penultimate example.

Options

Main

eform_option specifies that the effect sizes and confidence limits should be exponentiated.
The option also generates a heading for the effect size column in the output (table and forest plot).

Note that forestplot expects effect sizes to be beta coefficients (i.e. on the linear scale).

effect(string) specifies a heading for the effect size column in the output.
This overrides any heading generated by eform_option.

favours(favours_option) applies a label saying something about the treatment effect to either side of the graph,
with the following syntax (carried over from metan9):

favours(left_text # right_text [, suboptions])

where left_text and right_text may consist of multiple lines of text delimited by quotes,
as described in title_options;
and suboptions are any axis_label_options relevant to text rather than to label values.
In addition, the following suboptions may be used:

nosymmetric overrides the default symmetric placement of left and right labels about the null line.
Instead, the labels are independently placed midway between the null line and the extremity of the plot region.

fp(#) specifies an x-axis value for one or other of the labels; the other is then placed symmetrically about the null line.

lcols(varlist) and rcols(varlist) define columns of additional data to the left or right of the graph.
These options work in exactly the same way as in metan when specified directly to forestplot.

By default, the first column on the left will contain study names/identifiers, and the first two columns on the right
will contain effect sizes and confidence intervals, and study weights
(unless suppressed using the options nonames, nostats and nowt respectively).
Columns specified in lcols() and rcols() will appear next to these in the order supplied.

Note: These options have a different syntax when specified to ipdmetan.

nonull and null(#) affect the null hypothesis line.
By default, this line appears at x=0, or x=1 if eform_option is specified.
null(#) overrides this, whilst nonull suppresses the display of the line.
Note that both may be specified simultaneously; the placement of the line
affects other characteristics of the plot even if the line itself does not appear.

xlabel(...) and xtick(...) have the same syntax as described under axis_label_options,
except for the following points:

If eform_option is specified, the x-axis is automatically shown on an expontiated scale, with a value of 1 indicating a null effect.
Hence, values supplied to xlabel() and xtick() are interpreted on this scale; e.g. values of 0.5 and 2 would appear symmetrically
either side of the null line. A similar interpretation also applies to fp(#) and null(#).

An alternative to range() (see below) is to allow force as an additional sub-option to xlabel().
The smallest and largest values supplied to xlabel() then become the plotted limits of study confidence intervals and effect sizes.
(Note: the force option is carried over from metan9).

Advanced

dataid(varname [, newwt]) define groups of observations making up a complete forest plot.
It may be that the data in memory comes from multiple separate meta-analyses, to be plotted
within the same plot region (see region_options) and with the same axes, labels, headings etc.
Specifying dataid() tells forestplot about this structure, resulting in correct placement of overall and/or subgroup effect lines.
Note that dataid() does not alter the placement or ordering of data within the plot.

The newwt suboption requests that weighted box scaling is normalised within levels of varname.

double allows the text of variables specified in lcols() and rcols() to run over two lines in the plot.
This may be of use if long strings are to be used.

dp(#) specifies the number of decimal places to format the effect sizes.

See also options savedims() and usedims().

leftjustify left-justifies all data columns, rather than applying the formatting
of each variable as currently in memory.

Note that metan will left-justify string variables
before creating "results sets", including the left-most "study name" column.
However, individual variables in lcols(), rcols() or labels(), whether numeric or string,
may be formatted within the dataset before running forestplot or metan.
(If using ipdmetan or ipdover, formatting may also be applied within the cols_info syntax).

maxlines(#) and maxwidth(#) may help in circumstances where forestplot gives suboptimal formatting
for the titles of one or more data columns. They override some of the defaults used by forestplot when
cutting up and spreading column title strings over multiple lines.

maxlines(#) increases the number of lines over which a column title can be spread, from the default of 3.
This may be useful when the title is lengthy but consisting of mostly short words.

maxwidth(#) increases the maximum permitted width (i.e. length) of each line of a column title.
This may be useful when the width of the column data is small compared to that of the column title.

plotid(varlist [, list nograph]) specifies one or more categorical variables
to form a series of groups of observations in which specific aspects of plot rendition may be affected
using box#opts, ci#opts etc.
The groups of observations will automatically be assigned ordinal labels (1, 2, ...) based on the ordering of varlist.
Note that plotid() does not alter the placement or ordering of data within the plot.

The contents of each group may be inspected with the list option.
In complex situations it may be helpful to view this list without creating the plot itself;
this may be achieved using the nograph option.

rfdist(varlist) specifies two variables containing the lower and upper limits of prediction intervals
associated with pooled estimates. As such, observations containing prediction interval data should have use = 3 or 5.
See the metan option rfdist for more information.

Rendering of prediction intervals may be controlled using the rfopts() and rf#opts() options.

useopts applies a list of previously-saved options.

useopts is useful when a "results set" saved by metan
is loaded and edited before running forestplot to create the final plot.
Any options supplied to metan with relevance to the forest plot
(mostly, but not exclusively, those supplied as forestplot() sub-options)
are saved within the "results set" as data charateristics, and may subsequently be applied by specifying useopts.
If an option name found in useopts is also supplied as an option to forestplot in the standard way,
then the option within useopts will be overridden.

Note that useopts typically also contains information on varlist, use(), wgt() and labels().

usestrict checks that the data is consistent with use. Since forestplot will otherwise go ahead and
interpret the data on the basis of the observed values of use, this might be a useful way of investigating why a plot did not look as intended.
Specifically, usestrict checks that:

ES, lci and uci are non-missing if use == 1

ES, lci, uci and wgt are missing if use == 2

labels and wgt are missing if use == 6 (unless nonames or nowt are supplied, respectively)

values of use are between 0 and 6 inclusive.

Fine-tuning

These options allow fine-tuning of the plot construction and text/data placement.
Forest plots are non-standard twoway plots, and have features that Stata graphs were not designed to accommodate
(e.g. columns of text, and a wide range of potential aspect ratios). Occasionally, therefore, forestplot
will produce unsatisfactory results, which may be improved by use of one or more of these options.

noadjust suppresses a calculation within forestplot which sometimes results
in text overlapping the plotted data.

This calculation, carried over from metan9, attempts to take advantage of the fact that pooled-estimate
diamonds have less width than individual study estimates, whilst their labelling text is often longer,
to "compress" the plot and make it more aesthetic.

astext(#) specifies the percentage of the width of the plot region to be taken up, in total, by columns of text.
The default is 50 and the percentage must be in the range 10-90.

boxscale(#) controls scaling of weighted boxes. The default is 100 (as in a percentage) and may be increased
or decreased as such (e.g., 80 or 120 for 20% smaller or larger respectively).

range(), cirange() give finer control over the
range of the x-axis within which the graph is constructed, and within which the data is plotted.
These options may be used, for instance, to create or reduce blank space between the data and either the
left or right columns of text or data.
(Note that blank space may also be created or reduced by appropriate formatting of column variables.)

range([numlist] [min] [max]) specifies the boundary between the part of the x-axis
within which the graph will appear, and the parts containing columns of text or data (see lcols(), rcols()).
min and max are shorthand for the smallest and largest values among the data to be plotted.
If min is specified, then range() also implies noadjust.

cirange([numlist] [min] [max]) specifies the plotted limits of study confidence intervals and effect sizes.
Data outside this range will be represented by off-scale arrows.
min and max are shorthand for the smallest and largest values among the data to be plotted.

Note: the documented option range() as a sub-option to xscale() should not be used with forestplot,
as it will almost certainly not give the desired effect.
However, other xscale() sub-options such as lcolor() may be used.

savedims(matname) saves certain values ("dimensions") associated with the current forest plot in a matrix,
so that they may be applied via usedims(matname) to a subsequent forest plot.
These values, which are also saved in r(), include the calculated optimum text size, aspect ratio, vertical spacing, and
the display width of the different parts of the plot.

spacing(#) alters the vertical gap between lines of text.
Increasing it has the side-effect of making the text size smaller, and vice versa.
Default values are 1.5 if the plot is "tall" (many studies) or 2 if the plot is "wide" (few studies).

textsize(#) applies a correction factor to the default text size.
# is a percentage of the default size, such that textsize(100) represents no change.
Note that forestplot takes spacing(#) into account when determining optimum values for text size and plot layout;
whereas textsize(#) is applied post hoc.

Plot rendition

These options specify sub-options for individual components making up the forest plot,
each of which is drawn using a separate twoway command.
Any sub-options associated with a particular twoway command may be used,
unless they would conflict with the appearance of the graph as a whole.
For example, confidence intervals are plotted using the twoway rspike command, so line_options may be used,
but not horizontal or vertical.
As with any Stata twoway command, default plot options will be taken from the current graph scheme.

hlineopts(line_options) affects the rendition of the horizontal line above the data and below the column headings.

boxopts(marker_options) and box#opts(marker_options)
affect the rendition of weighted boxes representing point estimates
and use options for a weighted marker (e.g., shape, colour; but not size).

ciopts([line_options] [nooverlay] [rcap]) and ci#opts([line_options] [rcap])
affect the rendition of confidence intervals.
The additional option nooverlay draws confidence interval lines behind weighted boxes rather than overlaying them
(note: cannot be specified with ci#opts()).
The additional option rcap requests capped spikes.

diamopts(area_options) and diam#opts(area_options)
affect the rendition of diamonds representing pooled estimates.

nlineopts([line_options] [nooverlay]) affects the rendition of the null hypothesis line.
The additional option nooverlay draws this line first, and places data features (e.g. weighted boxes, confidence interval lines) on top.

olineopts([line_options] [nooverlay]) and oline#opts(line_options)
affect the rendition of overall effect lines.
The additional option nooverlay draws these lines first, and places data features (e.g. weighted boxes, confidence interval lines) on top
(note: cannot be specified with oline#opts()).

Note: For oline#opts() to take effect, # must be the value taken by plotid
at the observation corresponding to the relevant pooled effect.
If the pooled effect itself is not plotted, e.g. for an influence meta-analysis (see ocilineopts()),
# must be the value taken by plotid at the observation where the overall effect line begins.

ocilineopts([line_options] [area_options] [hide])
and ociline#opts([line_options] [area_options] [hide])
affect the rendition of optional additional vertical lines representing the confidence limits
of the pooled effect. By default, cumulative and influence meta-analyses (see metan)
display these lines, along with the option hide which "hides" the pooled-effect observation itself.
Otherwise, such lines may be obtained by specifying any line_options.
In addition, if any area_options are supplied then the box-shaped region between the confidence limit lines
will be rendered as an area plot (drawn underneath other plot features such as indivdual study estimates).

pointopts(marker_options) and point#opts(marker_options)
affect the rendition of (unweighted) point estimate markers,
e.g. to clarify the precise point within a larger weighted box (see boxopts()).

rfopts([line_options] [overlay] [rcap] [sepline])
and rf#opts([line_options] [overlay] [rcap] [sepline])
affect the rendition of prediction interval lines as defined by rfdist(varlist).
The additional option overlay results in the prediction interval being plotted as a single line,
continuing through the confidence interval and point estimate. (The default is for separate lines
to be plotted either side of the confidence interval.)
The additional option rcap requests capped spikes.
The additional option sepline plots the prediction interval line separately, below the confidence interval rather than straddling it.

rfcilineopts([line_options] [area_options] [hide])
and rfciline#opts([line_options] [area_options] [hide])
affect the rendition of optional additional vertical lines representing the limits
of the prediction interval. These options function in the same way as ocilineopts().

If pooled estimates are not to be represented by diamonds,
but rather by point estimates plus confidence intervals as for the individual estimates
(albeit with different plot_options), this may be achieved by specifying
the following options as replacements for diamopts() or diam#opts():

nodiamonds simply replaces all diamonds with point estimates and confidence intervals, with default line_options

pciopts(line_options) and pci#opts(line_options)
affect the rendition of confidence intervals for pooled estimates

ppointopts(marker_options) and ppoint#opts(marker_options)
affect the rendition of (unweighted) pooled estimate markers.

Note that, if pooled estimates are not represented by diamonds, then the default prediction interval line may become indistinguishable from the confidence interval line.
In this case, the lines may be distinguished via appropriate twoway options (e.g. colours); or the option sepline could be used.

Saved results

forestplot saves the following in r() to assist with fine-tuning:

Scalars

r(aspect) aspect ratio of plot region (see aspect_option)

r(astext) proportion of plot width taken up by columns of text

r(ldw) display width of left-hand columns of text

r(rdw) display width of right-hand columns of text

r(cdw) display width of the central part, where the data is plotted

r(height) approximate total number of lines of text, including titles, footnotes etc.

r(spacing) spacing of lines of text (see spacing() option)

r(ysize) relative height of graph region (see region_options)

r(xsize) relative width of graph region (see region_options)

r(textsize) calculated optimum text size (before applying user-specified scaling with textsize(#))

r(range) numlist containing the x-axis limits of the plotted data

r(obs) number of observations in the final plot (i.e. after generating column titles etc.)

In addition, by default forestplot leaves behind a variable named _EFFECT containing the string-valued
concatenation of the (formatted) effect size and confidence limits appearing on the forest plot to the right of the plotted data.
Access to this variable allows, for example, pooled-effect p-values to be manually added to the forest plot; see the penultimate example.

Note: Differences from previous versions of metan

This version of forestplot has been designed to be backwards-compatible with metan9 as far as possible.
However, there are some minor differences in syntax and behaviour. In particular:

The procedure for creating the plot has been improved, so that the use of options such as
xsize(#), ysize(#) and textsize(#) should be needed less often.
Similarly, automated x-axis labelling is improved, so that xlabel() may not be needed.

Options xlabel() and xtick() now expect a standard Stata numlist, with force as a sub-option.
The older syntax using comma-separated lists, with force as a stand-alone option, continues to be supported;
but a message will be printed to the Results Window as a reminder that the documented syntax has changed.

If the metan option counts is used, the resulting columns will appear on the left-hand side of the plot,
between the study label and the plotted data, instead of on the right-hand side as in metan9.
This matches with the layout used by other popular meta-analysis packages such as Cochrane's Review Manager.

Variable formats are honoured by forestplot wherever possible.
Therefore, the contents of lcols() and rcols() will appear right-justified by default,
which may cause some differences in display when compared to metan9.
To control this, individual variables, whether numeric or string, may be formatted within the dataset
before running forestplot.
Alternatively, leftjustify will left-justify all data columns.

(Note that metan automatically left-justifies "core" variables,
such as the left-most "study name" column and the effect sizes.)

Examples

We will use the same example dataset as for metan.
The dataset contains variables containing the odds ratio and 95% confidence limits, but forestplot is designed to work on the
interval (e.g. log OR) scale. So we take need to take logs of these variables before proceeding further:

. use http://fmwww.bc.edu/repec/bocode/m/metan_example_data, clear

. gen logOR = log(OR)

. gen logORlci = log(ORlci)

. gen logORuci = log(ORuci)

(click to run)

First, see what happens when forestplot is run with no options at all:

. forestplot logOR logORlci logORuci

(click to run)

With a little more work, we can recreate the result of running metan with the nooverall option:

. gen wgt = (2*1.96/(logORuci - logORlci))^2

. summ wgt, meanonly

. replace wgt = 100 * wgt / r(sum)

. label variable wgt "% Weight"

. format wgt %6.2f

. format id %-14s

. forestplot logOR logORlci logORuci, eform effect(Odds ratio) labels(id) wgt(wgt)

(click to run)

Compare with using metan directly: the result is exactly the same.
The extra work needed demonstrates how few assumptions forestplot makes about the data, and therefore how flexible it is.

. metan logOR logORlci logORuci, eform effect(Odds ratio) lcols(id) rcols(wgt) nooverall

(click to run)

Use of plotid() and plot#opts(), and also favours():

. forestplot, eform effect(Odds ratio) labels(id) plotid(type_study)

favours(Favours treatment # Favours control)

box1opts(mcolor(red)) ci1opts(lcolor(red) rcap) box2opts(mcolor(blue)) ci2opts(lcolor(blue))

(click to run)

Next, we will run a slightly different metan command, and use the option clear to replace
the data in memory with a "forestplot results set". We then insert the p-value for the test of overall effect.
Finally, we run forestplot with the useopts option, to recover the counts option previously specified to metan.
We also request a "filled" diamond, and demonstrate the use of the cirange() and range() options.

(Note that we need to include _EFFECT within rcols() to prevent forestplot over-writing our p-value;
and that _WT also needs to be included to maintain the default ordering of columns; see Description.)

. use http://fmwww.bc.edu/repec/bocode/m/metan_example_data, clear

. metan tdeath tnodeath cdeath cnodeath, rd random rfdist lcols(id) counts nograph clear

. replace _EFFECT = "p=0.261" if _USE==4

. forestplot, useopts nostats nowt rcols(_EFFECT _WT) diamopt(fcolor("0 0 100"))

xlabel(-.25 0 .25) cirange(-.35 .35) range(-.5 .5)

(click to run)

We may also use line or area options to demonstrate the width of confidence and/or predictive intervals
compared to the individual study data.
The option hide is used to suppress the pooled-effect diamond, as it is now redundant:

. forestplot, useopts ocilineopts(color(gs8) hide) rfcilineopts(color(gs12)) classic

(click to run)

Finally, as a more advanced example, we will recreate Figure 2 of Fisher et al (2017),
which demonstrates a novel form of forest plot designed to facilitate the presentation of treatment-covariate interactions.
It involves creating two related but different plots, and presenting them side-by-side such that their pertinent features align.
The original data were presented in Analysis 8.2 of a Cochran review by Fearon et al (2012).

. use http://fmwww.bc.edu/repec/bocode/f/forestplot_fisher2017, clear

// Create the "results set" for the left-hand sub-plot

. metan n1 mean1 sd1 n0 mean0 sd0, wmd by(trial) lcols(carer)

nooverall nosubgroup nograph saving(fig2a)

// Create the "results set" for the right-hand sub-plot

// (using built-in statsby, but note that ipdmetan could also be used

// and would pool the coefficients at the same time (see later))

. statsby _b[carer] _se[carer], by(trial) saving(fig2b) : vwls _ES carer, sd(_seES)

(click to run)

Left-hand sub-plot:

// Create an extra observation for the missing category of the Montreal trial

. use fig2a, clear

. expand 2 if _BY=="Montreal 2000":_BY & _USE==1

. replace _LABELS = "No carer" in L

. replace _USE = 2 in L

. sort _BY _USE _STUDY

// Create three more dummy obs at the end, to line up with the "overall" part of the right-hand side

. local oldN = _N

. local oldN_3 = `oldN' + 3

. set obs `oldN_3'

. replace _USE = 6 if _n > `oldN'

. forestplot, wmd keepall nostats nowt

favours("Favours" "ESD" " " # "Favours" "no ESD" " ")

xlabel(-50 0 50, force) astext(35) savedims(A) name(fig2a)

(click to run)

Right-hand sub-plot:

// Load the "results set" into memory, and pool the interaction coefficients

. use fig2b, clear

. metan _stat_1 _stat_2, lcols(trial) effect(Diff. in mean diffs.)

keepall keeporder nograph clear

// To make the two subplots line up, need to generate 2 new observations per trial, plus 1 for overall

// before creating, and saving, the right-hand sub-plot

. gen toexpand = 1 + 3*inlist(_USE, 1, 2) + 2*(_USE==5)

. local oldN = _N

. expand toexpand, gen(expand)

. replace _USE = 6 * (1 - (_n > `oldN' & !mod(_n, 3))) if expand

. replace _WT = . if _USE==0

. sort _STUDY _USE

. forestplot, useopts interaction usedims(A) nonames

favours("Favours greater effect" "of ESD with" "carer present"

# "Favours greater effect" "of ESD with" "no carer present", fp(40))

xlabel(-50 0 50, force)	name(fig2b)

(click to run)

Finally, show both sub-plots side-by-side:

. graph combine fig2a fig2b, imargin(zero) xsize(4)

(click to run)

Author

David Fisher, MRC Clinical Trials Unit at UCL, London, UK.

Email d.fisher@ucl.ac.uk

Acknowledgments

Thanks to the authors of metan9, upon which this code is based;
particularly Ross Harris for his comments and good wishes.
Also thanks to Vince Wiggins at Statacorp for advice, and to Daniel Klein (Universität Kassel, Germany)
for assistance with testing under older Stata versions.

The "click to run" element of the examples in this document is handled using an idea originally developed by Robert Picard.

References

Fisher DJ. 2015.
Two-stage individual participant data meta-analysis and generalized forest plots.
Stata Journal 15: 369-396

Fisher DJ, Carpenter JR, Morris TP, Freeman SC, Tierney JF. 2017.
Meta-analytical methods to identify who benefits most from treatments: daft, deluded, or deft approach?
BMJ 356: j573. doi: 10.1136/bmj.j573

Fearon P, Langhorne P. Early Supported Discharge Trialists. 2012.
Services for reducing duration of hospital care for acute stroke patients.
Cochrane Database Syst Rev 9: CD000443

Review Manager (RevMan) [Computer program]. Version 5.4, The Cochrane Collaboration, 2020.