Read the dataset into RStudio
setwd("C:/Users/Parul Verma/Desktop/Data Analytics Internship/HBR Cases")
DeanDilemma.df <- read.csv(paste("DataDeanDilemma.csv",sep = ""))
List of questions based on “A Dean’s Dilemma: Selection of Students for the MBA Program”
placed.df <- DeanDilemma.df[which(DeanDilemma.df$Placement == "Placed"),]
aggregate(placed.df$Salary~placed.df$Gender, FUN = mean)
## placed.df$Gender placed.df$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
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(placed.df$Salary~placed.df$Gender,data = placed.df)
##
## Welch Two Sample t-test
##
## data: placed.df$Salary by placed.df$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
The meaning of the t-test, as applied to the average salaries of male and female MBAs - We see that our p-value = 0.00234 < 0.05. This means that we can reject our null hypothesis which is that there’s no significant difference between the average salaries of the male MBAs and the female MBAs. On the contrary, there’s a significant difference between the means of the salaries of our sample population. Therefore, it is true that average salary of male MBAs is higher than the average salary of female MBAs.