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

You want ... if husband == 1 | wife == 1 Otherwise put, | gives you unions, & gives you intersections. Nick n.j.cox@durham.ac.uk Nirina F Dear Nick, Also, husband's age, wife's age etc... were created using if wife==1& husband==1, so even if I don't use the constraint "if wife==1& husband==1", I get 0 observation. I am stuck with my definition. On 3/7/08, Nirina F <fstata@gmail.com> wrote: > I am sorry Nick, I meant sex==0 is male and I had it correct in my do > file but somehow I had it 1 here. > So after I generate these and then run reg with if wife==1 & > husband==1, I get 0 observation because the union of the two is zero. > > > On 3/6/08, Nick Cox <n.j.cox@durham.ac.uk> wrote: > > It seems that you have data on individuals, some male, some female; > > some husbands, some wives, some other categories. > > > > Your definitions are > > > > gen wife = ms == 2 & sex == 1 & head == 2 > > > > gen husband = ms == 2 & sex == 1 & head == 1 > > > > I assume here heterosexual marriages. Hence a husband must > > be male. So sex == 1 is wrong to define husbands if, as you say, > > that designates females. > > > > Nick > > n.j.cox@durham.ac.uk > > > > Nirina F > > > > Dear Nick, > > I looked at what you put together on Stata faqs > > http://stata.com/support/faqs/data/members.html > > so could you may be help me in this. > > I have one dataset so I don't need to merge but to separate members of > > household out but then be able to run a > > reg income ageofwife ageofhusband schoolingofwife fe > > This is how I defined > > > > gen wife=0 > > replace wife=1 if ms==2 & sex==1 & head==2 > > > > [ms is marital status, taking value 2 if married > > sex is gender, taking value 1 if female > > head is the relationship to hh head, taking value 2 if wife] > > > > gen husband=0 > > replace husband=1 if ms==2 & sex==1 & head==1 > > > > I have one dataset so I don't need to merge but to separate members of > > household out but then be able to run an equation like: > > > > reg income ageofwife ageofhusband schoolingofwife schoolingofhusband > > > > I know something is wrong with my definition above because I get 0 > > observation when I run the regression. * * 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/

- Prev by Date:
**RE: st: RE: -hhset- hrespnr?** - Next by Date:
**RE: st: Gamma functions in R and Stata's Gamma Functions** - Previous by thread:
**st: imputation of censored survival times** - Next by thread:
**st: Re: Log files with "log off" and "log on"** - Index(es):

© Copyright 1996–2016 StataCorp LP | Terms of use | Privacy | Contact us | What's new | Site index |