Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: use of if command after commands with options


From   "Sergiy Radyakin" <[email protected]>
To   [email protected]
Subject   Re: st: use of if command after commands with options
Date   Thu, 31 Jul 2008 13:21:12 -0400

Dear Stephan,

there are two ways to do it:
1) write if first, then put a comma and all options
2) write a comma, all options, another comma and then if condition

E.g.:

sysuse auto
regress p w, noconst, if foreign
regress p w if foreign, noconst,

Regards,
  Sergiy Radyakin

On 7/31/08, Stephan Rudolfer <[email protected]> wrote:
> I wish to use the if command to select a subset for estimation purposes, but also use options for the main command.  This doesn't seem to work, since stata thinks that "if" is a further option.  For example, pca..., comp(6). If I follow this with "if x==1", it won't work because stata thinks that "x==1" is a further option for pca.
>
> Comments please!
> Stephan Rudolfer
> --
> Dr Stephan M Rudolfer
> Honorary Research Fellow
> in Biostatistics & Mathematical Statistics
> Chairman, Manchester Group, Royal Statistical Society
> Biostatistics, Health Methodology Research Group
> School of Community Based Medicine
> University Place (1st Floor)
> University of Manchester
> Oxford Road, Manchester M13 9PL.
> Tel: +44 161 275 1650    Fax: +44 161 275 5205
> Email: [email protected]
> Web: http://www.maths.man.ac.uk/DeptWeb/Homepages/smr/
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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