asad
>
> And for the MEANS:
>
> bysort hhold g_id ns : egen meanage = mean(age) if ns
> by hhold g_id : gen S_age = meanage[2] if _n == 1
> by hhold g_id : replace S_age = meanage[1] if S_age ==
> .
>
> But the above doesnt create correct Spouse_age for
> those with OK==0 i.e. monogamous couples. Rather it
> assigns the average age to each i.e. husband and wife
> get the same (average) age. Hence, the first command
> line (for means) should be as follows:
>
> bysort hhold S_id: egen meanS_age = mean(Age) if
> S_id~=.
Correct, of course. Thanks for wrapping up the thread.
Nick
[email protected]
*
* 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/