[R-sig-ME] Priors for us(trait):units structure in MCMCglmm model. Error message - help needed.
Jarrod Hadfield
j.hadfield at ed.ac.uk
Mon Jan 26 10:37:39 CET 2015
Hi,
If temp is continuous, you are trying to estimate a 2X2 covariance
matrix for the random effects and a scalar variance for the residuals.
In general, I use priors of the form:
prior<-list(G=list(G1=list(V=diag(2), nu=2, alpha.mu=c(0,0),
alpha.V=diag(2)*1000)), R=list(V=diag(1), nu=0.002))
If temp is categorical then you are trying to estimate a 3X3
covariance matrix for the random effects. Personally, I would opt for
continuous temp, at least in the random effect part of the model.
You almost certainly want random=~us(1+Temp):species rather than
random=~us(1+Temp):Range. It sounds like Temp:Range in the fixed part
of the model is the key term you want to test (do large ranging
species respond differently to temp). random=~us(1+Temp):species deals
with the fact that species may vary in their response to temperature
independently of anything to do with their ranges.
You don't have many species so don't expect to get very precise
estimates of the covariance matrix, particularly given the species
effects are assumed to be correlated due to their shared phylogenetic
history.
Cheers,
Jarrod
Quoting Tricia Markle <markl033 at umn.edu> on Mon, 26 Jan 2015 00:05:20 -0600:
> 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]]
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
More information about the R-sig-mixed-models
mailing list