scam object produced by scam() and produces various useful
summaries from it. The same code as in summary.gam of the mgcv package is used here with slight modifications
to accept the exponentiated parameters of the monotone smooth terms and the corresponding covariance matrix.## S3 method for class 'scam':
summary(object, dispersion=NULL, freq=FALSE, alpha=0,...)
## S3 method for class 'summary.scam':
print(x,digits = max(3, getOption("digits") - 3),
signif.stars = getOption("show.signif.stars"),...)monogam object as produced by scam().summary.scam object produced by summary.scam().NULL to use estimate or
default (e.g. 1 for Poisson).summary.scam produces the same list of summary information for a fitted scam object as in the
unconstrained case summary.gam except for the last element BFGS termination condition.p.coeff's divided by their standard errors.freq=TRUE), divided
by scale parameter.freq=TRUE).bfgs_gcv.ubrefor details)scam## simulating data...
n <- 200
set.seed(1)
x1 <- runif(n)*6-3
f1 <- 3*exp(-x1^2) # unconstrained smooth term
x2 <- runif(n)*4-1;
f2 <- exp(4*x2)/(1+exp(4*x2)) # monotone increasing smooth
x3 <- runif(n)*5;
f3 <- -log(x3)/5 # monotone decreasing smooth
f <- f1+f2+f3
y <- f + rnorm(n)*0.3
dat <- data.frame(x1=x1,x2=x2,x3=x3,y=y)
## fit model ...
b <- scam(y~s(x1,k=15,bs="cr",m=2)+s(x2,k=30,bs="mpi",m=2)+s(x3,k=30,bs="mpd",m=2),
data=dat)
summary(b)
plot(b,pages=1)Run the code above in your browser using DataLab