Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

st: RE: How to drop individuals from sample?

From   "Ivica Rubil" <[email protected]>
To   <[email protected]>
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 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
[email protected] ||

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Dheepan Ratha
Sent: 25. srpanj 2012 8:54
To: [email protected]
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

Dheepan Ratha
*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index