Calculate key descriptive statistics for a given set of data.
describe_data(data, data_name, criterion_name, baseline_value)
A data frame with a criterion variable criterion_name
.
A character string specifying a name for the data.
A character string specifying the criterion name.
The value in criterion_name
denoting the baseline
(e.g., TRUE
or FALSE
).
A data frame with the descriptive statistics.
data(heartdisease)
describe_data(heartdisease, "heartdisease",
criterion_name = "diagnosis",
baseline_value = TRUE)
#> # A tibble: 1 × 7
#> Name Cases_n Criterion Baseline_pct Predictors_n NAs_n NAs_pct
#> <chr> <int> <chr> <dbl> <dbl> <int> <dbl>
#> 1 heartdisease 303 diagnosis 45.9 13 0 0