I have a sample data and want to match values between different variables. Here are the first 100 rows of sample data. There are three variables, conm (supplier name), gvkey (supplier identifier), and cnms (customer name). I want to check whether some customers are listed in the suppliers so I want to create a logic that can check if values of cnms appear in the conm. I understand that cnms is in the proper case and conm is in the upper case so I have to unify the cases. After matching between conm and cnms, I want to extract the gvkey for those cnms values appearing in the conm variable.
I am new to Stata so I need help with this programming.
Thanks in advance.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str58 conm str6 gvkey str50 cnms "111 INC -ADR" "034066" "3 Customers" "21VIANET GROUP INC" "186876" "4 Customers" "21VIANET GROUP INC" "186876" "Not Reported" "21VIANET GROUP INC" "186876" "4 Customers" "21VIANET GROUP INC" "186876" "Not Reported" "21VIANET GROUP INC" "186876" "Not Reported" "21VIANET GROUP INC" "186876" "4 Customers" "2U INC" "019881" "Georgetown University School of Nursing and Health" "2U INC" "019881" "University of Southern California" "2U INC" "019881" "University of Southern California" "2U INC" "019881" "Georgetown University School of Nursing and Health" "2U INC" "019881" "Not Reported" "2U INC" "019881" "University of Southern California" "2U INC" "019881" "Georgetown University School of Nursing and Health" "2U INC" "019881" "Simmons College" "2U INC" "019881" "University of Southern California" "2U INC" "019881" "University of North Carolin" "2U INC" "019881" "Simmons College" "2U INC" "019881" "University of Southern California" "2U INC" "019881" "University of North Carolin" "2U INC" "019881" "Simmons University" "2U INC" "019881" "University of Southern California" "2U INC" "019881" "3 Customers" "2U INC" "019881" "Syracuse University" "360 SECURITY TECHNOLOGY INC" "186717" "Not Reported" "360 SECURITY TECHNOLOGY INC" "186717" "3 Customers" "360 SECURITY TECHNOLOGY INC" "186717" "Not Reported" "360 SECURITY TECHNOLOGY INC" "186717" "3 Customers" "360 SECURITY TECHNOLOGY INC" "186717" "Not Reported" "360 SECURITY TECHNOLOGY INC" "186717" "5 Customers" "3D SYSTEMS CORP" "014898" "Not Reported" "500.COM LTD -ADR" "019042" "Not Reported" "500.COM LTD -ADR" "019042" "Not Reported" "500.COM LTD -ADR" "019042" "Not Reported" "500.COM LTD -ADR" "019042" "Not Reported" "500.COM LTD -ADR" "019042" "Not Reported" "58.COM INC -ADR" "019026" "Not Reported" "6D GLOBAL TECHNOLOGIES" "181445" "Shenyang Xinxingjia Bellows Company" "6D GLOBAL TECHNOLOGIES" "181445" "Fuxin Nationality Industrial Park Construction Dev" "6D GLOBAL TECHNOLOGIES" "181445" "Liaoning Shenmei Hongyang Thermoelectric Co., Ltd" "6D GLOBAL TECHNOLOGIES" "181445" "Henan Pinggao Electric Co., Ltd" "6D GLOBAL TECHNOLOGIES" "181445" "Huaneng Tongyu Wind Power Co. Ltd." "6D GLOBAL TECHNOLOGIES" "181445" "Guodian Hefeng Wind Power Development Co. Ltd" "6D GLOBAL TECHNOLOGIES" "181445" "Beijing Guodian North China Power Engineering Co." "6D GLOBAL TECHNOLOGIES" "181445" "Shenyang Air Blower Group" "6D GLOBAL TECHNOLOGIES" "181445" "Not Reported" "6D GLOBAL TECHNOLOGIES" "181445" "Shenyang Air Blower Group" "6D GLOBAL TECHNOLOGIES" "181445" "4 Customers" "6D GLOBAL TECHNOLOGIES" "181445" "Not Reported" "6D GLOBAL TECHNOLOGIES" "181445" "Not Reported" "6D GLOBAL TECHNOLOGIES" "181445" "3 Customers" "A10 NETWORKS INC" "019849" "9 Customers" "A10 NETWORKS INC" "019849" "Nec Corp" "A10 NETWORKS INC" "019849" "Ntt Docomo Inc" "A10 NETWORKS INC" "019849" "Nec Corp" "A10 NETWORKS INC" "019849" "8 Customers" "A10 NETWORKS INC" "019849" "Not Reported" "A10 NETWORKS INC" "019849" "Microsoft Corp" "A10 NETWORKS INC" "019849" "Ntt Docomo Inc" "A10 NETWORKS INC" "019849" "Itochu Techno-Solutions Corp" "A10 NETWORKS INC" "019849" "10 Customers" "A10 NETWORKS INC" "019849" "Ntt Docomo Inc" "A10 NETWORKS INC" "019849" "10 Customers" "A10 NETWORKS INC" "019849" "10 Customers" "A10 NETWORKS INC" "019849" "Itochu Techno-Solutions Corp" "A10 NETWORKS INC" "019849" "10 Customers" "A10 NETWORKS INC" "019849" "10 Customers" "A10 NETWORKS INC" "019849" "Itochu Techno-Solutions Corp" "A10 NETWORKS INC" "019849" "Adaptive Integration" "AAC HOLDINGS INC" "178698" "Blue Cross Blue Shield of California" "AAC HOLDINGS INC" "178698" "Aetna Inc." "AAC HOLDINGS INC" "178698" "Aetna Inc." "AAC HOLDINGS INC" "178698" "United Behavioral Health" "AAC HOLDINGS INC" "178698" "Blue Cross Blue Shield of California" "AAC HOLDINGS INC" "178698" "Blue Cross Blue Shield of California" "AAC HOLDINGS INC" "178698" "Blue Cross Blue Shield of Texas" "AAC HOLDINGS INC" "178698" "United Behavioral Health" "AAC HOLDINGS INC" "178698" "Anthem Blue Cross Blue Shield of Colorado" "AAC HOLDINGS INC" "178698" "Aetna Inc." "AAC HOLDINGS INC" "178698" "Blue Cross Blue Shield of California" "AAC HOLDINGS INC" "178698" "Anthem Blue Cross Blue Shield of Colorado" "AAC HOLDINGS INC" "178698" "Aetna Inc." "AAC HOLDINGS INC" "178698" "Blue Cross Blue Shield of Texas" "ABBVIE INC" "016101" "3 Customers" "ABBVIE INC" "016101" "3 Customers" "ABBVIE INC" "016101" "3 Customers" "ABBVIE INC" "016101" "3 Customers" "ABBVIE INC" "016101" "3 Customers" "ABBVIE INC" "016101" "Not Reported" "ABBVIE INC" "016101" "3 Customers" "ABBVIE INC" "016101" "Not Reported" "ABBVIE INC" "016101" "3 Customers" "ABBVIE INC" "016101" "3 Customers" "ABBVIE INC" "016101" "Not Reported" "ABBVIE INC" "016101" "Not Reported" "ABBVIE INC" "016101" "3 Customers" "AC IMMUNE SA" "027372" "Genentech Inc" "AC IMMUNE SA" "027372" "Genentech Inc" "AC IMMUNE SA" "027372" "Genentech Inc" "AC IMMUNE SA" "027372" "Genentech Inc" end
0 Response to Match Values between Two Variables
Post a Comment