deleting cases based on values of variables

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

deleting cases based on values of variables

Arlin Cuncic
Hi everyone,

I was just wondering if there is a command along the lines of DELETE CASES IF....

I want to delete a bunch of cases based on their ID numbers and whether they are flagged with a zero on a certain variable. I can figure out a long way of doing it, I was just wondering if there is a delete cases command like there is a select cases command.

Thanks!
Arlin
Reply | Threaded
Open this post in threaded view
|

Re: deleting cases based on values of variables

Lei Gao-3
I don't know about the ID numbers but for the flag you can try
SELECT IF FLAG ~= 0.
EXE.
So it would get rid of all the cases where FLAG is 0.

Lei Gao
Ipsos-Loyalty
[hidden email]
(973)658-1762


-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Arlin Cuncic
Sent: Friday, June 23, 2006 2:26 PM
To: [hidden email]
Subject: deleting cases based on values of variables

Hi everyone,

I was just wondering if there is a command along the lines of DELETE
CASES IF....

I want to delete a bunch of cases based on their ID numbers and whether
they are flagged with a zero on a certain variable. I can figure out a
long way of doing it, I was just wondering if there is a delete cases
command like there is a select cases command.

Thanks!
Arlin
Reply | Threaded
Open this post in threaded view
|

Re: deleting cases based on values of variables

Keith McCormick
In reply to this post by Arlin Cuncic
If I undertand you will need to manipulate the caseid as well.

COMPUTE ID = $casenum.

This will create a variable that contains the caseid.  I couldn't tell
from your post if you had done that or not.

Best, Keith

On 6/23/06, Arlin Cuncic <[hidden email]> wrote:
> Hi everyone,
>
> I was just wondering if there is a command along the lines of DELETE CASES IF....
>
> I want to delete a bunch of cases based on their ID numbers and whether they are flagged with a zero on a certain variable. I can figure out a long way of doing it, I was just wondering if there is a delete cases command like there is a select cases command.
>
> Thanks!
> Arlin
>
Reply | Threaded
Open this post in threaded view
|

Re: deleting cases based on values of variables

Arnaldo Ferrari Nasi
In reply to this post by Arlin Cuncic
If I understand...


compute flag2 =1.
if ((ID >= YourBunchIdMinNumber)&(ID <=
YourBunchIdMaxNumber))&(CertainFlagVariable =0) flag2 =0.
fre flag2.
sel if (flag2 =1).
exe.

Arnaldo.





>Date:    Fri, 23 Jun 2006 14:25:44 -0400
>From:    Arlin Cuncic <[hidden email]>
>Subject: deleting cases based on values of variables
>
>Hi everyone,
>
>I was just wondering if there is a command along the lines of DELETE =
>CASES IF....
>
>I want to delete a bunch of cases based on their ID numbers and whether =
>they are flagged with a zero on a certain variable. I can figure out a =
>long way of doing it, I was just wondering if there is a delete cases =
>command like there is a select cases command.
>
>Thanks!
>Arlin