Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mod <- gam(bodyMass ~ s(Age, bs = "cr"), data = mydata, method = "REML")
- pred <- with(mydata, data.frame(Age = seq(min(Age), max(Age), length = 100)))
- pred <- transform(pred,
- bodyMass = predict(mod, newdata = pred))
- plot(bodyMass ~ Age, data = mydata)
- lines(bodyMass ~ Age, data = pred, col = "red", lwd = 2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement