i would like to clean up my data set to only use observations when at least 5 different forecasters have given an estimated eps in a quarter for one firm.
My data set looks like this:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str37 username double user_id str90 name byte fiscal_quarter int fiscal_year double eps "KevinHavas" 16644 "Micron Technology Inc." 1 2015 .95 "rsreina" 33854 "Micron Technology Inc." 1 2015 .92 "Analyst_1578006" 25662 "Micron Technology Inc." 1 2015 .98 "LDrogen" 1078 "Micron Technology Inc." 1 2015 .97 "Gnawkz" 18104 "Micron Technology Inc." 1 2015 .89 "1nvestor" 1146 "Commercial Metals Company" 1 2015 .26 "pursuit" 30631 "Micron Technology Inc." 1 2015 .94 "TradingOptChris" 35210 "Sonic Corp." 1 2015 .15 "mc2188" 20988 "Micron Technology Inc." 1 2015 .95 "KevinHavas" 16644 "Micron Technology Inc." 1 2015 .93 end
As a solution I thought about the generation of a new variable that counts the users and in connection with this a drop if command. But I am not sure how to create the code for it.
Help would be greatly appreciated!
Kind regards
Thomas
0 Response to data set clean up
Post a Comment