Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

st: RE: How to drop individuals from sample?


From   "Ivica Rubil" <irubil@eizg.hr>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: How to drop individuals from sample?
Date   Wed, 25 Jul 2012 09:36:17 +0200

There's probably a more elegant way to do this than the one I will
suggest you, but I would do it as follows.

Steps to do:

1. generate dummy variables like fired_in_year1, fired_in_year2, ... ,
fired_in_year6, where for example fired_in_year1 = 1 if the individual
experienced a job loss in year1.

2. generate one more variable which will contain horizontal sums of
dummy variables fired_in_year1 to fired_in_year6 

3. drop individuals for whom the value of the variable generated in step
2 is greater than 1 

I know it's not very elegant, but it should work.

Hope it helps.

Ivica






--
Ivica Rubil
Ekonomski institut || The Institute of Economics, Zagreb
Trg J. F. Kennedyja 7, 10 000 Zagreb, Croatia
tel. +385-1-2362-269 || fax. +385-1-2335-165
irubil@eizg.hr || www.eizg.hr

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Dheepan Ratha
Krishnan
Sent: 25. srpanj 2012 8:54
To: statalist@hsphsun2.harvard.edu
Subject: st: How to drop individuals from sample?

Hello all,

I am writing my dissertation on happiness adaptation to life events
(such as being fired or getting married) and am looking for a stata
command that will enable me to exclude individuals who have
experienced a particular life event more than once in my dataset. My
reason for doing this is so that I can analyse how individuals adapt
(in terms of happiness scores) to a life event at one particular time
within a specific sample period. For example, within a sample period
of 6 years, if individual A gets fired once and individual B gets
fired twice, how do I omit individual B and others like him from the
sample?

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


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