% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/regression_table.R
\name{regression_table}
\alias{regression_table}
\title{Create table of regression model}
\usage{
regression_table(x, ...)
}
\arguments{
\item{x}{regression model}

\item{...}{passed to methods}

\item{args.list}{list of arguments passed to 'fun'.}

\item{fun}{function to use for table creation. Default is "gtsummary::tbl_regression".}
}
\value{
object of standard class for fun
}
\description{
Create table of regression model
}
\examples{
\dontrun{
tbl <- gtsummary::trial |>
  regression_model(
    outcome.str = "stage",
    fun = "MASS::polr"
  ) |>
  regression_table(args.list = list("exponentiate" = TRUE))
gtsummary::trial |>
  regression_model(
    outcome.str = "age",
    fun = "stats::lm",
    formula.str = "{outcome.str}~.",
    args.list = NULL
  ) |>
  regression_table() |>
  plot()
gtsummary::trial |>
  regression_model(
    outcome.str = "trt",
    fun = "stats::glm",
    args.list = list(family = binomial(link = "logit"))
  ) |>
  regression_table()
gtsummary::trial |>
  regression_model_uv(
    outcome.str = "trt",
    fun = "stats::glm",
    args.list = list(family = stats::binomial(link = "logit"))
  ) |>
  regression_table()
gtsummary::trial |>
  regression_model_uv(
    outcome.str = "stage",
    args.list = list(family = stats::binomial(link = "logit"))
  ) |>
  regression_table()
mtcars|>
 regression_model(
    outcome.str = "mpg",
    args.list = NULL)
  ) |>
  regression_table()


list(
  "Univariable" = regression_model_uv,
  "Multivariable" = regression_model
) |>
  lapply(\(.fun){
    do.call(
      .fun,
      c(
        list(data = gtsummary::trial),
        list(outcome.str = "stage")
      )
    )
  }) |>
  purrr::map(regression_table) |>
  tbl_merge()
}
}
