Bookmark and Share

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


[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






--
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] || www.eizg.hr

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Dheepan Ratha
Krishnan
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
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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index