Statalist


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

Re: st: Creating variables of parents education when ID is known


From   "Martin Weiss" <[email protected]>
To   [email protected]
Subject   Re: st: Creating variables of parents education when ID is known
Date   Sun, 15 Mar 2009 09:12:11 +0100

<>

Try http://www.stata.com/support/faqs/data/members.html

HTH
Martin

-------- Original-Nachricht --------
> Datum: Sun, 15 Mar 2009 02:47:28 -0500
> Von: Eunsu Ju <[email protected]>
> An: [email protected]
> Betreff: st: Creating variables of parents education when ID is known

> Hello Stata Users,
> 
> I would like to generate a new variable which contains the information
> of parents, e.g. dad's education.
> My data looks like below.
> 
>  FID  PID  Var1 Edu Var3 FFID FPID Fedu
> 
>  1001 100  XXX  XXX XXXX   ----   ----   ????
>  1001 200  XXX  XXX XXXX   ----   ----   ????
>  1001 300  XXX  XXX XXXX 1001  100  ????
>  1001 310  XXX  XXX XXXX 1001  100  ????
>  1002 101  XXX  XXX XXXX   ----   ----   ????
>  1002 102  XXX  XXX XXXX   ----   ----   ????
>  1002 200  XXX  XXX XXXX 1002  101  ????
>  1002 300  XXX  XXX XXXX 1002  101  ????
>  1002 310  XXX  XXX XXXX 1002  200  ????
>  1002 320  XXX  XXX XXXX 1002  200  ????
> 
> 
> *Note: FID = Family ID; PID = Person ID; FFID = Father's family ID;
>           FPID = Father's person ID; Fedu = Father's Education
> 
> 
> What I want to do is to have the last (far right) column, which is not
> included in the dataset.
> (I want to do this kind of works for other variables, e.g. Var1 and Var3.)
> 
> What is the best & simplist way to do this in stata?
> 
> I think I can do this like the following.
> 1) Split the data set into two files so that one file contains Dad's
> FID and Dad's PID, and the other has all others.
> 2) Then, rename FID and PID in the second file as Dad's FID and Dad's PID.
> 3) Rename Edu (and/or other variables I want to have at Dad's level)
> as Dad's Edu
> 4) Merge two files by matching Dad's FID and Dad's PID.
> 
> However, there might be easier way to do this. Please let me know if
> you know anything that makes the work easier.
> Thanks much, in advance.
> 
> 
> Eunsu Ju
> Ph.D. Candidate, Research Specialist
> School of Social Work, University of Minnesota
> *
> *   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/

-- 
Martin Weiss
Hackersteigle 3
72076 Tübingen
00497071/793535
00491784597218

Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger01
*
*   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/



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