# How to measure correlation between variance and rank?

I have an independent variable is a manipulation/predictor which is applied in increasing degrees of strength across groups. The independent variable alters the amount of variation in the dependent variable.

Because we are looking at variance, I cannot use Spearman's Rho to calculate correlation without a weird hack (detailed below).

What is the best way to measure the correlation of variance?

In non-mathematical terms, I am testing if increasing the use of a metaphor/mental model unifies responses. If the mental model alters the way people think about a problem, then increasing the "reminders" of this mental model should unify the responses.

There are 5 independent groups, 0-4, ranked according to the number of "reminders" in each one. As the reminders are qualitatively different, I must use ranks.

If one examines the SD of each group according to rank, they line up almost perfectly:

SD - group

drop down

• .639 - drop down menu

• .604 - vertical
• .484 - horizontal

slider

• .5515
• .4504 - colored

Group Averages

• .639
• .544
• .501

That's a difference of ~15% and ~8%, albeit a very rough and indirect way of measuring change in variance. However, Bartlett and Levene's tests confirm a statistically significant difference in the variance between the groups.

However, neither Spearman nor Kendall look at variance directly, so a difference of -1 and +1 will negate each other using these measures. If I combine the two extreme scores (0-1-2 -> 0-1) then I get a Spearman's of .142 with a sig <.001.

While I think this is a defensible hack, it doesn't seem to match up with my ad-hoc analysis above.

• Why did you consider absolute values if you are interested in the dispersion of the response distribution on the original scale?
– chl
Mar 11, 2013 at 12:02
• I am testing for extremes on a Likert scale, so strong agreement/disagreement are no different since they are both strong feelings. Mar 12, 2013 at 0:18
• Thanks. So you mean that the shape of the response distribution (in particular, its variance, or maybe its spread) differs depending on the level of your independent variable? However, you end up with a 3-level discrete response variable (taking values in {0,1,2}): what would a variance test, usually applied on a continuous measure, mean in that case? What about your independent variable: Is it continuous or discrete like your outcome?
– chl
Mar 12, 2013 at 20:05
• The independent variables are discrete; "slider", "colored" slider, and "drop-down". Mar 13, 2013 at 2:45
• @chl I've reformulated this question, would you mind taking another crack? Mar 23, 2014 at 23:25

You could model the variance explicitly specifying a shared mean and only the variance with a Maximum Likelihood Formation such as

$$\max_{\hat\gamma_0,\hat\gamma_1} (\sum_{i=1}(ln(D(x_i, \hat\mu, \hat\gamma_0+\hat\gamma_1 rank)))$$

Where D is the PDF of a distribution of your choice in which the mean is specified as the first argument ($\mu$) and the second argument specifies the variance.

I show how to do this in R using a normal distribution.

This will not directly give you a correlation between rank and variance but you can approximate such a correlation by transforming the coefficient (using $cor(x,y)=cov(x,y)/sd(x)sd(y)$ and $\hat \beta=cov(x,y)/var(x))$ $$\hat {cor}_{rank,var}=\hat\gamma_1 \hat {sd({\gamma_1})}/\hat {sd}({rank})$$

Note, because $\hat \beta=cov(x,y)/var(x))$ is only true in OLS the above transformation is at best only an approximation.

But really, you don't need the "correlation" when you have a more interesting statistic generated directly from the MLE estimation: "How does variance change with respect to a one unit change in ranking?"

• Well, this is proof that I need SE Q/A. From what I can tell, this looks correct. I need to run it past my professor before I really grok the answer, however. As to your latter comment, I'm guessing that it hits on the problem I had with Spearman's Rho. Mar 24, 2014 at 21:21

One option is to report the ratio of the larger to the smaller standard deviations or the ratio of the larger to the smaller variance for the two groups. Such a metric is more comparable than the raw difference in standard deviation or variance with different studies that are on different scales.

Perhaps this solution is overly simplistic. If so, could you please provide a reference to prove me wrong?

What if we just take regression of DV with respect to case/control CV and all confounders, and then apply Levene's test to residuals? Since we only care about variability in dv between groups defined by values of cv, let's regress out all confounding factors iv1, iv2, etc. as follows:

library('lawstat')
library('xlsx')
levene.test(m$residuals, cv, location="median", correction.method="zero.correction", bootstrap=TRUE,num.bootstrap=1000)  Sounds like an analysis of a 3x3 table. How about a log-linear analysis with appropriate odds ratios of the effects? Further edits Loglinear regression analysis is used to describe the pattern of data in a contingency table. A model is constructed to predict the natural log of the frequency of each cell in the contingency table. For a 2x2 table, that means the model is$\ln f = br * row + bc * col + bi * int + a \$.