There, in this questionnaire, as you know, some questions load onto a certain scale, let us say depression. Simply, my question is related to the interpretation of mini-mult MMPI. I have got a question to ask and I hope that you will kindly guide me as to it. Like so, our last example shows a different route to flag fulltime working males and females using different criteria.Įxample 4 - Compute Variable Differently Based on Gender II You can get around this limitation by combining RECODE with DO IF, however. If(gender = 0 & whours >= 36) fulltime = 1. This is the reason whyīut you can use an IF condition involving multiple variables: Second, RECODE can only set values based on a single variable. You can't RECODE a function -mean, sum or whatever- into anything nor recode anything into a function.
Is not possible -q1 is a variable, not a constant- but However, RECODE has more limitations too.įirst off, RECODE only replaces (ranges of) constants -such as 0, 99 or system missing values- by other constants. In many cases, RECODE is an easier alternative for IF. *IF: respondents meeting both conditions get result_2. *DO IF: respondents meeting both conditions get result_1. The syntax below sketches this idea.ĭO IF - ELSE IF Versus Multiple IF Commands If you use multiple IF commands instead, the last condition met by each case takes effect.
For getting the most out of this tutorial, we recommend you download the file and try the examples for yourself.
In this guide, I have described how to compute the mean of various variables in SPSS. In the example, this is the ‘ Score_avg‘ variable. This value will then be the mean of the variables entered into the function. The outputĪfter running the MEAN compute function in SPSS, the new variable should be visible in the data sheet. Finally, click the ‘ Continue‘ button to compute the mean variable. In the example, the function will be the following: MEAN(Maths,English,Biology,Chemistry)ģ. To avoid errors with typos, you can also double-click on the variables listed in the box to the left of the window. Ensure the variables are entered exactly as they appear in the SPSS datasheet.
Within the brackets of the mean function, enter all of the variables to be averaged, separating each one with a comma. In the ‘ Numeric Expression‘ box, enter the function ‘ MEAN()‘. A good example is to add the suffix ‘ _avg‘ to the variable name to signify that it is a mean. Remember, SPSS does not like spaces in the variable names. In the new Compute Variable window, first enter the name of the new variable to be created in the ‘ Target Variable‘ box.