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

From |
"Nirina F" <fstata@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: RE: -hhset- hrespnr? |

Date |
Fri, 7 Mar 2008 14:56:54 -0500 |

Dear Nick, Thank you for taking the time to respond. I understand what you mean but actually, what I meant was that if I run "reg income ageofwife ageofhusband schoolingofwife schoolingofhusband " it gives me 0 observation because of how the explanatory variables were generated: ageofwife=age if wife==1 ageofhusband=age if husband==1 then used together ends up in intersection and here comes my problem. Nirina On 3/7/08, Nick Cox <n.j.cox@durham.ac.uk> wrote: > Unless I am looking at another typo, you have it the wrong way around. > > ... if husband == 1 & wife == 1 > > checks whether a particular person is _both_ husband _and_ wife. > From your definitions, or otherwise, it is clear that can't happen, > so as you say no observations turn out to be selected. > > 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/ > * * 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/

**Follow-Ups**:**Re: st: RE: -hhset- hrespnr?***From:*Richard J Stoll <stoll@rice.edu>

**RE: st: RE: -hhset- hrespnr?***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

**References**:**st: -hhset- hrespnr?***From:*"Nirina F" <fstata@gmail.com>

**st: RE: -hhset- hrespnr?***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

**Re: st: RE: -hhset- hrespnr?***From:*"Nirina F" <fstata@gmail.com>

**RE: st: RE: -hhset- hrespnr?***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

**Re: st: RE: -hhset- hrespnr?***From:*"Nirina F" <fstata@gmail.com>

**Re: st: RE: -hhset- hrespnr?***From:*"Nirina F" <fstata@gmail.com>

**RE: st: RE: -hhset- hrespnr?***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

- Prev by Date:
**Re: st: biprobit for more than 2 dependent variables** - Next by Date:
**RE: st: biprobit for more than 2 dependent variables** - Previous by thread:
**RE: st: RE: -hhset- hrespnr?** - Next by thread:
**RE: st: RE: -hhset- hrespnr?** - Index(es):

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