The data set used for this set of questions is as follows:
dd <- read.csv(paste("DeansDilemma.csv", sep=""))
View(dd)
The following table describes trend of gender vs salary:
placed <- dd[ which(dd$Placement_B=='1'), ]
gendersalary <- xtabs(~ Gender+Salary, data = placed)
View(gendersalary)
Average salaries of males:
placedmale <- placed[ which(placed$Gender.B=='0'), ]
mean(placedmale$Salary)
## [1] 284241.9
Average salaries of females:
placedfemale <- placed[ which(placed$Gender.B=='1'), ]
mean(placedfemale$Salary)
## [1] 253068
We see that average salary of placed males = 284241.9. Whereas, average salary of placed females = 253068. This is less than males’ salary by 10.9%. Thus, we can clearly see the gender gap present.
placed <- dd[ which(dd$Placement_B=='1'), ]
t.test(Salary ~ Gender.B, data = placed)
##
## 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
P-value = 0.00234
The t-test declares that “alternative hypothesis- true difference in means is not equal to 0.” This means that there is a significant difference between salary of males and salary of females.