asdocx: Export from Stata to Word, Excel, LaTeX & HTML Forums asdocx Forum Decimal points for the percentages and p-values in table1 template | asdocx

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • Jens
    Participant
    Post count: 3

    Dear Attaullah,

    Hope this finds you well.

    A quick question today – I have used the code below to test the output as I would like to use this type of table for a report:

    webuse nhanes2b, clear   
    
    asdocx  tabulate diabetes i.agegrp ,  template(table1) ///
     col dec(1) dect(1) format(%3.1f) replace 

    However I can’t seem to get percentages with one dp only?

    Is there anything I am missing? I read the help file but could not find info about this.

    Thanks in advance!

    Best regards,

    Attaullah Shah
    Moderator
    Post count: 76

    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.
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.