library(gtsummary)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
trial %>%
tbl_summary()
| Characteristic |
N = 200 |
| Chemotherapy Treatment |
|
| Drug A |
98 (49%) |
| Drug B |
102 (51%) |
| Age |
47 (38, 57) |
| Unknown |
11 |
| Marker Level (ng/mL) |
0.64 (0.22, 1.41) |
| Unknown |
10 |
| T Stage |
|
| T1 |
53 (27%) |
| T2 |
54 (27%) |
| T3 |
43 (22%) |
| T4 |
50 (25%) |
| Grade |
|
| I |
68 (34%) |
| II |
68 (34%) |
| III |
64 (32%) |
| Tumor Response |
61 (32%) |
| Unknown |
7 |
| Patient Died |
112 (56%) |
| Months to Death/Censor |
22.4 (15.9, 24.0) |
names(trial)
## [1] "trt" "age" "marker" "stage" "grade" "response" "death"
## [8] "ttdeath"
# View(trial)
trial %>%
select(
age,
marker,
response,
death,
ttdeath
) %>%
tbl_summary(
statistic = list(
all_continuous()~c("{mean} ({sd})")
)
)
| Characteristic |
N = 200 |
| Age |
47 (14) |
| Unknown |
11 |
| Marker Level (ng/mL) |
0.92 (0.86) |
| Unknown |
10 |
| Tumor Response |
61 (32%) |
| Unknown |
7 |
| Patient Died |
112 (56%) |
| Months to Death/Censor |
19.6 (5.3) |