EconPapers    
Economics at your fingertips  
 

WRITEINPUT: Stata module to turn the data in memory into a self-contained, reproducible input command block

Eric Booth

Statistical Software Components from Boston College Department of Economics

Abstract: writeinput converts the data in memory, or a filtered subset of it, into an input command a reader can paste to reconstruct the dataset exactly - the standard way to post a minimum working example on Statalist or Stack Overflow. It is built for bit-for-bit fidelity: precision(hex) writes doubles as %21x so nothing is lost in the round trip, extended missing values (.a through .z) are detected and preserved, and every string is wrapped in compound double quotes so internal quotes and backticks cannot break the block. Works with frames, if/in, and random sample drawing; variable labels can be emitted as comments and value labels decoded into the example. Output goes to a .do file, to the results window (dryrun), or as a fenced code block for GitHub (markdown).

Language: Stata
Requires: Stata version 16.0
Keywords: reproducible example; data management; Statalist; input (search for similar items in EconPapers)
Date: 2026-07-30
Note: This module should be installed from within Stata by typing "ssc install writeinput". The module is made available under terms of the MIT license (https://opensource.org/licenses/MIT).
References: Add references at CitEc
Citations:

Downloads: (external link)
http://fmwww.bc.edu/repec/bocode/w/writeinput.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/w/writeinput.sthlp help file (text/plain)

Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.

Export reference: BibTeX RIS (EndNote, ProCite, RefMan) HTML/Text

Persistent link: https://EconPapers.repec.org/RePEc:boc:bocode:s459825

Ordering information: This software item can be ordered from
http://repec.org/docs/ssc.php

Access Statistics for this software item

More software in Statistical Software Components from Boston College Department of Economics Boston College, 140 Commonwealth Avenue, Chestnut Hill MA 02467 USA. Contact information at EDIRC.
Bibliographic data for series maintained by Christopher F Baum ().

 
Page updated 2026-08-14
Handle: RePEc:boc:bocode:s459825