Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: -by()- suboptions with -twoway- plots


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: -by()- suboptions with -twoway- plots
Date   Sun, 25 Jan 2004 19:10:47 -0000

I confirm the same behaviour 
with the auto data, substituting -mpg- for 
-comprate- and -weight- for -week- and 
-foreign- for -unit-. 

I fixed all problems by removing spaces between -by- and 
-(<its argument>)-. 

In essence, no space is ever _required_ there 
and I don't believe that one is ever used in 
code examples in Stata documentation. Although 
your examples seem inconsistent, it seems that
Stata is trying to read your mind from what 
you typed, and succeeding sometimes and not 
others. Sometimes spaces are ignored as superfluous, but 
not always. 

Stata isn't human but as in other contexts 
you can be misunderstood if you bend linguistic
rules too much. I recommend always following 
an option name immediately by any argument in 
parentheses that it may have. 

Nick 
[email protected] 

> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]]On Behalf Of Doug Simmons
> Sent: 23 January 2004 21:23
> To: [email protected]
> Subject: st: -by()- suboptions with -twoway- plots
> 
> 
> My apologies. As I have done some more testing I have learned 
> it is not
> a difference between command line and .do file operation.
> 
> This code works as expected:
> 	scatter comprate week ||		///
> 	fpfit comprate week ||,		///
> 	by (unit)
> 
> However, this block fails with the message ") required":
> 	scatter comprate week ||		///
> 	fpfit comprate week ||,		///
> 	by (unit, total)
> 
> There appears to be yet another issue as the following works:
> 	scatter comprate week ||, by (unit)
> 
> But, this does not:
> 	scatter comprate week, by (unit)
> 
> The inclusion of suboptions fails in all cases and it does not seem to
> matter what suboptions are used. I have tried several 
> different -twoway-
> plottypes, each yielding the same results.
> 
> Thanks again for any insight and assistance.
> Doug
> 
> >>> [email protected] 1/23/2004 14:18:03 >>>
> Please show us some commands. 
> 
> Nick 
> [email protected] 
> 
> Doug Simmons
>  
> > On a related note, I have just run into an issue using -by()- 
> > suboptions with -twoway- graphs in a .do file. On the command line 
> > everything works
> > as expected, however, when attempting to run from a .do file, I get
> > parentheses mismatch errors. This only occurs when attempting 
> > to include
> > suboptions, actually, just when the comma is included, even if no
> > suboptions are specified. I am running 8.2 on XP.
> > 
> > I am wondering if anyone else has encountered this or can 
> > duplicate it.
> > And if so, is there a work-around or solution?
> 
> *
> *   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/
> *
> *   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/

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