11  Differences in Variability

Occasionally researchers would like to compare the variations between two conditions or groups rather than the mean. Two commonly used are the natural logarithms of variability ratio (\(lnVR\)) and the coefficient of variance ratio (\(lnCVR\)). The latter of these can be useful when there may be a mean-variance relationship present (i.e., variances tend to increase with mean values) in order to account for this. An lnVR or lnCVR of zero therefore would indicate no difference in variation between the two groups, an lnVR or lnCVR of >0 would indicate larger variance in group 1, and an lnVR or lnCVR of <0 would indicate larger variance in group 2. There are both independent and dependent versions of these effect sizes (see Senior, Viechtbauer, and Nakagawa 2020). To obtain confidence intervals of a the lnVR or lnCVR then we, for example 95% confidence intervals, we merely multiply the standard error for the parameter by 1.96 similarly to other effect size statistics,

\[ CI_{lnVR/lnCVR}=lnVR \pm 1.96\cdot SE_{lnVR/lnCVR} \tag{11.1}\]

Here is a table for every effect size discussed in this chapter:

Type Description Section
Variability Ratios (VR) Section 11.1
\(lnVR_\text{ind}\) - Natural Logarithm of variability ratio for independent groups Used to compare the standard deviations (i.e., the variability) between two groups. Section 11.1.1
\(lnVR_\text{dep}\) - Natural Logarithm of variability ratio for dependent groups Used to compare the standard deviations (i.e., the variability) between paired groups (i.e., repeated measures designs). Section 11.1.2
Coefficient of Variation Ratios (CVR) Section 11.2
\(lnCVR_\text{ind}\) - Natural Logarithm of coefficient variation ratio for independent groups Used to compare the variation between two groups. More useful than a variability ratio (\(lnVR_\text{ind}\)) when there is a relationship between the mean and variance. Section 11.2.1
\(lnCVR_\text{dep}\) - Natural Logarithm of coefficient variation ratio for dependent groups Used to compare the variation between paired groups (i.e., repeated measures). More useful than a variability ratio (\(lnVR_\text{dep}\)) when there is a relationship between the mean and variance. Section 11.2.1

11.1 Variability Ratios

11.1.1 Natural Logarithm of Variability Ratio for Independent Groups (\(lnVR_\text{ind}\))

The variability ratio for independent groups can be calculated by taking the natural logarithm of the standard deviation within one group divided by the standard deviation in another group,

\[ lnVR_\text{ind}=\ln\left(\frac{S_T}{S_C}\right) + CF \tag{11.2}\]

Where \(CF\) is a small sample correction factor calculated as,

\[ CF=\frac{1}{2(n_T-1)}-\frac{1}{2(n_C-1)} \tag{11.3}\]

A \(lnVR\) of zero therefore would indicate no difference in variation between the two groups, a \(lnVR\) of >0 would indicate larger variance in group 1, and \(lnVR\) of <0 would indicate larger variance in group 2. The standard error of the VR can be calculated as,

\[ SE_{lnVR_\text{ind}}=\sqrt{\frac{n_T}{2(n_T-1)^2}+\frac{n_C}{2(n_C-1)^2}} \tag{11.4}\]

In R, we can simply use the metafor packages escalc() function from the metafor package (Viechtbauer 2010) as follows:

# Example:
# Group 1: standard deviation = 4.5, sample size = 50
# Group 2: standard deviation = 3.5, sample size = 50

library(metafor)

# prepare the data
SD1 <- 4.5
SD2 <- 3.5
n1 <- n2 <- 50

lnVRind <- escalc(
    measure = "VR",
    sd1i = SD1,
    sd2i = SD2,
    n1i = n1,
    n2i = n2
  )


lnVRind$SE <- sqrt(lnVRind$vi)

# calculate confidence interval
lnVRind_low <- lnVRind$yi - 1.96*lnVRind$SE
lnVRind_high <- lnVRind$yi + 1.96*lnVRind$SE

# print the VR value and confidence intervals
data.frame(lnVRind = MOTE::apa(lnVRind$yi),
           lnVRind_low = MOTE::apa(lnVRind_low),
           lnVRind_high = MOTE::apa(lnVRind_high))
  lnVRind lnVRind_low lnVRind_high
1   0.251      -0.029        0.531

From the example, we obtain a natural log variability ratio of \(lnVR_\text{ind}\) = 0.25 [-0.03, 0.53].

11.1.2 Natural Logarithm of Variability Ratio for Dependent Groups (\(lnVR_\text{dep}\))

The variability ratio for dependent groups can similarly be calculated by taking the natural logarithm of the standard deviation within one group divided by the standard deviation in another group,

\[ lnVR_\text{dep}=\ln\left(\frac{S_T}{S_C}\right) \tag{11.5}\]

Note, the correction factor for small sample size bias is not relevant here as due to its calculation its value is zero.

\[ SE_{lnVR_\text{dep}}=\sqrt{\frac{n}{n-1} - \frac{r^2}{n-1} + \frac{r^4\left(S^8_T+S^8_C\right)}{2(n-1)^2 S^4_T+S^4_C}} \tag{11.6}\]

In R, we can simply use the metafor packages escalc() function as follows:

# Example:
# Group 1: standard deviation = 4.5
# Group 2: standard deviation = 3.5
# Sample size = 50
# Correlation = 0.4

library(metafor)

# prepare the data
SD1 <- 4.5
SD2 <- 3.5
n <- 50
r <- 0.4

