gam.sig.start {spgam}R Documentation

~~function to do ... ~~

Description

~~ A concise (1-5 lines) description of what the function does. ~~

Usage

gam.sig.start(form, gam.data, pts, region, h, ngrid)

Arguments

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~~

Details

~~ If necessary, more details than the description above ~~

Value

~Describe the value returned If it is a LIST, use

comp1 Description of 'comp1'
comp2 Description of 'comp2'

...

Warning

....

Note

~~further notes~~

~Make other sections like Warning with section{Warning }{....} ~

Author(s)

~~who you are~~

References

~put references to the literature/web site here ~

See Also

~~objects to See Also as help, ~~~

Examples

##---- 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))
  }

[Package spgam version 1.0 Index]