Last chance! 50% off unlimited learning
Sale ends in
hunua
data frame has 392 rows and 18 columns.
Altitude is explanatory, and there are binary responses
(presence/absence = 1/0 respectively) for 17 plant species.data(hunua)
waitakere
.# Fit a GAM using vgam() and compare it with the Waitakere Ranges one
fit.h <- vgam(agaaus ~ s(altitude, df = 2), binomialff, data = hunua)
plot(fit.h, se = TRUE, lcol = "orange", scol = "orange",
llwd = 2, slwd = 2, main = "Orange is Hunua, Blue is Waitakere")
head(predict(fit.h, hunua, type = "response"))
fit.w <- vgam(agaaus ~ s(altitude, df = 2), binomialff, data = waitakere)
plot(fit.w, se = TRUE, lcol = "blue", scol = "blue", add = TRUE)
head(predict(fit.w, hunua, type = "response")) # Same as above?
Run the code above in your browser using DataLab