Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: How to sum group of variables to a single variable ina large data set?


From   "Richard Atkins" <Richard.Atkins@lshtm.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   Re: st: How to sum group of variables to a single variable ina large data set?
Date   Mon, 05 Mar 2007 12:28:32 +0000

Since your example mentions diag9201 and diag98201 as referring to diagnosis groups 9 and 98,
you might want to use the ? wildcard as this replaces a single unknown character.

e.g.

   egen diag98 = rsum(diag9???)

Will match diag9201 but not diag98201.

Richard

*--------------------------------------------------------
Richard Atkins
London School of Hygiene and Tropical Medicine





*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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