Select IF

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

Select IF

Jignesh Sutar
Hi, I have data in the format as provided in the sample data below.

I would like to select cases for maximum values of var1. In this instance it
would be for var1=14.

Many thanks


DATA LIST LIST /var1 (F8.2).
BEGIN DATA.
      1.00
      1.00
      2.00
      2.00
      2.00
      3.00
      3.00
      3.00
      3.00
      4.00
      4.00
      4.00
      4.00
      4.00
      5.00
      5.00
      5.00
      5.00
      5.00
      6.00
      6.00
      6.00
      7.00
      8.00
      8.00
      8.00
      8.00
      8.00
      9.00
      9.00
      9.00
      9.00
      9.00
      9.00
     10.00
     10.00
     10.00
     10.00
     10.00
     10.00
     10.00
     11.00
     11.00
     11.00
     11.00
     11.00
     11.00
     11.00
     12.00
     12.00
     12.00
     12.00
     12.00
     12.00
     12.00
     12.00
     12.00
     12.00
     12.00
     12.00
     12.00
     13.00
     13.00
     13.00
     13.00
     13.00
     13.00
     13.00
     13.00
     13.00
     14.00
     14.00
     14.00
     14.00
     14.00
     14.00
     14.00
     14.00
     14.00
     14.00
     14.00
     14.00
     14.00
END DATA.

=====================
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: Select IF

Marta Garcia-Granero
J Sutar escribió:
> Hi, I have data in the format as provided in the sample data below.
>
> I would like to select cases for maximum values of var1. In this instance it
> would be for var1=14.
>

temporary.
compute k=1.
AGGREGATE
  /OUTFILE=*
  MODE=ADDVARIABLES
  /BREAK=k
  /Max = MAX(var1).
select if var1 = Max.
list.

Regards,
Marta García-Granero

> DATA LIST LIST /var1 (F8.2).
> BEGIN DATA
>       1.00
>       1.00
>       2.00
>       2.00
>       2.00
>       3.00
>       3.00
>       3.00
>       3.00
>       4.00
>       4.00
>       4.00
>       4.00
>       4.00
>       5.00
>       5.00
>       5.00
>       5.00
>       5.00
>       6.00
>       6.00
>       6.00
>       7.00
>       8.00
>       8.00
>       8.00
>       8.00
>       8.00
>       9.00
>       9.00
>       9.00
>       9.00
>       9.00
>       9.00
>      10.00
>      10.00
>      10.00
>      10.00
>      10.00
>      10.00
>      10.00
>      11.00
>      11.00
>      11.00
>      11.00
>      11.00
>      11.00
>      11.00
>      12.00
>      12.00
>      12.00
>      12.00
>      12.00
>      12.00
>      12.00
>      12.00
>      12.00
>      12.00
>      12.00
>      12.00
>      12.00
>      13.00
>      13.00
>      13.00
>      13.00
>      13.00
>      13.00
>      13.00
>      13.00
>      13.00
>      14.00
>      14.00
>      14.00
>      14.00
>      14.00
>      14.00
>      14.00
>      14.00
>      14.00
>      14.00
>      14.00
>      14.00
>      14.00
> END DATA.
>
> =====================
> 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
>
>


--
For miscellaneous statistical stuff, visit:
http://gjyp.nl/marta/

=====================
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