*SPSS syntax example by www.spss-tutorials.com.
*First download and open hospital.sav.
get file 'hospital.sav'.
*Declare new tmp string variable.
string tmp(a1000).
*Combine values and value labels of four variables into tmp string variable.
compute tmp = concat(
"doctor_rating = ",string(doctor_rating,f1)," (",rtrim(valuelabels(doctor_rating)),") ",
"room_rating = ",string(room_rating,f1)," (",rtrim(valuelabels(room_rating)),") ",
"food_rating = ",string(food_rating,f1)," (",rtrim(valuelabels(food_rating)),") ",
"nurse_rating = ",string(nurse_rating,f1)," (",rtrim(valuelabels(nurse_rating)),") "
).
execute.
*From here on, proceed as usual with AUTORECODE and so on.