Post date: Oct 05, 2016 7:9:11 PM
Here are the main results from (analyses are described here).
DIC model comparison results (lower values are better). The different models give similar results (i.e., DIC does not vary that much), but the model with elevation is the best one.
Cross-validation results (based on posterior medians), presented as the correlation between the true and inferred dark morph frequency at each site and time (with 4 cross-validation sets and only including samples with at least 25 individuals).
Plot of true vs. inferred for elevation (along with best fit line from lm): plot
Summary of parameter estimates for the best model (with elevation as the co-variate):
Point estimates (medians) and 95% ETPIs for key parameters (the model is pasted below).
1's denote effects related to intercepts (expected stripe frequency) and 2's denote effects related to the effect of temperature on morph frequencies.
So, a1 is the overall intercept (not interesting). a2 is the average of effect of temperature on morph frequency (higher temp. increases morph freq.). b1 shows that average morph freq. (independent of temp.) declines with increasing elevation, but there isn't an obvious interaction between elevation and temp. (based on b2). c1 and c2 show that pops. feeding on C have higher dark morph freqs. than A, and that the positive effect of temp. on dark morph freq. is reduced on C relative to A. Dark morphs are rarer on Refugio (d1, note that the effect is greater in magnitude than host), but mountain does not interact with temp. There is little evidence for an overall effect of year (theta).
Finally, the effect of temp. (beta) is positive (i.e., point est. positive and 95% ETPIs excluding 0) in 23 populations (out of 208), negative in none, and uncertain in most (185 pops.).
model{
## binomial likelihood and link function for glm
for(i in 1:(N-1)){
y[i]~dbinom(p[i],n[i])
logit(p[i])<-alpha[pop[i]]+beta[pop[i]]*temp[i]+theta*yr[i]+epsilon[i]
epsilon[i]~dnorm(0,taue)
}
## sum-to-zero constraints
y[N]~dbinom(p[N],n[N])
logit(p[N])<-alpha[pop[N]]+beta[pop[N]]*temp[N]+theta*yr[N]+epsilon[N]
epsilon[N]<--1*sum(epsilon[1:(N-1)])
## linear model for intercepts and slopes
for(j in 1:Npop){
alpha[j]<-a[1]+b[1]*elev[j]+c[1]*host[j]+d[1]*mntn[j]
beta[j]<-a[2]+b[2]*elev[j]+c[2]*host[j]+d[2]*mntn[j]
}
## hyperpriors
taue~dgamma(0.1,0.01)
for(k in 1:2){
a[k]~dnorm(0,0.0001)
b[k]~dnorm(0,0.0001)
c[k]~dnorm(0,0.0001)
d[k]~dnorm(0,0.0001)
}
theta~dnorm(0,0.0001)
}