Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

st: New package -gsgroup- on SSC


From   "Roger B. Newson" <r.newson@imperial.ac.uk>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: New package -gsgroup- on SSC
Date   Wed, 03 Oct 2012 11:54:36 +0100

Thanks again to Kit Baum, a new package -gsgroup- is now available for download from SSC. In Stata, use the -ssc- command to do this.

The -gsgroup- package is described as below on my website, and creates a grouping variable corresponding to a -gsort- key, leaving the data in their original order. Optionally, it also creates an output dataset (or resultsset) with 1 observation per value of the group variable, and data on the corresponding -gsort- key values. This can be useful when we create a concatenated resultsset whose observations contain values of the generated group variable, and we want it also to contain the corresponding -gsort- key variables. The online help for -gsgroup- contains an example using -gsgroup- with -margins- and the SSC package -parmest-.

Best wishes

Roger


---------------------------------------------------------------------------------------
package gsgroup from http://www.imperial.ac.uk/nhli/r.newson/stata10
---------------------------------------------------------------------------------------

TITLE
gsgroup: Create a group variable and optionally an output dataset for a gsort key

DESCRIPTION/AUTHOR(S)
      gsgroup inputs a gsort key (a list of elements of the form used
      by gsort), and generates as output a new variable, indicating
      the sequential order of the group to which each observation
      belongs, and (optionally) an output dataset (or resultsset),
      with 1 observation per group, and data on the values of the
      generated variable, and the variables of the gsort key
      corresponding to that group.  Unlike gsort, gsgroup does not
      change the sort order of the dataset in memory.  The output
      dataset can be merged into other datasets, using the official
      Stata command merge or the SSC package addinby.  gsgroup is
      typically used together with the SSC packages parmest and
      xcontract.

      Author: Roger Newson
      Distribution-Date: 27september2012
      Stata-Version: 10

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

--
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.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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