IBM Support

Does SPSS have a test of equality of variance for paired variables?

Troubleshooting


Problem

I want to test equality of variance for two variables measured on the same subjects. I know that SPSS has independent samples tests of homogeneity of variance, but I don't see any for correlated variables. Does SPSS offer such a test?

Resolving The Problem

The MIXED procedure can be applied to this problem to produce a likelihood-ratio (LR) test of equality of variances, allowing for unequal means and correlation between the two variables. This requires running the procedure twice and manually subtracting the values of -2 RLL (restricted log-likelihoods), then referring the difference to a chi-square distribution, using a critical alpha of twice the normal level (dividing the obtained p value from a standard test in half). An example follows.

Suppose we have two variables, x1 and x2, for which we want to compare variances. Following is a small set of example data and the commands necessary to use MIXED to produce the two -2 RLL values we need to construct the LR test of equal population variances:

DATA LIST LIST / x1 x2.
BEGIN DATA
3 2
5 11
11 16
2 1
8 7
10 12
7 1
8 8
9 14
END DATA.

VARSTOCASES /ID = id
/MAKE x FROM x1 x2
/INDEX = time(2).

MIXED x BY time
/FIXED = time
/REPEATED = time | SUBJECT(id) COVTYPE(CS) .

MIXED x BY time
/FIXED = time
/REPEATED = time | SUBJECT(id) COVTYPE(UN) .

The variables x1 and x2 have sample variances of 9.5 and 32.5, respectively. They are also strongly correlated, at about .768, producing a sample covariance of 13.5. The sample covariance matrix of x1 and x2 (showing only the three unique elements in lower triangular form) is thus:

9.5
13.5 32.5

The VARSTOCASES command restructures the data into what we call the univariate or mixed models approach data setup for repeated measures (some people refer to this as a "long" data format, as opposed to the "wide" format used when repeated measurements are held in the same case in different variables). We arbitrarily called the variable we'll use to index the original variable number time, since that's consistent with the framework we'll be using in MIXED. The restructured data file will have three variables: an ID variable linking cases involving the same original cases or subjects, an index variable we've named time that indicates whether this case represents an original x1 or x2 value, and x, which has the original data values.

The two MIXED commands both model mean differences in x using the fixed time factor, in a one-way repeated-measures ANOVA model. They differ only in their assumptions about the covariance matrix of the repeated measurements, which is the covariance matrix among our original x1 and x2 variables. In the first command, we specify compound symmetry (CS), which allows correlation among the two time points, but restricts the variances to be equal. The second command fits an unstructured (UN) or free covariance matrix, which allows correlation as well as unequal variances.

Since we are dealing with a 2x2 covariance matrix, the CS specification uses two unique parameters: one for the covariance and one for the constant variance. For these data, the covariance value is estimated to be 13.5, and the diagonal offset, or constant value added to the covariance estimate to estimate the assumed common variance, is 7.5. If we were to print the R matrix in MIXED, the lower triangular form of the estimated population covariance matrix is:

21
13.5 21

The UN specification produces three distinct parameters: one for the covariance and one for each of the variances. The estimated population covariance matrix thus perfectly matches the sample covariance matrix, since we're estimating as many parameters as the number of unique elements in the matrix.

The -2 RLL value for the CS model is about 94.247, while that for the UN model is about 88.522. Subtracting the latter from the former gives us an LR chi-square value of about 5.725. To obtain a p value or significance level for this, we can use:

COMPUTE p=SIG.CHISQ(5.725,1)/2.

It is also possible to form a Wald test by printing the covariance matrix of the estimates of the covariance parameters for the UN model and using the appropriate linear combination of values to produce a standard error for the estimated difference between diagonal values of R, but this is more work than the LR test, and the properties of the test are typically not better. It should be noted that in both cases the tests are asymptotic and do assume normality, so use with as small a problem as this example is questionable (the problem was kept small for convenience).

[{"Product":{"code":"SSLVMB","label":"IBM SPSS Statistics"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Not Applicable","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"Not Applicable","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Historical Number

70687

Document Information

Modified date:
16 April 2020

UID

swg21478274