confint.gam: Confidence Intervals for Model Parameters

Description Usage Arguments Value Examples

View source: R/confint.gam.R

Description

Computes confidence intervals for one or more parameters in a fitted model. This is a method specific to the "gam" class from package "mgcv".

Usage

1
2
## S3 method for class 'gam'
confint(object, parm = NULL, level = 0.95, ...)

Arguments

object

a fitted model object of class "gam".

parm

a specification of which parameters are to be given confidence intervals, either a vector of numbers or a vector of names. If missing, all parameters are considered.

level

the confidence level required.

...

not implemented

Value

A tidy data frame containing parameter names, Estimates and confidence intervals for parametric terms

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
set.seed(101)
library(dplyr)
library(mgcv)
dat <- data.frame(x = runif(n=100),
                  y = runif(n=100)) %>%
  dplyr::mutate(z = rnorm(n=100,
                   mean = 1 - 2*x - sin(2*pi*y),
                   sd = 0.1))

fit1 <- gam(data=dat, z ~ y + s(x))

confint(fit1)
confint(fit1, parm="y", level=0.8)

samclifford/mgcv.helper documentation built on Oct. 10, 2019, 6:05 p.m.