Read data
MBA <- read.csv(file="Data - Deans Dilemma (1).csv", header=TRUE, sep=",")
subset of placed people
placed <- MBA[which(MBA$Placement_B == '1'),]
TASK-3d1:table of avarage salaries of both men and women.
aggregate(Salary ~ Gender, data = placed, mean)
## Gender Salary
## 1 F 253068.0
## 2 M 284241.9
TASK-3d2:avarage salary of male
placedm<-placed[which(placed$Gender=='M'),]
mean(placedm$Salary)
## [1] 284241.9
TASK-3d3:avarage salary of female
placedf<-placed[which(placed$Gender=='F'),]
mean(placedf$Salary)
## [1] 253068
TASK-3d4 Using T-test.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
TASK-3d5 P value based on the T test is 0.00234
TASK-3d6 The P-value is <0.05,thus we reject the null hypothesis that says there’s no significant difference between the average salaries.