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

Dataframe called placed, that contains a subset of only those students who were successfully placed.

placed <- dean_data.df[ which(dean_data.df$Placement_B=='1'), ]
View(placed)

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

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

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

The answer is 253068.0

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

The answer is 284241.9

4.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.”

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

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

The answer is 0.00234

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

If we have H1 as:“The average salary of the male MBAs is higher than the average salary of female MBAs”.The null hypothesis is, “There is no significnat difference between the average salaries of the males and females, who are placed”.TAn now as the value of p, is ‘0.00234’, i.e , (p<0.05), it suggests there is a significant difference between the average salaries of the males and females, who are placed, and we reject our null hypothesis.