| Date: | Wed, 10 Sep 2003 07:15:55 -0700 |
| Reply-To: | Dale McLerran <stringplayer_2@YAHOO.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Dale McLerran <stringplayer_2@YAHOO.COM> |
| Subject: | Re: repeated measures, correlation |
|
| In-Reply-To: | <OF1889103B.458179D8-ON88256D97.005B7D55@epamail.epa.gov> |
| Content-Type: | text/plain; charset=us-ascii |
|---|
Akin Pala [mailto:akin@COMU.EDU.TR] wrote (originally):
> I have two repeated Y variables and I want to measure the correlation
> between them. I am guessing just use proc corr? Do I need to do any
> corrections because the errors are correlated in these two dependent
> factors?
>
Akin,
As David Cassell points out, the simple correlation coefficient
obtained through PROC CORR assumes independent samples, an
assumption which your data do not meet due to the repeated
measurement structure. I would note that the procedure MIXED
offers the ability to estimate the covariance structure in a
multivariate repeated measures model. One must employ the
REPEATED statement with appropriate TYPE statement. The
appropriate TYPE statements all employ a specification of
UN@??? where ??? is either CS, AR(1), or UN. If you have
Y1,Y2 at only two time points, then it does not matter which
of the three TYPE specifications you employ. If you have
more repeated measures on each subject then you will want to
choose the TYPE which maximizes AIC and/or BIC statistics.
It should also be observed that in order to employ the MIXED
procedure with its capability of fitting multivariate repeated
measures models, you must construct your data with a single
response vector and an indicator variable for the response.
That is, rather than constructing the data as
subject time Y1 Y2
1 1 3 4
1 2 8 7
2 1 6 8
...
your data would need to be constructed as
subject time indic value
1 1 1 3
1 1 2 4
1 2 1 8
1 2 2 7
2 1 1 6
2 1 2 8
...
When you fit a multivariate repeated measures model, the
covariance will be partitioned into two component sets: 1)
the multivariate response covariance structure, and 2) the
covariance structure for the repeated measurements. The
multivariate response covariance structure is reported first
in the covariance parameters table, followed by the covariance
structure for the repeated measurement model.
For any of the multivariate repeated measures specifications,
the correlation between Y1 and Y2 is obtained from the
variance/covariance matrix for the multivariate response.
Given that your multivariate response has only two variables,
these will be the first three components reported by the
MIXED procedure in the covariance parameters table. The
first parameter in the table will be the variance for variable
1, the second parameter will be the covariance between the
two variables, while the third parameter will be the variance
for variable 2. The correlation between Y1 and Y2 can be
computed as
R(Y1,Y2) = cov(Y1,Y2) / sqrt(V(Y1)*V(Y3))
= parm2 / sqrt(parm1*parm3)
Given that your data are constructed as above, specific code
for fitting the multivariate repeated measures model would be
proc mixed;
class subject time indic;
model value =;
repeated indic time / subject=subject type=un@???;
run;
again substituting CS, AR(1), or UN for ???. I don't know what
the standard error of the correlation would be. If there is
perfect within-subject correlation over time, then the standard
error would be
se = 1 / sqrt(N-3)
where N is the number of independent subjects. If the
within-subject correlation over time is zero (such that every
observation could be treated as though they were independent),
then the standard error would be
se = 1 / sqrt(2*N-3)
But if the within-subject correlation over time is between 0
and 1, then I do not know immediately what the standard error
would be. You could obtain an estimate of the standard error
of the correlation through the delta method, or by bootstrapping
the mixed model. Sorry, I don't have time to elaborate on
either of these.
Dale
=====
---------------------------------------
Dale McLerran
Fred Hutchinson Cancer Research Center
mailto: dmclerra@fhcrc.org
Ph: (206) 667-2926
Fax: (206) 667-5977
---------------------------------------
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
|