Debian Codegraph @

man/tidy.gam.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/mgcv.R
3 \name{tidy.gam}
4 \alias{tidy.gam}
5 \alias{mgcv_tidiers}
6 \alias{gam_tidiers}
7 \title{Tidy a(n) gam object}
8 \usage{
9 \method{tidy}{gam}(
10 x,
11 parametric = FALSE,
12 conf.int = FALSE,
13 conf.level = 0.95,
14 exponentiate = FALSE,
15 ...
16 )
17 }
18 \arguments{
19 \item{x}{A \code{gam} object returned from a call to \code{\link[mgcv:gam]{mgcv::gam()}}.}
20
21 \item{parametric}{Logical indicating if parametric or smooth terms should
22 be tidied. Defaults to \code{FALSE}, meaning that smooth terms are tidied
23 by default.}
24
25 \item{conf.int}{Logical indicating whether or not to include a confidence
26 interval in the tidied output. Defaults to \code{FALSE}.}
27
28 \item{conf.level}{The confidence level to use for the confidence interval
29 if \code{conf.int = TRUE}. Must be strictly greater than 0 and less than 1.
30 Defaults to 0.95, which corresponds to a 95 percent confidence interval.}
31
32 \item{exponentiate}{Logical indicating whether or not to exponentiate the
33 the coefficient estimates. This is typical for logistic and multinomial
34 regressions, but a bad idea if there is no log or logit link. Defaults
35 to \code{FALSE}.}
36
37 \item{...}{Additional arguments. Not used. Needed to match generic
38 signature only. \strong{Cautionary note:} Misspelled arguments will be
39 absorbed in \code{...}, where they will be ignored. If the misspelled
40 argument has a default value, the default value will be used.
41 For example, if you pass \code{conf.lvel = 0.9}, all computation will
42 proceed using \code{conf.level = 0.95}. Two exceptions here are:
43 \itemize{
44 \item \code{tidy()} methods will warn when supplied an \code{exponentiate} argument if
45 it will be ignored.
46 \item \code{augment()} methods will warn when supplied a \code{newdata} argument if it
47 will be ignored.
48 }}
49 }
50 \description{
51 Tidy summarizes information about the components of a model.
52 A model component might be a single term in a regression, a single
53 hypothesis, a cluster, or a class. Exactly what tidy considers to be a
54 model component varies across models but is usually self-evident.
55 If a model has several distinct types of components, you will need to
56 specify which components to return.
57 }
58 \details{
59 When \code{parametric = FALSE} return columns \code{edf} and \code{ref.df} rather
60 than \code{estimate} and \code{std.error}.
61 }
62 \examples{
63 \dontshow{if (rlang::is_installed("mgcv")) withAutoprint(\{ # examplesIf}
64
65 # load libraries for models and data
66 library(mgcv)
67
68 # fit model
69 g <- gam(mpg ~ s(hp) + am + qsec, data = mtcars)
70
71 # summarize model fit with tidiers
72 tidy(g)
73 tidy(g, parametric = TRUE)
74 glance(g)
75 augment(g)
76 \dontshow{\}) # examplesIf}
77 }
78 \seealso{
79 \code{\link[=tidy]{tidy()}}, \code{\link[mgcv:gam]{mgcv::gam()}}
80
81 Other mgcv tidiers:
82 \code{\link{glance.gam}()}
83 }
84 \concept{mgcv tidiers}
85 \value{
86 A \code{\link[tibble:tibble]{tibble::tibble()}} with columns:
87 \item{estimate}{The estimated value of the regression term.}
88 \item{p.value}{The two-sided p-value associated with the observed statistic.}
89 \item{statistic}{The value of a T-statistic to use in a hypothesis that the regression term is non-zero.}
90 \item{std.error}{The standard error of the regression term.}
91 \item{term}{The name of the regression term.}
92 \item{edf}{The effective degrees of freedom. Only reported when
93 `parametric = FALSE`}
94 \item{ref.df}{The reference degrees of freedom. Only reported when
95 `parametric = FALSE`}
96
97 }