make_table1.Rd
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_table1(
obj,
treat = NULL,
...,
vr = NULL,
use_treat_vars = FALSE,
tab_stat = "Mean",
tab_stat2 = "SD",
smd = F,
smd_lower_limit = FALSE,
round = 2,
format = "markdown",
collapse.columns = FALSE,
graph = FALSE,
side.by.side = FALSE,
caption = "",
totaln = TRUE,
table_footer = "",
colors = "Dark2",
theme = "basic"
)
Either a cmprisk
object or a data.frame
, if a data.frame
then a treatment variable must
be specified if it is to be used
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. It can also be omitted by entering all of the variables in the vr
statement.
The covariates to be used in the table
The variable(s) which should be included in the table. If
null, then all of the variables within ...
are included in the table.
It defaults to null.
In addition to variables passed by the user, also include variables from treatment model in table
The type of statistic you want reported for continuous variables, options should be either "Mean" (default) or "Median"
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
Should the standardized mean difference be displayed, default = FALSE
Should smd display show '<0.01' for small values
The number of decimals results should be displayed
Deprecated. You can add/modify format my modifying output gt
object.
Deprecated. You can add/modify table my modifying output gt
object.
Returns a distribution graph (default = FALSE
)
Should both the unweighted and weighted estimates be presented in the same table, defaults to FALSE
, not available for non-ipwrisk
objects
Deprecated. You can add/modify caption my modifying output gt
object.
Should n = be presented for each stratified group, defaults to TRUE
Deprecated. You can add/modify footer my modifying output gt
object.
The color scheme used for distribution graphs (when applicable)
Appearance of table, can be either "basic" or "jama"
Returns a gt
object
if (FALSE) {
make_table1(example1, Statin, DxRisk, Frailty, Sex, graph = TRUE)
make_table1(example1, Statin, vr = c("DxRisk", "Frailty", "Sex"), graph = TRUE)
make_table1(example1, vr = c("DxRisk", "Frailty"))
make_table1(example1, Statin, DxRisk, Frailty, Sex, graph = TRUE)
make_table1(example1, Statin, DxRisk, Frailty, Sex, graph = TRUE, smd = TRUE)
make_table1(example1, Statin, DxRisk)
}