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

From |
Ekaterina Hertog <ekaterina.hertog@sociology.ox.ac.uk> |

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

Subject |
Re: st: counting the number of nonmissing values in varlist for each observation |

Date |
Mon, 28 Dec 2009 18:31:42 +0100 |

Dear Martin,

sincerely yours, Ekaterina

<> See the rules at -help varlist-: "?" stands for one character... *** clear* set obs 10 forv i=1/10{ gen fammem`i'=cond(runiform()<.1,.,1) gen fammem`i'_liv=. } egen nmbfammem= rownonmiss(fammem? fammem??) su nmbfammem *** HTH Martin -------- Original-Nachricht --------Datum: Mon, 28 Dec 2009 17:13:40 +0100 Von: Ekaterina Hertog <ekaterina.hertog@sociology.ox.ac.uk> An: "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> Betreff: st: counting the number of nonmissing values in varlist for each observationDear all,I need to create a variable which will contain the count the number ofnonmissing values in varlist for each observation for the variablescalled fammem1, fammem2 etc.I came up with the following command: egen nmbfammem= rownonmiss (fammem*) The problem is I have two types of variables starting with fammem: fammem1, fammem2 etc. until fammem10 (which note one's family members) andfammem1_liv, fammem2_liv etc. (which notes whether one lives with thegiven family member in the same household or not)and I only want to create the count of one's family members.Is it possible in Stata 11 to specify varlist as all variables the nameof which start with fammem followed by a number between 1 and 10?I will be very grateful for advice, Sincerely yours, Ekaterina * * 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: counting the number of nonmissing values in varlist for each observation***From:*"Martin Weiss" <Martin.Weiss1@gmx.de>

**References**:**st: Cannot allocate more than 779 MB to STATA11***From:*roland andersson <rolandersson@gmail.com>

**Re: st: Cannot allocate more than 779 MB to STATA11***From:*Neil Shephard <nshephard@gmail.com>

**Re: st: Cannot allocate more than 779 MB to STATA11***From:*roland andersson <rolandersson@gmail.com>

**Re: st: Cannot allocate more than 779 MB to STATA11***From:*Neil Shephard <nshephard@gmail.com>

**Re: st: Cannot allocate more than 779 MB to STATA11***From:*Robert A Yaffee <bob.yaffee@nyu.edu>

**Re: st: Cannot allocate more than 779 MB to STATA11***From:*roland andersson <rolandersson@gmail.com>

**Re: st: Cannot allocate more than 779 MB to STATA11***From:*roland andersson <rolandersson@gmail.com>

**Re: st: Cannot allocate more than 779 MB to STATA11***From:*David Kantor <kantor.d@att.net>

**st: counting the number of nonmissing values in varlist for each observation***From:*Ekaterina Hertog <ekaterina.hertog@sociology.ox.ac.uk>

**Re: st: counting the number of nonmissing values in varlist for each observation***From:*"Martin Weiss" <Martin.Weiss1@gmx.de>

- Prev by Date:
**Re: st: RE: counting the number of nonmissing values in varlist for each observation** - Next by Date:
**Re: st: stata mp 10.1 issue** - Previous by thread:
**Re: st: counting the number of nonmissing values in varlist for each observation** - Next by thread:
**Re: st: counting the number of nonmissing values in varlist for each observation** - Index(es):

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