Match Function from Ecel

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Match Function from Ecel

Jignesh Sutar
Hello,

I have the following data, as below, but for the purpose of what I am trying
to achieve I have exported the data to Excel, since I can apply a MAX
formula within a MATCH formula in Excel to compute what I require.

The formula I apply in Excel cell E2 is "=MATCH(MAX(A2:D2),A2:D2,0)". But
how do I apply this same computation in SPSS?

NEW FILE.
DATA LIST LIST/ v1(F8.0) v2(F8.0) v3(F8.0) v4(F8.0).
BEGIN DATA.
20.76 26.37 30.42 33.83
9.24 12.89 10.08 16.05
24.87 24.06 19.13 19.6
3.42 6.72 3.32 9.39
20.05 22.99 25.59 25.76
15.9 18.61 13.71 17.86
24.45 25.21 25.96 24.8
30.95 34.21 37.75 41.3
16.59 22.04 25.18 25.2
22.07 24.76 28.09 26.42
15.89 20.44 20.84 27.56
12.7 16.9 18.66 24.72
16.89 20.12 21.77 21.93
10.42 13.64 12.93 18.76
14.87 15.44 14.59 16.39
28.13 28.22 24.52 25.69
18.56 21.3 25.33 25.73
28.2 27.54 23.38 27.04
27.4 25.84 21.65 21.39
19.5 22.01 19.14 22.49
26.12 29.94 32.06 32.49
27.28 27.81 28.03 28.96
29.6 30.62 30.27 32.91
6.96 9.93 5.01 9.62
25.27 23.73 20.26 19.74
25.32 24.3 23.38 24.43
10.48 12.48 12.45 14.71
23.2 25.13 24.11 24.58
30.13 34.48 37.57 40.99
28.78 32.21 36.21 37.6
18.2 19.2 14.42 20
26.98 30.07 32.92 33.93
30.42 34.42 39.97 37.24
28.23 30.1 31.2 29.68
END DATA.

SAVE TRANSLATE OUTFILE='C:\temp\match function test.xls'
  /TYPE=XLS /VERSION=8 /MAP /REPLACE /FIELDNAMES
  /CELLS=VALUES .





Many Thanks in advance!

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Match Function from Ecel

Bob Walker-2
Reply | Threaded
Open this post in threaded view
|

Re: Match Function from Ecel

vlad simion
In reply to this post by Jignesh Sutar
hi,

try this:

do repeat v=v1 to v4
/i=1 to 4.
if v=max(v1,v2,v3,v4) key=i.
end repeat print.
exe.

hth,
vlad



On Mon, Jul 28, 2008 at 7:58 PM, J Sutar <[hidden email]> wrote:

> Hello,
>
> I have the following data, as below, but for the purpose of what I am
> trying
> to achieve I have exported the data to Excel, since I can apply a MAX
> formula within a MATCH formula in Excel to compute what I require.
>
> The formula I apply in Excel cell E2 is "=MATCH(MAX(A2:D2),A2:D2,0)". But
> how do I apply this same computation in SPSS?
>
> NEW FILE.
> DATA LIST LIST/ v1(F8.0) v2(F8.0) v3(F8.0) v4(F8.0).
> BEGIN DATA.
> 20.76 26.37 30.42 33.83
> 9.24 12.89 10.08 16.05
> 24.87 24.06 19.13 19.6
> 3.42 6.72 3.32 9.39
> 20.05 22.99 25.59 25.76
> 15.9 18.61 13.71 17.86
> 24.45 25.21 25.96 24.8
> 30.95 34.21 37.75 41.3
> 16.59 22.04 25.18 25.2
> 22.07 24.76 28.09 26.42
> 15.89 20.44 20.84 27.56
> 12.7 16.9 18.66 24.72
> 16.89 20.12 21.77 21.93
> 10.42 13.64 12.93 18.76
> 14.87 15.44 14.59 16.39
> 28.13 28.22 24.52 25.69
> 18.56 21.3 25.33 25.73
> 28.2 27.54 23.38 27.04
> 27.4 25.84 21.65 21.39
> 19.5 22.01 19.14 22.49
> 26.12 29.94 32.06 32.49
> 27.28 27.81 28.03 28.96
> 29.6 30.62 30.27 32.91
> 6.96 9.93 5.01 9.62
> 25.27 23.73 20.26 19.74
> 25.32 24.3 23.38 24.43
> 10.48 12.48 12.45 14.71
> 23.2 25.13 24.11 24.58
> 30.13 34.48 37.57 40.99
> 28.78 32.21 36.21 37.6
> 18.2 19.2 14.42 20
> 26.98 30.07 32.92 33.93
> 30.42 34.42 39.97 37.24
> 28.23 30.1 31.2 29.68
> END DATA.
>
> SAVE TRANSLATE OUTFILE='C:\temp\match function test.xls'
>  /TYPE=XLS /VERSION=8 /MAP /REPLACE /FIELDNAMES
>  /CELLS=VALUES .
>
>
>
>
>
> Many Thanks in advance!
>
> =====================
> To manage your subscription to SPSSX-L, send a message to
> [hidden email] (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD
>

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD