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

Re: st: RE: different n's using "if"


From   "Sarah A. Mustillo" <[email protected]>
To   [email protected]
Subject   Re: st: RE: different n's using "if"
Date   Fri, 01 Nov 2002 09:49:18 -0500

Thanks to all who replied to my question. Sometimes the simple things are the hardest for me to figure out! I appreciate you all clearing this up for me. I tried it the way you suggested and, of course, it worked. Thanks.

Sarah







 xi: xtgee pul    per2Xlagccm period2 lagccm age if
sex==0&racewh==1&period==1|2 [pweight=wt], robust corr(exch)
You've got a problem with your "period==1|2".  It needs to be (with
spaces to make things easier to read:

	sex==0 & racewh==1 & (period==1 | period==2)

YOu can't do "something==this|that"; you need to do "something==this |
something==that",
or use the inlist function:  inlist(something,this,that).

Your confusing results occurs because Stata is evaluating:

	(sex==0&racewh==1&period==1) | (2)

and (2) is always true.

--Nick Winter

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



Sarah A. Mustillo, Ph.D
Center for Developmental Epidemiology
Department of Psychiatry and Behavioral Sciences
Duke University School of Medicine
Box 3454
Durham NC 27710

919 687-4686 x234

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