Machine Learning With IBM SPSS - Logistic Regression

Blog

Machine Learning With IBM SPSS - Logistic Regression

Machine Learning With IBM SPSS – Logistic Regression

In the second part of this series of ML using IBM (first part Linear Regression) you shall be introduced to the logistic regression feature of IBM SPSS. It is interesting to know that one can carry out classification and prediction with zero coding experience. However, one still needs to understand how to interpret the results to have the best experience using software. NOTE: the most important part of the modelling will be discussed in this blog and the reader is strongly encouraged to explore other functions available. If you are curious to know the theory of logistic regression I recommend this blog Logistic Regression Explained.

The primary goal of this blog is to develop a logistic classification model to predict where the engine of a car will be located, rear or front.

 It is assumed that you have imported your data into the SPSS workspace. Then navigate as thus: Analyse>>>Regression>>>Binary Logistic…

 

Machine Learning Logistic Regression - SPSS

Then Figure 2 should display where the dependent and independent variables will be dropped in their respective box. For this research, we have selected enginelocation_tr as the dependent variable and enginesize, stroke, compressionratio, horsepower, numofcylinders_tr as the independent variables. The rationale behind this was that we surveyed the variables in the data and identified the likely variables that are more going to predict the location of the engine of a car. Of course, the earlier approaches highlighted in the first blog of this series was applied to identify the variables.

 

Machine Learning Logistic Regression - SPSS

Then, move to the Categorical variable option to select the independent variables that are categorical in nature. This is very important to have a more intelligent model because SPSS will treat them differently. However, there is no categorical variables in the independent variables using in this blog (Figure 3). Hence, we skip the option. Then go to the Save option.

 

Machine Learning Logistic Regression - SPSS

In the Save option, you can select various options as shown in Figure 4.

 

Machine Learning Logistic Regression - SPSS

Then you should move to the Options… where the most important parameters for explaining logistic regression are located (see Figure 5). We have selected “Classification plots” and “Cl for exp(B)” and Hosmer-Lemeshow goodness-of-fit. Other options are default. “Hosmer-Lemeshow goodness-of-fit” is used to validate how the model fits the data. Any values less than 0.5 indicates a poor fit and a value close to 1 indicates that the model fits better.

 

Machine Learning Logistic Regression - SPSS

Machine Learning Logistic Regression - SPSS

The table above on the left shows the dependent variable codes, 0 and 1. The Classification Table shows that there are 193 cases of “0” and 3 cases of “1.”

The Nagelkerke R Square is 1.00 and this indicates that 100% of the target variable can be explained by the predicting variables. This interpretation is similar for the Hosmer Lemeshow Test. The Sig values in the last table below shows the significant effect of each of the predictor and it can be seen that the effects of enginesize and numofcylinders_tr are more significant in determining the position of engine of a car. This seems reasonable as the bigger an engine size is the more unfitting it becomes for staying at the rear. Cylinders also makes up the main size of the engine.

 

Machine Learning Logistic Regression - SPSS

Machine Learning Logistic Regression - SPSS

Conclusion

In conclusion, using IBM SPSS for logistic regression has been demonstrated in this blog. Classification model for the prediction of the location of a car engine has been developed in this blog and it has been found that 100% of the target variable can be explained by the predictors. In addtion, it has been estableshed that enginesize and numofcylinders_tr.

See you in the next technique - Two - Step Clustering


← Back


Comments

No comments added


Leave a Reply

Success/Error Message Goes Here
Do you need help with your academic work? Get in touch

AcademicianHelp

Your one-stop website for academic resources, tutoring, writing, editing, study abroad application, cv writing & proofreading needs.

Get Quote
TOP