[R] Error using mgcv package

spime sabya23 at gmail.com
Mon Jun 11 12:30:27 CEST 2007


Hi all,

I need some solution in the following problem. The following error appears
when i use "mgcv" package for implementing GAM. But the same formula works
fine in "gam" package.

> model.gam <- gam(formula = RES ~
> CAT01+s(NUM01,5)+CAT02+CAT03+s(NUM02,5)+CAT04+
+ CAT05+s(NUM03,5)+CAT06+CAT07+s(NUM04,5)+CAT08+s(NUM05,5)+CAT09+
+ CAT10+s(NUM06,5)+CAT11+NUM07+CAT12+CAT13,
+ family = binomial(link = logit), data = train.data,na.action = na.exclude,
+ control = list(epsilon = 0.001,bf.epsilon = 0.001, maxit = 50, 
+ bf.maxit = 10, trace = F))

Error in terms.formula(reformulate(term[i])) : 
        invalid model formula in ExtractVars

And after deleting df's 

model.gam <- gam(formula = RES ~ CAT01+s(NUM01)+CAT02+CAT03+s(NUM02)+CAT04+
+ CAT05+s(NUM03)+CAT06+CAT07+s(NUM04)+CAT08+s(NUM05)+CAT09+
+ CAT10+s(NUM06)+CAT11+NUM07+CAT12+CAT13,
+ family = binomial(link = logit), data = train.data)

Error in smooth.construct.tp.smooth.spec(object, data, knots) : 
        A term has fewer unique covariate combinations than specified
maximum degrees of freedom
 

Can anybody show me some light in this case!!!

Thanks in advance.
-- 
View this message in context: http://www.nabble.com/Error-using-mgcv-package-tf3900783.html#a11058255
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list