How can I add a row of number missing into a baseline table created with dtable
in Stata 18?
Example baseline table:
clear
cls
webuse brcancer
/* Generate missing values */
set seed 1234
gen rand1 = runiform()
gen rand2 = runiform()
replace x1 = . if rand1 < 0.2
replace x2 = . if rand2 < 0.2
/* Baseline table */
dtable x1 i.x2, by(hormon)
----------------------------------------------------------------
Hormonal therapy
0 1 Total
----------------------------------------------------------------
N 440 (64.1%) 246 (35.9%) 686 (100.0%)
Age (years) 51.256 (10.020) 57.368 (9.127) 53.436 (10.135)
Menopausal status
1 185 (52.3%) 43 (22.6%) 228 (41.9%)
2 169 (47.7%) 147 (77.4%) 316 (58.1%)
----------------------------------------------------------------
For each missing, I would makea row of missing
with the number.