select cases

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

select cases

Aysha Abbas
Hello, I have a large data set (shown below. I want to select cases where DT
=> 4 and MMR =>2 (ID 1088, 1146 and 1673 in this case).

ID Vacc dosesum
1088 DT 4
1088 MMR 2
1096 DT 4
1096 MMR 1
1126 DT 3
1126 MMR 2
1363 DT 3
1363 MMR 1
1146 DT 6
1146 MMR 2
1673 DT 4
1673 MMR 2

Any help will be greatly appreciated.
Thanks

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

Albert-Jan Roskam
Hi,

Do you mean this?

select if ( (vacc eq "DT" and dosenum ge 4) or (vacc eq "MMR" and dosenum ge 2) ).

Cheers!!
Albert-Jan

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In the face of ambiguity, refuse the temptation to guess.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

--- On Fri, 1/8/10, Aysha Abbas <[hidden email]> wrote:

From: Aysha Abbas <[hidden email]>
Subject: [SPSSX-L] select cases
To: [hidden email]
Date: Friday, January 8, 2010, 6:53 AM

Hello, I have a large data set (shown below. I want to select cases where DT
=> 4 and MMR =>2 (ID 1088, 1146 and 1673 in this case).

ID Vacc dosesum
1088 DT 4
1088 MMR 2
1096 DT 4
1096 MMR 1
1126 DT 3
1126 MMR 2
1363 DT 3
1363 MMR 1
1146 DT 6
1146 MMR 2
1673 DT 4
1673 MMR 2

Any help will be greatly appreciated.
Thanks

=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@... (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