Homework 4 Peer AssessmentBackgroundThe owner of a company would like to be able to predict whether employees will stay with the company or leave. The data contains information about various characteristics of employees. See below for the description of thesecharacteristics.Data DescriptionThe data consists of the following variables:1. Age.Group: 1-9 (1 corresponds to teen, 2 corresponds to twenties, etc.) (numerical)2. Gender: 1 if male, 0 if female (numerical)3. Tenure: Number of years with the company (numerical)4. Num.Of.Products: Number of products owned (numerical)5. Is.Active.Member: 1 if active member, 0 if inactive member (numerical)6. Staying: Fraction of employees that stayed with the company for a given set of predicting variablesNote: Please do not treat any variables as categorical.Read the dataA data.frame: 6 × 8Age.GroupGenderTenureNum.Of.ProductsIs.Active.MemberStayEmployeesStaying<int><int><int><int><int><int><int><dbl>1213105110.45454552214105100.50000003214112130.15384624207103100.30000005217102140.14285716204204120.3333333Question 1: Fitting a Model - 6 ptsFit a logistic regression model using Stayingas the response variable with Num.Of.Productsas the predictor and logit as the link function. Call it model1.(a) 2 pts - Display the summary of model1. What are the model parameters and estimates?Call:glm(formula = Staying ~ Num.Of.Products, family = "binomial", data = data, weights = Employees) Deviance Residuals: Min 1Q Median 3Q Max -4.2827 -1.4676 -0.1022 1.4490 4.7231 Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 2.1457 0.1318 16.27 <2e-16 *** Num.Of.Products -1.7668 0.1031 -17.13 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for binomial family taken to be 1) Null deviance: 981.04 on 157 degrees of freedom Residual deviance: 632.04 on 156 degrees of freedom AIC: 1056.8 Number of Fisher Scoring iterations: 4 The model parameters are β0 and β1 whose estimates are:β0 : 2.1457β1 : -1.7668In logistic regression since there are no error terms there is no parameter for variance as we have in standard linear regression(b) 2 pts - Write down the equation for the odds of staying.The equation for odds of staying is(c) 2 pts - Provide a meaningful interpretation for the coefficient for Num.Of.Productswith respect to the log-odds of staying and the odds of staying.With a 1-unit increase of Num.Of.Products, the log oddsof an employee staying in the company decreases by 1.7668.With a 1-unit increase in Num.Of.Products the odds of stayingdecreases by 82.92%. This is found as Question 2: Inference - 9 pts(a) 3 pts - Using model1, find a 90% confidence interval for the coefficient for Num.Of.Products.Waiting for profiling to be done... 5 %:-1.9383609629848295 %:-1.59896517002452The 90% confidence interval for Num.Of.Products is ~ (-1.94,-1.60).(b) 3 pts - Is model1 significant overall? How do you come to your conclusion?0We will use a chi-square test to compare the fitted model to the null model.We see above that the our calculated p-value is very close to 0, this therefore means that the model is statistically significant.