[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: rename a lot of variables
I have personnel data from 6 companies and the maximum number of employees
in those companies is 18. There are 27 variables for each employee. The data
is shaped in the wide form, therefore, I have 18*27=486 variables in total.
I would like to reshape the data to a long form. However, the way these
variables are named is hard for me to do the reshape command.
c1p1a1 c1p1a2 .....
c4p1e1 c4p1e2 .....
The p1 in each of those variable names represent employee 1. Sometimes p1
is at the end of the variable names, but most of the times it is in the
middle of the variable names (342 in total) . I would like to move p1 to the
end of the variable name so that I could define 1-18 to be the "j" in the
I have checked the commands "rename" "renvars" "renpfix" "rensfix", but none
of them seems to be able to do this in a quick and easy way. Please give me
Thank you in advance.
* For searches and help try: