Reclassifying the Data

  1. Using a Variable File source node, connect to the dataset drug_long_name in the Demos folder.
    Figure 1. Sample stream showing string reclassification for binomial logistic regression
    Sample stream showing string reclassification for binomial logistic regression
  2. Add a Type node to the Source node and select Cholesterol_long as the target.
  3. Add a Logistic Regression node to the Type node.
  4. In the Logistic Regression node, click the Model tab and select the Binomial procedure.
    Figure 2. Long string details in the "Cholesterol_long" field
    Long string details in the "Cholesterol_long" field
  5. When you execute the Logistic Regression node in reclassify_strings.str, an error message is displayed warning that the Cholesterol_long string values are too long.

    If you encounter this type of error message, follow the procedure explained in the rest of this example to modify your data.

    Figure 3. Error message displayed when executing the binomial logistic regression node
    Error message displayed when executing the binomial logistic regression node
  6. Add a Reclassify node to the Type node.
  7. In the Reclassify field, select Cholesterol_long.
  8. Type Cholesterol as the new field name.
  9. Click the Get button to add the Cholesterol_long values to the original value column.
  10. In the new value column, type High next to the original value of High level of cholesterol and Normal next to the original value of Normal level of cholesterol.
    Figure 4. Reclassifying the long strings
    Reclassifying the long strings
  11. Add a Filter node to the Reclassify node.
  12. In the Filter column, click to remove Cholesterol_long.
    Figure 5. Filtering the "Cholesterol_long" field from the data
    Filtering the "Cholesterol_long" field from the data
  13. Add a Type node to the Filter node and select Cholesterol as the target.
    Figure 6. Short string details in the "Cholesterol" field
    Short string details in the "Cholesterol" field
  14. Add a Logistic Node to the Type node.
  15. In the Logistic node, click the Model tab and select the Binomial procedure.
  16. You can now execute the Binomial Logistic node and generate a model without displaying an error message.
Figure 7. Choosing Binomial as the procedure
Choosing Binomial as the procedure

This example only shows part of a stream. If you require further information about the types of streams in which you may need to reclassify long strings, the following examples are available:

More information on how to use IBM® SPSS® Modeler, such as a user's guide, node reference, and algorithms guide, are available from the \Documentation directory of the installation disk.