Description Usage Arguments Value Methods Examples
This function calculates the unadjusted or adjusted difference in rates with confidence interval.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
data |
A data frame |
y |
vector of binary outcome variables. Outcome variables can be numeric, character or factor, but must have two and only two non-missing levels |
x |
string indicating the binary stratifying variable. The stratifying variable can be numeric, character or factor, but must have two and only two non-missing levels |
formula |
By default, |
label |
List of formulas specifying variables labels, If a variable's label is
not specified here, the label attribute ( |
statistic |
Statistics to display for each group. Default |
method |
The method for calculating p-values and confidence intervals around the
difference in rates. The options are |
conf.level |
Confidence level of the returned confidence interval. Must be a single number between 0 and 1. The default is a 95% confidence interval. |
bootstrapn |
The number of bootstrap resamples to use. The default is 2000
for |
estimate_fun |
Function to round and format estimates. By default
|
pvalue_fun |
Function to round and format p-value. By default
|
A tbl_propdiff
object, with sub-class "gtsummary"
The chisq
option returns a p-value from the prop.test
function and a
confidence interval for the unadjusted difference in proportions based on
the normal approximation.
The exact
option returns a p-value from the fisher.test
function. The
confidence interval returned by this option is the same as the confidence
interval returned by the chisq
option and is based on the normal approximation.
The boot_centile
option calculates the adjusted difference between groups
in all bootstrap samples (the default for this method is 2000 resamples)
and generates the confidence intervals from the distribution of these
differences. For the default, a 95% confidence interval, the 2.5 and 97.5
centiles are used. The p-value presented is from a logistic regression model.
The boot_sd
option calculates the adjusted difference between groups
in all bootstrap samples (the default for this method is 200 resamples).
The mean and standard deviation of the adjusted difference across all
resamples are calculated. The standard deviation is then used as the
standard error to calculate the confidence interval based on the true
adjusted difference. The p-value presented is from a logistic regression model.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | tbl_propdiff(
data = trial,
y = "response",
x = "trt"
)
tbl_propdiff(
data = trial,
y = "response",
x = "trt",
formula = "{y} ~ {x} + age + stage",
method = "boot_sd",
bootstrapn = 25
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.