add_nevent_regression: Add event N to regression table

Description Usage Arguments Example Output Examples

Description

Add event N to regression table

Usage

1
2
3
4
5
## S3 method for class 'tbl_regression'
add_nevent(x, location = NULL, ...)

## S3 method for class 'tbl_uvregression'
add_nevent(x, location = NULL, ...)

Arguments

x

a tbl_regression or tbl_uvregression table

location

location to place Ns. When "label" total Ns are placed on each variable's label row. When "level" level counts are placed on the variable level for categorical variables, and total N on the variable's label row for continuous.

...

Not used

Example Output

Example 1

Example 2

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Example 1 ----------------------------------
add_nevent.tbl_regression_ex1 <-
  trial %>%
  select(response, trt, grade) %>%
  tbl_uvregression(
    y = response,
    method = glm,
    method.args = list(family = binomial),
  ) %>%
  add_nevent()
# Example 2 ----------------------------------
add_nevent.tbl_regression_ex2 <-
  glm(response ~ age + grade, trial, family = binomial) %>%
  tbl_regression(exponentiate = TRUE) %>%
  add_nevent(location = "level")

ddsjoberg/gtsummary documentation built on April 8, 2021, 5:48 a.m.