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
Consistently sorting data ahead of generating duplicatesDear community, I am currently trying to identify different individuals(across several years) withi…
Market shares after mixlogitDear all, Does anyone know how can the market shares after a mixlogit model, including price, be est…
Stratified analysis or statistical measures of co-linearityHello, I have a sample of 1239 participants. My exposure variable is binary (1 = yes, 0 = no), and …
Programming a loop for non-time series datasetDear all, I turn to you for advice once again, as I am working for the first time on a dataset that…
Difference GMM, building valid instruments with X that is (mostly) time invariant.Hello, I have a theoretical question regarding the estimation of Difference GMM (Arellano Bond). I h…
Subscribe to:
Post Comments (Atom)
0 Response to renaming variables using values they hold
Post a Comment