Takes either a data.frame or an ipw object and cycles through all of the given variables and computes summary statistcs across levels of treatment. Standardized mean difference and a distribution plot can also be added to the plot.

make_phr_table1(
  obj,
  ...,
  treat = NULL,
  use_treat_vars = FALSE,
  tab_stat = "Mean",
  tab_stat2 = "SD",
  smd = F,
  round = 2,
  side.by.side = F,
  totaln = T
)

Arguments

obj

Either a cmprisk object or a data.frame, if a data.frame then a treatmet variable must be specified if it is to be used

...

The covariates to be used in the table

treat

The stratifying/treatment variable. If the obj is a data.frame then treat is the first variable specified after the obj, whereas if it is an ipw object, then the treatment variable was previously specified in the model.

use_treat_vars

In addition to variables passed by the user, also include variables from treatment model in table

tab_stat

The type of statistic you want reported for continuous variables, options should be either "Mean" (default) or "Median"

tab_stat2

The secondary statistic, options should be either "SD" (default) for standard deviation, "CI" for confidence intervals, or "IQR" for inter-quartile range of the median

smd

Should the standardized mean difference be displayed default = F

round

The number of decimals results should be displayed

side.by.side

Should both the unweighted and weighted estimates be presented in the same table, defaults to F, not available for non, ipwrisk objects

totaln

Should n = be presented for each stratified group, defaults to T

Value

Returns a dataframe object

Author

Matt Phelan