Dear Stata Users,
I am trying to import dataset below into stata from csv Array but some variable names are too long and and are separated by '/' so they come out in the format v23, v24 v25, etc. Kindly I seek guidance on how I can write a loop statement in stata to import this dataset into stata without renaming the variables in the format v23, v24 and etc. I I would prefer to start ready from right and stops where the 1st '/' and pick that as the variable name. I believe this is possible but through loops. Kindly I would appreciate any guidance on how to fix this. see attached data format for guidance.
Thank you.
Collins
Related Posts with importing dataset with long variables names into stata through loop statements
Panel bootstrap after Wooldridge (1995) two-step estimatorDear Statalisters, I have a panel data set which suffers from sample selection bias. I am following…
Creating local macro names using a loopHi, this is my first post in the forum, I hope I will do this correctly. I am using Stata 15.1 I ha…
Panel Setting problem, and country-year fixed effectsHi to everyone, Im new in Stata programing, and it would be very helpful if someone gave me an opi…
Special characters issue PC to MacHello all, I am working on a survey project where the variable and value labels are in French, mean…
Users' Written Command update and Stata versionIs there a way to make Stata not update the commands to a version higher than that of Stata. Some c…
Subscribe to:
Post Comments (Atom)
0 Response to importing dataset with long variables names into stata through loop statements
Post a Comment