DA Internship task under Prof. Sameer Mathur
dean.df<-read.csv(paste("Deans Dilemma.csv"))
View(dean.df)
placed<-dean.df[ which(dean.df$Placement_B==1), ]
View(placed)
aggregate(placed$Salary~placed$Gender, FUN=mean)
## placed$Gender placed$Salary
## 1 F 253068.0
## 2 M 284241.9
t.test(placed$Salary~placed$Gender)
##
## Welch Two Sample t-test
##
## data: placed$Salary by placed$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
aggregate(placed$Salary~placed$Gender, FUN=mean)
## placed$Gender placed$Salary
## 1 F 253068.0
## 2 M 284241.9
Female MBAs average salary=253068.0 and Male MBAs average salary=284241.9
t.test(placed$Salary~placed$Gender)
##
## Welch Two Sample t-test
##
## data: placed$Salary by placed$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
After conducting the t-test we got the p-value as 0.00234. Since the given p-value is less than 0.05, we can reject the null hypothesis that male MBAs and female MBAs have equal salaries. Hence, The average salary of the male MBAs is higher than the average salary of female MBAs.