Read the data

mba <- read.csv(paste("Data - Deans Dilemma.csv", sep=""))
View(mba)

Creating a dataframe ‘placed.df’ containing entries of all placed students

placed.df <- subset(mba, Placement=='Placed')
View(placed.df)

TASK 3d

List of questions based on “A Dean???s Dilemma: Selection of Students for the MBA Program”

Submit your R code that creates a table showing the mean salary of males and females, who were placed. What is the average salary of male MBAs who were placed? What is the average salary of female MBAs who were placed? 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.” What is the p-value based on the t-test? Please interpret the meaning of the t-test, as applied to the average salaries of male and female MBAs.

gen_mean <- aggregate(Salary ~ Gender, data=placed.df, mean)
gen_mean
##   Gender   Salary
## 1      F 253068.0
## 2      M 284241.9

The average salary of male MBAs who were placed = 284241.9

The average salary of female MBAs who were placed = 253068.0

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

The p-value based on the t-test = 0.00234(p<0.05)

The hypothesis for the t-test was : The average salary of the male MBAs is higher than the average salary of female MBAs. Thus the null hypothesis was : There is no significant difference between the average salaries of male MBAs and female MBAs.

After conducting the t-test, the p-value is less than 0.05. Hence, we reject the null hypothesis and conclude that there is a significant difference between the average salaries of male MBAs and female MBAs.

Observing the mean values of the salary of males and females, we conclude that the average salary of the male MBAs is higher than the average salary of the female MBAs.