Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: New version of -addinby- on SSC


From   "Newson, Roger B" <r.newson@imperial.ac.uk>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: New version of -addinby- on SSC
Date   Mon, 21 Sep 2009 16:17:19 +0100

Thanks to Kit Baum, a new version of the -addinby- package (superseding last week's version) is now available for download from SSC. In Stata, use the -ssc- command to do this, or -adoupdate- if you already have an existing version of -addinby-.

The -addinby- package is described as below on my website. The new version adds a -sorted- option, indicating that the using dataset is already sorted by its foreign key. This should potentially lead to savings in space and/or time if the -using- dataset is very large, because it should no longer be necessary for -merge- to input a copy of the -using- dataset and to sort it. It does not seem to have the desired effect in the examples I have tried so far (where the using dataset belongs to a very large cohort study and the master dataset belongs to a small nested case-control study). However, I suspect that the new Stata 11 -merge- command will be due for some streamlining in the near future.

Best wishes

Roger


Roger B Newson BSc MSc DPhil
Lecturer in Medical Statistics
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute
Imperial College London
Royal Brompton Campus
Room 33, Emmanuel Kaye Building
1B Manresa Road
London SW3 6LR
UNITED KINGDOM
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Email: r.newson@imperial.ac.uk 
Web page: http://www.imperial.ac.uk/nhli/r.newson/
Departmental Web page:
http://www1.imperial.ac.uk/medicine/about/divisions/nhli/respiration/popgenetics/reph/

Opinions expressed are those of the author, not of the institution.

---------------------------------------------------------------------------------
package addinby from http://www.imperial.ac.uk/nhli/r.newson/stata11
---------------------------------------------------------------------------------

TITLE
      addinby: Add in data from a disk dataset using a foreign key

DESCRIPTION/AUTHOR(S)
      addinby is a "cleaner" alternative version of merge m:1, designed to
      reduce the lines of code in Stata do-files.  It adds variables
      and/or values to existing observations in the dataset currently in
      memory (the master dataset) from a Stata-format dataset stored in
      the file filename (the using dataset), using a foreign key of
      variables specified by the keyvarlist to identify observations in
      the using dataset.  These foreign key variables must identify
      observations in the using dataset uniquely.  Unlike merge m:1,
      addinby always preserves the observations in the master dataset in
      their original sorting order, and never adds any additional
      observations, and only generates a matching information variable if
      requested to do so.  However, addinby may optionally check that
      there are no unmatched observations in the master dataset, and/or
      check that there are no missing values in the foreign key variables
      in the master dataset.
      
      Author: Roger Newson
      Distribution-Date: 21september2009
      Stata-Version: 11

INSTALLATION FILES                                  (click here to install)
      addinby.ado
      addinby.sthlp
---------------------------------------------------------------------------------
(click here to return to the previous screen)

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index