asdocx: Export from Stata to Word, Excel, LaTeX & HTML › Forums › asdocx Forum › Decimal points for the percentages and p-values in table1 template | asdocx › Reply To: Decimal points for the percentages and p-values in table1 template | asdocx
I forgot to change a macro in the table1 template, this is why dec() and dect() had no effect on the output. I have fixed that. You can update to the beta version and test it. To update, please type:
asdocx_update, beta mlib
Here is an example where I would like to report 4 dp for the p-values and 1 dp for the percentages.
asdocx tabulate diabetes i.agegrp , template(table1) /// col dec(1) dect(1) replace
Table 1: Demographics
Variables | Not diabetic (n=9850) | Diabetic (n = 499) | Total (10349) | P-value |
---|---|---|---|---|
Age group | 0.0000 | |||
20–29
|
2305 (23.4%) | 15 (3.0%) | 2320 (22.4%) | |
30–39
|
1600 (16.2%) | 21 (4.2%) | 1621 (15.7%) | |
40–49
|
1229 (12.5%) | 42 (8.4%) | 1271 (12.3%) | |
50–59
|
1219 (12.4%) | 72 (14.4%) | 1291 (12.5%) | |
60–69
|
2622 (26.6%) | 238 (47.7%) | 2860 (27.6%) | |
70+
|
875 (8.9%) | 111 (22.2%) | 986 (9.5%) | |
P-values by t-test for continuous variables and Chi2 test for binary/categorical variables. |