My task is to test if there's change in covariance matrix of 6 variables. Values of 6 variables are measured twice from same subjects (3 years between measurements).
How can I do that? I've been doing most of my work using SAS.
My task is to test if there's change in covariance matrix of 6 variables. Values of 6 variables are measured twice from same subjects (3 years between measurements).
How can I do that? I've been doing most of my work using SAS.
Assuming that your distributions are multivariate normal (as the tests for covariance matrices tend to assume that, anyway), your null hypothesis is that the two populations differ only by shift. You can test this with a Kolmogorov-Smirnov test on the two groups of data from which their means were subtracted.
Rencher (2002) (Sec. 7.3.2) provides the likelihood ratio test statistic for comparing two matrices (Box M-test) as follows:
$$M=|S_1|^{\nu_1/2} |S_2|^{\nu_2/2}/|S_p|^{(\nu_1+\nu_2)/2}$$
where $S_1$ and $S_2$ are the sample covariance matrices in the two samples, $S_p$ is the pooled covariance matrix, $\nu_1$ and $\nu_2$ are the degrees of freedom (sample size minus 1). Asymptotically, $-2\log M$ follows $\chi^2$ distribution with $p(p+1)/2$ degrees of freedom where $p$ is the size of the matrices. Rencher (2002) also gives the Bartlett-corrected version of the test and an $F$-approximation. This, however, is a two-sample test, rather than the repeated measures test, so it may be somewhat conservative.
You could use structural equation modelling software. This is a sketch of how the process might work in Amos:
var_x1 = var_y1 var_x2 = var_y2
and so oncov_x1_x2 = cov_y1_y2 cov_x1_x3 = cov_y1_y3
and so onThis can probably be tested with proc mixed (well you have to assume multivariate normality). Stack all data on one column. You'll need then indicators for the subject ID and for the time-point. You'll have to define both subject ID and time point-indicator as class variables. Fit an intercept only model; then use perhaps a repeated statement to fit an unconstrained variance/covariance structure (type=un
). Write down the $-2\ln(\mathcal{L})$ where $\mathcal{L}$ is the likelihood) and the degrees of freedom. Then fit a second model, but this time in the repeated statement, use the group=
option to make SAS
fit separate covariance structures for each time-point (i.e. each time-point is a group). Write down the $-2\ln(\mathcal{L})$ and df. Then conduct the LRT test of no difference in fit using the difference in -2loglikelihoods and dfs between the two models, which should be distributed chi-squared under the null hypothesis of no difference in fit between the two models.