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" <>
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.


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

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:

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