11  Differences in Variability

Keywords

collaboration, confidence interval, effect size, open educational resource, open scholarship, open science

Occasionally researchers would like to compare the variations between two conditions or groups rather than the mean. Two commonly used effect sizes are the natural logarithm of the variability ratio (\(LVR\)) and the coefficient of variance ratio (\(LCVR\)). 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). An \(LVR\) or \(LCVR\) of zero therefore would indicate no difference in variation between the two groups, an \(LVR\) or \(LCVR\) of >0 would indicate larger variance in group A, and an \(LVR\) or \(LCVR\) of <0 would indicate larger variance in group B (reference group). There are both independent and dependent versions of these effect sizes (see Senior, Viechtbauer, and Nakagawa 2020). To obtain confidence intervals of the \(LVR\) or \(LCVR\), we multiply the standard error of \(LVR/LCVR\) by 1.96 similarly to other effect size statistics,

\[ CI_{LVR}=LVR \pm 1.96\cdot SE_{LVR} \tag{11.1}\]

\[ CI_{LCVR}=LCVR \pm 1.96\cdot SE_{LCVR} \tag{11.2}\]

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

Type Description Section
Variability Ratios (VR) Section 11.1
\(LVR_\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
\(LVR_\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
\(LCVR_\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 (\(LVR_\text{ind}\)) when there is a relationship between the mean and variance. Section 11.2.1
\(LCVR_\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 (\(LVR_\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 (\(LVR_\text{ind}\))

The variability ratio for independent groups (denoted as group \(A\) and group \(B\)) can be calculated by taking the natural logarithm of the standard deviation within one group divided by the standard deviation in another group,

\[ LVR_\text{ind}=\ln\left(\frac{S_A}{S_B}\right) + CF \tag{11.3}\]

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

\[ CF=\frac{1}{2(n_A-1)}-\frac{1}{2(n_B-1)} \tag{11.4}\]

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

\[ SE_{LVR_\text{ind}}=\sqrt{\frac{n_A}{2(n_A-1)^2}+\frac{n_B}{2(n_B-1)^2}} \tag{11.5}\]

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

library(metafor)

# Example:
# Group A: standard deviation = 4.5, sample size = 50
# Group B: standard deviation = 3.5, sample size = 50

# calculate the variability ratio
LVRind <- escalc(
    measure = "VR",
    sd1i = 4.5,
    sd2i = 3.5,
    n1i = 50,
    n2i = 50,
    var.names = c("LVRind","variance")
  )

# display results
summary(LVRind)

  LVRind variance    sei     zi   pval   ci.lb  ci.ub 
1 0.2513   0.0204 0.1429 1.7592 0.0785 -0.0287 0.5313 

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

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

The variability ratio for dependent groups (denoted as groups 1 and 2; e.g., pre-post comparisons) can similarly be calculated by taking the natural logarithm of the standard deviation within one group divided by the standard deviation in another group,

\[ LVR_\text{dep}=\ln\left(\frac{S_2}{S_1}\right) \tag{11.6}\]

Note, the correction factor is irrelevant due to the fact that the conditions will have the same sample size (\(n=n_1=n_2\)). The standard error for which can be calculated as,

\[ SE_{LVR_\text{dep}}=\sqrt{\frac{n}{n-1} - \frac{r^2}{n-1} + \frac{r^4\left(S^8_A+S^8_B\right)}{2(n-1)^2 S^4_A+S^4_B}}. \tag{11.7}\]

Where \(r\) is the correlation between the two conditions. In R, we can use the escalc() function from the metafor package as follows:

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

# calculate variability ratio
LVRdep <- escalc(
  measure = "VRC",
  sd1i = 4.5,
  sd2i = 3.5,
  ni = 50,
  ri = .40,
  var.names = c("LVRdep","variance")
)

summary(LVRdep)

  LVRdep variance    sei     zi   pval   ci.lb  ci.ub 
1 0.2513   0.0171 0.1309 1.9194 0.0549 -0.0053 0.5079 

The output shows a \(LVR_\text{dep}\) of 0.25 95% CI [-0.01, 0.51].

11.2 Coefficient of Variation Ratios

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

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,

\[ LCVR_\text{ind}=\ln\left(\frac{CV_A}{CV_B}\right) + CF \tag{11.8}\]

Where \(CV_A =S_A / M_A\), \(CV_B =S_B / M_B\), 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 \(LRR\) (presented earlier) and the \(LVR\) calculated as,

\[ CF=\frac{1}{2(n_A-1)}-\frac{1}{2(n_B-1)} + \frac{S_A^2}{2(n_AM_A^2)} + \frac{S_B^2}{2(n_BM_B^2)} \tag{11.9}\] In R, we can use the escalc() function from the metafor package as follows:

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

# calculate variability ratio
LCVRind <- escalc(
  measure = "CVR",
  m1i = 22.4,
  m2i = 20.1,
  sd1i = 4.5,
  sd2i = 3.5,
  n1i = 50,
  n2i = 50,
  var.names= c("LCVRind", "variance")
)

 
summary(LCVRind)

  LCVRind variance    sei     zi   pval   ci.lb  ci.ub 
1  0.1430   0.0218 0.1477 0.9679 0.3331 -0.1466 0.4325 

The output shows a \(LCVR_\text{ind}\) of 0.14 95% CI [-0.15, 0.43].

11.2.2 Natural Logarithm of Coefficient of Variation Ratio for independent groups (\(LCVR_\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,

\[ LCVR_\text{dep}=\ln\left(\frac{CV_2}{CV_1}\right) + CF \tag{11.10}\]

Where \(CV_1 =S_1 / M_1\), \(CV_2 =S_2 / M_2\) and the correction factor is calculated as,

\[ CF = \frac{S^2_2}{2n M_2^2} - \frac{S^2_1}{2nM_1^2} \tag{11.11}\]

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

\[ SE_{LCVR_\text{dep}} = \sqrt{\frac{S^2_1}{n M_1^2} + \frac{S^2_2}{nM_2^2} + \frac{S^4_1}{2n^2 M_1^4} + \frac{S^4_2}{2n^2 M_2^4} + \frac{2rS_1S_2}{n M_1 M_2} + \frac{r^2S^2_1 S^2_2 (M^4_1 + M^4_2)}{2n^2M_1^4M^4_2}} \tag{11.12}\]

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

# calculate coefficient of variability ratio
LCVRdep <- escalc(
  measure = "CVRC",
  m1i = 22.4,
  m2i = 20.1,
  sd1i = 4.5,
  sd2i = 3.5,
  ni = 50,
  ri = .40,
  var.names = c("LCVRdep", "variance")
)

# display results
summary(LCVRdep)

  LCVRdep variance    sei     zi   pval   ci.lb  ci.ub 
1  0.1430   0.0180 0.1342 1.0658 0.2865 -0.1200 0.4059 

The output shows a \(LCVR_\text{dep}\) of 0.14 95% CI [-0.12, 0.41].