Learn R Programming

scam (version 1.0)

summary.scam: Summary for a SCAM fit

Description

Takes a fitted 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.

Usage

## 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"),...)

Arguments

object
a fitted monogam object as produced by scam().
x
a summary.scam object produced by summary.scam().
dispersion
A known dispersion parameter. NULL to use estimate or default (e.g. 1 for Poisson).
freq
By default p-values for individual terms are calculated using the frequentist estimated covariance matrix of the parameter estimators. If this is set to FALSE then the Bayesian covariance matrix of the parameters is used instead.
alpha
adjustment to reference distribution per estimated smoothing parameter.
digits
controls number of digits printed in output.
signif.stars
Should significance stars be printed alongside output.
...
other arguments.

Value

  • 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.coeffis an array of estimates of the strictly parametric model coefficients.
  • p.tis an array of the p.coeff's divided by their standard errors.
  • p.pvis an array of p-values for the null hypothesis that the corresponding parameter is zero. Calculated with reference to the t distribution with the estimated residual degrees of freedom for the model fit if the dispersion parameter has been estimated, and the standard normal if not.
  • mThe number of smooth terms in the model.
  • chi.sqAn array of test statistics for assessing the significance of model smooth terms. See details.
  • s.pvAn array of approximate p-values for the null hypotheses that each smooth term is zero. Be warned, these are only approximate.
  • searray of standard error estimates for all parameter estimates.
  • r.sqThe adjusted r-squared for the model. Defined as the proportion of variance explained, where original variance and residual variance are both estimated using unbiased estimators. This quantity can be negative if your model is worse than a one parameter constant model, and can be higher for the smaller of two nested models! Note that proportion null deviance explained is probably more appropriate for non-normal errors.
  • dev.explThe proportion of the null deviance explained by the model.
  • edfarray of estimated degrees of freedom for the model terms.
  • residual.dfestimated residual degrees of freedom.
  • nnumber of data.
  • gcvminimized GCV score for the model, if GCV used.
  • ubreminimized UBRE score for the model, if UBRE used.
  • scaleestimated (or given) scale parameter.
  • familythe family used.
  • formulathe original GAM formula.
  • dispersionthe scale parameter.
  • pTerms.dfthe degrees of freedom associated with each parameteric term (excluding the constant).
  • pTerms.chi.sqa Wald statistic for testing the null hypothesis that the each parametric term is zero.
  • pTerms.pvp-values associated with the tests that each term is zero. For penalized fits these are approximate. The reference distribution is an appropriate chi-squared when the scale parameter is known, and is based on an F when it is not.
  • cov.unscaledThe estimated covariance matrix of the parameters (or estimators if freq=TRUE), divided by scale parameter.
  • cov.scaledThe estimated covariance matrix of the parameters (estimators if freq=TRUE).
  • p.tablesignificance table for parameters
  • s.tablesignificance table for smooths
  • p.Termssignificance table for parametric model terms
  • BFGS termination conditionthe value of the maximum component of the scaled GCV/UBRE gradient used as stopping condition. This value is printed if the termination code of the BFGS optimization process is not `1' (not full convergence) (see bfgs_gcv.ubrefor details)

WARNING

The p-values are approximate.

References

Wood S.N. (2006) Generalized Additive Models: An Introduction with R. Chapman and Hall/CRC Press. Pya, N. (2010) Additive models with shape constraints. PhD thesis. University of Bath. Department of Mathematical Sciences

See Also

scam

Examples

Run this code
## 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