Read Data

  mba.df <- read.csv("Data - Deans Dilemma.csv")

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

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

The average salary of male MBAs who were placed

avgsal<-aggregate(Salary~Gender,data=placed,FUN=mean)
  avgsal[2,2]
## [1] 284241.9

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 between the salaries of males and females.

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

p-Value

The p-value is 0.00234.

## Interpretation of T-test

  1. The average salary of men is 284241 which is higher than that of women at 253068.

2.After performing a t-test on the two variables we can see that the p value is 0.003287, which is too low and hence the NULL hypothesis here that the mean salary of men is NOT significantly higher than the women will be rejected which shows us that the average salary of men is indeed higher than that of women.