Statalist


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

RE: st: RE: dropping observation


From   "Kieran McCaul" <[email protected]>
To   <[email protected]>
Subject   RE: st: RE: dropping observation
Date   Thu, 11 Jun 2009 06:46:05 +0800

..

OK,

sort analystID employerID
by analystID employerID: gen N1=_N
by analystID: gen N2=_N
drop if N2==N1



______________________________________________
Kieran McCaul MPH PhD
WA Centre for Health & Ageing (M573)
University of Western Australia
Level 6, Ainslie House
48 Murray St
Perth 6000
Phone: (08) 9224-2701
Fax: (08) 9224 8009
email: [email protected]
http://myprofile.cos.com/mccaul 
http://www.researcherid.com/rid/B-8751-2008
______________________________________________
Man is a credulous animal, and must believe something; in the absence of good grounds for belief, 
he will be satisfied with bad ones. Bertrand Russell 


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Stefano Bonini
Sent: Thursday, 11 June 2009 6:36 AM
To: [email protected]
Subject: Re: st: RE: dropping observation

thanks Kieran 

unfortunately in the example I know that I have to drop analyst 1 (visual inspection makes it easy) but I have thousands of analysts with thousands of forecasts and visual inspection is not an option for identifying who needs to be dropped.


----- Original Message -----
From: "Kieran McCaul" <[email protected]>
To: [email protected]
Sent: Wednesday, June 10, 2009 6:31:00 PM GMT -05:00 US/Canada Eastern
Subject: st: RE: dropping observation

..

drop if analystID==1

______________________________________________
Kieran McCaul MPH PhD
WA Centre for Health & Ageing (M573)
University of Western Australia
Level 6, Ainslie House
48 Murray St
Perth 6000
Phone: (08) 9224-2701
Fax: (08) 9224 8009
email: [email protected]
http://myprofile.cos.com/mccaul 
http://www.researcherid.com/rid/B-8751-2008
______________________________________________
Man is a credulous animal, and must believe something; in the absence of good grounds for belief, 
he will be satisfied with bad ones. Bertrand Russell 


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Stefano Bonini
Sent: Thursday, 11 June 2009 6:18 AM
To: [email protected]
Subject: st: dropping observation

Hi
I have a huge panel dataset containing analyst forecasts. Each analyst is associated with an employer. Sometimes analyst change employer. I want to restrict my dataset, dropping the observations of analysts that never change employer. The dataset may look like this

forecast#     analystID   employer ID
1                 1            1
2                 1            1
3                 1            1

1                 2            1
2                 2            1
3                 2            2
4                 2            2

1                 3            3
2                 3            4

In this case I'd nee to drop all observations by analyst 1 because he never changes employer, while keeping those of analysts 2 and 3.

I really cannot figure out the way to do it as visual inspection is just impossible with over 1.2m obs.

Thanks!

Stefano
*
*   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/

-- 
Stefano Bonini
Visiting Associate Professor
Department of Finance
New York University
Stern School of Business
44W 4th St. New York, NY

Ph. +1 212 998 0305
Email [email protected]
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index