Dear all,
I would like to hear your advice/directions on how to account to spatial
autocorrelation in MCMCglmm modeling.
I have found a really good reference on that in a former R-sig-mixed thread:
(Another MCMCglmm question - fixing correlations)
https://stat.ethz.ch/pipermail/r-sig-mixed-models/2010q4/004940.html
But, I still can not implement it in my real study.
I am now asking a question of how additive genetic effect, population
structure, and environment can affect the phenotypic variations, by the data
measured/observed in >50 wild pine populations. You know, pine is plant, not
animal, they can not move by themselves. There should be some variance come
from geological autocorrelation (individuals are more near in geological
scale, they expressed more similar phenotype).
In the first run, I just expect the autocorrelation defined by longitude and
latitude. And, it may extent to be defined by longitude, latitude and
altitude. I do not know how to fix a MCMCglmm model accounting for such a
autocorrelation. Can it just be fixed as random effect of interaction
between longitude and latitude. Or is it necessary to use sir() function?
Could you please give any directions? I think this question may have general
interests for those who want to asking ecological/genetic question using
data from field.
Thanks in advance.
Best regards,
Jian-Feng,
Please see my problem in more detail as followings:
########################
# my data (in dataframe, nypd.data),
response - conlen (cone length)
predictor - popcode (population code)
tree (tree code, there are 5 replicates for each tree)
Ped (pedigree, now I have not prepared it)
########################
# the model without autocorrelation
prior1.1 <- list(G = list(G1 = list(V = 1,n=0.002),
G2=list(V=1, n=0.002)
#G3=list(V= matrix(con.var/4),n= 1)
#G4 = list(V = 1, n=0.002)
),
R=list(V=1,n= 0.002))
cone.model1.1<-MCMCglmm(fix=conlen ~ 1,
random = ~ popcode + tree,
#pedigree = Ped,
data = nypd.data,
nitt=53000000,
thin=50000,
burnin=13000000,
prior = prior1.1, verbose = FALSE
)
########################
# the model with autocorrelation be defined as random effect
prior1.2 <- (I am not clear how to specific this prior)
cone.model1.2<-MCMCglmm(fix=conlen ~ 1,
random = ~ popcode + tree + lon*lat,
#pedigree = Ped,
data = nypd.data,
nitt=53000000,
thin=50000,
burnin=13000000,
prior = prior1.4, verbose = FALSE
)
########################
# the model with autocorrelation be defined by sir()
# I got error for this model:
Error in sir(~W, ~units) :
sir formulae invalid: factor levels of intersecting variables have
to be the same
### the model
W <- as.matrix(cbind(nypd.data$lon, nypd.data$lat))
prior1.9 <- list(G = list(G1 = list(V = 1,n=0.002),
G2=list(V=1, n=0.002)
#G3=list(V= matrix(con.var/4),n= 1)
#G4 = list(V = 1, n=0.002)
),
R=list(V=1,n= 0.002))
cone.model1.9<-MCMCglmm(fix=conlen ~ 1 + sir(~W, ~units),
random = ~ popcode + tree,
#pedigree = Ped,
data = nypd.data,
nitt=53000000,
thin=50000,
burnin=13000000,
prior = prior1.9, verbose = FALSE
)
[[alternative HTML version deleted]]