Skip to content
Prev 12822 / 20628 Next

Repeated Measures in MCMCglmm model

Hi Jarrod,

Thank you for the reply. We are defining plasticity as the difference in
slope for oxygen consumption on temperature at different acclimations. So
essentially asking if wide-ranging species have a greater change in slope
between acclimation temperatures than narrow-ranging species. Since there
are three acclimation temps, one thought is to break it up and look at the
difference in slope between acclimation at 15C vs. 22C and then 15C vs. 6C
(so that 15C is somewhat of a reference point).

I like the idea of allowing different species to have different levels of
plasticity, but agree that for 19 species it's going to be hard to
interpret the results. I also have the species broken into 2 groups based
on range size  (large vs. small) and since this gets at the heart of what
I'd like to test perhaps it is the best way to go for now?

I do have multiple individuals per species (and each individual is tested
at each acclimation temp). If I break the data into 2 groups based on range
size, would the random term then be us(1+temp):Range? Since the same
individuals are used in multiple trials would I need to also include ID
somewhere?

The code did work despite the odd script with A inverse associated with
species (I was basing it on an example that I found). I tried some of your
random effect suggestions and now I get the error message  "prior$G has the
wrong number of structures".

Here is my code as it stands now (I would also love your thoughts on the
phylogeny component and if the code for that looks right):

library(MCMCglmm)
dataset<-read.csv(file="RespDataID.csv", head=TRUE)
dataset$Range<-as.factor(dataset$Range)
str(dataset)

#Phylogeny Component
tree<-read.tree("Plethodontidae_comb61_PL.phy")
species<-c("D._carolinensis_KHK103", "D._fuscus_KHK142",
"D._imitator_KHK05", "D._ochrophaeus_WKS05", "D._ocoee_B_KHK62",
"D._orestes_KHK129",  "D._monticola_A",  "D._santeetlah_11775",
"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
plot(sptree, show.node.label=TRUE)

treeAinv<-inverseA(sptree)$Ainv

prior<-list(G=list(G1=list(V=1, n=0.002), R=list(V=1, n=0.002))

#Model 1  with Range Size - Small (1) versus Large (2)
model1<-MCMCglmm(LVO2~1+Acclm+Temp+LMass+Sex+Range+Acclm*Temp*Range,
random=~us(1+Temp):species, data=dataset, family="gaussian",
ginverse=list(species=treeAinv), nodes="ALL", prior=prior, nitt=300000,
burnin=25000, thin = 1000, verbose=FALSE)

summary(model1)

best,
Tricia


On Thu, Dec 25, 2014 at 10:36 PM, Jarrod Hadfield <j.hadfield at ed.ac.uk>
wrote: