-
Notifications
You must be signed in to change notification settings - Fork 110
/
tbl_regression_methods.Rd
119 lines (100 loc) · 3.82 KB
/
tbl_regression_methods.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tbl_regression_methods.R
\name{tbl_regression_methods}
\alias{tbl_regression_methods}
\alias{tbl_regression.model_fit}
\alias{tbl_regression.workflow}
\alias{tbl_regression.survreg}
\alias{tbl_regression.mira}
\alias{tbl_regression.mipo}
\alias{tbl_regression.lmerMod}
\alias{tbl_regression.glmerMod}
\alias{tbl_regression.glmmTMB}
\alias{tbl_regression.glmmadmb}
\alias{tbl_regression.stanreg}
\alias{tbl_regression.brmsfit}
\alias{tbl_regression.gam}
\alias{tbl_regression.tidycrr}
\alias{tbl_regression.crr}
\alias{tbl_regression.multinom}
\title{Methods for tbl_regression}
\usage{
\method{tbl_regression}{model_fit}(x, ...)
\method{tbl_regression}{workflow}(x, ...)
\method{tbl_regression}{survreg}(
x,
tidy_fun = function(x, ...) dplyr::filter(broom::tidy(x, ...), .data$term !=
"Log(scale)"),
...
)
\method{tbl_regression}{mira}(x, tidy_fun = pool_and_tidy_mice, ...)
\method{tbl_regression}{mipo}(x, ...)
\method{tbl_regression}{lmerMod}(
x,
tidy_fun = function(x, ...) broom.mixed::tidy(x, ..., effects = "fixed"),
...
)
\method{tbl_regression}{glmerMod}(
x,
tidy_fun = function(x, ...) broom.mixed::tidy(x, ..., effects = "fixed"),
...
)
\method{tbl_regression}{glmmTMB}(
x,
tidy_fun = function(x, ...) broom.mixed::tidy(x, ..., effects = "fixed"),
...
)
\method{tbl_regression}{glmmadmb}(
x,
tidy_fun = function(x, ...) broom.mixed::tidy(x, ..., effects = "fixed"),
...
)
\method{tbl_regression}{stanreg}(
x,
tidy_fun = function(x, ...) broom.mixed::tidy(x, ..., effects = "fixed"),
...
)
\method{tbl_regression}{brmsfit}(
x,
tidy_fun = function(x, ...) broom.mixed::tidy(x, ..., effects = "fixed"),
...
)
\method{tbl_regression}{gam}(x, tidy_fun = tidy_gam, ...)
\method{tbl_regression}{tidycrr}(x, tidy_fun = tidycmprsk::tidy, ...)
\method{tbl_regression}{crr}(x, ...)
\method{tbl_regression}{multinom}(x, ...)
}
\arguments{
\item{x}{(regression model)\cr
Regression model object}
\item{...}{arguments passed to \code{tbl_regression()}}
\item{tidy_fun}{(\code{function})\cr
Tidier function for the model. Default is to use \code{broom::tidy()}.
If an error occurs, the tidying of the model is attempted with
\code{parameters::model_parameters()}, if installed.}
}
\description{
Most regression models are handled by \code{\link[=tbl_regression]{tbl_regression()}},
which uses \code{\link[broom:reexports]{broom::tidy()}} to perform initial tidying of results. There are,
however, some model types that have modified default printing behavior.
Those methods are listed below.
}
\section{Methods}{
The default method for \code{tbl_regression()} model summary uses \code{broom::tidy(x)}
to perform the initial tidying of the model object. There are, however,
a few models that use \link[=tbl_regression_methods]{modifications}.
\itemize{
\item \code{"parsnip/workflows"}: If the model was prepared using parsnip/workflows,
the original model fit is extracted and the original \verb{x=} argument
is replaced with the model fit. This will typically go unnoticed; however,if you've
provided a custom tidier in \verb{tidy_fun=} the tidier will be applied to the model
fit object and not the parsnip/workflows object.
\item \code{"survreg"}: The scale parameter is removed, \code{broom::tidy(x) \%>\% dplyr::filter(term != "Log(scale)")}
\item \code{"multinom"}: This multinomial outcome is complex, with one line per covariate per outcome (less the reference group)
\item \code{"gam"}: Uses the internal tidier \code{tidy_gam()} to print both parametric and smooth terms.
\item \code{"lmerMod"}, \code{"glmerMod"}, \code{"glmmTMB"}, \code{"glmmadmb"}, \code{"stanreg"}, \code{"brmsfit"}: These mixed effects
models use \code{broom.mixed::tidy(x, effects = "fixed")}. Specify \code{tidy_fun = broom.mixed::tidy}
to print the random components.
}
}
\keyword{internal}