when reshaping data, from long to wide, we wanted to make each row per director, and all the companies their associated with as different variables (e.g. otherdirectorcompany 1 otherdirectorcompany2 otherdirectorcompany3...)
however it has inserted lots of blanks, such that our company variables goes from otherdirectorcompany1 all the way to otherdirectorcompany737
Is there a way to delete the blanks such that it shifts the non-blanks left?
Here is the dataex (with sample of otherdirectorcompanyn variables - they do go continuously from 1 to 737):
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str54 directorname str66(otherdirectorcompany1 otherdirectorcompany2 otherdirectorcompany20 otherdirectorcompany21 otherdirectorcompany22 otherdirectorcompany40 otherdirectorcompany41 otherdirectorcompany42 otherdirectorcompany200) "Abdool-Samad Tasneem" "" "" "Absa Financial Services Limited" "" "" "" "" "" "" "Adebayo Kazeem" "" "" "" "" "" "" "" "" "" "Africa Brendan" "" "" "" "" "" "" "" "" "" "Ahern Anet" "" "" "" "" "" "" "" "" "" "Ally Fathima" "" "" "" "" "" "" "" "" "" "Ally Mustak" "" "" "" "" "" "" "" "" "" "Andre Louw Korsten" "" "" "" "" "" "" "" "" "" "Andriesa Johanna Korsten" "" "" "" "" "" "" "" "" "" "Anel Kotze" "" "" "" "" "" "" "" "" "" "Anthony Bradley" "" "" "" "" "" "" "" "" "" "Aranda Idoya" "" "" "" "" "" "" "" "" "" "Armstrong Brian" "" "" "" "" "" "" "" "" "" "Arnold Michael" "" "" "" "" "" "" "" "" "" "Artus Duncan" "" "" "" "" "" "" "" "" "" "Bailey Lester" "" "" "" "" "" "" "" "" "" "Baldock Henrietta" "" "" "" "" "" "" "" "" "" "Baleni Msokoli" "" "" "" "" "" "" "" "" "" "Baloyi Paul" "" "" "" "" "" "" "" "" "" "Bam Lwazi" "" "" "" "" "" "" "" "" "" "Barkhuysen Marius" "" "" "" "" "" "" "" "" "" "Bassa Zarina" "" "" "" "" "" "" "" "" "" "Bassier Khadeeja" "" "" "" "" "" "" "" "" "" "Bekker Jacobus" "" "" "" "" "" "" "" "" "" "Bellingan GP" "" "" "" "" "" "" "" "" "" "Bethlehem Lael" "" "" "" "" "" "" "" "" "" "Bezuidenhout Jacobus" "" "" "" "" "" "" "" "" "" "Bhettay Nadya Fatima" "" "" "" "" "" "" "" "" "" "Binedell Engelbert" "" "" "" "" "" "" "" "" "" "Bird Stuart" "" "" "" "" "" "" "" "" "" "Birrell Andrew" "" "" "" "" "" "" "" "" "" "Blades Simon Andrew" "" "" "" "" "" "" "" "" "" "Blumenthal Henry" "" "" "" "" "" "" "" "" "" "Boardman Thomas" "" "" "" "" "" "" "" "" "" "Bomela Mary" "" "" "" "" "" "" "" "" "" "Booi Pambili Mtutuzeli" "" "" "" "" "" "" "" "" "" "Boonzaier Nicolaas" "" "" "" "" "" "" "" "" "" "Boonzaier Reynecke Nicolaas" "" "" "" "" "" "" "" "" "" "Booth Charles" "" "" "" "" "" "" "" "" "" "Booysen Stefanes Francois (Steve)" "" "" "" "" "" "" "" "" "" "Bosman Hermanus" "" "" "" "" "" "" "" "" "" "Botha Anton" "" "" "" "" "" "" "" "" "" "Botha Susan" "" "" "" "" "" "" "" "" "" "Botha Susan Louise (Santie)" "" "" "" "" "" "" "" "" "" "Bouwer Beverley" "" "" "" "" "" "" "" "" "" "Boyce Lulama" "" "" "" "" "" "" "" "" "" "Boyes Jamie " "" "" "" "" "" "" "" "" "" "Bradley Anthony " "" "" "" "" "" "" "" "" "" "Briesies Reece" "" "" "" "" "" "" "" "" "" "Brody Hubert" "" "" "" "" "" "" "" "" "" "Brown Michael" "" "" "" "" "" "" "" "" "" "Brown Neil" "" "" "" "" "" "" "" "" "" "Brown Steven" "" "" "" "" "" "" "" "" "" "Burger Johan" "" "" "" "" "" "" "" "" "" "Burger Johan Petrus" "" "" "" "" "" "" "" "" "" "Burnett Meagen" "" "" "" "" "" "" "" "" "" "Burton Patrick" "" "" "" "" "" "" "" "" "" "Bydawell Bruce" "" "" "" "" "" "" "" "" "" "Campher Leon" "" "" "" "" "" "" "" "" "" "Capazorio Sean" "" "" "" "" "" "" "" "" "" "Carolus Cheryl" "" "" "" "" "" "" "" "" "" "Cele Sibonelo" "" "" "" "" "" "" "" "" "" "Chapman Warren" "" "" "" "" "" "" "" "" "" "Charreton Didier" "" "" "" "" "" "" "" "" "" "Chetty Thavanesan" "" "" "" "" "" "" "" "" "" "Chirwa Nditshe" "" "" "" "" "" "" "" "" "" "Chiume Lisa" "" "" "" "" "" "" "" "" "" "Churr Rudi" "" "" "" "" "" "" "" "" "" "Cilliers Jeanette" "" "" "" "" "" "" "" "" "Equilibrium Investment Management (Pty) Ltd" "Clark Philip" "" "" "" "" "" "" "" "" "" "Cluer Paul" "" "" "" "" "" "" "" "" "" "Coetzee Abraham Andre" "" "" "" "" "" "" "" "" "" "Coetzee Abraham Andre " "" "" "" "" "" "" "" "" "" "Coetzer Johan" "" "" "" "" "" "" "" "" "" "Coffee Gert Johannes" "" "" "" "" "" "" "" "" "" "Cohen Laurence Richard" "" "" "" "" "" "" "" "" "" "Collis John" "" "" "" "" "" "" "" "" "" "Collopy Terence" "" "" "" "" "" "" "" "" "" "Combi Zitulele" "" "" "" "" "" "" "" "" "" "Conrad Alethea" "" "" "" "" "" "" "" "" "" "Cook Paul" "" "" "" "" "" "" "" "" "" "Cooper Maheshvera" "" "" "" "" "" "" "" "" "" "Cooper Peter" "" "" "" "" "" "" "" "" "" "Criticos Nick" "" "" "" "" "" "" "" "" "" "Cummins John" "" "" "" "" "" "" "" "" "" "Cunningham Anthony" "" "" "" "" "" "" "" "" "" "Currie Louise" "" "" "" "" "" "" "" "" "" "Daehnke Arno" "" "" "" "" "" "" "" "" "" "Dambuza Amanda" "" "" "" "" "" "" "" "" "" "Dames Brian" "" "" "" "" "" "" "" "" "" "Darko Alex" "" "" "" "" "" "" "" "" "" "Davis Michael" "" "" "" "" "" "" "" "" "" "De Villier Gerhardus Francois" "" "" "" "" "" "" "" "" "" "De Vries Anastasia Jane" "" "" "" "" "" "" "" "" "" "Desai Prakash" "" "" "" "" "" "" "" "" "" "Dickson Carlo" "" "" "" "" "" "" "" "" "" "Dlamini Kuseni" "" "" "" "" "" "" "" "" "" "Dloti Thabo" "" "" "" "" "" "" "" "" "" "Dolamo Anne" "" "" "" "" "" "" "" "" "" "Dongwana Neo" "" "" "" "" "" "" "" "" "" "Dotwana Loyiso" "" "" "" "" "" "Afrimat Ltd" "" "" "" end
Best
0 Response to Cleaning challenge blanks in variables
Post a Comment