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

Re: st: parentheses don't balance?

From (Jean Marie Linhart, StataCorp.)
Subject   Re: st: parentheses don't balance?
Date   Fri, 07 Feb 2003 13:50:38 -0600

Christopher W. Ryan asked about a problem using the twoway overlay
dialog box which produced a command that Stata complained about with
"parentheses do not balance".  The command generated was:
> twoway (scatter mpg weight if foreign==0, msymbol(square)
> msize(medsmall) mcolor("255 0 0") mlabel(rep78)) (scatter mpg weight
> if foreign==1, msymbol(x) mcolor("0 0 255") mlabel(rep78)),
> ytitle(miles per gallon, color("0 0 128")) xtitle(weight, color("0 0
> 128")) title(Mileage for Weight, size(medium)) subtitle(By country of
> origin, size(small)) caption(Stata fictional data) note(February 2003)
> legend(on colfirst order(1 "domestic 2 "foreign"))

He asked:
> And how could a command generated by a dialogue box (that is, by
> Stata itself) have an error in the parentheses?  I didn't type them
> in.  Must mean there is something wrong with the way the dialogue box
> works?

Nick Cox suggested that the problem might be lack of quotes around
titles, but that is not the problem here.  Lack of quotes
could certainly be a problem if you had a comma in a title, as Nick

Thomas Steichen's sharp eyes caught a misplaced quote, which
was the source of the problem.

I just have a comment on figuring out what went wrong when using dialog
boxes.  As you know, some dialog boxes, especially those for graphics,
can produce very long commands.  What you are going to want to do is to cut
things down to the smallest subset of selections that cause the
problem.  Assuming you are working with graphics dialogs, change as
many things as you can back to "Default", one by one, until you have a
small command that isn't working.  You can uncheck options, blank out
edit fields, etc. to reduce the number of options. This should tell
you which option or set of options is/are causing the problem, and it
will hopefully be pretty obvious whether the dialog box is misbehaving
or if something was typed incorrectly. 

If in fact the dialog is in error, this will point us right at the
spot where the problem is, so we will quickly be able to provide
a fix for you.   But I'm hoping this won't happen!

If you use the "Submit" button, your dialog box will still be up, and
you can start eliminating options immediately.  If you hit "Okay" go
find that dialog and open it again, most of what you selected should
still be there.  (Options such as "replace" and "clear" that overwrite
files or data should not come back, for obvious reasons.)  If you hit
"Submit" and then "Cancel" you will be out of luck, "Cancel" tells
Stata to quit the dialog box and not save what was entered.

Hope that helps.

--Jean Marie
*   For searches and help try:

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