Lecture 3 Logistic Regression
Lecture 3 Logistic Regression
1
Linear vs. Logistic Regression
• There are two main
forms of regression
analysis.
• Linear regression has a
continuous set of
results that can easily
be mapped on a graph
as a straight line.
Logistic Regression
• Logistic regressions are non-linear and are portrayed on a
graph with a curved shape called a sigmoid.
• Instead of a continuous set of results, a logistical regression
has two or more categories for data.
• If you want to learn the probability of getting a job based
on how many applications you submit, whether you get a
job is a discrete number of variables.
• Therefore, you would use a logistic regression program for
that data.
Another example
• For instance, a bank might like to develop an estimated regression
equation for predicting whether a person will be approved for a credit
card or not
• The dependent variable can be coded as y =1 if the bank approves the
request for a credit card and y = 0 if the bank rejects the request for a
credit card.
• Using logistic regression we can estimate the probability that the bank
will approve the request for a credit card given a particular set of values
for the chosen independent variables.
4
Types of Logistic Regression
• Binary: A binary output is a variable where there are only two possible
outcomes. These outcomes must be opposite of each other and
mutually exclusive. Whether you have a cat is a binary output.
• Multi-class: A multi-class has three or more categories without any
numerical value, though they usually have a numerical stand-in for
datasets. For example, you could ask if someone if they have a dog, cat
or fish.
• Ordinal: An ordinal output also has three or more categories, though
they're in a ranked output. For example, asking a friend if they like
cats, dislike cats or don't care is an ordinal output.
Estimating the Logistic Regression Equation
• In simple linear and multiple regression the least squares method is used to
compute b0, b1, . . . , bp as estimates of the model parameters (β0 , … , βp)
• The nonlinear form of the logistic regression equation makes the method of
computing estimates more complex
• The estimated logistic regression equation is
7
Logistic Regression Equation
• Because of the interpretation of E( y) as a probability, the logistic
regression equation is often written as follows
8
Logistic regression equation for β0 and β1
9
Logistic regression equation for β0 and β1
10
Example
11
Sample dataset
14