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

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


From   Roger Newson <[email protected]>
To   [email protected]
Subject   Re: st: RE: RE: parmby if=exp for strings
Date   Wed, 14 Jul 2004 19:45:31 +0100

At 19:22 14/07/2004, Douglas wrote:
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").
Compound quotes are allowed to surround pairs of simple quotes, but simple quotes are not allowed to surround pairs of compound quotes. The example below demonstrates this in the -auto- data.

I hope this helps.

Roger

. sysuse auto, clear
(1978 Automobile Data)

. parmby `"regress mpg weight if index(make,"A")==0, robust"', list(,)
Command: regress mpg weight if index(make,"A")==0, robust

Regression with robust standard errors Number of obs = 67
F( 1, 65) = 103.19
Prob > F = 0.0000
R-squared = 0.6890
Root MSE = 3.3485

------------------------------------------------------------------------------
| Robust
mpg | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
weight | -.0061874 .0006091 -10.16 0.000 -.0074038 -.0049709
_cons | 40.07409 2.099547 19.09 0.000 35.88101 44.26718
------------------------------------------------------------------------------

Listing of results:

+---------------------------------------------------------------------------------------------------+
| parmseq parm estimate stderr dof t p min95 max95 |
|---------------------------------------------------------------------------------------------------|
1. | 1 weight -.00618736 .00060909 65 -10.158359 4.752e-15 -.0074038 -.00497092 |
2. | 2 _cons 40.074091 2.0995471 65 19.087016 2.414e-28 35.881005 44.267176 |
+---------------------------------------------------------------------------------------------------+

. parmby `"regress mpg weight if index(make,`"A"')==0, robust"', list(,)
Command: regress mpg weight if index(make,`"A"')==0, robust

Regression with robust standard errors Number of obs = 67
F( 1, 65) = 103.19
Prob > F = 0.0000
R-squared = 0.6890
Root MSE = 3.3485

------------------------------------------------------------------------------
| Robust
mpg | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
weight | -.0061874 .0006091 -10.16 0.000 -.0074038 -.0049709
_cons | 40.07409 2.099547 19.09 0.000 35.88101 44.26718
------------------------------------------------------------------------------

Listing of results:

+---------------------------------------------------------------------------------------------------+
| parmseq parm estimate stderr dof t p min95 max95 |
|---------------------------------------------------------------------------------------------------|
1. | 1 weight -.00618736 .00060909 65 -10.158359 4.752e-15 -.0074038 -.00497092 |
2. | 2 _cons 40.074091 2.0995471 65 19.087016 2.414e-28 35.881005 44.267176 |
+---------------------------------------------------------------------------------------------------+

. parmby "regress mpg weight if index(make,`"A"')==0, robust", list(,)
too few quotes
r(132);



--
Roger Newson
Lecturer in Medical Statistics
Department of Public Health Sciences
King's College London
5th Floor, Capital House
42 Weston Street
London SE1 3QD
United Kingdom

Tel: 020 7848 6648 International +44 20 7848 6648
Fax: 020 7848 6620 International +44 20 7848 6620
or 020 7848 6605 International +44 20 7848 6605
Email: [email protected]
Website: http://www.kcl-phs.org.uk/rogernewson

Opinions expressed are those of the author, not the institution.

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