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

mba.data <- read.csv("Data - Deans Dilemma.csv")
placed.df <- mba.data[ which(mba.data$Placement_B=='1'),]
aggregate(placed.df$Salary, by=list(placed.df$Gender),mean)
##   Group.1        x
## 1       F 253068.0
## 2       M 284241.9

2) R code to find average salary of placed males

mean_data.df<-aggregate(placed.df$Salary, by=list(placed.df$Gender),mean)
mean_data.df[2,c(2)]
## [1] 284241.9

3) R code to find average salary of placed females

mean_data.df[1,c(2)]
## [1] 253068

4) 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(Salary ~ Gender.B,data=placed.df)
## 
##  Welch Two Sample t-test
## 
## data:  Salary by Gender.B
## 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:
##  11209.22 51138.42
## sample estimates:
## mean in group 0 mean in group 1 
##        284241.9        253068.0

5) p-value based on the t-test

p-value=0.00234

6) Interpretation of t-test,as applied to average salaries of male and female MBAs.

p-value generated is <0.05, thus we reject the null hypothesis that says there’s no significantdifference between the average salaries, however at the same time we cannot reject our test hypothesis as p-value<0.05