Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Vincenzo Carrieri <vincenzo.carrieri@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | st: shifting status variable |
Date | Thu, 18 Nov 2010 20:23:13 +0100 |
Dear statlisters, I would like to create a dummy variable equals to one for persons which decide to divorce in a given year. I have a panel data with the following key variables: pb010=year variable (2004, 2005, 2006, 2007) separati=dummy variable equal to one for divorced persons (marital status=divorced) pb030=personal id My question is: How is it possible to create a variable which takes the value one if the person changes his marital status (from married to divorced) in the year 2005 (with respect to 2004), 2006 (with respect to 2005) and 2007 (with respect to 2006)? My final concern is to build 3 variables: people divorced in 2005, people divorced in 2006 and people divorced in 2007. Any help is appreciated. Many thanks, * * 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/