T-Test Analysis based on “A Dean’s Dilemma”"

3a

Dean<-read.csv("C:/Users/here_is_sachin/Downloads/Data - Deans Dilemma.csv")
View(Dean)
placed <- Dean[ which(Dean$Placement_B==1), ]

3b

by(placed$Salary, placed$Gender, mean)
## placed$Gender: F
## [1] 253068
## -------------------------------------------------------- 
## placed$Gender: M
## [1] 284241.9

3c

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

As p-value is less than 0.005 so we reject the null hypothesis that is male and female placed have equal salary.