Regression
Regression
TABLE OF CONTENTS
INTRODUCTION
Regression analysis is a powerful statistical method that allows you to examine the
relationship between two or more variables of interest. While there are many types of
regression analysis, at their core they all examine the influence of one or more independent
variables on a dependent variable.
Regression analysis is an important tool for modelling and analysing data. Here, we fit a
curve / line to the data points, in such a manner that the differences between the distances of
data points from the curve or line is minimized. We’ll explain this in more details in coming
sections.
Page |4
Let’s say, you want to estimate growth in sales of a company based on current economic
conditions. You have the recent company data which indicates that the growth in sales is
around two and a half times the growth in the economy. Using this insight, we can predict
future sales of the company based on current & past information.
There are multiple benefits of using regression analysis. They are as follows:
Regression analysis also allows us to compare the effects of variables measured on different
scales, such as the effect of price changes and the number of promotional activities. These
benefits help market researchers / data analysts / data scientists to eliminate and evaluate the
best set of variables to be used for building predictive models.
Page |5
There are various kinds of regression techniques available to make predictions. These
techniques are mostly driven by three metrics (number of independent variables, type of
dependent variables and shape of regression line). We’ll discuss them in detail in the
following sections.
Many regressions can also be created for individual purposes, if one feels the need to use a
combination of the parameters above, which people haven’t used before. In order to
understand its utility, let us understand the most commonly used regressions:
1. Linear Regression
It is one of the most widely known modelling techniques. Linear regression is usually among
the first few topics which people pick while learning predictive modelling. In this
technique, the dependent variable is continuous, independent variable(s) can be continuous or
discrete, and nature of regression line is linear.
The difference between simple linear regression and multiple linear regression is that,
multiple linear regression has (>1) independent variables, whereas simple linear regression
has only 1 independent variable. Now, the question is “How do we obtain best fit line?”
This task can be easily accomplished by Least Square Method. It is the most common method
used for fitting a regression line. It calculates the best-fit line for the observed data by
minimizing the sum of the squares of the vertical deviations from each data point to the line.
Because the deviations are first squared, when added, there is no cancelling out between
positive and negative values.
Page |7
We can evaluate the model performance using the metric R-square. To know more details
about these metrics, you can read: Model Performance metrics Part 1, Part 2 .
Important Points:
2. Logistic Regression
ln(odds) = ln(p/(1-p))
Above, p is the probability of presence of the characteristic of interest. A question that you
should ask here is “why have we used log in the equation?”.
Since we are working here with a binomial distribution (dependent variable), we need to
choose a link function which is best suited for this distribution. And, it is logit function. In the
equation above, the parameters are chosen to maximize the likelihood of observing the
sample values rather than minimizing the sum of squared errors (like in ordinary regression).
Page |8
Important Points:
3. Polynomial Regression
y=a+b*x^2
In this regression technique, the best fit line is not a straight line. It is rather a curve that fits
into the data points.
Important Points:
While there might be a temptation to fit a higher degree polynomial to get lower error,
this can result in over-fitting. Always plot the relationships to see the fit and focus on
making sure that the curve fits the nature of the problem. Here is an example of how
plotting can help:
Especially look out for curve towards the ends and see whether those shapes and
trends make sense. Higher polynomials can end up producing wierd results on
extrapolation.
P a g e | 10
4. Stepwise Regression
This form of regression is used when we deal with multiple independent variables. In this
technique, the selection of independent variables is done with the help of an automatic
process, which involves no human intervention.
This feat is achieved by observing statistical values like R-square, t-stats and AIC metric to
discern significant variables. Stepwise regression basically fits the regression model by
adding/dropping co-variates one at a time based on a specified criterion. Some of the most
commonly used Stepwise regression methods are listed below:
Standard stepwise regression does two things. It adds and removes predictors as
needed for each step.
Forward selection starts with most significant predictor in the model and adds variable
for each step.
Backward elimination starts with all predictors in the model and removes the least
significant variable for each step.
The aim of this modelling technique is to maximize the prediction power with minimum
number of predictor variables. It is one of the method to handle higher dimensionality of data
set.
5. Ridge Regression
Ridge Regression is a technique used when the data suffers from multicollinearity
(independent variables are highly correlated). In multicollinearity, even though the least
squares estimate (OLS) are unbiased; their variances are large which deviates the observed
value far from the true value. By adding a degree of bias to the regression estimates, ridge
regression reduces the standard errors.
y=a+ b*x
P a g e | 11
This equation also has an error term. The complete equation becomes:
y=a+b*x+e (error term), [error term is the value needed to correct for a prediction error
In a linear equation, prediction errors can be decomposed into two sub components. First
is due to the biased and second is due to the variance. Prediction error can occur due to any
one of these two or both components. Here, we’ll discuss about the error caused due to
variance.
In this equation, we have two components. First one is least square term and other one is
lambda of the summation of β2 (beta- square) where β is the coefficient. This is added to
least square term in order to shrink the parameter to have a very low variance.
Important Points:
6. Lasso Regression
Similar to Ridge Regression, Lasso (Least Absolute Shrinkage and Selection Operator) also
penalizes the absolute size of the regression coefficients. In addition, it is capable of reducing
the variability and improving the accuracy of linear regression models. Look at the equation
P a g e | 12
below: Lasso regression differs from ridge regression in a way that it uses absolute values in
the penalty function, instead of squares. This leads to penalizing (or equivalently constraining
the sum of the absolute values of the estimates) values which causes some of the parameter
estimates to turn out exactly zero. Larger the penalty applied, further the estimates get shrunk
towards absolute zero. This results to variable selection out of given n variables.
Important Points:
7. ElasticNet Regression
ElasticNet is hybrid of Lasso and Ridge Regression techniques. It is trained with L1 and L2
prior as regularizer. Elastic-net is useful when there are multiple features which are
correlated. Lasso is likely to pick one of these at random, while elastic-net is likely to pick
both.
A practical advantage of trading-off between Lasso and Ridge is that, it allows Elastic-Net to
inherit some of Ridge’s stability under rotation.
Important Points:
It is usually simple, when you know only one or two techniques. Most common
misconception prevalent in the people is – if the outcome is continuous – apply linear
regression. If it is binary – use logistic regression! However, higher the number of options
available at one’s disposal, more difficult it becomes to choose the right one. A similar case
happens with regression models.
X= Number of Claims
Y= Total Payment for all the claims in lakhs of Indian Rupees for Geographical zones in
India
P a g e | 15
Like if we had 10 claims in a region say Delhi, then the unit lakhs of payment
expected would be 3.414X10 + 19.99 = 54.13 i.e. 54 lakhs 13 thousand.
A linear regression is an appropriate analysis when the goal of research is to assess the
extent of a relationship between a dichotomous or interval/ratio predictor variable on an
interval/ratio criterion variable. In this case, the predictor variable is the independent
variable and the criterion variable(s) is the dependent variable. The following regression
equation will be used: y = b1*x + c; where y = estimated dependent variable, c = constant, b
= regression coefficient and x = independent variable. The F-test will be used to assess
whether the independent variable predicts the dependent variable. R-squared will be
reported and used to determine how much variance in the dependent variable can be
accounted for by the independent variable. The t-test will be used to determine the
significance of the predictor and beta coefficients will be used to determine the magnitude
and direction of the relationship. For statistically significant models, for every one unit
increase in the predictor, the dependent variable will increase or decrease by the number of
unstandardized beta coefficients. The assumptions of a linear regression —linearity and
homoscedasticity—will be assessed. Linearity assumes a straight line relationship between
the predictor variables and the criterion variable and homoscedasticity assumes that scores
are normally distributed about the regression line. Linearity and homoscedasticity will be
assessed by examination of a scatter plots.
Acknowledgement
We would like to sincerely thank our professor Dr. Sumeet Singh Jaisal for his guidance and
knowledge throughout the timeframe of making this report. We would also like to thank the
PSU New India Insurance for their data on a public platform. Lastly we would like to thank
our group members, our friends and respondents for their constant support.
P a g e | 18
P a g e | 19
BIBLOGRAPHY
David A. Freedman (27 April 2009). Statistical Models: Theory and Practice.
Cambridge University Press. ISBN 978-1-139-47731-4.
R. Dennis Cook; Sanford Weisberg Criticism and Influence Analysis in Regression,
Sociological Methodology, Vol. 13. (1982), pp. 313–361
A.M. Legendre. Nouvelles méthodes pour la détermination des orbites des comètes,
Firmin Didot, Paris, 1805. “Sur la Méthode des moindres quarrés” appears as an
appendix.
Chapter 1 of: Angrist, J. D., & Pischke, J. S. (2008). Mostly Harmless Econometrics:
An Empiricist's Companion. Princeton University Press.
Seltman, Howard J. (2008-09-08). Experimental Design and Analysis (PDF). p. 227.
"Statistical Sampling and Regression: Simple Linear Regression". Columbia
University. Retrieved 2016-10-17.
Lane, David M. Introduction to Statistics (PDF). p. 462.
Zou KH; Tuncali K; Silverman SG (2003). "Correlation and simple linear regression".
Radiology. 227 (3)