Logistic Regression Practical part- 4

SAS Analytics Logistic Regression- Case Study & Practical
10 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$69.99
List Price:  $99.99
You save:  $30
€67.18
List Price:  €95.97
You save:  €28.79
£55.86
List Price:  £79.80
You save:  £23.94
CA$97.87
List Price:  CA$139.82
You save:  CA$41.95
A$107.62
List Price:  A$153.75
You save:  A$46.13
S$94.24
List Price:  S$134.64
You save:  S$40.39
HK$544.83
List Price:  HK$778.36
You save:  HK$233.53
CHF 62.54
List Price:  CHF 89.34
You save:  CHF 26.80
NOK kr774.97
List Price:  NOK kr1,107.14
You save:  NOK kr332.17
DKK kr501
List Price:  DKK kr715.75
You save:  DKK kr214.74
NZ$119.95
List Price:  NZ$171.37
You save:  NZ$51.41
د.إ257.07
List Price:  د.إ367.26
You save:  د.إ110.19
৳8,361.58
List Price:  ৳11,945.63
You save:  ৳3,584.04
₹5,909.84
List Price:  ₹8,442.99
You save:  ₹2,533.15
RM312.71
List Price:  RM446.75
You save:  RM134.04
₦118,484.88
List Price:  ₦169,271.38
You save:  ₦50,786.49
₨19,443.22
List Price:  ₨27,777.22
You save:  ₨8,334
฿2,412.28
List Price:  ฿3,446.26
You save:  ฿1,033.98
₺2,418.32
List Price:  ₺3,454.90
You save:  ₺1,036.57
B$406.01
List Price:  B$580.04
You save:  B$174.03
R1,267.89
List Price:  R1,811.35
You save:  R543.45
Лв131.37
List Price:  Лв187.69
You save:  Лв56.31
₩98,301.65
List Price:  ₩140,436.95
You save:  ₩42,135.30
₪259.10
List Price:  ₪370.16
You save:  ₪111.06
₱4,125.14
List Price:  ₱5,893.31
You save:  ₱1,768.17
¥10,832.35
List Price:  ¥15,475.45
You save:  ¥4,643.10
MX$1,429.79
List Price:  MX$2,042.64
You save:  MX$612.85
QR255.18
List Price:  QR364.56
You save:  QR109.38
P956.90
List Price:  P1,367.06
You save:  P410.16
KSh9,061.51
List Price:  KSh12,945.58
You save:  KSh3,884.06
E£3,475.01
List Price:  E£4,964.52
You save:  E£1,489.50
ብር8,566
List Price:  ብር12,237.67
You save:  ብር3,671.66
Kz63,900.87
List Price:  Kz91,290.87
You save:  Kz27,390
CLP$69,057.73
List Price:  CLP$98,658.13
You save:  CLP$29,600.40
CN¥506.93
List Price:  CN¥724.22
You save:  CN¥217.29
RD$4,217.06
List Price:  RD$6,024.63
You save:  RD$1,807.57
DA9,397.90
List Price:  DA13,426.15
You save:  DA4,028.25
FJ$159.29
List Price:  FJ$227.57
You save:  FJ$68.27
Q540.13
List Price:  Q771.64
You save:  Q231.51
GY$14,638.82
List Price:  GY$20,913.50
You save:  GY$6,274.67
ISK kr9,776.20
List Price:  ISK kr13,966.60
You save:  ISK kr4,190.40
DH703.91
List Price:  DH1,005.63
You save:  DH301.72
L1,275.33
List Price:  L1,821.98
You save:  L546.64
ден4,132.76
List Price:  ден5,904.20
You save:  ден1,771.43
MOP$561.01
List Price:  MOP$801.48
You save:  MOP$240.46
N$1,268.91
List Price:  N$1,812.81
You save:  N$543.90
C$2,574.70
List Price:  C$3,678.31
You save:  C$1,103.60
रु9,449.77
List Price:  रु13,500.25
You save:  रु4,050.48
S/265.32
List Price:  S/379.05
You save:  S/113.72
K281.71
List Price:  K402.47
You save:  K120.75
SAR262.77
List Price:  SAR375.40
You save:  SAR112.63
ZK1,934.92
List Price:  ZK2,764.29
You save:  ZK829.37
L334.42
List Price:  L477.77
You save:  L143.34
Kč1,702.59
List Price:  Kč2,432.37
You save:  Kč729.78
Ft27,646.05
List Price:  Ft39,496.05
You save:  Ft11,850
SEK kr772.42
List Price:  SEK kr1,103.50
You save:  SEK kr331.08
ARS$70,259.44
List Price:  ARS$100,374.93
You save:  ARS$30,115.49
Bs483.50
List Price:  Bs690.75
You save:  Bs207.24
COP$307,238.59
List Price:  COP$438,931.09
You save:  COP$131,692.49
₡35,641.51
List Price:  ₡50,918.63
You save:  ₡15,277.11
L1,768.23
List Price:  L2,526.16
You save:  L757.92
₲546,248.87
List Price:  ₲780,388.98
You save:  ₲234,140.10
$U2,983.14
List Price:  $U4,261.82
You save:  $U1,278.67
zł291.40
List Price:  zł416.31
You save:  zł124.90
Already have an account? Log In

