I have a set of variables created during imputation as follows:
_1_rutter3all
_2_rutter3all
_3_rutter3all
_4_rutter3all
_5_rutter3all
_6_rutter3all
_7_rutter3all
_8_rutter3all
_9_rutter3all
_10_rutter3all
_11_rutter3all
_12_rutter3all
_13_rutter3all
_14_rutter3all
_15_rutter3all
_16_rutter3all
_17_rutter3all
_18_rutter3all
_19_rutter3all
_20_rutter3all
_21_rutter3all
_22_rutter3all
_23_rutter3all
_24_rutter3all
_25_rutter3all
I would like to rename the above variables by dropping the suffix 'all' (but keeping all other parts of the variable name). So, the new names will read: _1_rutter3, _2_rutter3, _3_rutter3 and so on.
I tried this:
Code:
rename (_1_rutter3all-_25_rutter3all) (*all* **)
Many Thanks
/Amal
0 Response to renaming a group of variables using rename
Post a Comment