EconPapers    
Economics at your fingertips  
 

New data cleaning command: assertlist – improves speed and accuracy of collaborative correction

Dale Rhoda () and Mary Kay Trimner
Additional contact information
Dale Rhoda: Biostat Global Consulting
Mary Kay Trimner: Biostat Global Consulting

2018 Stata Conference from Stata Users Group

Abstract: Stata’s handy assert command can certify that a dataset meets a set of user expectations, but when one assertion is violated, it throws an error and does not proceed to check the rest. Identifying problems with every variable in a large dataset can involve a messy set of ad hoc error traps and LIST commands to learn what unexpected values occur in which dataset rows. Furthermore, code to REPLACE errant values sometimes involves IF syntax with a list of terms connected by Boolean ANDs that identify the row targeted for the fix; when typed by hand, these rows are quite susceptible to typographical errors. This talk describes a new command named assertlist that can test an entire set of assertions in one run without ad hoc code to drill down or move on. Exceptions are listed either to the screen or a spreadsheet. In situations where problematic values will later be corrected or replaced, assertlist generates spreadsheet columns that wait to receive hand-entered corrected values and other columns that immediately put corrected values into Stata REPLACE commands, for easy pasting into downstream .do files. In our experience, assertlist streamlines well-documented data cleaning and guards against errors in correction code.

Date: 2018-08-02
References: Add references at CitEc
Citations:

Downloads: (external link)
http://fmwww.bc.edu/repec/scon2018/columbus18_Rhoda.pptx

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:scon18:40

Access Statistics for this paper

More papers in 2018 Stata Conference from Stata Users Group Contact information at EDIRC.
Bibliographic data for series maintained by Christopher F Baum ().

 
Page updated 2025-03-19
Handle: RePEc:boc:scon18:40