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

st: RE: RE: RE: RE: parmby if=exp for strings


From   "Douglas Crawford" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: RE: RE: parmby if=exp for strings
Date   Wed, 14 Jul 2004 11:50:28 -0700

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/



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