|
Open a new instance of SPSS. Copy the syntax below to a syntax file. Click <run>. Click <all>. Is this what you are looking for? data list list/ id(f2) v1 to v6 (6f3). begin data 01 1 2 3 4 1 4 02 4 1 4 3 2 1 03 1 1 3 4 1 4 04 1 2 2 4 1 4 01 1 2 3 3 1 4 04 1 2 3 4 4 4 07 1 2 3 4 1 1 08 1 1 3 3 1 1 09 2 2 2 4 1 4 10 3 3 3 3 3 3 11 2 2 2 2 1 1 12 1 1 2 2 2 2 13 3 3 3 3 3 4 14 1 1 2 2 3 3 end data. count k1 = v1 to v6(1). count k2 = v1 to v6(2). count k3 = v1 to v6(3). count k4 = v1 to v6(4). compute mosthits = max(k1 to k4). formats k1 to k4 mosthits (f1). compute mode1 =0. compute mode2 =0. compute mode3 =0. formats mode1 to mode3 (f3). do if mosthits ne 1. do repeat k = k1 to k4 /v = 1 to 4. do if k eq mosthits. do if mode1 eq 0. compute mode1 =v. else if mode1 gt 0 and mode2 eq 0 and v gt mode1. compute mode2 =v. else if mode2 gt 0 and mode3 eq 0 and v gt mode2. compute mode3 =v. end if. end if. end repeat. end if. list vars= id v1 to v6 mosthits mode1 mode2 mode3. Art Kendall Social Research Consultants Statmanz wrote: Thanks Art. In this case each variable has a rank from 1 to 4 (integers) and then I want to determine the mode across the variables W On 3/24/2009 11:33:05 AM, [hidden email] wrote: |
| Free forum by Nabble | Edit this page |
