Dear Statalisters,
I think what I have is a simple logic question involving replace.  I can't
seem to find a related question in the list archive.
I have data which looks something like:
x	y	z
-	-	-
A		A
A		A
A	B	A
A	B	A
	B	B
	B	B
I want 'z' to be all "A"s but this involves replacing 'z' with a value of
'x' which is found on a different observation line.  The problem is that the
amount of times 'x' and 'y' overlap throughout the dataset is not
consistent, and therefore I cannot use the x[_n-1] syntax for replacing.  I
think I could use a for-loop but I'm not sure.  Does anyone see how to go
about this?
Thanks very much,
Terra Curtis
*
*   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/