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
Help with SFA - sfpanel model BC95Dear Stata users, I am working on "the trade potential between China and Central and Eastern Europe…
How to use data in ARDL Bounds testThis is my first time to use Stata in fairly complicated research. Must the variables which are in l…
Problem with misspecificationHello All, Using a dataset of 600,000 observations and 60 variables I ran regress and then tested f…
Controlled interrupted time series with count data using glm, panel data, and Newey-West standard errorsHi, I am trying to conduct an interrupted time series analysis with an intervention group and a con…
2SLS/ Interpreting Cragg-Donald Wald F statistic and Stock-Yogo weak ID test critical valuesHello, I am running a robustness check using 2SLS and was having trouble interpreting the Cragg-Dona…
Subscribe to:
Post Comments (Atom)
0 Response to renaming variables using values they hold
Post a Comment