The average salary of male placed candidates is 231484.8 The average salary of female placed candidates is 193288.2
ctv.df <- read.csv(paste("Data - Deans Dilemma.csv", sep=""))
mydata<-ctv.df[which(ctv.df$Placement=="Placed"),]
aggregate(ctv.df$Salary, by=list(ctv.df$Gender), mean)
## Group.1 x
## 1 F 193288.2
## 2 M 231484.8
Independent t-test Since p-value<0.05, the NULL hypothesis can be rejected.Thus, there exists a significant difference between the average salaries of male and female MBA candidates.
##
## 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
Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.