Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

RE: st: finicky graph parsing


From   Nick Cox <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   RE: st: finicky graph parsing
Date   Tue, 2 Nov 2010 20:15:40 +0000

Well, yes and no. Michael will know these exceptions:  

1. Multiple commas moving back and forth between options and the preamble are perfectly legal. Not good style, perhaps, but legal. 

. sysuse auto 
. scatter mpg weight, ms(Oh), if foreign

is legal, and works. 

2. In addition, commas can be "embedded, within text". 


Nick 
[email protected] 


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Michael N. Mitchell
Sent: 02 November 2010 20:08
To: [email protected]
Subject: Re: st: finicky graph parsing

When it works to your advantage, it is a "feature", and when to your disadvantage, it is a 
"bug" :).

But seriously, the parser should have been saying something like "Hey buddy, you already 
have a comma, and now you have given me another comma. Only one comma per command/option!"

Michael N. Mitchell
Data Management Using Stata      - http://www.stata.com/bookstore/dmus.html
A Visual Guide to Stata Graphics - http://www.stata.com/bookstore/vgsg.html
Stata tidbit of the week         - http://www.MichaelNormanMitchell.com



On 2010-11-02 12.48 PM, Feiveson, Alan H. (JSC-SK311) wrote:
> "   The parser probably forgave you when the comma had no spaces around it, treating it as though the comma were a space."
>
> Interesting - is this a "feature" or a bug?
>
> Al
>
>
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf Of Michael N. Mitchell
> Sent: Tuesday, November 02, 2010 2:38 PM
> To: [email protected]
> Subject: Re: st: finicky graph parsing
>
> Dear Alan
>
>     You actually should be getting an error on all of these because an extra comma has been
> included in the second scatter command, shown again below with *,* around the extra comma.
>
>      (scatter P del2, c(l) s(i) clcolor(red) clwidth(thick) *,*xtitle("actual change (mm
> Hg)") ytitle("probability") legend(order(1  "same operator" 2  "different operators"  )
> cols(2)    )  )
>
>     The parser probably forgave you when the comma had no spaces around it, treating it as
> though the comma were a space.
>
> Hope that clarifies.
>
> Best regards,
>
> Michael N. Mitchell
> Data Management Using Stata      - http://www.stata.com/bookstore/dmus.html
> A Visual Guide to Stata Graphics - http://www.stata.com/bookstore/vgsg.html
> Stata tidbit of the week         - http://www.MichaelNormanMitchell.com
>
>
> On 2010-11-02 12.27 PM, Feiveson, Alan H. (JSC-SK311) wrote:
>> This works:
>>
>> twoway (scatter P del1,c(l) s(i) clwidth(thick) clcolor(blue)) (scatter P del2,c(l) s(i) clcolor(red) clwidth(thick) ,xtitle("actual change (mm Hg)") ytitle("probability") legend(order(1  "same operator" 2  "different operators"  ) cols(2)    )  )
>>
>>
>> This gives the message "invalid varlist":
>>
>> twoway (scatter P del1,c(l) s(i) clwidth(thick) clcolor(blue)) (scatter P del2,c(l) s(i) clcolor(red) clwidth(thick),xtitle("actual change (mm Hg)") ytitle("probability") legend(order(1  "same operator" 2  "different operators"  ) cols(2)    )  )
>>
>>
>> So does this:
>>
>> twoway (scatter P del1,c(l) s(i) clwidth(thick) clcolor(blue)) (scatter P del2,c(l) s(i) clcolor(red) clwidth(thick), xtitle("actual change (mm Hg)") ytitle("probability") legend(order(1  "same operator" 2  "different operators"  ) cols(2)    )  )
>>
>> The only difference is the spacing after "clwidth(thick)" and before "xtitle".
>>
>> Why?
>>
>> Al Feiveson
>>
>>
>>
>>
>> *
>> *   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index