Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
"Ivica Rubil" <irubil@eizg.hr> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
st: RE: data management problem |

Date |
Fri, 16 Dec 2011 14:52:25 +0100 |

CORRECTION Dear Statalisters I have the first THREE variables in the table below in my dataset, and I wish to generate the FOURTH variable. This variable should be such that it is equal to 1 for all members of a particular household if there is at least one pensioner in this household. Below is the table with only two households one of which contains at least one pensioner and I wish to assign 1 to each member of this household. The other household doesn't contain any pensioner and I wish to assign 0 to each member of this household. How to do that??? hh_id | hh_member | dummy member | | | is pensioner | dummy hh with | | | at least one | | | pensioner -------|-------------|----------------|--------------------------------- ----- 1 | 1 | 1 | 1 1 | 2 | 1 | 1 1 | 3 | 0 | 1 1 | 4 | 0 | 1 2 | 1 | 0 | 0 2 | 2 | 0 | 0 2 | 3 | 0 | 0 ... | ... | ... | ... Thanks. i -- Ivica Rubil Ekonomski institut / The Institute of Economics, Zagreb a. Trg J. F. Kennedyja 7, 10 000 Zagreb, Croatia t. +385-1-2362-269 f. +385-1-2335-165 e. irubil@eizg.hr www.eizg.hr -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Ivica Rubil Sent: 16. prosinac 2011 14:45 To: statalist@hsphsun2.harvard.edu Subject: st: data management problem Dear Statalisters I have the first four variables in the table below in my dataset, and I wish to generate the fifth variable. This variable should be such that it is equal to 1 for all members of a particular household if there is at least one pensioner in this household. Below is the table with only two households one of which contains at least one pensioner and I wish to assign 1 to each member of this household. The other household doesn't contain any pensioner and I wish to assign 0 to each member of this household. How to do that??? hh_id | hh_member | dummy_member_is_pensioner | dummy_hh_with_at_least_one_pensioner ------|-------------|----------------------------|---------------------- ---------------- 1 | 1 | 1 | 1 1 | 2 | 1 | 1 1 | 3 | 0 | 1 1 | 4 | 0 | 1 2 | 1 | 0 | 0 2 | 2 | 0 | 0 2 | 3 | 0 | 0 ... | ... | ... | ... Thanks. i -- Ivica Rubil Ekonomski institut / The Institute of Economics, Zagreb a. Trg J. F. Kennedyja 7, 10 000 Zagreb, Croatia t. +385-1-2362-269 f. +385-1-2335-165 e. irubil@eizg.hr www.eizg.hr * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**Re: st: RE: data management problem***From:*Benjamin Volland <volland@econ.mpg.de>

**References**:**st: Testing for mediation with categorical mediators and complex survey data?***From:*"Galinsky, Adena M." <agalinsk@jhsph.edu>

**Re: st: Testing for mediation with categorical mediators and complex survey data?***From:*John Antonakis <John.Antonakis@unil.ch>

**st: data management problem***From:*"Ivica Rubil" <irubil@eizg.hr>

- Prev by Date:
**st: data management problem** - Next by Date:
**Re: st: data management problem** - Previous by thread:
**st: data management problem** - Next by thread:
**Re: st: RE: data management problem** - Index(es):