Statalist The Stata Listserver


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

st: RE: numlist abbreviations interpreted differently in egenmore's eqany S8?


From   "Scott Merryman" <[email protected]>
To   <[email protected]>
Subject   st: RE: numlist abbreviations interpreted differently in egenmore's eqany S8?
Date   Tue, 28 Feb 2006 20:47:57 -0600

> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of Marino, Jennifer
> Sent: Tuesday, February 28, 2006 8:14 PM
> To: [email protected]
> Subject: st: numlist abbreviations interpreted differently in egenmore's
> eqany S8?
> 
> I'm working in Stata 8.
> 
> Four ways of generating a numlist of whole positive integers are
> supposed to be identical, but I'm finding they generate different
> results with the same dataset in Stata 8.2.
> 
> egen nurshealthtech=eqany(jobnum*),v(088 089 095 097 098 099 103/106 134
> 206/208 235 446 447)
> egen nurshealthtech2=eqany(jobnum*),v(088 089 095 097 098 099 103:106
> 134 206:208 235 446 447)
> egen nurshealthtech3=eqany(jobnum*),v(088 089 095 097 098 099 103 to 106
> 134 206 to 208 235 446 447)
> egen nurshealthtech4=eqany(jobnum*),v(088 089 095 097 098 099 103(1)106
> 134 206(1)208 235 446 447)
> 
> . count if nurshealthtech==1
>   173
> 
> . count if nurshealthtech2==1
>   156
> 
> . count if nurshealthtech3==1
>   156
> 
> . count if nurshealthtech4==1
>   173
> 
> Aren't these supposed to be the same?
> 

No.  For the ":" and "to" syntax, the preceding number specify the interval
used in constructing the number list.

For example:

10 15 to 25 == 10, 15, 20, 25

which is different than 

10 15/25 == 10 15, 16, 17,..

-help numlist- has many more examples.


Scott



*
*   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