Hello everyone,
I just switched to STATA 18 and I'm exploring the "dtable" function for descriptive tables. I have two questions: is it possible to count missing data, and how can I display the parameters of quantitative variables in rows? I'm sharing my code and a copy-paste of what I would like to achieve:
dtable Age i.sex, ///
sample(, statistics(freq) place(seplabels)) ///
continuous(, statistic(mean sd p25 med p75 min max)) ///
factor(, statistic(fvfrequency fvpercent)) ///
sformat("(N=%s)" frequency) ///
note(Total sample: N = 19) ///
nformat(%7.2f mean sd) ///
Gender [n (%)] | |||
n/missing | 154/0 | 146/0 | 300/0 |
Male | 99 (64.3) | 83 (56.8) | 182 (60.7) |
Female | 55 (35.7) | 63 (43.2) | 118 (39.3) |
Age (years) | |||
n/missing | 154/0 | 146/0 | 300/0 |
Mean (SD) | 56.9 (7.48) | 56.4 (6.96) | 56.7 (7.22) |
Median | 58.0 | 58.0 | 58.0 |
Q1; Q3 | 52.0; 63.0 | 52.0; 62.0 | 52.0; 62.0 |
Min; Max | 31; 69 | 30; 68 | 30; 69 |
Thank you in advance for your response.
Comment