0% found this document useful (0 votes)
11 views6 pages

Logistic Regression Analysis of Bank Marketing Data

This document summarizes a student project analyzing a bank marketing dataset using logistic regression. The dataset contains over 4,500 observations and 16 variables related to marketing campaigns. Descriptive statistics identified that the average client age was 39 and most had not been previously contacted. Logistic regression models were developed to predict client subscription. The best performing model used age, job, education, default, balance, housing, loan, duration, campaign, pdays, and previous as predictors. This model had a McFadden R-squared of 0.200352, indicating good fit for logistic regression.

Uploaded by

Francisco Pinho
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views6 pages

Logistic Regression Analysis of Bank Marketing Data

This document summarizes a student project analyzing a bank marketing dataset using logistic regression. The dataset contains over 4,500 observations and 16 variables related to marketing campaigns. Descriptive statistics identified that the average client age was 39 and most had not been previously contacted. Logistic regression models were developed to predict client subscription. The best performing model used age, job, education, default, balance, housing, loan, duration, campaign, pdays, and previous as predictors. This model had a McFadden R-squared of 0.200352, indicating good fit for logistic regression.

Uploaded by

Francisco Pinho
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Regression and Data Analysis

Second Project

MSc in Management
Specialization in Business Analytics Professor: Pedro Silva
1. Introduction

Inside the coverage of Regression and Data Analysis, it was proposed to develop a
logistic and a log-linear regression model about a dataset of personal choice,
or available at the course blackboard page.

Given that, this report provides a brief context for the dataset, how the data was
thoroughly checked and a descriptive analysis, insights into the Logistic and Log-Linear
models used, divided into subsections, according to the various methodologies
employed and the most important conclusions of the analyses performed.

The group selected the Bank Marketing dataset, whose information is related to a
Portuguese banking institution's direct marketing campaigns. These campaigns are vital
to an organization, with phone call questionnaires being a very reliable option, being
that more than one contact with the same client was frequently required in order to
determine whether the product (bank term deposit) would be (or would not be)
subscribed to, with also the bank being able to register relevant information regarding
the clients approached.
2. Data Description

2.1. Context

The dataset is composed by 4521 total observations, evaluated through 16 different


input variables of different kinds (numeric or categorical). Numeric variables are
comprised of: Age, Balance (average yearly balance, in euros), Day (last contact day of
the month), Duration (last contact duration), Campaign (number of contacts performed
in the campaign for one specific client), Pdays (number of days that passed by after the
client was last contacted from a previous campaign, with the “-1” meaning that the
client wasn’t yet contacted) and Previous (number of contacts performed before this
campaign and for the client). As for the Categorical variables, those are Job, Marital,
Education, Default (if the client as credit or not), Housing (if a client has a house on
loan), Loan (if a client has a personal loan), Contact, Month (last contact month of the
year), and Poutcome (Outcome of the previous marketing campaign).

2.2. Descriptive Analysis

We started by converting the variables into factors and checked for missing values
which is important because this way it allows us correctly implemented statistical
modelling, then a descriptive analysis of the numeric variables was conducted,
regarding the mean, median, standard deviation and the interquartile range.

Numerical Mean Standard Median Interquartile


variables Deviation Range
Age 41.17 10.57 39 16
Balance 1423 3009.64 444 1411
Day 15.92 8.25 16 12
Duration 264 259.86 185 225
Campaign 2.794 3.11 2 2
Pdays 39.77 100.12 -1 0
Previous 0.5426 1.69 0 0
According to the table, the most common client is 39 years old and has not
previously been contacted in a marketing campaign (since Pdays presents a value of -1
and Previous a value of 0 for the median value). Nevertheless, within this campaign, the
average client is contacted 2.794 times. It is also stated that the average number of days
that have passed from the last contact for clients who have previously been contacted is
39.77. To assess the dispersion of these variables, the standard deviation and
interquartile range were calculated as well, concluding that the variable Balance is
widely disperse, along with Duration.

A descriptive analysis was also performed for the categorical values with the following
being the most relevant

( 4 IMAGES)

3. Data Analysis

3.1. Logistic Regression

The primary goal of logistic regression is to describe the relationship between a


dependent binary variable and a set of explanatory variables. It's used to generate
prediction models, and in this case, to predict whether or not the client will
subscribe to a term deposit (y), which is the dependent binary variable influenced by
the independent variables. Two fundamental assumptions are supported in the
Logistic Regression model analysis, namely:

 The logarithm of the odds of y = yes vs y = no is a linear function of age,


job, marital status, education, default, balance, housing, loan, contact, day,
month, duration, campaign, pdays, previous, and poutcome.

 The proportions in which, in the sample, of 𝑦 = 𝑦𝑒𝑠 vs 𝑦 = 𝑛𝑜 reflect the


equivalent probabilities in the population of interest.
3.2 Model Development

The first model, Mod1BM, was developed with all explanatory variables and y
as the dependent variable. The AIC (Akaike Information Criterion) for the model
Mod1BM is 2259,651. This model is inefficient because it includes variables with proof
values greater than 0.

As a result, the creation of a model Mod2BM using the stepwise algorithm to


remove these variables is tested, resulting in a lower AIC of 2249,5, indicating a higher
relative quality. Nevertheless, there are still variables with proof values greater than 0,1,
so the model is re-estimated by removing the variables education, contact, month, and
poutcome. 

