1) Dataframe that contains a subset of only placed students

dean_dil.df <- read.csv("Data - Deans Dilemma.csv")
placed.df<- dean_dil.df[ which(dean_dil.df$Placement_B=='1'), ]
View(placed.df)

2) Table showing the mean salary of males and females, who were placed.

aggregate(placed.df$Salary, by=list(Gender=placed.df$Gender), mean)
##   Gender        x
## 1      F 253068.0
## 2      M 284241.9

3) average salary of male MBAs who were placed

placed_male <- placed.df[ which(placed.df$Gender.B=='0'), ]
library(psych)
describe(placed_male$Salary)
##    vars   n     mean       sd median  trimmed   mad    min    max  range
## X1    1 215 284241.9 99430.42 265000 273317.9 51891 120000 940000 820000
##    skew kurtosis     se
## X1 2.25     9.91 6781.1

4) average salary of female MBAs who were placed

placed_female <- placed.df[ which(placed.df$Gender.B=='1'), ]
library(psych)
describe(placed_female$Salary)
##    vars  n   mean       sd median  trimmed   mad    min    max  range skew
## X1    1 97 253068 74190.54 240000 246329.1 59304 120000 650000 530000 1.81
##    kurtosis      se
## X1     7.03 7532.91

5) Run a t-test to test the following hypothesis:

#H0: The average salary of the male MBAs is equal to the average salary of female MBAs.
t.test(placed.df$Salary~placed.df$Gender)
## 
##  Welch Two Sample t-test
## 
## data:  placed.df$Salary by placed.df$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 = 0.00234

7) Interpretation of the t-test,

As the p-value=0.00234 < 0.05, we can rejet the null hypothesis and conclude that the average salary of the male MBAs is higher than the average salary of female MBAs.