{smcl}
{* *! version 1.0 17 Jul 2020}{...}
{vieweralsosee "" "--"}{...}
{vieweralsosee "Install command2" "ssc install command2"}{...}
{vieweralsosee "Help command2 (if installed)" "help command2"}{...}
{viewerjumpto "Syntax" "batplot##syntax"}{...}
{viewerjumpto "Description" "batplot##description"}{...}
{viewerjumpto "Options" "batplot##options"}{...}
{viewerjumpto "Remarks" "batplot##remarks"}{...}
{viewerjumpto "Examples" "batplot##examples"}{...}
{title:Title}
{phang}
{bf:batplot} {hline 2} Produces a Bland-Altman plot when there is a relationship between paired differences and their average
{marker syntax}{...}
{title:Syntax}
{p 8 17 2}
{cmdab:batplot}
varlist
(min=2
max=2)
[{help if}]
[{help in}]
[{cmd:,}
{it:options}]
{synoptset 20 tabbed}{...}
{synopthdr}
{synoptline}
{syntab:Optional}
{synopt:{opt no:trend}} specifies that the original Bland-Altman plot (without a trend) be plotted.
{pstd}
{p_end}
{synopt:{opt info}} specifies that the percentage of points outside the limits of agreement are
displayed as a subtitle.
{p_end}
{synopt:{opt val:abel(varname)}} pecifies that the points outside the limits of agreement be labelled using
the variable varname.
{p_end}
{synopt:{opt moptions(string asis)}} specifies options for the markers that lie outside the limits of agreement.
{pstd}
{p_end}
{synopt:{opt shading(numlist min=2 max=2)}} specifies the extent of shading beyond the range of the data.
{pstd}
{p_end}
{synopt:{opt sc:atter(string asis)}} specifies options for the scatter part of the final plot.
{pstd}
{p_end}
{synopt:{opt nog:raph}} specifies that the graph is not displayed to the graphics window.
{pstd}
{p_end}
{synopt:{opt dp(#)}} specifies the precision of the numbers in the title of the graph.
{pstd}
{p_end}
{synopt:{opt *}} specifies other twoway options, for example titles and labels.{p_end}
{synoptline}
{p2colreset}{...}
{p 4 6 2}
{marker description}{...}
{title:Description}
{pstd}
{pstd}
batplot produces a Bland-Altman plot adjusted (or not) for trend.
{pstd}
The standard Bland-Altman plot is between the difference of paired variables versus the average,
this is produced using the notrend option. The main addition that this command handles is when
there is a linear relationship between the the paired difference and the paired average. A
regression model is used to adjust the limits of agreement accordingly. This is particularly
useful when the two variables might be measured on different scales and hence a straight conversion
factor would recalibrate the two variables.
{marker options}{...}
{title:Options}
{dlgtab:Main}
{phang}
{opt no:trend} specifies that the original Bland-Altman plot (without a trend) be plotted.
{pstd}
{p_end}
{phang}
{opt info} specifies that the percentage of points outside the limits of agreement are displayed as a
subtitle. Additionally when using the notrend option the limits of agreement and mean
difference are included in the subtitle.
{p_end}
{phang}
{opt val:abel(varname)} ) specifies that the points outside the limits of agreement be labelled using the
variable varname.
{p_end}
{phang}
{opt moptions(string asis)} specifies options for the markers that lie outside the limits of agreement, the options
can be anything from the scatter marker options.
{p_end}
{phang}
{opt shading(numlist min=2 max=2)} specifies the extent of shading beyond the range of the data. The default is that
the limits of shading is determined by the values in the xlabel option.
{p_end}
{phang}
{opt sc:atter(string asis)} specifies options for the scatter part of the final plot.
{pstd}
{p_end}
{phang}
{opt nog:raph} specifies that the graph is not displayed to the graphics window.
{pstd}
{p_end}
{phang}
{opt dp(#)} specifies the precision of the numbers in the title of the graph. The default is 2 decimal
places.
{p_end}
{phang}
{opt *} specifies other twoway options, for example titles and labels. {p_end}
{marker examples}{...}
{title:Examples}
{pstd}
{pstd}
Using the auto.dta dataset supplied with STATA 8 this command can check whether there is agreement
between turning circle (ft) and miles per gallon, click the highlighted text in order,
{pstd}
{stata sysuse auto, clear}
{pstd}
{stata batplot mpg turn}
{pstd}
This is the most basic graphic and using twoway options the look can be improved by clicking below,
{pstd}
{stata batplot mpg turn, title(Agreement between mpg and turn) xlab(26(4)38)}
{pstd}
By specifying extra options the outlying points can be labelled and identified by the car make,
{pstd}
{stata batplot mpg turn, title(Agreement between mpg and turn) info valabel(make) xlab(26(4)38)}
{pstd}
To obtain the original Bland Altman plot use the notrend option,
{pstd}
{stata batplot mpg turn, title(Agreement between mpg and turn) info valabel(make) notrend xlab(26(4)38)}
{pstd}
To improve the labelling of the point VW it may be preferable to change the clock position of the
label i.e. labels could appear to the left of the point. This is handled below with moptions().
{pstd}
{stata batplot mpg turn, title(Agreement between mpg and turn) info valabel(make) notrend xlab(26(4)38) moptions(mlabp(9))}
{pstd}
Additionally in the case of multiple scatter points by using the scatter() option the user can
specify to "jitter" datapoints
{pstd}
{stata batplot mpg turn, notrend xlab(26(4)38) moptions(mlabp(9)) sc(jitter(4))}
{pstd}
{title:Stored results}
{synoptset 15 tabbed}{...}
{p2col 5 15 19 2: Locals}{p_end}
{synopt:{cmd:r(mean)}} is the mean. {p_end}
{synopt:{cmd:r(b0)}} is the intercept. {p_end}
{synopt:{cmd:r(b1)}} is the slope. {p_end}
{synopt:{cmd:r(c0)}} is the intercept for the trend line. {p_end}
{synopt:{cmd:r(c1)}} is the slope for the trend line. {p_end}
{synopt:{cmd:r(eqn)}} is the equation. {p_end}
{synopt:{cmd:r(upper)}} is the upper limit equation. {p_end}
{synopt:{cmd:r(lower)}} is the lower limit equation. {p_end}
{title:References}
{pstd}
{pstd}
Bland JM, Altman DG. (1999) Measuring agreement in method comparison studies. Statistical Methods in Medical Research 8, 135-160.
{pstd}
{pstd}
{title:Author}
{p}
Prof Adrian Mander, Cardiff University.
Email {browse "mailto:mandera@cardiff.ac.uk":mandera@cardiff.ac.uk}