If I shorten the syntax to IF, END IF turns up red (error) towards the end of the syntax. Wouldn't the compute function work in this case? I am still having problems with combining these 3 variables. I did try doing 'check' and it confirmed valid values and missing values. I do not have string variables but I do have missing values. you could shorten your syntax a lot by using IF instead of DO IF. If there's no hidden decimals, "check" should result in a column of 1's which you can check by You could check for it by using something likeĬompute check = (variable1 = trunc(variable1)). By Ruben Geert van den Berg on July 12th, 2019įirst off, are you sure none of variable1 to variable3 are string variables?Īll system missings could also occur if your values have hidden decimals.Anybody knows what I'm doing wrong? Thanks in advance for your help! ☺️ĭO IF variable1 = 0 and variable2=0 and variable3=0.ĮLSE IF variable1 = 1 and variable2=1 and variable3=1.ĮLSE IF variable1 = 7 and variable2=7 and variable3=8.ĮLSE IF variable1 = 9 and variable2=9 and variable3=9. I used this syntax, but it returns with 0 valid and all missing values. 25 on a Mac to combine values from 3 different variables into one variable using the Compute function with multiple conditions.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |