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

st: RE: RE: copying the contents of a variable to another obervation


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: copying the contents of a variable to another obervation
Date   Mon, 8 Sep 2003 23:55:58 +0100

> If you have some extra code (e.g. -child- is 1 for children
> and 0 otherwise), there is stuff like
> 
> bysort hhid (child) : gen inc_spouse = income[3 - _n]
>                                          if _n < 3 & !child
> 

bysort hhid (child) : gen inc_spouse = income[3 - _n]
                           if _n < 3 & !child & !child[2] 
 
*
*   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