spss - Possible to use less/greater than operators with IF ANY? -


is possible use <,> operators if function? this:

select if (any(>10,q1) , any(<2,q2 q10)) 

you need create auxiliary variable this.

@jignesh sutar's solution 1 works fine. there multiple ways in spss accomplish task.

here solution count command comes in handy. important note following solution assumes values of variables integers. if have float values (1.5 instance) you'll wrong result.

* count occurrences q2 q10 less 2. count #qlt2 = q2 q10 (lowest thru 1).  * select if q1>10 ,  * there @ least 1 occurrence q2 q10 less 2. select (q1>10 , #qlt2>0). 

there variant sort of solution deals float variables correctly. think less intuitive though.

* count occurrences q2 q10 2 or higher. count #qge2 = q2 q10 (2 thru highest).  * select if q1>10 ,  * not every occurences of (the 9 variables) q2 q10 2 or higher. select if (q1>10 , #qge2<9). 

note: variables beginning # temporary variables. not stored in data set.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -