Skip to content

All the key ____________

All the key concepts, information, knowledge about Research and Data Analytics.

Menu
  • Home
    • Research
    • Data Analytics
    • Emerging topics
      • Privacy Policy
  • Research
  • Data Analytics
  • Emerging topics
Menu

Decision Tree with SPSS: a step by step example

Posted on by admin

Decision Tree has been considered as one of the most powerful and popular data mining tools for classification and prediction. In brief, a decision tree is a type of supervised machine learning used to categorize or make predictions based on how a previous set of questions were answered. For example, we may classify people into different groups according to a set of predefined questions.

Applications of decision tree:

  • Some application examples of decision tree include, but not limited to:
  • Customers can be classified into different groups according to their different predefined features.
  • People can be classified into good, average or not good categories according to some predefined questions in an application process.
  • Classification can be used to determine which products should be continued or dropped.
  • An analyst can use classification to predict the possible outcome of a football match.
  • Others

Following we use an example to demonstrate how to create decision tree with SPSS.

Firstly, we need to activate SPSS.

Now, let us to create a dataset with five attributes.

To create a dataset, the first step is to define the dataset structure, that is, the attributes of the dataset. To do so, we first select the ‘Variable view’ Environment at the bottom of the SPSS interface.

Now let use create five attributes (CreditRisk, Income, CreditCard, Mortgage and Education) in the ‘Variable View’ environment as below.

Once completed, let’s go to the ‘Data View’ Environment. The ‘Data View’ Environment can be found at the bottom of the of the SPSS interface.

Now you should able to see a table with five attributes.

Let’s type following data (Row 1 to row 11) into the created table.

Quick check: Can you spot any potential relationship between credit risks and other factors (e.g Income, Credit Card, Mortgage or Education).

Decision Tree can help to answer the question!

In SPSS, there are different types of Decision Tree methods. We shall use two common approaches: CHAID and CRT.

Goto: Analyze -> Classify -> Tree

Then click ‘OK’

Let’s select the dependent variable and independent variables as below.

In this example, we want to see how credit risk (i.e. dependent variable) can be explained by other factors (i.e. independent variables).

After we select the variables, let’s us define the criteria of the decision tree.

Goto ‘Criteria’, then set the Growth Limits as Parent node 2, Child node 2, then continue.

We need to set Parent node and Child node in order to limit the size of each group of suggested outcome, otherwise, SPSS may group everything together in one group (you can try the results by setting other numbers of parent node or child node).

Now you can try the two different methods (CHAID and CRT) by selecting the growing method at the bottom. And then check the results.


Here is the result of CHAID:

In this CHAID decision tree, it classified people into three groups. In the left hand side group, all the people (5 people) in the dataset with ‘Low’ education has ‘H’ credit risk. In the middle group, all the people (2 people) in the dataset with ‘Middle’ education has ‘M’ credit risk. In the right hand side group, 25% the people (1 people) in the dataset with ‘High’ education has ‘H’ credit risk and reminding 75% the people (3 people) in the dataset with ‘High’ education has ‘L’ credit risk.

Here is the result of CRT

In this CRT decision tree, it found that Credit Risk can be explained by Education and Income. According to the results of the Decision Tree, you can interrupt them by yourself. As mentioned above, you can try to change the number of parent and child node to familiar with the decision tree in SPSS.

Related posts:

  1. Power bi combine different column from DAX Power bi combine different column from DAX Here we will see how to combines different columns using DAX using Power BI. I will combine two-column that is Customer ID and Customer...
  2. Power BI Day of the Week Name using DAX Day of Week Name In order to get the Day of Week Name from this date, which is Monday, Tuesday, Wednesday, etc. We can use the FORMAT function as below: Day of...
  3. What is Power BI Microsoft Power BI is a business intelligence (BI) platform provided by Microsoft for analyzing and visualizing raw data to present actionable information. In February 2019, Gartner confirmed Microsoft as Leader...

Tag

API Axiology Blockchain Business cryptocurrency Data Analysis Data Analytics Data collection Data mining DAX Decision Tree Emerging topics Epistemology Finance FinTech literature review Ontology Positivism Post-Positivism Power BI Pragmatism quantum Research aims research idea Research methodology Research objectives Research philosophy Research question Research topic Sampling SPSS Start research Sustainability Technology trading workforce

©2025 All the key ____________ | Design: Newspaperly WordPress Theme