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?
 Instrumental variable analysis for binary dependent and independent variables and binary instrumentHello,
I am relatively new to STATA and I am working on a research study investigating medical outc… Instrumental variable analysis for binary dependent and independent variables and binary instrumentHello,
I am relatively new to STATA and I am working on a research study investigating medical outc…
 match tablesHello everybody
I am trying to merge 2 tables using the command merge 1:1 or 1:m or m:1 or m:n, but… match tablesHello everybody
I am trying to merge 2 tables using the command merge 1:1 or 1:m or m:1 or m:n, but…
 Conditional statements to avoid looping error due to missing dataThe loop program runs the regression by SICCode by year. However, it stops in the very initial stage… Conditional statements to avoid looping error due to missing dataThe loop program runs the regression by SICCode by year. However, it stops in the very initial stage…
 Event Study - estimation_window missing values generatedHi all
I'm having one problems with event study analysis and I really hope you can help me with this… Event Study - estimation_window missing values generatedHi all
I'm having one problems with event study analysis and I really hope you can help me with this…
 Geonear but with UTM?Hello. I understand that the geonear command uses geographic coordinates. I need a command that perf… Geonear but with UTM?Hello. I understand that the geonear command uses geographic coordinates. I need a command that perf…
Subscribe to:
Post Comments (Atom)
0 Response to How to execute some commands in .do according to conditions?
Post a Comment