Case study of a Dean’s dilemma in selection of MBA students.

Setting up the working directory and creating a dataframe called dean for the data file to be pasted.Then viewing the dataframe.

setwd("C:/Users/Kalyan/Downloads")
dean.df<-read.csv(paste("Data - Deans Dilemma.csv",sep=""))
View(dean.df)

A dataframe with a subset of only those students who were successfully placed.

placed<-dean.df[which(dean.df$Placement=='Placed'),]
View(placed)

A table showing the mean salary of males and females, who were placed.

salary<-aggregate(Salary~Gender,data=placed,mean)
salary
##   Gender   Salary
## 1      F 253068.0
## 2      M 284241.9

The average salary of male MBAs who were placed.

salary
##   Gender   Salary
## 1      F 253068.0
## 2      M 284241.9

284241.9 is the average salary of the male MBAs who were placed.

The average salary of female MBAs who were placed.

salary
##   Gender   Salary
## 1      F 253068.0
## 2      M 284241.9

253068 is the average salary of the female MBAs who were placed.

A t-test for the Hypothesis “The average salary of the male MBAs is higher than the average salary of female MBAs.”

t.test(Salary~Gender,data=placed)
## 
##  Welch Two Sample t-test
## 
## data:  Salary by Gender
## t = -3.0757, df = 243.03, p-value = 0.00234
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -51138.42 -11209.22
## sample estimates:
## mean in group F mean in group M 
##        253068.0        284241.9

the p-value based on the t-test

p-value:0.00234

Interpretation of the t-test

So we can see that since the p-value is 0.00234 i.e. p<0.05,this rejects the null hypothesis and therefore tells us that there is a difference in the mean salaries of male and female MBAs placed. Also,from this finally we can tell that the average salary of the male MBAs is higher than the average salary of the female MBAs.