Make demographics table
Usage
make_demographics_table(
data,
strata = "Gender",
vars = c("Age at visit", "Primary Race/Ethnicity", "FXTAS Stage", "CGG"),
make_ft = TRUE,
...
)
Arguments
- data
a data.frame containing the variables specified by
strata
andvars
- strata
names of column variable, specified as character
- vars
names of row variables, specified as character
- make_ft
logical whether to convert to flextable
- ...
Arguments passed on to
format_demographics_table_as_flextable
Examples
test_data_v1 |> make_demographics_table()
#> 3 missing rows in the "FX*" column have been removed.
#> 1 missing row in the "FX*" column has been removed.
Male
Female
M vs. F
(all CGG combined)
Characteristic
CGG <55
N = 47a
CGG ≥ 55
N = 192a
CGG <55
N = 11a
CGG ≥ 55
N = 58a
p-valueb
Age at visit
0.382c
Mean (SD)
60.1 (9.59)
62.7 (9.39)
62.3 (11.19)
63.4 (10.10)
Median [Min, Max]
60 [40, 78]
63 [41, 85]
62 [47, 80]
64 [41, 84]
Missing
0 (0%)
2 (1.0%)
Primary race/ethnicity
0.646d
White
41 (98%)
161 (90%)
9 (100%)
47 (87%)
Hispanic
1 (2.4%)
12 (6.7%)
0 (0%)
4 (7.4%)
Black
0 (0%)
1 (0.6%)
0 (0%)
1 (1.9%)
Other
0 (0%)
5 (2.8%)
0 (0%)
2 (3.7%)
Missing
5 (11%)
13 (6.8%)
2 (18%)
4 (6.9%)
FXTAS stage
0.485d
0
13 (30%)
69 (38%)
5 (56%)
12 (24%)
1
8 (19%)
23 (13%)
1 (11%)
6 (12%)
2
6 (14%)
33 (18%)
2 (22%)
15 (29%)
3
11 (26%)
41 (23%)
1 (11%)
14 (27%)
4
3 (7.0%)
13 (7.2%)
0 (0%)
4 (7.8%)
5
2 (4.7%)
2 (1.1%)
0 (0%)
0 (0%)
Missing
4 (8.5%)
11 (5.7%)
2 (18%)
7 (12%)
CGG
0.627c
Mean (SD)
77.3 (28.29)
84.7 (63.91)
69.7 (29.30)
77.9 (30.03)
Median [Min, Max]
85 [23, 130]
84 [20, 845]
70 [30, 106]
79 [20, 145]
Missing
0 (0%)
1 (0.5%)
an (%)
bp-values represent tests for sex differences in distributions of characteristics, all CGG repeat levels.
cp-value for significance of sex difference by Wilcoxon rank sum test
dp-value for significance of sex difference by Fisher's exact test