Hello,
here it is the example of my data (I use stata12), the real sample contains more than 60000 observations.
* Example generated by -dataex-. To install: ssc install dataex
clear
* Example generated by -dataex-. To install: ssc install dataex
clear
input str40 name long appln_id str14 sector
"PONTIFICIA UNIVERSIDAD CATOLICA DEL PERU" 423510260 "UNIVERSITY_FOR"
"PONTIFICIA UNIVERSIDAD CATOLICA DEL PERU" 423510260 "UNIVERSITY_FOR"
"PONTIFICIA UNIVERSIDAD CATOLICA DEL PERU" 423510260 "UNIVERSITY_FOR"
"PONTIFICIA UNIVERSIDAD CATOLICA DEL PERU" 423510260 "UNIVERSITY_FOR"
"PONTIFICIA UNIVERSIDAD CATOLICA DEL PERU" 423510260 "UNIVERSITY_FOR"
"PONTIFICIA UNIVERSIDAD CATOLICA DEL PERU" 423510260 "UNIVERSITY_FOR"
"PONTIFICIA UNIVERSIDAD CATOLICA DEL PERU" 423510260 "UNIVERSITY_FOR"
"PRAYON" 423510368 "COMPANY"
"PRAYON" 423510368 "COMPANY"
"PRAYON" 423510368 "COMPANY"
"VAN GENECHTEN PACKAGING" 423597672 "COMPANY"
"VAN GENECHTEN PACKAGING" 423597672 "COMPANY"
"VAN GENECHTEN PACKAGING" 423597674 "COMPANY"
"VAN GENECHTEN PACKAGING" 423597674 "COMPANY"
"BOSCH " 423598235 "COMPANY"
"BOSCH " 423598235 "COMPANY"
"EXXONMOBIL CHEMICAL" 423610441 "COMPANY"
"EXXONMOBIL CHEMICAL" 423610441 "COMPANY"
"GILEAD" 420926514 "UNIVERSITY"
"KATHOLIEKE UNIVERSITEIT LEUVEN" 420926514 "COMPANY"
end
Many observations of my data have the same sector within their appln_id, but some of them have different sectors within one appln_id. I need to identify all appln_id (id) with different sectors within the same appln_id (e.g. appln_id = 420926514 has "UNIVERSITY" and "COMPANY" sectors).
here it is the example of my data (I use stata12), the real sample contains more than 60000 observations.
* Example generated by -dataex-. To install: ssc install dataex
clear
* Example generated by -dataex-. To install: ssc install dataex
clear
input str40 name long appln_id str14 sector
"PONTIFICIA UNIVERSIDAD CATOLICA DEL PERU" 423510260 "UNIVERSITY_FOR"
"PONTIFICIA UNIVERSIDAD CATOLICA DEL PERU" 423510260 "UNIVERSITY_FOR"
"PONTIFICIA UNIVERSIDAD CATOLICA DEL PERU" 423510260 "UNIVERSITY_FOR"
"PONTIFICIA UNIVERSIDAD CATOLICA DEL PERU" 423510260 "UNIVERSITY_FOR"
"PONTIFICIA UNIVERSIDAD CATOLICA DEL PERU" 423510260 "UNIVERSITY_FOR"
"PONTIFICIA UNIVERSIDAD CATOLICA DEL PERU" 423510260 "UNIVERSITY_FOR"
"PONTIFICIA UNIVERSIDAD CATOLICA DEL PERU" 423510260 "UNIVERSITY_FOR"
"PRAYON" 423510368 "COMPANY"
"PRAYON" 423510368 "COMPANY"
"PRAYON" 423510368 "COMPANY"
"VAN GENECHTEN PACKAGING" 423597672 "COMPANY"
"VAN GENECHTEN PACKAGING" 423597672 "COMPANY"
"VAN GENECHTEN PACKAGING" 423597674 "COMPANY"
"VAN GENECHTEN PACKAGING" 423597674 "COMPANY"
"BOSCH " 423598235 "COMPANY"
"BOSCH " 423598235 "COMPANY"
"EXXONMOBIL CHEMICAL" 423610441 "COMPANY"
"EXXONMOBIL CHEMICAL" 423610441 "COMPANY"
"GILEAD" 420926514 "UNIVERSITY"
"KATHOLIEKE UNIVERSITEIT LEUVEN" 420926514 "COMPANY"
end
Many observations of my data have the same sector within their appln_id, but some of them have different sectors within one appln_id. I need to identify all appln_id (id) with different sectors within the same appln_id (e.g. appln_id = 420926514 has "UNIVERSITY" and "COMPANY" sectors).
Comment