Is there any way to use tabulate command in such a manner so that it publishes output like the following (I took this table from a research paper randomly to use it as a reference):
When I use tabulate command I get results like the following:
| married
race | single married | Total
-----------+----------------------+----------
white | 487 1,150 | 1,637
black | 309 274 | 583
other | 8 18 | 26
-----------+----------------------+----------
Total | 804 1,442 | 2,246
Pearson chi2(2) = 101.4215 Pr = 0.000
lives in | married
south | single married | Total
-----------+----------------------+----------
0 | 464 840 | 1,304
1 | 340 602 | 942
-----------+----------------------+----------
Total | 804 1,442 | 2,246
Pearson chi2(1) = 0.0620 Pr = 0.803
From where I need to create that above table manually. Is there any way to do this directly?
Age (in year) | ||||
20–39 | 39.9 (7697) | 18.5 (1659) | 58.3 (6038) | < 0.001 |
40–59 | 34.5 (6959) | 38.6 (3674) | 31.0 (3285) | |
60+ | 25.6 (7279) | 42.9 (5830) | 10.7 (1449) | |
Gender | ||||
Male | 47.1 (10,499) | 50.1 (5671) | 44.6 (4828) | < 0.001 |
Female | 52.9 (11,436) | 49.9 (5492) | 55.4 (5944) |
| married
race | single married | Total
-----------+----------------------+----------
white | 487 1,150 | 1,637
black | 309 274 | 583
other | 8 18 | 26
-----------+----------------------+----------
Total | 804 1,442 | 2,246
Pearson chi2(2) = 101.4215 Pr = 0.000
lives in | married
south | single married | Total
-----------+----------------------+----------
0 | 464 840 | 1,304
1 | 340 602 | 942
-----------+----------------------+----------
Total | 804 1,442 | 2,246
Pearson chi2(1) = 0.0620 Pr = 0.803
From where I need to create that above table manually. Is there any way to do this directly?
Comment