I want to rename the varlists in different files having different the numbers of varlists.
e.g
I want do the following commods in first file
ren A v1_1
ren B v2_1
ren C v3_1
ren D v4_1
ren E v5_1
ren F v6_1
ren G v7_1
ren H v8_1
ren I v9_1
ren J v1_2
ren K v2_2
ren L v3_2
ren M v4_2
ren N v5_2
ren O v6_2
ren P v7_2
Do the following commods the other file
ren A v1_1
ren B v2_1
ren C v3_1
ren D v4_1
ren E v5_1
ren F v6_1
ren G v7_1
and there are so many files,so I wonder is there some way to simpliy this process,such as set a dictionary if the name is A,rename it as v1_1,or count the number of the varlists,and execute the first few columns,but I don't know how to realize this idea.
Related Posts with How to execute some commands in .do according to conditions?
defining perfect sequence pairs and average non-perfect pairs of dataDear all, In the data structure below I have a perfect sequences Buy (B) Sell (S). Sometimes Buy or…
Labeling multiple variables using the foreach loopI am trying to learn the foreach loop command in Stata 13.0. I want to label multiple variables usin…
destringingHello, I was wondering if anyone could help me destring certain variable in my dataset. I have a var…
is it possible to do a repeated Measures ANOVA without case identifierHi all, I am currently using a Qualtrics platform survey to measure the perceived social consensus …
Merging two databases. With different dates. Best method?Dear members, These days I am working on my (master) thesis and I am working with Stata in order t…
Subscribe to:
Post Comments (Atom)
0 Response to How to execute some commands in .do according to conditions?
Post a Comment