Statalist


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

[no subject]



In essence you are being bit by Stata here, and you are being bit by
what is elsewhere a feature. 
Stata lets you specify keywords like -long- within varlists on some
commands, but the parsing of 
command syntax means that Stata checks for those keywords in other
contexts too. 

Only StataCorp can say how much clean-up is possible here with what
cost-benefit analysis. 

I'd opt for adding a sentence to the documentation. 

Nick 
[email protected] 

Sergiy Radyakin

Thank you Nick and Austin.

[U]11.3 indeed lists quite a few reserved names, however it says "You
may not use these reserved words for your variables", which is
different from "you may not use these for abbreviated names of your
variables". I believe there is no reason to forbid using "in" for
"income" if the command syntax does not include "in", and especially
since both "i" and "inc" will work fine.

On 4/11/08, Nick Cox <[email protected]> wrote:
> Reserved words are documented at [U] 11.3.
>
> Nick
> [email protected]
>
> Austin Nichols
>
> Sergiy Radyakin <[email protected]>:
>
> I would guess that the prohibited abbreviations include words that are
> not allowed as variables names, e.g. long or byte:
>
> . g byte_ok=1
>
> . d byte
> byte not allowed
> r(101);
>
> . d byte*
>
>              storage  display     value
> variable name   type   format      label      variable label
>
------------------------------------------------------------------------
> -----------------------
> byte_ok         float  %9.0g
>
> . unab g: byte
> byte not allowed
> r(101);
>
> . unab g: byt
>
> . di "`g'"
> byte_ok
>
> I think that the above looks a bit like a bug.
>
> On Fri, Apr 11, 2008 at 1:24 PM, Sergiy Radyakin
> <[email protected]> wrote:
>
> > I wonder if there is any bug in unabbreviation of variable names. I
> > have a persistent problem, which can be reproduced as following
(Stata
> > for Windows version 9 and 10):
> >
> > // --------------------------------------------------------
> > sysuse auto
> > keep gear_ratio
> > describe gear
> > rename gear_ratio long_name
> > describe long
> > // --------------------------------------------------------
> >
> > r(101): long not allowed
> >
> > Same thing happens when I use tab instead of describe.
> >
> > In real life I have a variable long_unempl, which caused troubles
when
> > abbreviated in such a way. Is it only the word "long" that causes
such
> > problems? Or are there other "prohibited" abbreviations (I know
> > "using" is one because it is a reserved word and appears in the
syntax
> > of describe, but "long" is not a part of the syntax)?

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