2.Setting the working directory and the data frame

setwd("C:/Users/alouk/Downloads")
mba.df <- read.csv("Data-Deans Dilemma.csv")

3.Now storing the placed student’s data in dataframe ‘placed’

placed <- mba.df[which(mba.df$Placement_B ==1),]

4.Table showing the average salary of males and females who were placed

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

5.#T-Test to test the hypothesis Hypothesis : The average salary of the male MBAs is higher than the average salary of female MBAs.

t.test(placed$Salary~placed$Gender,var.equal = TRUE)
## 
##  Two Sample t-test
## 
## data:  placed$Salary by placed$Gender
## t = -2.7597, df = 310, p-value = 0.00613
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -53400.627  -8947.012
## sample estimates:
## mean in group F mean in group M 
##        253068.0        284241.9

The p-value is 0.00613

Since p<0.01 , the hypothesis is true

if the value of p is greater than 0.01, then our hypothesis will fail.

Therefore,the average salary of the male MBAs is higher than the average salary of female MBAs.