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

    References listed on IDEAS

    as
    1. Christopher F Baum & Mark E. Schaffer & Steven Stillman, 2003. "Instrumental variables and GMM: Estimation and testing," Stata Journal, StataCorp LP, vol. 3(1), pages 1-31, March.
    2. Hansen, Lars Peter, 1982. "Large Sample Properties of Generalized Method of Moments Estimators," Econometrica, Econometric Society, vol. 50(4), pages 1029-1054, July.
    3. Arellano, Manuel & Bover, Olympia, 1995. "Another look at the instrumental variable estimation of error-components models," Journal of Econometrics, Elsevier, vol. 68(1), pages 29-51, July.
    4. Beck, Thorsten & Levine, Ross, 2004. "Stock markets, banks, and growth: Panel evidence," Journal of Banking & Finance, Elsevier, vol. 28(3), pages 423-442, March.
    5. Holtz-Eakin, Douglas & Newey, Whitney & Rosen, Harvey S, 1989. "The Revenues-Expenditures Nexus: Evidence from Local Government Data," International Economic Review, Department of Economics, University of Pennsylvania and Osaka University Institute of Social and Economic Research Association, vol. 30(2), pages 415-429, May.
    6. Andersen, Torben G & Sorensen, Bent E, 1996. "GMM Estimation of a Stochastic Volatility Model: A Monte Carlo Study," Journal of Business & Economic Statistics, American Statistical Association, pages 328-352.
    7. Calderon Cesar Augusto & Chong Alberto & Loayza Norman V., 2002. "Determinants of Current Account Deficits in Developing Countries," The B.E. Journal of Macroeconomics, De Gruyter, pages 1-33.
    8. Blundell, Richard & Bond, Stephen, 1998. "Initial conditions and moment restrictions in dynamic panel data models," Journal of Econometrics, Elsevier, vol. 87(1), pages 115-143, August.
    9. Ruth Judson & Ann L. Owen, "undated". "Estimating Dynamic Panel Data Models: A Practical Guide for Macroeconomists," Finance and Economics Discussion Series 1997-03, Board of Governors of the Federal Reserve System (U.S.).
    10. Nickell, Stephen J, 1981. "Biases in Dynamic Models with Fixed Effects," Econometrica, Econometric Society, vol. 49(6), pages 1417-1426, November.
    11. Bowsher, Clive G., 2002. "On testing overidentifying restrictions in dynamic panel data models," Economics Letters, Elsevier, vol. 77(2), pages 211-220, October.
    12. Theodore H. Moran & Edward M. Graham & Magnus Blomstrom, 2005. "Does Foreign Direct Investment Promote Development?," Peterson Institute Press: All Books, Peterson Institute for International Economics, number 3810.
    13. David Roodman, 2009. "A Note on the Theme of Too Many Instruments," Oxford Bulletin of Economics and Statistics, Department of Economics, University of Oxford, vol. 71(1), pages 135-158, February.
    14. Manuel Arellano & Stephen Bond, 1991. "Some Tests of Specification for Panel Data: Monte Carlo Evidence and an Application to Employment Equations," Review of Economic Studies, Oxford University Press, vol. 58(2), pages 277-297.
    15. Kiviet, Jan F., 1995. "On bias, inconsistency, and efficiency of various estimators in dynamic panel data models," Journal of Econometrics, Elsevier, vol. 68(1), pages 53-78, July.
    16. Anderson, T. W. & Hsiao, Cheng, 1982. "Formulation and estimation of dynamic models using panel data," Journal of Econometrics, Elsevier, vol. 18(1), pages 47-82, January.
    Full references (including those not matched with items on IDEAS)

    More about this item

    NEP fields

    This paper has been announced in the following NEP Reports:

    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.

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

    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 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.

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

    IDEAS is a RePEc service hosted by the Research Division of the Federal Reserve Bank of St. Louis . RePEc uses bibliographic data supplied by the respective publishers.