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

From |
"sdm1" <sdm1@york.ac.uk> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
st: RE: RE: Strings and the greater than/less than operators |

Date |
Wed, 13 May 2009 17:59:38 +0100 |

Noooooooooooo! Thanks Nick...and, of course, you're dead right. The giveaway, I realise now, is the alignment of the values of code under the heading 'code' in the tabulation. I think that the last character aligns vertically with the 'e' of 'code'. The only bit I don't understand is: "The order is that of -char()-". It sounds to me as if char is user defined. This is from the help for char: The dataset itself and each variable within the dataset have associated with them a set of characteristics. Characteristics are named and referred to as varname[charname], where varname is the name of a variable or _dta. The characteristics contain text. Characteristics are stored with the dataset in the Stata-format .dta dataset, so they are recalled whenever the dataset is loaded. If characteristics for a variable are not defined by the user, what's the default order? Is there a list somewhere which will tell me the order in which Stata sorts characters e.g. alphabetric, numeric, spaces, etc. Or am I misinterpreting here? Once again, thanks for your help. Steve -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nick Cox Sent: 13 May 2009 17:26 To: statalist@hsphsun2.harvard.edu Subject: st: RE: Strings and the greater than/less than operators General question: Absolutely. The order is that of -char()-. Specific question: "N05 " > "N05". You have trailing spaces. They are characters too. Nick n.j.cox@durham.ac.uk Steve Can the greater than (>) and less than (<) operators be applied to strings? If the answer is 'yes' (as I thought), why is "N05" included in the output for the following command? . tab code admimeth if (admimeth==31 | admimeth==32) & (code>"N05" & code<"N13") | admimeth code | 31 32 | Total -----------+----------------------+---------- N05 | 103 163 | 266 N06 | 23,858 132 | 23,990 N07 | 364,687 2,653 | 367,340 N08 | 8,079 18 | 8,097 N09 | 70,953 132 | 71,085 N10 | 24,606 88 | 24,694 N11 | 123,635 256 | 123,891 N12 | 546,148 21,998 | 568,146 -----------+----------------------+---------- Total | 1,162,069 25,440 | 1,187,509 * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**st: RE: RE: RE: Strings and the greater than/less than operators***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

**Re: st: RE: RE: Strings and the greater than/less than operators***From:*Gary Longton <glongton@fhcrc.org>

**References**:**st: Strings and the greater than/less than operators***From:*"sdm1" <sdm1@york.ac.uk>

**st: RE: Strings and the greater than/less than operators***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

- Prev by Date:
**st: sample size estimates for multilevel models** - Next by Date:
**Re: st: sample size estimates for multilevel models** - Previous by thread:
**st: RE: Strings and the greater than/less than operators** - Next by thread:
**Re: st: RE: RE: Strings and the greater than/less than operators** - Index(es):

© Copyright 1996–2017 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |