Statalist


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

Re: st: RE: minor bug in -describe-?


From   Jeph Herrin <[email protected]>
To   [email protected]
Subject   Re: st: RE: minor bug in -describe-?
Date   Thu, 30 Oct 2008 11:00:16 -0400

I did notice it applied to other reserved words, but I hadn't
noticed it applied to other commands (eg, -regress-).

I'll drop StataCorp a note about the issue.

cheers,
Jeph



Sergiy Radyakin wrote:
Martin, it applies not only to -describe-, it is all over:

       sysuse auto, clear
       rename trunk income
       regress price inc*
       regress price in*

And in this case the message "varlist not allowed" can knockout anyone
who wanted to use it in according to the syntax:
       regress depvar indepvarlist

It also applies to reserved words -if- and -using-, but not to -byte-.
(Tried "ifo", "using_method", and "bytevar" as variable names in the
code above and abbreviated to the length of the reserved word).

In general I do want the above regression to work, and when parsing a
command for parts of syntax, "in" should be different from "in*". But
may be there is something else there. Since -syntax- is built-in , we
may never know, unless someone from Stata, corp steps in.

A related 'bug' (?) would be the following:

       generate byte long float double z=1

is this a valid command? if yes, what is the resulting type of z? why?

Best wishes,
   Sergiy Radyakin


On Wed, Oct 29, 2008 at 5:34 PM, Martin Weiss <[email protected]> wrote:
Ok, thanks for that! I thought that line 7 of describe.ado did the same as
-varlist- in -syntax- but your example has convinced me that it does not.
What is your take on the bug issue, then?


HTH
Martin


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Sergiy Radyakin
Sent: Wednesday, October 29, 2008 10:26 PM
To: [email protected]
Subject: Re: st: RE: minor bug in -describe-?

Hi Martin,

if one writes -varlist- variables must already exist in memory. But
you sometimes want:

       clear
       describe somevars using somefile.dta

to work.

Your modified version will work ok, but replace it with varlist and
see what happens.

Best regards,
   Sergiy Radyakin




On Wed, Oct 29, 2008 at 4:46 PM, Martin Weiss <[email protected]> wrote:
Curiously, describe.ado takes -anything- in its -syntax- statement. If you
copy it to your very own describe2.ado in your personal directory and
restate that as -anything(everything)- then you  can pass it "in*" and it
works as expected. I think that could be called a bug. Whether minor or
not,
I do not want to decide... -help describe- indicates that it takes a
-varlist- so why would one want -anything- and not -varlist- in the
-syntax-
statement?


HTH
Martin


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Jeph Herrin
Sent: Wednesday, October 29, 2008 6:53 PM
To: [email protected]
Subject: st: minor bug in -describe-?



-in- is a reserved word in Stata, but it's also a very
common prefix for variable names. So I often run into
this:

. d in*
varlist not allowed
r(101);


Obviously, -describe- takes a varlist, but it won't take
a varlist that looks like a reserved word. A bug, right?
Or is there a reason for this?

thanks,
Jeph





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

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

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



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