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 destring a variable containing some observations in a range?I have a variable wage. The wage variable has some observations in range, such as 400-500, 1200-1300…
conditionally check if 2 column clusters have no missing valuesHi, I have a dataset below that has 6 columns . I would like to check if [ not missing in any of th…
Running svy and clogit and get "the group() variable is not nested within the final stage sampling units" errorHi, I am working with National Inpatient Sample (NIS). Considering the survey design, I am running …
Normalizing GraphsHello All, I am attempting to normalize my graph to match the unconditional average for the corresp…
merging datasetshi guys, would anyone please be able to explain to me how to combine two datasets, one of which is a…
Subscribe to:
Post Comments (Atom)
0 Response to renaming variables using values they hold
Post a Comment