Question

In: Statistics and Probability

Let’s verify what we’re seeing with logistic regression. We’ll start by making a relevant data frame...

Let’s verify what we’re seeing with logistic regression. We’ll start by making a relevant data frame in R. Type the following into the R terminal (or, easier, make an R script that contains the following code):

data(UCBAdmissions)
Adm <- as.integer(UCBAdmissions)[(1:(6*2))*2-1]
Rej <- as.integer(UCBAdmissions)[(1:(6*2))*2]
Dept <- gl(6,2,6*2,labels=c("A","B","C","D","E","F"))
Sex <- gl(2,1,6*2,labels=c("Male","Female"))
Ratio <- Adm/(Rej+Adm)
berk <- data.frame(Adm,Rej,Sex,Dept,Ratio)

You can see the first several rows of the data frame by typing head(berk). Now let’s do logistic regression to try and predict probability of admission using only gender as a predictor with the following code:

LogReg.gender <- glm(cbind(Adm,Rej)~Sex,data=berk,family=binomial("logit"))
summary(LogReg.gender)

Based on this output, what can we say about the admission probabilities between Males and Females?

(f) Now re-fit the logistic regression model taking both gender and department into ac- count. What happens to the coefficient for female? Give a brief summary of what we’ve shown throughout this problem.

Solutions

Expert Solution

LogReg.gender <- glm(cbind(Adm,Rej)~Sex,data=berk,family=binomial("logit"))
summary(LogReg.gender)

Output:

Deviance Residuals:
Min 1Q Median 3Q Max
-16.7915 -4.7613 -0.4365 5.1025 11.2022

Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -0.22013 0.03879 -5.675 1.38e-08 ***
SexFemale -0.61035 0.06389 -9.553 < 2e-16 ***
---
Signif. codes:
0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Here we can see wherever sex is female is significant for the model with an estimate of -0.61035. Females are less likely to get admitted.

(f) Now after re-fit the logistic regression model taking both gender and department into ac- count

Output:

Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 0.58205 0.06899 8.436 <2e-16 ***
SexFemale 0.09987 0.08085 1.235 0.217
DeptB -0.04340 0.10984 -0.395 0.693
DeptC -1.26260 0.10663 -11.841 <2e-16 ***
DeptD -1.29461 0.10582 -12.234 <2e-16 ***
DeptE -1.73931 0.12611 -13.792 <2e-16 ***
DeptF -3.30648 0.16998 -19.452 <2e-16 ***
---
Signif. codes:
0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

SexFemale and DeptC becomes insignificant. with SexFemale having estimate of 0.09987.


Related Solutions

When should logistic regression be used for data analysis? What is the assumption of logistic regression?...
When should logistic regression be used for data analysis? What is the assumption of logistic regression? How to explain odds ratio?
What is binary logistic regression, and how to use it?
What is binary logistic regression, and how to use it?
What is binary logistic regression, and how to use it?
What is binary logistic regression, and how to use it?
What is the difference and similarities between SVM and Logistic Regression?
What is the difference and similarities between SVM and Logistic Regression?
Plot logistic regression in Rstudio: The data set in the table considers information on the spread...
Plot logistic regression in Rstudio: The data set in the table considers information on the spread of prostate cancer to the lymph nodes for 53 patients. For a sample of prostate cancer patients, a set of possible predictor variables were measured before surgery to determine if the lymph nodes were compromised. Subsequently, the patient underwent surgery and the status of his lymph nodes was determined. The data set contains 53 observations of 7 variables: id: identifiers for each subject in...
What is the main purpose of logistic regression? Do you know other regression that can provide...
What is the main purpose of logistic regression? Do you know other regression that can provide similar estimates?
What are the similarities and differences between multiple linear regression, and logistic regression? Please consider Typical...
What are the similarities and differences between multiple linear regression, and logistic regression? Please consider Typical Application (used when), assumptions needed, Data Type
1.When is logistic regression the appropriate model for modeling non-metric outcomes? 2.In what ways is logistic...
1.When is logistic regression the appropriate model for modeling non-metric outcomes? 2.In what ways is logistic regression comparable to multiple regression? How does it differ? 3.Why are there two forms of logistic coefficients (original and exponentiated)?
COMPLETE A LOGISTIC REGRESSION, AS WELL AS A K-MEANS CLUSTER ANALYSIS IN EXCEL? Using the data...
COMPLETE A LOGISTIC REGRESSION, AS WELL AS A K-MEANS CLUSTER ANALYSIS IN EXCEL? Using the data to find four clusters of cities. Write a short report about the clusters you find. Does the clustering make sense? Can you provide descriptive, meaningful names for the clusters? SHOW GRAPHS PLEASE (Scatter plot/cluster) Metropolitan_Area Cost_Living Transportation Jobs Education Abilene, TX 96.32 36.54 17.28 49.29 Akron, OH 47.31 69.68 86.11 71.95 Albany, GA 86.12 28.02 32.01 26.62 Albany-Schenectady-Troy, NY 25.22 82.71 52.97 99.43 Albuquerque,...
For what type of dependent variable is logistic regression appropriate? Give an example of such a...
For what type of dependent variable is logistic regression appropriate? Give an example of such a variable. In what metric are logistic regression coefficients? What can we do to them to make them more interpretable, and how would we interpret the resulting translated coefficients? (Understanding and Using Statistics for Criminology and Criminal Justice)
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT