DA Internship task under Prof. Sameer Mathur

Recall the Data - Dean’s Dilemma.csv data file associated with the case “A Dean’s Dilemma: Selection of Students for the MBA Program”.

dean.df<-read.csv(paste("Deans Dilemma.csv"))
View(dean.df)

Create a table showing the average salary of males and females, who were placed. Review whether there is a gender gap in the data.

placed<-dean.df[ which(dean.df$Placement_B==1), ]
View(placed)
aggregate(placed$Salary~placed$Gender, FUN=mean)
##   placed$Gender placed$Salary
## 1             F      253068.0
## 2             M      284241.9

Use R to run a t-test to test the following hypothesis:

H1: 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

R code that creates a table showing the mean salary of males and females, who were placed.

aggregate(placed$Salary~placed$Gender, FUN=mean)
##   placed$Gender placed$Salary
## 1             F      253068.0
## 2             M      284241.9

What is the average salary of male MBAs who were placed?

What is the average salary of female MBAs who were placed?

Female MBAs average salary=253068.0 and Male MBAs average salary=284241.9

R code to run a 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

What is the p-value based on the t-test?

Please interpret the meaning of the t-test, as applied to the average salaries of male and female MBAs.

After conducting the t-test we got the p-value as 0.00234. Since the given p-value is less than 0.05, we can reject the null hypothesis that male MBAs and female MBAs have equal salaries. Hence, The average salary of the male MBAs is higher than the average salary of female MBAs.