Changing large numbers of variable names without scripting
In this recipe we learn how to change variable names by adding suffixes or prefixes using a Derive node. The data sources for this recipe were developed by computing the average value of several key fields after aggregating by the variable STATE
and then by DOMAIN
. The Aggregate node, as a default, appends the string _Mean
(when obtaining a mean) to each of the variables so that the variable names come from both.
Getting ready
This recipe uses the datafiles cup98lrn_reduced_vars3_varchange state.sav
and up98lrn_reduced_vars3_varchange domain.sav
, and the stream Recipe – change variable names.str
.
How to do it...
To change variable names by adding suffixes or prefixes using a Derive node:
Open the stream
Recipe – change variable names.str
by navigating to File | Open Stream.Make sure the datafile points to the correct path to the
cup98lrn_reduced_vars3_varchange state.sav
andcup98lrn_reduced_vars3_varchange domain.sav
.Open the Type node...