Transcript

In this video we will be setting up a cutoff probability level based on which we will be converting this estimated probability into a binary variable taking value zero or one and the variable name will be status. So let's do that. First, let's set up the cutoff gravity level. So we are using the data step we are doing DATA step two create the binary variable status. So data we are creating a separate data set called Data Fred underscore result. This is a duplicate data set that is meant to be created inside work.

Just because we did not specify any library name so the pred underscore result data set will be created inside work, set result. The result is the already created data set which is there inside work. So the result is the original data set, which is getting copied in credit this concept. So the data set which I'm specifying data statement that is a duplicate data set at the state data set, which specify in the set statement that is original data set. So this original data set is getting copied in the duplicate data set that is created dischord result now I'm seeing in order to set up the V set of the cutoff priority level in such a ways that if our estimated probability is greater than the cutoff probability level, we say it's an event otherwise, it's an non event that is here we are building a model illustration the dependent variable is calculating the probability for Y equals to one so if our estimated travel there are the probability that we have estimated that is also estimated for Y equals to one that is probability of an event is estimated that is a probability.

So if our predicted probability is greater than the setup, the cutoff probability level that we have set, then we say that a particular event will occur. So then the value of status will be one, because one means event, otherwise it won't occur then the value of status will be zero that is it will be a non event. So if predicted is a variable name is greater than point five. That is I have set the cutoff level as point five. We can change according to our choice, but generally we keep it as points at five. So, if our estimated probability for Y equals to one is greater than point five, then I'm creating a status variable which will be my daughter binary variable, then status will be equal to one.

One means it's an event. Otherwise, the status vd will will take over zero then, let's run the code. So before we run the code, let me explain all the code. So here we are doing a data step, we are creating a data set called pred underscore result which is going to be created inside work as we did not specify any library named Farah underscore result data set will be created inside work set result, this result is my original data set which is already there in the work so result is getting copied in pred underscore result now I have set the cutoff probability level as point five saying that is the predicted probability that is the estimated gravity of for vehicles to work that is for bikers to event in our model, which is showing that the customer will not be alone defaulted is greater than point five then status equals to one that means there we are predicting the status value was one.

That is if we are saying that the the greatest probability is greater than point five, we're saying that status data will be one that is the event will occur, one means event. And if the predicted probability is less than point five, that is else status will be zero. So, in this way, we are converting the stated probability variable into a binary variable, you know that we have to actually calculate the accuracy of the model. So, in order to calculate the accuracy of the model, our response variable, we need one observed response variable and predicted response variable. So, both has to be binary in nature. So, in this way we are converting this predicted probability into a binary variable called status, the name of the variable can be anything.

