Reading Dean’s dilemma dataset

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

A subset of only those students who were successfully placed.

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

The mean salary of males and females, who were placed.

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

The average salary of male MBAs who were placed.

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

The average salary of female MBAs who were placed.

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

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

t.test(placed$Salary~placed$Gender)
## 
##  Welch Two Sample t-test
## 
## data:  placed$Salary by placed$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

p-value based on the T-test

0.00234

Interpreting the T-test

So we can see that since the p-value is p<0.05,this accepts the alternative hypothesis and tells us that there is a significant difference in the average salaries of male and female MBAs placed. We can tell that the average salary of the male MBAs is higher than the average salary of the female MBAs.