|
I like using the 'any' syntax when making sample restrictions (odd that
it is not documented in the reference syntax guide but I think I recall someone saying it was an old code). But, how can one use it with the not equal option. sel if any(v1,7,21,33). /* works fine. sel if ne any(v1,7,21,33). /* does not work, any suggestions? David ===================== 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 |
|
Try:
sel if not any(v1,7,21,33). David Wasserman Educational Data Consultant -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of David Wright Sent: January-04-10 2:37 PM To: [hidden email] Subject: sel if & any with ne I like using the 'any' syntax when making sample restrictions (odd that it is not documented in the reference syntax guide but I think I recall someone saying it was an old code). But, how can one use it with the not equal option. sel if any(v1,7,21,33). /* works fine. sel if ne any(v1,7,21,33). /* does not work, any suggestions? David ===================== 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 ===================== 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 |
|
In reply to this post by wsu_wright
sel if any(v1,7,21,33). /* works fine.
Means sel if (any(v1,7,21,33) NE 0). /* works fine. Try: Sel if(any(v1,7,21,33)=0). | |I like using the 'any' syntax when making sample restrictions |(odd that it is not documented in the reference syntax guide |but I think I recall someone saying it was an old code). But, |how can one use it with the not equal option. | |sel if any(v1,7,21,33). /* works fine. | | |sel if ne any(v1,7,21,33). /* does not work, any suggestions? | | |David ===================== 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 |
|
In reply to this post by wsu_wright
Jon Peck SPSS, an IBM Company [hidden email] 312-651-3435
I like using the 'any' syntax when making sample restrictions (odd that it is not documented in the reference syntax guide but I think I recall someone saying it was an old code). But, how can one use it with the not equal option. >>>Any is a standard transformation function and is documented with the 200+ others. "ANY. ANY(test,value[,value,...]). Logical. Returns 1 or true if the value of test matches any of the subsequent values; returns 0 or false otherwise." ne is a comparison operator that requires a second value as in any(...) ne 1 but in this case using NOT would be more natural as in SELECT IF NOT any(...). HTH, Jon Peck sel if any(v1,7,21,33). /* works fine. sel if ne any(v1,7,21,33). /* does not work, any suggestions? David ===================== 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 |
|
In the specific example cited (and as a general form), change sel if ne any(v1,7,21,33) to select if not(any(v1, 7, 21, 33)).
Jon Peck SPSS, an IBM Company [hidden email] 312-651-3435
I like using the 'any' syntax when making sample restrictions (odd that it is not documented in the reference syntax guide but I think I recall someone saying it was an old code). But, how can one use it with the not equal option. >>>Any is a standard transformation function and is documented with the 200+ others. "ANY. ANY(test,value[,value,...]). Logical. Returns 1 or true if the value of test matches any of the subsequent values; returns 0 or false otherwise." ne is a comparison operator that requires a second value as in any(...) ne 1 but in this case using NOT would be more natural as in SELECT IF NOT any(...). HTH, Jon Peck sel if any(v1,7,21,33). /* works fine. sel if ne any(v1,7,21,33). /* does not work, any suggestions? David ===================== 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 |
| Free forum by Nabble | Edit this page |
