Hi R community!
I am analyzing the data set "motorins" in the package "faraway" by using
the generalized additive model. it shows the following error. Can some one
suggest me the right way?

library(faraway)
data(motorins)
motori <- motorins[motorins$Zone==1,]
library(mgcv)
>amgam <- gam(log(Payment) ~ offset(log(Insured))+
s(as.numeric(Kilometres)) + s(Bonus) + Make + s(Claims),family = gaussian,
data = motori)
Error in smooth.construct.tp.smooth.
spec(object, dk$data, dk$knots) :
  A term has fewer unique covariate combinations than specified maximum
degrees of freedom
> summary(amgam)
Error in summary(amgam) : object 'amgam' not found
Gyan

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to