Statalist The Stata Listserver


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

Re: st: varlist error? or feature?


From   Jeph Herrin <[email protected]>
To   [email protected]
Subject   Re: st: varlist error? or feature?
Date   Tue, 17 Oct 2006 16:18:28 -0400

Thanks for the replies. I guess I have always created
these kinds of variables in order in the dataset, so references
like com1-com45 always did what I thought they should. Funny
how one can learn wrong.


Jeph




Richard Goldstein wrote:
try d com* or egen total=rtotal(com*)

you might also look at the -aorder- command

Rich

Jeph Herrin wrote:
Why have I never noticed this before? Stata 9, updated.


. d com1-com45

storage display value
variable name type format label variable label
-------------------------------------------------------------------------------
com1 byte %8.0g BPH
medcom2 byte %9.0g meds: CA
com2 byte %8.0g CA
medcom3 byte %9.0g meds: CHF/HTN
com3 byte %8.0g CHF/HTN
medcom4 byte %9.0g meds: ESRD
com4 byte %8.0g ESRD
medcom5 byte %9.0g meds: GERD
com5 byte %8.0g GERD
medcom6 byte %9.0g meds: HIV
com6 byte %8.0g HIV
medcom7 byte %9.0g meds: HTN
.
.
.


And I discovered it when

. egen total=rtotal(com1-com45)

totalled all the -medcom- variables as well. How can I reference
just those variables that start with -com-?


thanks,
Jeph
*
*   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/


*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index