Stata Module To Create A Grouping Variable With Key Values In An ...

IDEAS home Advanced search
  • Economic literature: papers, articles, software, chapters, books.
  • Authors
  • Institutions
  • Rankings
  • Help/FAQ
  • MyIDEAS
  • More options at page bottom
  • Economic literature
  • Authors
  • Institutions
  • Rankings
  • Help/FAQ
  • MyIDEAS (now with weekly email digests)
Advanced search

Browse Econ Literature

  • Working papers
  • Journals
  • Software components
  • Books
  • Book chapters
  • JEL classification

More features

  • Subscribe to new research
  • RePEc Biblio
  • Author registration
  • Economics Virtual Seminar Calendar
  • ConfWatcher NEW!
IDEAS home Printed from https://ideas.repec.org/c/boc/bocode/s456996.html XGROUP: Stata module to create a grouping variable with key values in an output dataset
  • Author & abstract
  • Download
  • Related works & more
  • Corrections

Author

Listed:
  • Roger Newson

    (King's College London)

Registered:
  • Roger Benedict Newson

Programming Language

Stata

Abstract

xgroup is an extended version of the egen function group(varlist). It inputs a varlist of existing variables, and generates as output a new variable, defining a grouping of the observations by the varlist, and also an output dataset (or resultsset), with 1 observation per non-missing value of the new output variable, and data on the values of the input variables corresponding to that value of the output variable. The output dataset is sorted primarily by the new grouping variable, and secondarily by the variables in the varlist, allowing the output dataset to be merged into other datasets, using the official Stata command merge or the SSC package addinby. xgroup is typically used together with the SSC packages parmest and factext when a multiple-intercept model is fitted to the data, with 1 intercept for each combination of values for the varlist.

Suggested Citation

  • Roger Newson, 2009. "XGROUP: Stata module to create a grouping variable with key values in an output dataset," Statistical Software Components S456956, Boston College Department of Economics, revised 04 Feb 2009.
  • Handle: RePEc:boc:bocode:s456996 Note: This module should be installed from within Stata by typing "ssc install xgroup". The module is made available under terms of the GPL v3 (https://www.gnu.org/licenses/gpl-3.0.txt). Windows users should not attempt to download these files with a web browser. as HTML HTML with abstract plain text plain text with abstract BibTeX RIS (EndNote, RefMan, ProCite) ReDIF JSON

    Download full text from publisher

    File URL: http://fmwww.bc.edu/repec/bocode/x/xgroup.adoFile Function: program codeDownload Restriction: no File URL: http://fmwww.bc.edu/repec/bocode/x/xgroup.sthlpFile Function: help fileDownload Restriction: no --->

    Tag » How To Group Variables In Stata