*! version 1.0.0 02Aug2021

Title

rmloa -- Limits of agreement for data with repeated measures

Syntax

rmloa
yvar
xvar
[if] [in]
[,
i(varname)
constant
level(#)
figure[(twoway_options)]

yvar is the dependent variable and xvar is the independent variable

i(varname) subject identifier; when i() is not specified, the LOA is computed assuming that paired (yvar-xvar) observations are independent

constant computes LOA for when the true value is constant; default is to use the method for when the true value varies

level(#) set confidence level; default is level(95)

figure[(twoway_options)] produce a graphical display of the LOA

by is allowed with rmloa; see [D] by.

Description

rmloa computes Bland and Altman's limits of agreement (LOA) for paired X-Y observations. When i() is not specified, the LOA is
computed assuming that each X-Y paired observation is independent of all other observations (Bland and Altman 1986). When i() is specified,
LOA is computed for repeated measures, using either the method where the true value of the difference is constant
(by specifying the constant option), or the default, which uses the method where the true value of the difference varies
(see Bland and Altman [2007] for the details of these methods).

When the figure option is specified, a graph is generated that plots the difference between the Y and X variable against the mean of Y and X,
together with the upper and lower limits of agreement and mean difference.

Options

i(varname) specifies the subjects' identifier. When i() is not specified,
LOA is computed assuming that paired (yvar-xvar) observations are independent of all other pairs.

constant computes LOA for when the true value is constant;
default is to use the method for when the true value varies.

level(#) specifies the confidence level, as a percentage, for
limits of agreement. The default is level(95) or whatever is set by
set level.

figure[(twoway_options)] produces a Bland and Altman graph that plots the difference
between dvar and xvar against the mean of dvar and xvar. When i() is specified, subjects' identifiers
are used for the markers. A line is superimposed representing the mean difference,
along with lines for the lower and upper limits of agreement. Specifying figure
without options uses the default graph settings.

Examples

Setup for independent observations

. use bland1986.dta

Basic specification when X-Y pairs are independent of other observations

. rmloa wright mini, fig

Setup for repeated measures

. use bland2007.dta

Specification for repeated measures using the method where the true value varies

. rmloa rv ic, i(subj) fig

Specification for repeated measures using the method where the true value is constant

. rmloa rv ic, i(subj) constant fig

Comments

The LOA results produced by loa for repeated measures do not match those reported in Bland and Altman (2007) due to
mathematical errors in that paper. This was reported by Jones (2019) in a subsequent letter to the editor.

Stored results

rmloa stores the following in r():

Scalars

r(diff) mean difference between yvar and xvar

r(sd) standard deviation of the difference

r(lb) lower limit of agreement

r(ub) upper limit of agreement

r(obs) number of observations in estimation sample

References

Bland, J. M., and D. G. Altman. 1986. Statistical methods for assessing agreement between two methods of clinical measurement. Lancet I: 307-310.

Bland, J. M. and D. G. Altman. 2007. Agreement between methods of measurement with multiple observations per individual. Journal of Biopharmaceutical Statistics
17: 571-582.

Jones, W. S. 2019. Letter to the editor: Arithmetic error in Bland, J. M., & Altman, D. G. 2007. Agreement between methods of measurement with
multiple observations per individual. Journal of Biopharmaceutical Statistics 29: 574-575.

Citation of rmloa

rmloa is not an official Stata command. It is a free contribution
to the research community, like a paper. Please cite it as such:

Linden A. (2021). RMLOA: Stata module to compute limits of agreement for data with repeated measures.

Authors

Ariel Linden

President, Linden Consulting Group, LLC

alinden@lindenconsulting.org

Also see

Online: concord (if installed), batplot (if installed), rmcorr (if installed)