IDEAS home Printed from https://ideas.repec.org/c/boc/bocode/s460003.html

TABTOOLS: Stata module to export publication-ready descriptive, model, survival, and rate tables to Excel and Markdown

Author

Listed:
  • Timothy P Copeland

    (Karolinska Institutet)

Programming Language

Abstract

tabtools is a suite of commands that turn descriptive, regression, treatment-effect, survival, rate, and composite results into publication-ready tables written to formatted Excel workbooks, GitHub-Flavored Markdown, CSV files, or Stata frames. table1_tc and desctab build Table 1 descriptive tables with automatic group comparison tests, standardized differences, weights, and small-cell suppression; crosstab produces cross-tabulations with chi-square or exact tests, odds ratios, risk ratios, risk differences, and trend tests; regtab exports coefficients from most estimation commands, including multi-model, multi-equation, and mixed-effects layouts with model statistics; effecttab tabulates teffects and margins results; tabcell formats a single estimate, p-value, n (%), or median (IQR) cell; outtab reports binary outcomes by exposure with model ratios; stratetab and ratetab tabulate events, person-time, and incidence rates with confidence intervals (exact, Poisson, or cluster-robust in ratetab); survtab reports Kaplan-Meier survival, restricted mean survival, and median survival; comptab and hrcomptab assemble vertical model composites and rate-interlocked tables; puttab styles any in-memory dataset, frame, or matrix, and stacktab assembles multi-sheet composite workbooks. All commands share one set of output and formatting options (fonts, borders, shading, digits, titles, footnotes), and tabtools manages persistent session defaults and destinations. Results are returned in r(), including the rendered table and a methods sentence.

Suggested Citation

  • Timothy P Copeland, 2026. "TABTOOLS: Stata module to export publication-ready descriptive, model, survival, and rate tables to Excel and Markdown," Statistical Software Components S460003, Boston College Department of Economics.
  • Handle: RePEc:boc:bocode:s460003
    Note: This module should be installed from within Stata by typing "ssc install tabtools". The module is made available under terms of the MIT license (https://opensource.org/licenses/MIT).
    as

    Download full text from publisher

    File URL: http://fmwww.bc.edu/repec/bocode/t/tabtools.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/t/tabtools.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/t/tabtools_tips.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/t/tabtools_tips.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_tabtools_common.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_tabtools_xlsx_write.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_tabtools_export_hint.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_tabtools_markdown_write.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_tabtools_visible_vars.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_tabtools_colwidth.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_tabtools_csv_write.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_tabtools_check_sinks.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_tabtools_xlsx_read.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_tabtools_collect_render.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_tabtools_collect_atmatrix.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_tabtools_fvterm_label.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_tabtools_st_timescale.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_tabtools_match_rows.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_tabtools_fitcount.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_tabtools_flatframe.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_tabtools_xlsx_apply_styles.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_tabtools_xlsx_build_styles.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_tabtools_xlsx_compact_styles.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_tabtools_xlsx_deferred_styles.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_desctab_collect.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_desctab_misscell.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_tabtools_smallcells.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_tabtools_smallcells_render.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_tabtools_smallcells_opt.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_tabtools_set.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_tabtools_set_sinks.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/t/table1_tc.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/t/table1_tc.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/d/desctab.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/d/desctab.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/r/regtab.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/r/regtab.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_activeb.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_addcol.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_addrow.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_bnotes.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_cellnote.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_classes.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_cmdopts.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_cmdsets.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_collabels.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_eqkeys.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_estats.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_fitrec.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_flatten.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_frameopts.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_fvbase.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_fvparent.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_keys.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_methods.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_mincount.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_modelnoun.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_mstats.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_optstr.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_prefopts.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_relabel.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_remeta.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_rlabels.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_role.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_scale.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_statrows.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_statspec.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_regtab_unwrap.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/e/effecttab.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/e/effecttab.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/s/stratetab.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/s/stratetab.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/h/hrcomptab.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/h/hrcomptab.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/c/comptab.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/c/comptab.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/s/survtab.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/s/survtab.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/c/crosstab.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/c/crosstab.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/p/puttab.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/p/puttab.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/s/stacktab.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/s/stacktab.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_stacktab_frames.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/t/tabcell.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/t/tabcell.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_tabcell_render.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_tabtools_fmt_p.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_tabtools_fmt_pct.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/r/ratetab.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/r/ratetab.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/o/outtab.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/o/outtab.sthlp
    File Function: help file
    Download Restriction: no
    ---><---

    More about this item

    Keywords

    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:boc:bocode:s460003. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    We have no bibliographic references for this item. You can help adding them by using this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Christopher F Baum (email available below). General contact details of provider: https://edirc.repec.org/data/debocus.html .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.