## how to compare different variable in the case? help :(

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

syckyip
Posts: 2
Joined: Tue Apr 05, 2016 2:16 am

### how to compare different variable in the case? help :(

first thanks for your kindly help
here is the problem we encountered. We have 3 different variables( let's say A,B,C) for every cases , and we want to create a new variable (let's say V1 )that classifies different cases according to whether the case score highest in A,B,or C and sort them accordingly.
(for example, if case1 have A=1 B=2 C=1 , then the case belongs to B, and in V1, it will be B)
(another example, if case2 have A=4 B=2 C=2 , then the case belongs to A, and in V1, it will be A)

is there a way to create that variable effectively? we tried compare mean ,but it only generate a new table ,not a variable
many thanks
GerineL
Moderator
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

### Re: how to compare different variable in the case? help :(

look into the max function.
syckyip
Posts: 2
Joined: Tue Apr 05, 2016 2:16 am

### Re: how to compare different variable in the case? help :(

maybe I didn't explain myself clearly..yeah we tried Max function, but we are not merely trying to capture the value, so it doesn't work well
if we simply use max function, the below will be the result:
v1_v2_v3___target
1__4__2_____4
4__1__7_____7
2__6__9_____9
7__3__2_____7

but what we try to achieve is:
v1_v2_v3___target
1__4__2_____2(implying this case score highest in v2)
4__1__7_____3(implying this case score highest in v3)
2__6__9_____3
7__3__2_____1(implying this case score highest in v1)

we want a new variable that can show whether the case score highest in V1,V2,or V3, rather than directly capture the max value from v1,v2,v3, is that possible in SPSS? cuz otherwise we will have to deal with it manually (but we have like 400 cases)
GerineL
Moderator
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

### Re: how to compare different variable in the case? help :(

Code: Select all

``````if (target = v1) target_2 = 1.
if (target = v2) target_2 = 2.
if (target = v3) target_2 = 3.
execute.
``````
Note that this syntax just takes the latest variable if e.g. both 1 and 3 are equal to the max.
mikosha
Posts: 2
Joined: Wed May 18, 2016 5:27 am

### Re: how to compare different variable in the case? help :(

Hello everyone. I am a beginner at SPSS. and I do not get some points. E.g. I have Satisfaction scale. there are 4 questions. How I find out are they satisfied or not.
P.s. I have 3 factors, and 7 dimensions, 45 questions (including demographic data), how to analyze all of them. The main things to understand: r the ppl satisfied, r they committed and how these independent n mediating variables affect on the performance…

### Who is online

Users browsing this forum: No registered users and 2 guests