# use escalc to compute lnVRdep
lnVRdep <- escalc(
  measure = "VRC",
  sd1i = SD1,
  sd2i = SD2,
  ni = n1,
  ri = r
)


lnVRdep$SE <- sqrt(lnVRdep$vi)

# calculate confidence interval
lnVRdep_low <- lnVRdep$yi - 1.96*lnVRdep$SE
lnVRdep_high <- lnVRdep$yi + 1.96*lnVRdep$SE

# print the VR value and confidence intervals
data.frame(lnVRdep = MOTE::apa(lnVRdep$yi),
           lnVRdep_low = MOTE::apa(lnVRdep_low),
           v_high = MOTE::apa(lnVRdep_high))
  lnVRdep lnVRdep_low v_high
1   0.251      -0.005  0.508

11.2 Coefficient of Variation Ratios

11.2.1 Natural Logarithm of Coefficient of Variation Ratio for independent groups (lnCVR_)

The coefficient of variation ratio for independent groups can be calculated by taking the natural logarithm of the coefficient of variation within one group divided by the coefficient of variation in another group,

\[ lnCVR_\text{ind}=\ln\left(\frac{CV_T}{CV_C}\right) + CF \tag{11.7}\]

Where \(CV_T =S_T / M_T\), \(CV_C =S_C / M_C\), and \(M\) indicates the mean of the respective group. The correction factor, \(CF\), is a small sample size bias correction factor that combines that from the lnRR (presented earlier) and the lnVR calculated as,

\[ CF=\frac{1}{2(n_T-1)}-\frac{1}{2(n_C-1)} + \frac{S_T^2}{2(n_TM_T^2)} + \frac{S_C^2}{2(n_CM_C^2)} \tag{11.8}\] In R, we can simply use the escalc() function from the metafor package as follows:

# Example:
# Group 1: mean = 22.4, standard deviation = 4.5, sample size = 50
# Group 2: mean = 20.1, standard deviation = 3.5, sample size = 50

library(metafor)

# prepare the data
M1 <- 22.4
M2 <- 20.1
SD1 <- 4.5
SD2 <- 3.5
n1 <- n2 <- 50

lnCVRind <- escalc(
  measure = "CVR",
  m1i = M1,
  m2i = M2,
  sd1i = SD1,
  sd2i = SD2,
  n1i = n1,
  n2i = n2
)

lnCVRind$SE <- sqrt(lnCVRind$vi) 

# calculate confidence interval
lnCVRind_low <- lnCVRind$yi - 1.96*lnCVRind$SE
lnCVRind_high <- lnCVRind$yi + 1.96*lnCVRind$SE

# print the VR value and confidence intervals
data.frame(lnCVRind = MOTE::apa(lnCVRind$yi),
           lnCVRind_low = MOTE::apa(lnCVRind_low),
           lnCVRind_high = MOTE::apa(lnCVRind_high))
  lnCVRind lnCVRind_low lnCVRind_high
1    0.143       -0.147         0.433

11.2.2 Natural Logarithm of Coefficient of Variation Ratio for independent groups (\(lnCVR_\text{dep}\))

The coefficient of variation ratio for dependent groups can be similarly calculated by taking the natural logarithm of the coefficient of variation within one group divided by the coefficient of variation in another group,

\[ lnCVR_\text{dep}=\ln\left(\frac{CV_T}{CV_C}\right) + CF \tag{11.9}\]

Where \(CV_T =S_T / M_T\), \(CV_C =S_C / M_C\) and CF is a small sample size bias correction factor that combines that from the \(lnVR\) (presented earlier) and the \(lnVR\) (note again for dependent cases this is zero and so omitted) calculated as,

\[ CF = \frac{S^2_T}{2n M_T^2} - \frac{S^2_C}{2nM_C^2} \tag{11.10}\]

The standard error of the \(lnCVR_\text{dep}\) can be calculated as,

\[ \small{SE_{lnCVR_\text{dep}} = \sqrt{\frac{S^2_T}{n M_T^2} + \frac{S^2_T}{nM_T^2} + \frac{S^4_T}{2n^2 M_T^4} + \frac{S^4_T}{2n^2 M_T^4} + \frac{2rS_CS_T}{n M_C M_T} + \frac{r^2S^2_T S^2_C (M^4_T + M^4_C)}{2n^2M_T^4M^4_C}}} \tag{11.11}\] In R, we can simply use the metafor packages escalc() function as follows:

# Example:
# Group 1: standard deviation = 4.5
# Group 2: standard deviation = 3.5
# Sample size = 50
# Correlation = 0.4
library(metafor)

# prepare the data
M1 <- 22.4
M2 <- 20.1
SD1 <- 4.5
SD2 <- 3.5
n <- 50
r <- 0.4

lnCVRdep <- escalc(
  measure = "CVRC",
  m1i = M1,
  m2i = M2,
  sd1i = SD1,
  sd2i = SD2,
  ni = n1,
  ri = r
)

lnCVRdep$SE <- sqrt(lnCVRdep$vi)

# calculate confidence interval
lnCVRdep_low <- lnCVRdep$yi - 1.96*lnCVRdep$SE
lnCVRdep_high <- lnCVRdep$yi + 1.96*lnCVRdep$SE

# print the CVR value and confidence intervals
data.frame(lnCVRdep = MOTE::apa(lnCVRdep$yi),
           lnCVRdep_low = MOTE::apa(lnCVRdep_low),
           lnCVRdep_high = MOTE::apa(lnCVRdep_high))
  lnCVRdep lnCVRdep_low lnCVRdep_high
1    0.143       -0.120         0.406