summary: Summary methods for Fit Models

summaryR Documentation

Summary methods for Fit Models

Description

summary methods for object classes "gsm", "sm", and "ss".

Usage

## S3 method for class 'gsm'
summary(object, ...)

## S3 method for class 'sm'
summary(object, ...)

## S3 method for class 'ss'
summary(object, ...)

## S3 method for class 'summary.gsm'
print(x, digits = max(3, getOption("digits") - 3), 
      signif.stars = getOption("show.signif.stars"), ...)

## S3 method for class 'summary.sm'
print(x, digits = max(3, getOption("digits") - 3), 
      signif.stars = getOption("show.signif.stars"), ...)

## S3 method for class 'summary.ss'
print(x, digits = max(3, getOption("digits") - 3), 
      signif.stars = getOption("show.signif.stars"), ...)

Arguments

object

an object of class "gsm" output by the gsm function, "sm" output by the sm function, or "ss" output by the ss function

x

an object of class "summary.gsm" output by the summary.gsm function, "summary.sm" output by the summary.sm function, or "summary.ss" output by the summary.ss function.

digits

the minimum number of significant digits to be printed in values.

signif.stars

logical. If TRUE, ‘significance stars’ are printed for each coefficient.

...

additional arguments affecting the summary produced (currently ignored).

Details

Summary includes information for assessing the statistical and practical significance of the model terms.

Statistical inference is conducted via (approximate) frequentist chi-square tests using the Bayesian interpretation of a smoothing spline (Nychka, 1988; Wahba, 1983).

With multiple smooth terms included in the model, the inferential results may (and likely will) differ slightly depending on the tprk argument (when using the gsm and sm functions).

If significance testing is of interest, the tprk = FALSE option may be desirable, given that this allows for unique basis function coefficients for each model term.

In all cases, the inferential results are based on a (pseudo) F or chi-square statistic which fails to consider the uncertainty of the smoothing parameter estimation.

Value

residuals

the deviance residuals.

fstatistic

the F statistic for testing all effects (parametric and smooth).

dev.expl

the explained deviance.

p.table

the coefficient table for (approximate) inference on the parametric terms.

s.table

the coefficient table for (approximate) inference on the smooth terms.

dispersion

the estimate of the dispersion parameter.

r.squared

the observed coefficient of multiple determination.

adj.r.squared

the adjusted coefficient of multiple determination.

kappa

the collinearity indices, i.e., square-roots of the variance inflation factors (see varinf). A value of 1 indicates no collinearity, and higher values indicate more collinearity of a given term with other model terms.

pi

the importance indices. Larger values indicate more importance, and the values satisfy sum(pi) = 1. Note that elements of pi can be negative.

call

the original function call.

family

the specified family (for gsm objects).

Author(s)

Nathaniel E. Helwig <helwig@umn.edu>

References

Helwig, N. E. (2020). Multiple and Generalized Nonparametric Regression. In P. Atkinson, S. Delamont, A. Cernat, J. W. Sakshaug, & R. A. Williams (Eds.), SAGE Research Methods Foundations. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.4135/9781526421036885885")}

Nychka, D. (1988). Bayesian confience intervals for smoothing splines. Journal of the American Statistical Association, 83(404), 1134-1143. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.2307/2290146")}

Wahba, G. (1983). Bayesian "confidence intervals" for the cross-validated smoothing spline. Journal of the Royal Statistical Society. Series B, 45(1), 133-150. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/j.2517-6161.1983.tb01239.x")}

See Also

gsm, sm, and ss

Examples

### Example 1: gsm

# generate data
set.seed(1)
n <- 1000
x <- seq(0, 1, length.out = n)
z <- factor(sample(letters[1:3], size = n, replace = TRUE))
fun <- function(x, z){
  mu <- c(-2, 0, 2)
  zi <- as.integer(z)
  fx <- mu[zi] + 3 * x + sin(2 * pi * x + mu[zi]*pi/4)
}
fx <- fun(x, z)
y <- rbinom(n = n, size = 1, p = 1 / (1 + exp(-fx)))

# define marginal knots
probs <- seq(0, 0.9, by = 0.1)
knots <- list(x = quantile(x, probs = probs),
              z = letters[1:3])

# fit sm with specified knots (tprk = TRUE)
gsm.ssa <- gsm(y ~ x * z, family = binomial, knots = knots)
summary(gsm.ssa)

# fit sm with specified knots (tprk = FALSE)
gsm.gam <- gsm(y ~ x * z, family = binomial, knots = knots, tprk = FALSE)
summary(gsm.gam)


### Example 2: sm

# generate data
set.seed(1)
n <- 100
x <- seq(0, 1, length.out = n)
z <- factor(sample(letters[1:3], size = n, replace = TRUE))
fun <- function(x, z){
  mu <- c(-2, 0, 2)
  zi <- as.integer(z)
  fx <- mu[zi] + 3 * x + sin(2 * pi * x + mu[zi]*pi/4)
}
fx <- fun(x, z)
y <- fx + rnorm(n, sd = 0.5)

# define marginal knots
probs <- seq(0, 0.9, by = 0.1)
knots <- list(x = quantile(x, probs = probs),
              z = letters[1:3])

# fit sm with specified knots (tprk = TRUE)
sm.ssa <- sm(y ~ x * z, knots = knots)
summary(sm.ssa)

# fit sm with specified knots (tprk = FALSE)
sm.gam <- sm(y ~ x * z, knots = knots, tprk = FALSE)
summary(sm.gam)


### Example 3: ss

# generate data
set.seed(1)
n <- 100
x <- seq(0, 1, length.out = n)
fx <- 2 + 3 * x + sin(2 * pi * x)
y <- fx + rnorm(n, sd = 0.5)

# regular smoothing spline
ss.reg <- ss(x, y, nknots = 10)
summary(ss.reg)


npreg documentation built on May 29, 2024, 4:17 a.m.

Related to summary in npreg...