inst/scripts/mackgam.q

library(gam)
model1  <- gam(log(Density) ~ lo(log(mack.depth)) + lo(Temperature)
            + lo(mack.lat, mack.long), data = mackerel)
print(model1)
print(gam(log(Density) ~ lo(Temperature) + lo(mack.lat, mack.long),
            data = mackerel))
print(gam(log(Density) ~ lo(log(mack.depth))  + lo(mack.lat, mack.long),
            data = mackerel))
print(gam(log(Density) ~ lo(log(mack.depth))  + lo(Temperature),
            data = mackerel))
par(mfrow=c(2,2))
plot(model1, se = TRUE)
par(mfrow=c(1,1))

Try the sm package in your browser

Any scripts or data that you put into this service are public.

sm documentation built on May 1, 2019, 8:06 p.m.