SYNOPSIS This is an R Markdown document for the analysis of T-test on the Dean’s dilemma dataset testing the hypothesis- The average salary of the male MBAs is higher than the average salary of female MBAs.
Reading the dataset
setwd("~/winter internship")
mba <- read.csv(paste("Data - Deans Dilemma.csv",sep=""))
View(mba)
1)table depicting the mean salary of males and females who were placed
placed <- mba[which(mba$Placement_B==1), ]
View(placed)
aggregate(placed$Salary,by=list(placed$Gender),mean)
## Group.1 x
## 1 F 253068.0
## 2 M 284241.9
2)The average salary of males who are placed is 284241.9
3)The average salary of females who are placed is 253068.0
4)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
5)Therefore the p-value of the given hypothesis is 0.00234
6)Result interpretation
-Males have higher mean salary at 284241.9 as compared to females which have a mean salary of 253068.0
-The t test showed there was a significant difference in salaries of placed male and female since the value of p is less than 0.05