[R-sig-ME] Priors for us(trait):units structure in MCMCglmm model. Error message - help needed.
Tricia Markle
markl033 at umn.edu
Mon Jan 26 07:05:20 CET 2015
Hello,
I am hoping that someone could provide some thoughts on an appropriate
prior set-up for my model which uses a “us(trait):units” structure in an
MCMCglmm model with repeat measures and a phylogeny component.
I am assuming that I need to use uninformative proper priors with a set-up
something along the lines of:
prior<-list(G=list(G1=list(V=diag(#), nu=#)), R=list(V=diag(#), n=#))
I have spent a considerable amount of time working on this (looking at help
guides, posted examples etc.) and regardless of what numbers I try, I
continue to get the following error message:
Error in priorformat(if (NOpriorG) { :
V is the wrong dimension for some prior$G/prior$R elements
Data Details: I have 308 individual salamanders, each acclimated at 3
different temperatures (6,14,22C). Then for each acclimation temperature
metabolic rate is measured at 3 test temperatures (5, 15, 25C) (so total of
9 trials per individual).
I am attempting to compare slopes of the test temperatures between
acclimation temperatures. There are 18 species, but my main question is
whether large ranging species have greater differences in slope between
acclimation temps than narrow ranging species (species are divided into
those with small (1) versus large (2) ranges).
Here is the rest of my code:
dataset<-read.csv(file="RespData.csv", head=TRUE)
dataset$Range<-as.factor(dataset$Range)
str(dataset)
#Phylogeny Component
tree<-read.tree("Plethodontidae_comb61_PL.phy")
species<-c("D._carolinensis", "D._fuscus", "D._imitator", "D._ochrophaeus",
"D._ocoee", "D._orestes", "D._monticola_A", "D._santeetlah",
"P_cinereus", "P_cylindraceus", "P_glutinosus", "P_hubrichti",
"P_montanus", "P_punctatus", "P_richmondi", "P_teyahalee", "P_virginia",
"P_wehrlei")
pruned.tree<-drop.tip(tree,tree$tip.label[-match(species,
tree$tip.label)])# Prune tree to just include species of interest
sptree<-makeNodeLabel(pruned.tree, method="number", prefix="node") #rename
nodes to be unique
treeAinv<-inverseA(sptree, nodes="TIPS")$Ainv
random=~us(1+Temp):Range
#note, I could alternatively use random=~us(1+Temp):species, but results
are likely harder to interpret
prior<-list(G=list(G1=list(V=diag(#), nu=#)), R=list(V=diag(#), n=#))
model1<-MCMCglmm(LVO2~1+Acclm+Temp+LMass+Sex+Range+Acclm*Temp*Range,
random=random, data=dataset, family="gaussian",
ginverse=list(species=treeAinv), prior=prior, nitt=300000, burnin=25000,
thin = 1000, verbose=FALSE)
Thank you kindly for your help.
Tricia
[[alternative HTML version deleted]]
More information about the R-sig-mixed-models
mailing list