Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: replace value for all person


From   "Rodrigo A. Alfaro" <[email protected]>
To   <[email protected]>
Subject   st: Re: replace value for all person
Date   Wed, 3 Jan 2007 13:10:05 -0500

Assumming that wagefemal>0 & income is always nonmissing.
I suggest to try:

bysort hid: egen income2=min(income)

R.

----- Original Message ----- 
From: <[email protected]>
To: <[email protected]>
Sent: Wednesday, January 03, 2007 12:45 PM
Subject: st: replace value for all person


I wish you an happy new year.
I have a question about calculated a new variable that have the same  
value for all person in the house.
I have a datset where the variables are: hid(ident house),  
pid(personal ident), houseincome(income in the house), wagefemel(wage  
of wife)
and income( houseincome - wagefemel)

hid         pid        houseincome     wagefemal   income
1            1               100        0           100
1            2               100        10          90
1            3               100         0          100


I have need that the house income is the house income minus wagefemal  
for ech pid in the same house(hid) or 90.
I created wagefemal by hid, but not change.
thanks a lot for your help.
C.N.



















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

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