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?
Construct the standard error for the SCAR (event study)Dear Stata community, I'm trying to replicate the empirical strategy of the paper from Aybar and Ay…
The modification of survey questions that are not replicated throughout years but have similar meaningDear members of Statalist, I am writing here regarding a dilemma that I have. I have a dataset from …
qlqc30 command / stata deletes vars that dont need to be deletedhttps://journals.sagepub.com/doi/pdf...867X1501500407 Hi there, I have quality of life data that i …
Non-linear constraint in a SURE estimationDear Statalist contributors, I am trying to estimate a system of seemingly unrelated labor supplies…
Interpolate (extrapolate) values (mipolate)Hi Everyone, As my data set has some missing values, I have used the "mipolate" command found in st…
Subscribe to:
Post Comments (Atom)
0 Response to How to execute some commands in .do according to conditions?
Post a Comment