Thursday, March 02, 2006

Re: st: use of *OR* | in 'replace'

> . replace Include=1 if Temp==1 | Dose_Group<35 > (26 real changes made) Well it's obviously possible. However, what about this one:

*************************************************************** set obs 10 obs was 0, now 10

. gen mouse = _n

. gen Dose_Group = 1

. replace Dose_Group = 2 if mouse > 32 (0 real changes made)

. replace Dose_Group = 2 if mouse > 3 (7 real changes made)

. replace Dose_Group = 3 if mouse > 6 (4 real changes made)

. gen Temp=41.5

. replace Temp = 42.5 if mouse > 5 (5 real changes made)

. gen Include = 0

. replace Include=1 if Dose_Group > 2 | Temp==41.5 (9 real changes made)

. drop Include

. gen Include = 0

. replace Include=1 if Temp==41.5 Dose_Group > 2 invalid 'Dose_Group' r(198); ***************************************************************

I'm certain that there's some logical explanation - it just eludes me.

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


Tag:


Links to this post:

Create a Link



<< Home

This page is powered by Blogger. Isn't yours?