2 years ago
#65666
Sophie Janssen
Compute variable with wildcard on variable names in SPSS?
I have a dataset with variables that start with category 'RC' and end wih a number that corresponds to a brand. The middle letter refers to a product.
For example:
RC_x_1 RC_b_1 RC_g_1 RC_x_2 RC_b_2 RC_g_2 etc.
Each variable has 5 values. I want to compute a new variable with all variables per brand that score within top 2 values.
So:
RC_x_1 (1 or 2) OR RC_b_1 (1 or 2) OR RC_g_1 (1 or 2) = RC_all_1
RC_x_2 (1 or 2) OR RC_b_2 (1 or 2) OR RC_g_2 (1 or 2) = RC_all_2
I tried some wild card options like: If RC_""1 = 1 OR RC""_1 = 2 RC_all_1 =1.
But it doesn't work :) Any ideas how to create something like this?
Thanks mucho!
variables
wildcard
spss
0 Answers
Your Answer