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

From |
"Leonor Saravia" <lmisaravia@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
st: Re: "cond" command |

Date |
Thu, 11 Sep 2008 14:12:31 -0400 |

Eva and Nick, I really appreciate your help! What I need to do is this: I have three variables: jub = (1, 0) ; inv = (1,0) ; sob = (1,0) and I need to look the number of observations that satisfy each condition, ei, I need to know how many persons "have" jub == 1 or jub == 0; how many have inv == 1 or inv == 0 and how many hve sob == 1 or sob == 0. So, that´s why I thought that I could generate another variable (pension = jub + inv + sob) which might be useful to order the obervations. The kind of table I´d like to construct is something like this (that´s why I thought that using the 'cond' function was right): pension | jub | inv | sob | | if == 1 | if == 0| if == 1 | if == 0| if == 1 | if == 0| 1 | N 1 | N0 | n1 | n0 | x1 | x0 | 2 | N 1 | N0 | n1 | n0 | x1 | x0 | 3 | N 1 | N0 | n1 | n0 | x1 | x0 | 0 | N 1 | N0 | n1 | n0 | x1 | x0 | Thank you very much for your time and your help! :) Leonor 2008/9/11, Leonor Saravia <lmisaravia@gmail.com>: > Hello Statalisters, > > I'm trying to tabulate some information, but I´m having problems doing > it, so I´d appreciate if you could see it and tell me what's what I´m > doing wrong. > > What I did, was: > > gen col = cond(pension == 1, /// > cond(jub == 1, 1, 2)) > > label define col 1 "pension, jub" /// > 2 "pension, Sobrevivencia" /// > > label value col col > > Where the variables have this information: pension = (0,1, 2) > jub = (0,1) > > > Thank you very much!! > > Leonor > * * 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**:**st: RE: Re: "cond" command***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

**Re: st: Re: "cond" command***From:*"Eva Poen" <eva.poen@gmail.com>

**References**:**st: "cond" command***From:*"Leonor Saravia" <lmisaravia@gmail.com>

- Prev by Date:
**st: RE: Trend Test for Rates** - Next by Date:
**Re: st: re: ML program and ML maximize help** - Previous by thread:
**Re: st: "cond" command** - Next by thread:
**Re: st: Re: "cond" command** - Index(es):

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