-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
project.org] On Behalf Of Zhiqiu Hu
Sent: Wednesday, January 09, 2013 1:45 PM
To: r-help at r-project.org
Subject: [R] How to estate the correlation between two autocorrelated
variables
Dear R users,
In my data, there are two variables t1 and t2. For each observation of
t1
and t2, two location indicators (x, y) were provided.
The data format is
# x y t1 t2
Since the both t1 and t2 are depended on x and y, t1 and t2 are
autocorrelated variables. My question is how to calculate the
correlation
between t1 and t2 by taking into account the structure of residual
variance
caused by x and y. Seemly, the gls function in nlme/R package might can
be
used for the purpose. However, I failed to figure out how to use the
function for my data. I appreciate your kind help providing an example
code
for the above data format. Please also let me know if there is any
other
more suitable R package for the analysis.
Best regards,
Zhiqiu