gam.sig.start {spgam} | R Documentation |
~~ A concise (1-5 lines) description of what the function does. ~~
gam.sig.start(form, gam.data, pts, region, h, ngrid)
form |
~~Describe form here~~ |
gam.data |
~~Describe gam.data here~~ |
pts |
~~Describe pts here~~ |
region |
~~Describe region here~~ |
h |
~~Describe h here~~ |
ngrid |
~~Describe ngrid here~~ |
~~ If necessary, more details than the description above ~~
~Describe the value returned If it is a LIST, use
comp1 |
Description of 'comp1' |
comp2 |
Description of 'comp2' |
...
....
~~further notes~~
~Make other sections like Warning with section{Warning }{....} ~
~~who you are~~
~put references to the literature/web site here ~
~~objects to See Also as help
, ~~~
##---- Should be DIRECTLY executable !! ---- ##-- ==> Define data, use random, ##-- or do help(data=index) for the standard data sets. ## The function is currently defined as function(form,gam.data,pts,region,h,ngrid) { ################ Tolerance interval for GAM #################### # Let gam.data be original data used for doing gamfit # Let fitted.gam be the result of doing a gamfit # Let h be chosen smoothing parameter # sets things up for doing signicance... formul=formula(form) termos<-terms(formul) at<-as.character(attr(termos,"variables"))[-1] data<-as.data.frame(as.matrix(gam.data[,at])) fit=glm(formul,family=binomial,data=data) prob=predict(fit,type='response') fit=gamfit(form,gam.data,pts=pts,region=region,h=h,ngrid=ngrid) surf.est=fit$g2est$z list(prob=prob,surf.est=surf.est,h=h,x=fit$g2est$x,y=fit$g2est$y, tvalobs=mean(fit$g2^2)) }