Is it possible to delete cases through the syntax? I know it is
possible to delete variables through the syntax but I can't find the
equivalent cases.
Kind regards,
Filip Van Droogenbroeck
http://www.vub.ac.be/TOR/
If you have some type of criterion within a variable you can use
select if statements to delete particular cases.
*This syntax would only keep cases with a value of 1 for the variable
named V1.
select if V1 = 1.
*This syntax would only keep cases that did not have a value of 1.
select if V1 <> 1.
The SELECT IF approach works well if you have criteria that can be
coded reasonably as a Boolean formula. If, instead, you have a list
of ID values, say, for the cases to be deleted, rather than writing
out a long formula that tests the ID against this list, it is much
easier to make a dataset listing those ids; then match it against the
original, creating a new variable, say, BADID. Then select on BADID
not missing.
If the list of bad id's is reasonably short, you can use the ANY
function to avoid having to write a long list of equality conditions,
e.g.,
any(id, 10,21,66, 44).
HTH,
Jon Peck