Helper function for make_table2.cumrisk

table2_helper_cumrisk(
  fit_models,
  effect_measure_type = "RD",
  rate_round = 2,
  pt_round = 0,
  pt_scale = 1,
  risk_round = 1,
  risk_time = NULL,
  alpha = 0.05,
  rate_alpha = 0.05,
  ref = 1,
  boot_method = "normal",
  caption = "",
  table_footer = "",
  calc_rate_ci = FALSE,
  scale_pt_display = TRUE
)

Arguments

fit_models

a list of fit cumrisk objects

effect_measure_type

A string identifying the type of effect measure to be computed from among the following options for a given method.

  • cumrisk: "RD" (risk difference), "RR" (risk ratio), "logRR" (logarithm of the risk ratio), or "AR" (attributable risk)

  • cumcount: "CD" (count difference) or "CR" (count ratio)

Note that when a given input results object was created using bootstrap estimation and boot_method is "log-normal", then only effect measures with support on the positive real line can be used (i.e. "RR" or "CR"). See the Cumulative risk effect measure types and Cumulative count effect measure types sections for the definitions of the various effect measures.

rate_round

The number of significant digits used for rounding the rate

pt_round

The number of significant digits used for rounding person-time

pt_scale

A scaling factor for the person time (default pt_scale = 1).

risk_round

The number of significant digits used for rounding the risk

risk_time

The time at which the cumulative risk estimates should be returned (the default value of NULL returns all times)

alpha

The desired nominal significance level of the confidence intervals

rate_alpha

The desired nominal significance level of the confidence intervals for the rate

ref

The category to use as the reference for effect measure calculations.

boot_method

The specific bootstrap approach used to compute confidence intervals (default method = "normal" for a normal approximation on the risk scale, other choices include "log-normal" for normal approximation on the log scale). When a given input results object was created without using bootstrap estimation then the value of boot_method is ignored. Note that when a given input results object was created using bootstrap estimation and boot_method is "log-normal", then only effect measures specified via effect_measure_type with support on the positive real line can be used.

caption

Text that will be added above the top left of the table, ie a title to the table

table_footer

Additional footer information accepts html formatting

calc_rate_ci

Logical that allows user to output confidence intervals for rates in table 2. Defaults to FALSE.

scale_pt_display

Logical that allows user to turn off pt_scale for person-time but not for rate (default = TRUE)

Value

The resulting table as data.frame which can be passed to table rendering functions such as datatable or kable.

Author

M. Alan Brookhart & Robert A. Overman