How do you recode categorical data?

Recoding a categorical variable The easiest way is to use revalue() or mapvalues() from the plyr package. This will code M as 1 and F as 2 , and put it in a new column.

How do you recode a continuous variable in categorical SPSS?

Go to ‘Transform’ — Recode into Different Variables. Throw in the continuous variable….Throw in the continuous variable.

  1. In the ‘Output Variable’ section, fill in the name and label.
  2. In the example, I named it ‘AgeCat’ to mean the knowledge category.
  3. Click ‘Change’.
  4. Click ‘Old and New Values’, and a window will appear.

How do you convert categorical data to numerical data in SPSS?

To automatically recode variables:

  1. Click Transform > Automatic Recode.
  2. Select the string variable of interest in the left column and move it to the right column.
  3. Enter a new name for the autorecoded variable in the New Name field, then click Add New Name.
  4. SPSS will assign numeric categories in alphabetical order.

How do I encode variables in SPSS?

Data Creation in SPSS

  1. Click the Variable View tab. Type the name for your first variable under the Name column.
  2. Click the Data View tab.
  3. Now you can enter values for each case.
  4. Repeat these steps for each variable that you will include in your dataset.

How do I recode a dummy variable in SPSS?

Procedure in SPSS Statistics to create dummy variables

  1. Click Transform > Create Dummy Variables on the main menu, as shown below:
  2. Transfer the categorical independent variable, favourite_sport, into the Create Dummy Variables for: box by selecting it (by clicking on it) and then clicking on the button.
  3. Click on the.

Why do you recode variables in SPSS?

There are two recode functions found on the Transform menu within SPSS: Recode into Same Variable and Recode into Different Variable. The first, Recode into Same Variable, allows you to reassign values of an existing variable; the new values will replace the old within the current variable.

How do you do a chi square test in SPSS?

Quick Steps

  1. Click on Analyze -> Descriptive Statistics -> Crosstabs.
  2. Drag and drop (at least) one variable into the Row(s) box, and (at least) one into the Column(s) box.
  3. Click on Statistics, and select Chi-square.
  4. Press Continue, and then OK to do the chi square test.
  5. The result will appear in the SPSS output viewer.

Categories: Common