Re: [R] Help with GAM (mgcv)

2010-12-06 Thread Stressed1985
Ye Thank you so much, finally i have something to look at. Just got to interpret the bloomin' thing now! -- View this message in context: http://r.789695.n4.nabble.com/Help-with-GAM-mgcv-tp3074165p3074414.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] Help with GAM (mgcv)

2010-12-06 Thread Simon Wood
OK, try... model3=gam(Symptoms~as.factor(txerad)+as.factor(maritalStatus),family=binomial,data=data2) or model3=gam(data2$Symptoms~as.factor(data2$txerad)+as.factor(data2$maritalSt atus),family=binomial) ... both types of construction work with the current mgcv:gam (and with glm). Your constructi

Re: [R] Help with GAM (mgcv)

2010-12-06 Thread Stressed1985
Ok, i just tried this: library(mgcv) model3=gam(data2$Symptoms~as.factor(data2$txerad)+as.factor(data2$maritalStatus),family=binomial,data=data2) And im still getting this error! Error in dl[[i]] : subscript out of bounds -- View this message in context: http://r.789695.n4.nabble.com/Help-w

Re: [R] Help with GAM (mgcv)

2010-12-06 Thread Simon Wood
Probably the problem is with trying to smooth maritalStatus, which is a factor variable. Smooths are generally functions of metric variables (i.e. variables that take numerical values, where the ordering is meaningful). You can have random effect smooths and markov random field smooths in more r

Re: [R] Help with GAM (mgcv)

2010-12-06 Thread Stressed1985
Thank you for your reply! It says: This is mgcv 1.5-5 . For overview type `help("mgcv-package")'. Its version: R 2.9.2 And summary(data2) gives: id age bmi siblingsgender Min. : 1.0 Min. :32.19 Min. :16.41 Min. :0.000 Fem

Re: [R] Help with GAM (mgcv)

2010-12-06 Thread Simon Wood
On Monday 06 December 2010 09:33, Stressed1985 wrote: > Please help! Im trying to run a GAM: > > model3=gam(data2$Symptoms~as.factor(data2$txerad)+s(data2$maritalStatus),fa >mily=binomial,data=data2) > > But keep getting this error: > Error in dl[[i]] : subscript out of bounds > > Can someone pleas

[R] Help with GAM (mgcv)

2010-12-06 Thread Stressed1985
Please help! Im trying to run a GAM: model3=gam(data2$Symptoms~as.factor(data2$txerad)+s(data2$maritalStatus),family=binomial,data=data2) But keep getting this error: Error in dl[[i]] : subscript out of bounds Can someone please tell me what this error is? Thanks -- View this message in cont