1. Reading the dataset

setwd("C:/Users/CJ With HP/Desktop/IIM Lucknow/Datasets")
dilemma.df <- read.csv(paste("Data - Deans Dilemma.csv",sep=""))

2.Creating a table showing the mean salary of males and females, who were placed.

placed.df <- dilemma.df[which(dilemma.df$Placement=="Placed"),]
aggregate(Salary~Gender,data=placed.df,mean)
##   Gender   Salary
## 1      F 253068.0
## 2      M 284241.9
boxplot(Salary~Gender,data=placed.df, main="Comparision of average \nsalaries of males and females")

3. Average salary of males

284241.9

4. Average salary of females

253068.0

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

Null Hypothesis: There is no significant difference in the average salary of male MBA’s and average salary of female MBA’s.

t.test(Salary~Gender,data=placed.df)
## 
##  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

6. p-value based on the t-test

p-value = 0.0234

Conclusion: Since, the p-value is < 0.05, we can reject the null hypothesis. And conclude that,“The average salary of the male MBAs is higher than the average salary of female MBAs.”.