student.df <- read.csv(paste("Data - Deans Dilemma.csv",sp=""))
View(student.df)
placed <-student.df[which(student.df$Placement_B==1),]
aggregate(placed$Salary,by=list(placed$Gender),mean)
## Group.1 x
## 1 F 253068.0
## 2 M 284241.9
Mean salary of females= 253068.0 Mean salary of males= 284241.9
t.test(Salary~Gender,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
p-value = 0.00234 since, p-value< 0.05, we reject the null hypothesis, which means there is a significant difference between the salaries of males and females.