The objective of this lab is to learn how to do Logistic regression You will use data
Question:
The objective of this lab is to learn how to do Logistic regression You will use data from Kaggel, Invistico_Airline_LR.csv, it contains information from an airline using the alias Invistico Airline on customer satisfaction, as well as details on each customer.
https://www.kaggle.com/datasets/sjleshrac/airlines-customer-satisfaction?resource=download
Please do the following:
1. Open the data file to further understand the problem, The columns of interest are Gender, Age, Class, Flight_Distance,
Departure_Delay_in_Minutes, Arrival_Delay_in_Minutes, and
satisfaction.
2. Read it (Invistico_Airline_LR.csv) into a data frame.
3. Re-code the categorical variables Gender, Class, and satisfaction in to dummy variables.
4. Create a new data frame X from the predictor variables Gender_female, Age, Class_Eco, Flight_Distance, Departure_Delay_in_Minutes, and Arrival_Delay_in_Minutes, in that order.
5. Create a response variable Y from the dummy variable satisfaction_satisfied.
6. Perform logistic regression on X and Y.
7. Print the parameters of the logistic regression model.
As an example, If only the variables Gender_female, Age, Class_Eco, Flight_Distance and Departure_Delay_in_Minutes are used as predictors, The output is:
const -1.681250
Gender_Female 2.868598
Age 0.000368
Class_Eco 0.350065
Flight_Distance -0.000354
Departure_Delay_in_Minutes -0.009452
dtype: float64
Marketing Research
ISBN: 9781119497639
13th Edition
Authors: V. Kumar, Robert P. Leone, David A. Aaker, George S. Day