Apologies for taking up time, and thanks for all of the excellent help, my
error (of course) the single quotes solve the problem.
Cheers,
Douglas
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Douglas Crawford
Sent: Wednesday, July 14, 2004 11:50 AM
To: [email protected]
Subject: st: RE: RE: RE: RE: parmby if=exp for strings
Hi Nick,
I'm sorry I should have been more explicit.
The following generates the original problem:
sysuse auto, clear
split make, gen (make_)
regress mpg weight if inlist(make_1, "Datsun", "Buick")
parmby "regress mpg weight if inlist(make_1, "Datsun", "Buick")", l(*)
Wrapping the parmby in single quotations keeps the parmby from executing:
. parmby `"regress mpg weight if inlist(make_1, "Datsun", "Buick")"', l(*)
You must specify at least one of the four options:
list(), saving(), norestore, and fast.
If you specify list(), then the output variables specified are listed.
If you specify saving(), then the new data set is output to a disk file.
If you specify norestore and/or fast, then the new data set is created in
the memory,
and any existing data set in the memory is destroyed.
For more details, see on-line help for parmby and parmest.
r(498);
Sorry to tie up so much time by not being clearer particularly since I'm
sure I am doing something wrong.
Cheers,
Douglas
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Nick Cox
Sent: Wednesday, July 14, 2004 11:28 AM
To: [email protected]
Subject: st: RE: RE: RE: parmby if=exp for strings
You must use `" "'
that is,
` left single quote
" double quote
whatever text
" double quote
' right single quote.
Nick
[email protected]
Douglas Crawford
> Thanks Nick, I have read but little understood the quotation nesting
> guidelines.
>
> I tried your suggestion, but when I surround the double
> quotes with `' the
> command is not executed. And when I tried the same on the
> quotes for the
> two string variables (e.g. inlist(var3, `"string1"',
> `"string2"')) it said
> "too few quotes").
>
> I can get the results I need with by encoding the string
> variable, but if
> you see my error it may really help in the future (and
> simplify these do
> files as well).
*
* 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/