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

A diff command for use with data files

Author

Listed:
  • Philip Schumm

    (Department of Health Studies, University of Chicago)

Abstract

One of the most important tools in a programmer's tool chest is the diff command. This command permits you to determine immediately if two code files are identical and, when they are not, to generate a patch which summarizes the differences and can be used to transform the first file into the second. In this presentation we shall introduce an analogous tool written for use with data files. Unlike code files in which each line is identified by its physical location within the file, records in a data file are typically identified by one or more indices, each composed of one or more distinct variables. Our tool compares two files based on one or more such indices, provides a compact, readable summary of the differences, and can generate a patch (in the form of a do-file) to update the first file based on the second. This tool is useful during data analysis whenever two or more versions of a data file are encountered, and may also be used by a Data Coordinating Center to manage repeated data submissions from multiple sites. The program was developed using Mata, and some of the programming techniques used will also be discussed.

Suggested Citation

  • Philip Schumm, 2006. "A diff command for use with data files," North American Stata Users' Group Meetings 2006 12, Stata Users Group.
  • Handle: RePEc:boc:asug06:12
    as

    Download full text from publisher

    File URL: http://repec.org/nasug2006/Schumm.pdf
    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:asug06:12. 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.