setwd("C:/Users/Jaswanth/Downloads")
data.df<-read.csv(paste("Data - Deans Dilemma.csv",sep=""))
View(data.df)
placed<-data.df[which(data.df$Placement=='Placed'),]
View(placed)
meansal<-aggregate(Salary~Gender,data=placed,mean)
meansal
## Gender Salary
## 1 F 253068.0
## 2 M 284241.9
meansal
## Gender Salary
## 1 F 253068.0
## 2 M 284241.9
meansal
## Gender 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
0.00234
So we can see that since the p-value is p<0.05,this accepts the alternative hypothesis and tells us that there is a significant difference in the average salaries of male and female MBAs placed. We can tell that the average salary of the male MBAs is higher than the average salary of the female MBAs.