IDEAS home Printed from https://ideas.repec.org/p/boc/scon18/40.html
   My bibliography  Save this paper

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

Author

Listed:
  • Dale Rhoda

    (Biostat Global Consulting)

  • Mary Kay Trimner

    (Biostat Global Consulting)

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.

Suggested Citation

  • Dale Rhoda & Mary Kay Trimner, 2018. "New data cleaning command: assertlist – improves speed and accuracy of collaborative correction," 2018 Stata Conference 40, Stata Users Group.
  • Handle: RePEc:boc:scon18:40
    as

    Download full text from publisher

    File URL: http://fmwww.bc.edu/repec/scon2018/columbus18_Rhoda.pptx
    Download Restriction: no
    ---><---

    More about this item

    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:scon18:40. 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/stataea.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.