SPSS COMPUTE IF argument1 AND argument2 AND argument3



SPSS COMPUTE IF argument1 AND argument2 AND argument3(

[pic]

Graduate student Howard Brandon came to me for help with his masters thesis. He wanted to dichotomize three continuous variables and then assign cases to groups (profiles) based on their scores on those dichotomized variables. I generally disapprove of dichotomizing continuous variables, but there was a good argument for doing so in this case. Here is the advice I gave him:

First find the median for each of the three continuous variables. Click Analyze, Descriptive Statistics, Explore. Scoot the three variables into the Dependent List box and then click OK. Write down the values of the medians.

Now to dichotomize the variables. From the data sheet, Click Transform, Recode, Into Different Variables. Scoot one of the continuous variables into the Numeric Variable Box. Type the name of the new variable (the dichotomized variable) into the Output Variable Box. Click Old and New Values. Select Range Lowest Through _____ and type the value of the Median in the box. Enter 1 in the new value box and click Add. Select Range _____ through highest and type the value of the Median + .000001 in the box. Enter 2 in the new value box and click Add.

[pic]

Click Continue.

[pic]

Click Change, OK. The new dichotomous variable is created and can be viewed in the data sheet. I recommend dragging and dropping it right next to the old variable so you can see that it worked as intended.

Now imagine that Howard has created his three dichotomous variables and is ready to create the grouping variable (profile) based on scores on the three dichotomous variables. I shall illustrate using dichotomous variables gender, class, and verdict. If a case has a score of 1 on each of these three variables, it is to be placed into profile 1. From the data sheet, click Transform, Compute. In the Target Variable box enter the name of the new variable. In the Numeric Expression box enter 1. Click If. Type in gender=1 and class=1 and verdict=1. [pic]

Click Continue.

[pic]

Click OK. The new variable, profile, is created, and all those cases with value 1 on each of the three defining variables will have value 1 for profile.

Now select those cases that will have value 2 for profile. For my example, these are cases where gender = 1, class = 1, and verdict = 2.

[pic]

Click Ok and continue on until the profile variable is fully defined.

Copyright 2005, Karl L. Wuensch - All rights reserved.

( Copyright 2005, Karl L. Wuensch - All rights reserved.

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download