Chapter 10 BO SP24

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

IST 686 Chapter 10 Breakout: Logistic Regression

Instructions: A csv file of data is posted in Blackboard. Assign the imported data set to a data
frame called “hiredata.” This data set contains n=295 survey responses from raters who
participated in a hiring process. The variables are:

hired: The dependent variable that is a binary variable with 0 for a candidate who was
subsequently not hired and 1 for a candidate who was.

recommend: each rater’s recommendation of whether to hire, with 1 = “Definitely Hire,” 2 =


“Possibly Hire,” and 3 = “Do Not Hire.”

In addition, there are six attitude/belief variables, all on 1 to 4 scales (with 1 as most favorable
and 4 as least favorable) with assessments on issues like leadership and collaboration.

You will explore the recommend variable as a predictor for whether or not a candidate was
hired.

1. Take a look at a summary of the data set, then look at the histograms for the two
variables of interest. Comment on the shapes.

2. Run cor() on these two variables and comment on the result.

3. Run and interpret a basic logistic regression model using glm:


glmOut <- glm(formula = hired ~ recommend, family = binomial(link="logit"), data =
hiredata)
Run summary() on the glmOut object and write a brief statement summarizing the
results. Is the predictor statistically significant?

4. Use exp() and confint() commands as described on page 225 of the textbook to convert
log odds for the coefficient on the predictor into regular odds.

5. The plain odds version of the coefficient on the predictor is fractional. This can make
interpretation of the results more difficult, particularly for non-statisticians to whom you
may wish to communicate your results. Invert the recommend variable:
hiredata$recInv <- (4 - hiredata$recommend)

Try the math in your head with the minimum value of recommend (1) and the maximum
value of recommend (3). Note that this command adds a new variable to your existing
data set. To cross check your results, correlate the new variable with the old one.

Modified from IST777/772 Materials – Copyright 2018, 2019 by Jeffrey Stanton – Please do not post online.
6. Rerun the code for #3 and #4 using recInv. Interpet the plain odds ratio, based on the
output you get from applying exp() and confint() to the coefficient.

7. Compare the null model to the predictor model using an anova and interpret the results.

8. Can a rater’s recommendation of whether to hire a candidate predict whether a


candidate is hired? Write a few sentences to answer this research question supported
by the results above.

Modified from IST777/772 Materials – Copyright 2018, 2019 by Jeffrey Stanton – Please do not post online.

You might also like