T-Test Analysis based on “A Dean’s Dilemma: Selection of Students for the MBA Program”

#setup
dean<-read.csv("C:\\Users\\ADI\\Downloads\\Data - Deans Dilemma.csv")
placed<-dean[which(dean$Placement_B==1),]

3d) 1.table showing the average salary of males and females, who were placed:

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

2.average salary of male MBAs who were placed=284241.9

3.average salary of female MBAs who were placed=253068.0

Upon reviewing, we observe that there is a gender gap in the data. The average salary of males is higher than that of females.

4.t-test to test the following hypothesis: H1: The average salary of the male MBAs is higher than the average salary of female MBAs.

t.test(Salary~Gender, data= dean)
## 
##  Welch Two Sample t-test
## 
## data:  Salary by Gender
## t = -2.69, df = 278.55, p-value = 0.007577
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -66149.06 -10244.26
## sample estimates:
## mean in group F mean in group M 
##        193288.2        231484.8

5.p-value=0.007577

6.Since the p value is <0.05, we reject the null hypothesis which was “the average salary of male MBAs is same as the average salary of female MBAs.”