Return to Data Cleaning

In bdeshd1.sav:

To create categories for the continuous variable called wathoth into high  or >60% (1) and low  <= 60% (0) you will use the RECODE command in SPSS.  This variable represents the percentage in the district that use other water sources.  The resulting new categorized variable will be a dichotomous (0 and 1) variable that can represent good and bad groups.   Here is how to do it.

1.  Open bdeshd1.sav

2.  Select Transform, Recode, Into a Different Variable...

3.  Select the variable wathcat from the list and enter it into the Numeric Variable to Output Variable box.

4.  In the output variable name box type the new variable name box dwater and click on the button marked Change.  

5.  Click on the button for Old and New Values and then in the left side of the box labeled Old values, select the dot marked Range, Lowest through and enter 60 in the box.  Then on the right side of the box labeled New values, click on the dot marked Value and enter 0Then click on Add to put it in the Old-->New value box.

6.  Now repeat this procedure, but this time select the Old value labeled Range, through Highest and enter 60.1 and then in the New Value box enter 1.  Then click on Add.   and then Continue.

7.  Now click OK.

You should see the new variable appear at the end of the data set. ( If you like, you can copy and paste it into a slot next to the old wathcat variable.  In order to do this you must first select the wathcat column, right click on your mouse and select Insert Variable and then paste the variable into the column).

Here is a frequency of the variable that is now dichotomous for high and low use of other water sources.

ex10_2.jpg (19049 bytes)

Take a look at the variable watothc2 and see if it matches the new dwater variable you created.   It should.   Here is how the two look side by side if you run a case summary of their information.  They should be the same variable where 1 is high (>60%) and 0 is low (<=60%).

ex10_1.jpg (117039 bytes) 

Return to Top of Page