This is a bit of a specific request. I am trying to create variable names that concentate the value of one variable with the name of another. Picture 2 separate data files with similarly named variables but which mean different things. I'd like to merge the files together and make sure that the variables are uniquely named.
Here's an example of what my datasets look like:
dataset 1:
dataset 2:
The variable names should be associated with their sequence number, which would create unique variable names. Here's what I want my data to look like:
Basically, I need to figure out how to rename the variables such that they incorporate the sequence number of the dataset.
Thank you in advance for any help you can provide.
Here's an example of what my datasets look like:
dataset 1:
District | Sequence Number | Var1 | Var2 |
A | 1 | 1111 | 1222 |
B | 1 | 1333 | 1444 |
District | Sequence Number | Var1 | Var2 | Var3 |
A | 2 | 1555 | 1666 | 1777 |
B | 2 | 1888 | 1999 | 2111 |
Item | 1Var1 | 1Var2 | 2Var1 | 2Var2 | 2Var3 |
A | 1111 | 1222 | 1555 | 1666 | 1777 |
B | 1333 | 1444 | 1888 | 1999 | 2111 |
Thank you in advance for any help you can provide.
Comment