# NOT RUN {
hspider[, 1:6] <- scale(hspider[, 1:6]) # Stdze the environmental variables
set.seed(123)
p1 <- cqo(cbind(Pardlugu, Pardmont, Pardnigr, Pardpull, Zoraspin) ~
WaterCon + BareSand + FallTwig +
CoveMoss + CoveHerb + ReflLux,
family = poissonff, data = hspider, Rank = 1,
I.toler = TRUE, Crow1positive = TRUE)
siteNos <- 1:2 # Calibrate these sites
cp1 <- calibrate(p1, trace = TRUE,
new = data.frame(depvar(p1)[siteNos, ]))
# }
# NOT RUN {
# }
# NOT RUN {
# 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)
# Actual site scores:
abline(v = latvar(p1)[siteNos], lty = 1, col = 1:length(siteNos))
abline(v = cp1, lty = 2, col = 1:length(siteNos)) # Calibrated values
# }
Run the code above in your browser using DataLab