Rename a series of indicators from a categorical variable and re-label each according to the original variable's value label.
Rename a series of indicators from a categorical variable and re-label each according to the original variable’s value label.
The current version is still a work in progress. To install, user can use the net install command to download from the project’s Github page:
net install splitrename, from("https://aarondwolf.github.io/splitrename")
splitrename varlist [if], oldname(varname) newname(varname)
splitrename takes a list of variables in varlist with a common stub (specified by oldname) and renames them, changing all instances of oldname to newname in all variable names and labels.
Let’s say you have three variables, c1, c1_1, and c1_2 (for example, if c1 was split). You want to rename them all var, var_1, and var_2. The command you would use is:
. splitrename c1 c1_1 c1_2, oldname(c1) newname(var)
splitrename stores the following in r():
Aaron Wolf, Northwestern University aaron.wolf@u.northwestern.edu