*! version 1.0.0 11Nov2021

Title

rmclass -- Classification statistics for data with repeated measures

Syntax

rmclass
refvar
classvar
[if] [in]
[,
id(varname)
gee
level(#)
model_options
]

refvar is the reference variable indicating the true state of the observation such as diseased and nondiseased or normal and abnormal,
and classvar is the classification variable indicating the rating or outcome of the diagnostic test or test modality. Both refvar and classvar
must be coded as 0 and 1.

id(varname) subject identifier; must be specified when specifying gee

gee specifies to fit a xtgee model. If gee is
not specified, rmclass will use logit as the default model; id() must be declared when specifying gee

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

[model_options] specify all available options for xtgee when the
gee option is chosen; otherwise, all available options for logit are specified.

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

Description

rmclass reports classification statistics and confidence intervals for data in which subjects have either been tested once (i.e. a single test compared to a reference standard),
or have undergone repeated testing. For data with repeated measurements (ascertained by specifying id()), a logit model is estimated with clustered standard errors by default.
Alternatively, the user may specify that a GEE model be used to estimate the classification statistics.

Options

id(varname) specifies the subjects' identifier; id() is required

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

gee specifies to fit a xtgee model. If gee is
not specified, rmclass will use logit as the default model; id() must be declared when specifying gee.

model_options specify all available options for xtgee when the
gee option is chosen; otherwise, all available options for logit are specified.
This is particularly useful for the GEE model where the user may want to specify a particular correlation structure.

Examples

Setup

. use example.dta

Basic specification where observations are assumed independent. A logit model is estimated with default standard errors.

. rmclass disease test

Data with repeated measures. A logit model is estimated with clustered standard errors.

. rmclass disease test, id(id)

Data with repeated measures. A GEE model is estimated with default exchangeable correlation structure and robust standard errors.

. rmclass disease test, id(id) gee

Data with repeated measures. A GEE model is estimated with an AR1 correlation structure and robust standard errors. However, we first must
specify a time variable using xtset

. xtset id order

. rmclass disease test, i(id) gee corr(ar 1)

Stored results

rmcorr stores the following in r():

Scalars

r(sens) sensitivity

r(spec) specificity

r(ppv) positive predictive value

r(npr) negative predictive value

r(fpr) false positive rate

r(fnr) false negative rate

References

Genders, T.S., Spronk, S., Stijnen, T., Steyerberg, E. W., Lesaffre, E. and M. M. Hunink. 2012.
Methods for calculating sensitivity and specificity of clustered data: a tutorial. Radiology 265: 910-916.

Leisenring W., Pepe, M. S. and G. Longton. 1997. A marginal regression modelling framework for evaluating medical diagnostic tests. Statistics in Medicine
16: 1263-1281.

Lim, Y. 2020. A GEE approach to estimating accuracy and its confidence intervals for correlated data. Pharmaceutical Statistics 19: 59-70.

Linden A. 2006. Measuring diagnostic and predictive accuracy in disease management: an introduction to receiver operating characteristic (ROC) analysis.
Journal of Evaluation in Clinical Practice 12: 132-139.

Smith, P. J. and A. Hadgu. 1992. Sensitivity and specificity for correlated observations. Statistics in Medince 11: 1503–1509.

Citation of rmclass

rmclass 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). RMCLASS: Stata module to compute classification statistics for data with repeated measures.

Authors

Ariel Linden

President, Linden Consulting Group, LLC

alinden@lindenconsulting.org

Also see

Online: estat classification, classtabi (if installed)