Hey everyone,
Is there a simple command (or few lines of code) to rename variables based on a specific string value they hold?
In more detail, the situation is that I have an elections results data set in which every variable is a "party", and the values it holds represent the amount of votes for that party. the problem is that variables are named by the letters represent each party on the ballots. I would like to rename the variables so that they indicate the parties' names. For doing that, I have another small table that has the same unwanted names (the representing letters) as variable names, but under each of them there is a string value of the party's real name.
Any ideas how to deal with this issue?
Much appreciation,
Ben
Related Posts with renaming variables using values they hold
How to transfer multiple values stored under a local macro into a variableHello, How can I transfer multiple values stored under a local macro into a variable? Below is wha…
List a single observation, formatted in a columnDear all, I would like to list the values of a single observation such that for each variable the o…
Adding a new variable on Stata that has different dimensions than the variables from a dataset that is in useHello, Is there a way to add a new variable on Stata that has different dimensions than the dataset…
randomisation in stepped wedge cluster RCTHi Statalisters, Does anyone know about any Stata community-contributed command to carry out random…
xtdcce2 short run estimates?I am trying to estimate xtdcce2 for T18 T8, the impact of trade openness on trade revenue. I am tryi…
Subscribe to:
Post Comments (Atom)
0 Response to renaming variables using values they hold
Post a Comment