Statalist The Stata Listserver


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

Re: st: Data Manipulation Question


From   Robert A Yaffee <bob.yaffee@nyu.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Data Manipulation Question
Date   Sat, 18 Nov 2006 08:41:13 -0500

Socrates,
  Martin's suggestion is better after you convert parent to numeric
with a destring command.
 - Robert


Robert A. Yaffee, Ph.D.
Research Professor
Shirley M. Ehrenkranz
School of Social Work
New York University

home address:
Apt 19-W
2100 Linwood Ave.
Fort Lee, NJ
07024-3171
Phone: 201-242-3824
Fax: 201-242-3825
yaffee@nyu.edu

----- Original Message -----
From: Robert A Yaffee <bob.yaffee@nyu.edu>
Date: Saturday, November 18, 2006 8:34 am
Subject: Re: st: Data Manipulation Question

> Socrates,
> 
> 
> If you don't have many parents, you could try:
> 
> 
> gen t = _n
> tsset t
> gen tt=l.t
> gen parentn = 1 if Parent==A
> replace parentn = 2 if Parent==X
> replace parentn = 3 if Parent==Z
> replace parentn = l.parentn if l.t==tt & parentn ==.
> 
> .  If have a lot of families, this approach might not be practical.
>  
> Robert
> 
> Robert A. Yaffee, Ph.D.
> Research Professor
> Shirley M. Ehrenkranz
> School of Social Work
> New York University
> 
> home address:
> Apt 19-W
> 2100 Linwood Ave.
> Fort Lee, NJ
> 07024-3171
> Phone: 201-242-3824
> Fax: 201-242-3825
> yaffee@nyu.edu
> 
> ----- Original Message -----
> From: Maarten buis <maartenbuis@yahoo.co.uk>
> Date: Saturday, November 18, 2006 8:11 am
> Subject: Re: st: Data Manipulation Question
> 
> > --- Socrates Mokkas <socrates.mokkas@economics.oxford.ac.uk> wrote:
> > > I have a question related to data manipulation. My data sample is
> > > like that:
> > > 
> > > Parent       Subsidiary
> > > A            B
> > >              C
> > >              D
> > >              F
> > > X            J
> > >              L
> > > Z            T
> > > 
> > > What I want is to fill the gaps of the ParName.
> > 
> > Socrates:
> > Something similar came up on the list recently: have a look at the
> > thread started with:
> > http://www.stata.com/statalist/archive/2004-07/msg00297.html
> > HTH,
> > Maarten
> > 
> > 
> > 
> > -----------------------------------------
> > Maarten L. Buis
> > Department of Social Research Methodology
> > Vrije Universiteit Amsterdam
> > Boelelaan 1081
> > 1081 HV Amsterdam
> > The Netherlands
> > 
> > visiting address:
> > Buitenveldertselaan 3 (Metropolitan), room Z434
> > 
> > +31 20 5986715
> > 
> > http://home.fsw.vu.nl/m.buis/
> > -----------------------------------------
> > 
> > 
> >        	
> > ___________________________________________________________ 
> > All New Yahoo! Mail  Tired of Vi@gr@! come-ons? Let our 
> SpamGuard 
> > protect you. http://uk.docs.yahoo.com/nowyoucan.html
> > *
> > *   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/
> 

*
*   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/



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