hspider[,1:6] = scale(hspider[,1:6]) # Needed when ITol = TRUE
set.seed(123)
p1 = cqo(cbind(Alopacce, Alopcune, Pardlugu, Pardnigr,
Pardpull, Trocterr, Zoraspin) ~
WaterCon + BareSand + FallTwig +
CoveMoss + CoveHerb + ReflLux,
family = poissonff, data = hspider, ITol = TRUE)
sort(p1@misc$deviance.Bestof) # A history of all the iterations
siteNos = 1:2 # Calibrate these sites
cp1 = calibrate(p1, new = data.frame(p1@y[siteNos,]), trace = TRUE)
# Graphically compare the actual site scores with their calibrated values
persp(p1, main = "Site scores: solid=actual, dashed=calibrated",
label = TRUE, col = "blue", las = 1)
abline(v = lv(p1)[siteNos], lty = 1, col = 1:length(siteNos)) # actual site scores
abline(v = cp1, lty = 2, col = 1:length(siteNos)) # calibrated values
Run the code above in your browser using DataLab