So if the greatest probability is greater than greater probability for Y equals to one is greater than the cutoff gravity level, which is point five x taken over here, then my filtered response variable whose name is status will be one. Otherwise status with Visio. So, let's run this code So let's open the data set credit disposals see the exact exactly whatever was given in the result data set that got copied over here, that is whatever we have in our original data set that is there, this is our response value, this is my observed response variable, which is already binary nature, which is given as binary nature. And this is this is an observed response variable, and this is my estimated probability that is a greater probability that we had predicted and this status is my predicted response variable, I have named it a status I've said that if the estimated profit is greater than point 8.5 is my cutter priority level, then the status value will be one otherwise, you see, here there's two main priorities point nine two they're probably got the status value as well again here the student priorities point three seven, then the we have the status value is zero.

So that means that whichever according to our cutter priority level if the estimator probabilities good Then point five, then we are then that to that individual, there is greater probability that that individual will not be a known defaulter. So the loan officer is going to give them the loan give them is more likely to give the loan to that individual. So whoever has an estimated probability greater than point five means they're more likely to get the loan because their probability y equals to one is going to be more, it is greater than point five means greater than 50% we have set the cutoff gravity level is 50%. point five we can set the cutoff priority level or do a choice but generally we keep the cutoff values 50%. So in this way, status we will create it and if the submitted priority is less than point five that means, that particular customer is less likely to get the loan.

So see over here this one priority is point three which is greater than which is less than point five. Therefore, the Status zero that is this customer the second customer is less likely to get a loan. So, this customer is more likely to be a loan default. Because probability by equals to one is the customer will not be alone default and probability by equals to zero is the customer will be a no loan default. So does I have an observe setter response variable in the bracket setters complete one is response and other is status. So in this way, I got this middle priority with status.

I've converted estimator priority to a status variable which is binary nature that is zero or one. And here my response value is also displayed, which are all observations. My response bad results district which for all the observations are one, because we are building the model for Y equals to one and the probability that is estimated that is also estimated probability for one close to one. So, the parameter that we have created that is estimated probability for Y equals to event Okay. Now, this month we are going to learn in this video that is we have got the status variable we have converted the estimate parameter to a status variable which is taking binary whether 01 by setting up a cutoff probability level which is called 50%. Before I move to the next video, let me recap the concepts here that we have done in these videos.

We have been working with the greatest analytics data set we have done step by selection, we have selected the significant variables by residual chi square test we have done Hushmail ensure goodness of fit is where we concluded the model is a good fit, we have generated classification table and we got the different measures of classification table at every level of probability from zero to one With a gap of 0.01 that is we got sensitivity specificity false positive false negative, correct incorrectly classified events correctly classified non events incorrectly classified events incorrectly classified non events, then percentage classified percentage correctly classified for every level of priority from zero to one. We got the analysis of maximum likelihood estimates table we got the odds ratio estimates table we got the table for percentage of concordance discordance and Taipei's were higher is the percentage of concordance better is our model, because less will be the miniscule Miss classification.

For our model, we have predicted the probability for Y equals to one then we have set up one cutoff gravity level is point five saying that if the freighter probability is greater than point five That is, if the estimator probability is greater than point five, then the status will be one, otherwise status will be zero. That means that the customers for whom the predicted probability are greater than point five, those customers are more likely to get the loan because they have maximum liability that they will not be alone default. There are maximum transfer those costs to customers that they will not be alone before death and those who have less than perfect their status is equal to zero because they are less likely to get the loan because they have maximum liability for vehicles to non event then y equals to event that is they are less likely to get the look as the record probability is less than point five.

So accordingly we have converted this estimated probability into a status variable which is binary nature taking value 01 saying that it's a greater priority is greater than point five when it is one otherwise it is zero. Thank you. Goodbye. see you for the next video.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.