deandata<-read.csv(paste("Data - Deans Dilemma.csv",sep=""))
View(deandata)
placed <- deandata[ which(deandata$Placement_B=='1'), ]
View(placed)
library(lattice)
seg.agg<-aggregate(Salary ~ Gender, data=placed,mean)
seg.agg
## Gender Salary
## 1 F 253068.0
## 2 M 284241.9
library(lattice)
seg.agg<-aggregate(Salary ~ Gender.B=='0', data=placed,mean)
seg.agg
## Gender.B == "0" Salary
## 1 FALSE 253068.0
## 2 TRUE 284241.9
The average salary of male placed members is 284241.9
library(lattice)
seg.agg<-aggregate(Salary ~ Gender.B=='1', data=placed,mean)
seg.agg
## Gender.B == "1" Salary
## 1 FALSE 284241.9
## 2 TRUE 253068.0
The average salary of female placed members is 253068.0
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
The p-value is 0.00234
The p-value is 0.00234<0.05. We have sufficient evidence to reject the null hypothesis. Therefore, we conclude that there is significant difference between the female and male average salaries.