Q1. Submit your R code that creates a table showing the mean salary of males and females, who were placed.

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)

Q2. What is the average salary of male MBAs who were placed?

Average salaries of males:

placedmale <- placed[ which(placed$Gender.B=='0'), ]
mean(placedmale$Salary)
## [1] 284241.9

Q3. What is the average salary of female MBAs who were placed?

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.

Q4. Submit 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.”

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

Q5.What is the p-value based on the t-test?

P-value = 0.00234

Q6. Please interpret the meaning of the t-test, as applied to the average salaries of male and female MBAs.

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.