I have a dataset with 468 cases. I need to delete 144 of them, because they are bad cases. I have one variable, an ID code, through which each case is uniquely identified; thus, I have 144 unique ID codes identifying the cases I need to delete. I am wondering if there is a way to accomplish this with syntax. I'd like to permanently delete these cases. I read somewhere that I could use SELECT IF NOT to de-select the cases for analysis, but am not sure how to use it to permanently delete cases. I've tried running to following syntax, which I got from point-and-click and altered to use SELECT IF NOT instead of SELECT IF (hoping maybe the double negative would fool SPSS?), and it did nothing. (MTurkID is the name of the variable). Any idea what I should do?
FILTER OFF. USE ALL. SELECT IF NOT (MTurkID = 295434) OR (MTurkID = 309993) OR (MTurkID = 383555) OR (MTurkID = 545144) OR (MTurkID = 621608).. etc. [lists all the IDs] Execute.
Since posting this, I've made a list of the IDs I wish to keep, and tried FILTER OFF. USE ALL. SELECT IF (MTurkID = 398789) OR etc. I did a trial run of 20 ID codes, to see if the syntax was right before I spent the time writing in all of the (MTurkID = between numbers. When I ran the syntax, SPSS deleted all of my cases. The variables are still there, but the when I click on Data View, there's not a single case there. Obviously I closed the file w/out saving it, so I still have my data. Am wondering if anyone knows what I need to change in my syntax to get this to work!
Answer by Pramod Bhatt (1) | Mar 18 at 01:32 AM
Am also looking for syntax to delete undesired cases