-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path02-DMT01.qmd
37 lines (30 loc) · 899 Bytes
/
02-DMT01.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
---
title: "Demographics and Baseline Characteristics (DMT01)"
editor: source
format:
html:
page-layout: full
code-fold: true
code-summary: "Show the code"
code-overflow: scroll
df-print: kable
---
```{css, echo = FALSE}
.output {
max-width: 800px;
overflow-x: scroll;
}
```
## Calculating DMT01 statstics using the {cards} package
In this example below, we calculate the same summary statistics usings the {cards} package with the same data set provided by the {chevron} package.
```{r}
#| code-summary: "Show the code"
library(cards)
library(chevron)
# build ARDs that calculate relevant statistics for continuous and categorical variables.
ards <- ard_stack(syn_data$adsl, ard_continuous(variables = c(AGE)),
ard_categorical(variables = c(AGEGR1, SEX, ETHNIC, RACE)),
.by = "ARM",
.overall = TRUE)
ards[, 1:8]
```