I am asking for your help. I have tried to search on the previous posts but I failed to solve my problem. I have a large dataset with about 423 variables in the form of a matrix of companies with high governance and those with low governance. I have assigned a value of 1 to firms with high governance and zero for firms with low governance. So I want to create a dummy variable that is equal to 1 if a company is interlocked or linked with a firm with high governance and zero otherwise. I have tried doing it manually but the variables are too many and I have to do it for 12 years. I am asking if there is any other way to create the dummy variable. All variables are company names. My sample is as below.
----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str27 Companies double(Eletropaulo Alpargatas Aracruz Bradespar BrasilTPar Braskem CCRSA Celesc Celpa Cemig) byte CiaHering double(Cemepe TranPaulist) "521 Particip" 0 0 0 0 0 0 0 0 0 0 0 0 0 "524 Particip" 0 0 0 0 1 0 0 0 0 0 0 0 0 "A P Participacoes" 0 0 0 0 0 0 0 0 0 0 0 0 0 "AES Elpa" 1 0 0 0 0 0 0 0 0 0 0 0 0 "AES Sul" 1 0 0 0 0 0 0 0 0 0 0 0 0 "AES Tiete" 1 0 0 0 0 0 0 0 0 0 0 0 0 "AES Tiete E" 1 0 0 0 0 0 0 0 0 0 0 0 0 "AGF Brasil" 0 0 0 0 0 0 0 0 0 0 0 0 0 "AGconcessoes" 0 0 0 0 0 0 1 0 0 0 0 0 0 "Aco Altona" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Acos Vill" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Aetatis Sec" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Agpart" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Albarus" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Alef S/A" 0 0 0 0 1 0 0 0 0 0 0 0 0 "Alfa Consorc" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Alfa Financ" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Alfa Holding" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Alfa Invest" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Aliperti" 0 0 0 0 0 0 0 0 0 0 0 0 0 "All Amer Lat" 0 0 0 0 0 0 0 0 0 0 0 0 0 "All Norte" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Alpargatas" 0 0 0 0 1 0 1 0 0 0 0 0 0 "Altere Sec" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Am Inox BR" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Amazonia" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Amazonia Celular" 0 0 0 0 1 0 0 0 0 0 0 0 0 "Ambev S/A" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Ampla Energ" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Anhanguera" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Aracruz" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Araucaria" 0 0 0 0 1 0 0 0 0 0 0 0 0 "Arcelor BR" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Arteb" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Arthur Lange" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Atompar" 0 0 0 0 0 0 0 0 1 0 0 0 0 "Azevedo" 0 0 0 0 0 0 0 0 0 0 0 0 0 "BR Ferrovias" 0 0 0 0 0 0 0 0 0 0 0 0 0 "BR Propert" 0 0 0 0 0 0 0 0 0 0 0 0 0 "BRB Banco" 0 0 0 0 0 0 0 0 0 0 0 0 0 "BRF SA" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Bahema" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Ban Armazens" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Banco Bec" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Bandeirante Energ" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Banese" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Banespa" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Banestes" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Banex S/A" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Banpara" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Banrisul" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Bardella" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Battistella" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Baumer" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Belapart" 0 0 0 0 1 0 0 0 0 0 0 0 0 "Besc" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Betapart" 0 0 0 0 1 0 0 0 0 0 0 0 0 "Bic Monark" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Biomm" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Blue Tree" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Bombril" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Bompreco Bah" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Bonaire Part" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Botucatu Tex" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Bradesco" 0 0 0 1 0 0 0 0 0 0 0 0 0 "Bradespar" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Brasil" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Brasil T Par" 0 1 0 0 0 0 0 0 0 0 0 0 0 "Braskem" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Brasmotor" 0 0 0 0 0 0 0 1 0 0 0 0 0 "Brazilian Fr" 0 0 0 0 1 0 0 0 0 0 0 0 0 "Buettner" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Bunge Brasil" 0 0 1 0 0 0 0 0 0 0 0 0 0 "CBC Cartucho" 0 0 0 0 0 0 0 0 0 0 0 1 0 "CCR SA" 0 1 0 0 0 0 0 0 0 0 0 0 0 "CPFL Energia" 0 0 1 1 0 0 1 0 0 0 0 0 0 "CPFL Geracao" 0 0 0 1 0 0 1 0 0 0 0 0 0 "CPFL Piratininga" 0 0 0 1 0 0 1 0 0 0 0 0 0 "Cabinda Part" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Cacique" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Caconde Part" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Caemi" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Caf Brasilia" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Caianda Part" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Cambuci" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Capitalpart" 0 0 0 0 1 0 0 0 0 0 0 0 0 "Caraiba Met" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Casan" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Cbcc Contact Center" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Ceb" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Cedro" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Ceee-Gt" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Ceg" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Celesc" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Celg" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Celm" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Celpa" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Celpe" 0 0 0 0 1 0 0 0 0 0 0 0 0 "Celul Irani" 0 0 0 0 0 0 0 0 0 0 0 0 0 "Cemar" 0 0 0 0 0 0 0 0 1 0 0 0 0 end
0 Response to Creating a dummy variable in a large data set for interlocked companies
Post a Comment