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
Level-2 Dependent variableGood morning, I am working with data from students (level 1) belonging to classes (level 2) within …
Asdoc: format percentage in tableHi all, I wonder if it´s possible format percentage in a table with asdoc. I mean display percentag…
methodological question: matching/imputation based on two datasetsHello, I struggle to find the right method for what I want to do using two household surveys. I hav…
Deleting part of a text in a string variableHi STATALIST, I need to create b from a : Code: * Example generated by -dataex-. To install: ss…
Why are all my residuals negative?I'm trying to use GMM to estimate a model on the following data: Code: * Example generated by -dat…
Subscribe to:
Post Comments (Atom)
0 Response to importing dataset with long variables names into stata through loop statements
Post a Comment