The AIC for the model Mod3BM is 2590,5. Even so, it still contains variables
with proof values greater than 0,1; therefore, the model is re-estimated by removing the
variables marital and day.

Mod4BM has an AIC of 2593,7 which does not differ much from the AIC of
Mod3BM, but since it has fewer variables, Mod4BM is better.

To summarize, ANOVA analysis of variance was used with the Chi-Square as a


reference to confirm which model is the best between Mod2BM and Mod4BM. The p-
value obtained was 0.14814 for Mod2BM and 0.02685 for Mod4BM, indicating that
Mod4BM is the best model.

 Given the lack of a measure that is exactly equivalent to R^2, the McFadden
R^2 Index can be used to assess model fit. The value discovered was 0.200352. One of
the benefits of Logistic Regression is that it allows for the prediction of new values
based on the results obtained, in this particular situation, predicting y based on the
values assumed by the remaining variables. The graphics below, respectively, represent
the conclusions obtained.
(Imagens)

Common questions

Powered by AI

Converting variables into factors during the data preparation process is essential for handling categorical data types efficiently in statistical modeling. Factors allow categorical variables to be recognized as distinct categories within analysis software, facilitating appropriate interpretation and analysis. In the logistic regression analysis, this conversion ensures that categories such as job, marital status, or education are appropriately incorporated as distinct levels within the model framework. This impacts the regression analysis by enabling the model to interact correctly with categorical predictors, contributing to a robust and interpretable model structure .

The primary goal of logistic regression in a business analytics project is to describe the relationship between a dependent binary variable and a set of explanatory variables, ultimately generating a prediction model. Specifically, it is used to predict whether a client will subscribe to a term deposit (the dependent binary variable) based on independent variables such as age, job, marital status, education, default status, balance, housing, loan status, contact method, day, month, duration, campaign, pdays, previous contacts, and poutcome. Two fundamental assumptions of logistic regression include: 1) the logarithm of the odds of the dependent variable is a linear function of its explanatory variables, and 2) the sample proportions reflect equivalent probabilities in the population of interest .

ANOVA (Analysis of Variance) was used with the Chi-Square as a reference to confirm which logistic regression model was best between Mod2BM and Mod4BM. The p-value obtained for Mod2BM was 0.14814, while Mod4BM had a p-value of 0.02685, indicating that Mod4BM was the better model .

The key numeric variables analyzed in the dataset were Age, Balance (average yearly balance, in euros), Day (last contact day of the month), Duration (last contact duration), Campaign (number of contacts performed in the campaign for one specific client), Pdays (days since the last contact from a previous campaign), and Previous (number of contacts performed before the current campaign). Insights drawn from these analyses indicated that the typical client is 39 years old, has an average balance of 1423 euros, and is contacted approximately 2.794 times during the campaign. Most clients had not been contacted previously in the campaign, as Pdays median value was -1 and Previous value was 0 .

The Akaike Information Criterion (AIC) was used as a measure of the relative quality of logistic regression models. Initially, Mod1BM included all explanatory variables and had an AIC of 2259.651, but it was deemed inefficient due to high proof values. Subsequent models were refined using the stepwise algorithm to lower AIC values, indicating improved model quality. Mod2BM had a reduced AIC of 2249.5. After re-estimation by removing variables with high proof values, Mod3BM and Mod4BM were developed with respective AICs of 2590.5 and 2593.7. Although Mod4BM had a slightly higher AIC than Mod3BM, its fewer variables deemed it preferable according to the model assessment objectives .

To improve the logistic regression model, initial adjustments included using the stepwise algorithm to remove variables with high proof values, which resulted in a lower AIC value and indicated a higher relative quality. Further adjustments involved re-estimating the model by removing additional variables like education, contact, month, and poutcome, among others. These iterations were aimed at reducing proof values to below 0.1 and further refining the model to achieve a balance between model complexity and explanatory power. Ultimately, Mod4BM, even with a marginally higher AIC than Mod3BM, was preferred for its fewer explanatory variables, demonstrating a streamlined approach without significant loss of model fit .

The McFadden R^2 Index was used to assess the model fit for the logistic regression analysis in the absence of a traditional R^2 measure. For the models developed, the McFadden R^2 Index value was calculated to be 0.200352, helping to gauge the model fit in the context of predicting client subscription behavior to bank term deposits .

Conducting a descriptive analysis of numeric variables is pivotal in providing an initial understanding of the dataset's basic features. This type of analysis involves calculating statistics such as the mean, median, standard deviation, and interquartile range, which help summarize the central tendency, dispersion, and shape of the data distribution. For example, analyzing variables like age, balance, and contact duration unveils patterns such as average client characteristics and variabilities, informing subsequent modeling strategies. In the context of this project, it provides foundational insights into client behavior and marketing campaign effectiveness, which is crucial for constructing meaningful regression models and drawing informed conclusions .

The standard deviation and interquartile range were calculated for the numeric variables to assess the dispersion and variability within the data. These statistical measures help identify how spread out the data points are around the mean, supporting accurate statistical modeling and analysis. In this dataset, the variables Balance and Duration showed high dispersion, indicating significant variability in client balances and contact durations within the bank's marketing campaign data .

Logistic regression allows for the prediction of new values by using the results obtained from analyzing the relationship between explanatory variables and the binary dependent variable. In the context of the project, it facilitates predicting whether a client will subscribe to a bank term deposit based on values of variables such as age, job, marital status, and others. This ability to make predictions is advantageous for crafting targeted marketing strategies and understanding customer behavior .

You might also like