

Dear all,

I am trying to fit mixed-effect models to symmetric distance or 
similarity matrices by optimizing the REML criterion. I am working with 
genetic and Euclidean distances between pairs of populations. My 
response variable is the lower triangle of a genetic distance matrix and 
my predictor variable is the lower triangle of a Euclidean distance 
matrix. My fixed effects are the Euclidean distances and my random 
effects are the individual populations. However, I haven't been 
successful in figuring out what the correct notation is in, for 
instance, the lmer function to account for the individual population effect.

I think it is easiest to clarify my question with a simplified example. 
In R I generate two (random) distance matrices between n = 4 
populations, resulting in n(n-1)/2 = 6 pairwise distances:

 > gen_dist <- matrix(data = NA, nrow = 4, ncol = 4)
 > Euc_dist <- matrix(data = NA, nrow = 4, ncol = 4)
 > gen_dist[lower.tri(gen_dist)] <- runif(6,0.0,1.0)
 > Euc_dist[lower.tri(Euc_dist)] <- runif(6,2.0,10.0)
 >
 > gen_dist
        [,1]        [,2]              [,3]         [,4]
[1,] NA            NA                NA           NA
[2,] 0.6502087    NA                NA           NA
[3,] 0.8794098     0.3812354            NA           NA
[4,] 0.1767883     0.8185685     0.4155871       NA
 > Euc_dist
        [,1]         [,2]             [,3]         [,4]
[1,] NA           NA               NA           NA
[2,] 2.047383    NA               NA           NA
[3,] 3.231873     9.933747           NA           NA
[4,] 7.415913     3.436233     3.056221       NA

'gen_dist' is my response matrix and 'Euc_dist' is my predictor matrix. 
Now I unfold these matrices into a data frame:

>  dat_frame2
   pop_ID1     pop_ID2      gen_dist     Euc_dist
   1               2         0.6502087     2.047383
   1               3         0.8794098     3.231873
   1               4         0.1767883     7.415913
   2               3         0.3812354     9.933747
   2               4         0.8185685     3.436233
   3               4         0.4155871     3.056221

Now I don't know how to indicate the grouping structure of the 
individual population effect in the formula of the lmer function. 
Namely, the gen_dist values belonging to the group of population 1 are 
0.6502087, 0.8794098 and 0.1767883, which can be referred to by pop_ID1 
= 1. However, the gen_dist values belonging to the group of population 2 
are 0.6502087, 0.3812354 and 0.8185685, which can only be referred to by 
a combination of pop_ID1 = 2 or pop_ID2 = 2. Also, in pop_ID1 there are 
three groups and in pop_ID2 there are also three groups. However, in 
total I am working with four groups (n = 4). I am not sure how to 
approach this problem and your help would be very much appreciated!

Thanking you very much in advance,

Maarten

-- 

Maarten van Strien
PhD Student
Swiss Federal Institute for Forest, Snow and Landscape Research WSL
Landscape Ecology
Zürcherstrasse 111
8903 Birmensdorf, Switzerland

Office: HL E40
Tel: +41 44 7392 819
Fax: +41 44 7392 215
E-mail: maarten.vanstrien@wsl.ch


	[[alternative HTML version deleted]]


