[R] Probelms on using gam(mgcv)

From: zhijie zhang <epistat_at_gmail.com>
Date: Thu, 13 Dec 2007 12:36:08 +0800


Dear all,

   Following the help from gam(mgcv) help page, i tried to analyze my dataset with all the default arguments. Unfortunately, it can't be run successfully. I list the errors below.

#m.gam<-gam(mark~s(x,y)+s(lstday2004)+s(slope)+s(ndvi2004)+s(elevation)+s(disbinary),family=binomial(logit),data=point)

m.gam<-gam(mark~s(x,y,k=10)+s(lstday2004,k=10)+s(slope,k=10)+s(ndvi2004,k=10)+s(elevation,k=10)+s(disbinary,k=10),family=binomial(logit),data=point)

> m.gam<-gam(mark~s(x.1,y.1,k=10)+s(lstday2004,k=10)+s(slope,k=10)+s(ndvi2004,k=10)+s(elevation,k=10)+s(disbinary,k=10),family=binomial(logit),data=point)
#??????
Errors: smooth.construct.tp.smooth.spec(object, data, knots) :   A term has fewer unique covariate combinations than specified maximum degrees of freedom.

#========================#

  Descriptions for my dataset
#========================#

  There are 1 response variable "mark" (1-case,0-control), and 7 explanatory covariables.
 x/y are spatial coordinates,
lstday2004, slope, ndvi2004, elevation: continuous variables; disbinary : binary variable.
  Is there any problems with the above codes? How should i solve it?   Any help or suggestions are greatly appreciated.
-- 
With Kind Regards,

oooO:::::::::
(..):::::::::
:\.(:::Oooo::
::\_)::(..)::
:::::::)./:::
::::::(_/::::
:::::::::::::
[***********************************************************************]
Zhi Jie,Zhang ,PHD
Tel:+86-21-54237149
Dept. of Epidemiology,School of Public Health,Fudan University
Address:No. 138 Yi Xue Yuan Road,Shanghai,China
Postcode:200032
Email:epistat_at_gmail.com
Website: www.statABC.com <http://www.statabc.com/>
[***********************************************************************]
oooO:::::::::
(..):::::::::
:\.(:::Oooo::
::\_)::(..)::
:::::::)./:::
::::::(_/::::
:::::::::::::

	[[alternative HTML version deleted]]

______________________________________________
R-help_at_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.
Received on Thu 13 Dec 2007 - 04:41:11 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 13 Dec 2007 - 12:30:18 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.