*! version 1.0.0 13Aug2023

Title

wscv -- Within-subject coefficient of variation

Syntax

wscv
rating1
rating2
[rating3 ...]
[if] [in]
[, level(#)
onesided
]

wscv

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

onesided one-sided test; default is two sided

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

Description

wscv computes the within-subject coefficient of variation (WSCV) among two or more repeated tests or ratings. The WSCV is widely used as a measure of reliability and reproducibility
for interval-level (continuous) data in medical and biological science. Quan and Shih (1996) recommend the WSCV as an alternative to the intraclass correlation (ICC) to assess reproducibility
of a measurement when the study population is homogeneous. In such cases, the ICC (which relies on between-subject variation) will produce a low estimate, whereas the WSCV is unaffected.

wscv uses the "within-subject standard deviation method" for computing WSCV, as described in Bland & Altman (1996). Two alternative computation approaches are the
"root mean square method" and "logarithmic method" as described in Bland (2006). All methods appear to produce similar point estimates, but there are various approaches to computing
confidence intervals that produce different results. wscv computes confidence intervals based on the delta method (Quan and Shih 1996), but I recommend using the bootstrap as
shown in the example below. The smaller the WSCV, the better the reproducibility. Estimates produced by wscv can be multiplied by 100 to provide results as a percentage.

Options

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

onesided indicates a one-sided test. The default is two-sided.

Examples

Setup

. use lungfunction.dta

Compute WSCV across four measurements of lung function in each of 20 schoolchildren (data are from Bland & Altman [1996]).

. wscv rating1 - rating4

Same as above but set CI level to 99.

. wscv rating1 - rating4, level(99)

We now rerun wscv and apply the bootstrap to compute 95% confidence intervals

. bootstrap wscv = r(wscv), reps(1000): wscv rating1 - rating4

. estat bootstrap, all

Stored results

wscv stores the following in r():

Scalars

r(ntar) number of targets (observations)

r(nrat) number of ratings

r(mu) mean of subject means

r(wssd) within-subject standard deviation

r(sd) standard deviation of the WSCV

r(lcl) lower confidence limit

r(ucl) upper confidence limit

References

Bland, J. M. and D. G. Altman. 1996. Statistics notes: measurement error. BMJ 312: 1654.

Bland, J. M. 2006. How should I calculate a within-subject coefficient of variation? Found at:
https://www-users.york.ac.uk/~mb55/meas/cv.htm

Quan, H., and W. Shih. 1996. Assessing reproducibility by the within-subject coefficient of variation with random effects models. Biometrics 52: 1195-1203.

Citation of wscv

wscv 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. (2023). WSCV: Stata module to compute the within-subject coefficient of variation.

Authors

Ariel Linden

President, Linden Consulting Group, LLC

alinden@lindenconsulting.org

Also see

Online: icc, finn (if installed), robinson (if installed), bhapkar (if installed), iota (if installed),
maxwell (if installed), repeatability (if installed), kappaetc (if installed)