[R-sig-eco] Correlations over two time-scales in "lme" corClasses

Robert Rankin robertw.rankin at gmail.com
Fri Feb 4 02:01:48 CET 2011


Hi All,

My question is about the proper use of the corClasses functions and
their correlation matrices in package "lme". I understand that they
are useful for inducing correlations between repeated measures, but
I'm curious about how to induce a correlation matrix which takes into
account two different time-scales, one on the medium-term /
weekly-scale, and another on the scale of hours. My study consists of
hourly wildlife counts conducted throughout a day at one site, and
repeated once-a-week over several months. e.g.,

JulianDay	Hour	Count	Temperature
1		8	3	15
1		12	2	20
1		16	1	19
1		20	5	17
8		8	4	16
8		12	3	20
8		16	1	21
8		20	2	22
15		8	3	28
15		12	1	30
15		16	0	30
15		20	2	29	
...

My model: gamm(Count ~ Temperature + s(Hour), correlation = corCAR1( ?? ))
The JulianDays and the Hours have different units, so I don't know how
I include both in a corClass. Ideally, I want to include each of...

correlation = corCAR1(0.2, form = ~Hour | JulianDay) # hourly
observations are correlated within the same day, as well as...

correlation = corCAR1(0.1, form = ~JulianDay) # observations on
different days are correlated as well, but in a different way

Here's an example of the correlation matrix I'd like to create, which
includes intra-day (hourly) correlations and the different inter-day
correlations
	DAY	1	1	1	1	8	8	8	8	...
DAY	HR	8	12	16	20	8	12	16	20	...
1	8  |	1	0.2	0.2^2	0.2^3	0.1	0.1	0.1	0.1	...
1	12 |	0.2	1	0.2	0.2^2	0.1	0.1	0.1	0.1	...
1	16 |	0.2^2	0.2	1	0.2	0.1	0.1	0.1	0.1	...
1	20 |	0.2^3	0.2^2	0.2	1	0.1	0.1	0.1	0.1	...	
8	8  |	0.1	0.1	0.1	0.1	1	0.2	0.2^2	0.2^3	...
8 	12 |	0.1	0.1	0.1	0.1	0.2	1	0.2	0.2^2	...
8	16 |	0.1	0.1	0.1	0.1	0.2^2	0.2	1	0.2	...
8	20 |	0.1	0.1	0.1	0.1	0.2^3	0.2^2	0.2	1	...
15	8  |	0.1^2	0.1^2	0.1^2	0.1^2	0.1	0.1	0.1	0.1	...
15	12 |	0.1^2	0.1^2	0.1^2	0.1^2	0.1	0.1	0.1	0.1	...
15	16 |	0.1^2	0.1^2	0.1^2	0.1^2	0.1	0.1	0.1	0.1	...
15	20 |	0.1^2	0.1^2	0.1^2	0.1^2	0.1	0.1	0.1	0.1	...
...	...	...	...	...	...	...	...	...	...

A second related question is whether there is a way to manually create
a corClass object. I can't seem to extract a matrix from the corClass
object, and I can't seem to
force the lme control to accept a manually specified matrix.

Thanks a lot for your insights and tips!

Robert Rankin
Analyst
Aquatic Survey
Bird Studies Canada
Port Rowan, ON
Canada
-- 
"You could give Aristotle a tutorial. And you could thrill him to the
core of his being ... Such is the privilege of living after Newton,
Darwin, Einstein, Planck, Watson, Crick and their colleagues."
-- Richard Dawkins



More information about the R-sig-ecology mailing list