#3d
dean.df <- read.csv(paste("Data - Deans Dilemma.csv",sep=""))
View(dean.df)
#3d 1
placedstudents.df <- dean.df[which(dean.df$Placement=="Placed"),];
aggregate( placedstudents.df$Salary,by=list(Gender=placedstudents.df$Gender),mean)
## Gender x
## 1 F 253068.0
## 2 M 284241.9
#3d 2
mean(placedstudents.df$Salary[which(placedstudents.df$Gender =="M")],)
## [1] 284241.9
Average salary on male is 284241
#3d 3
mean(placedstudents.df$Salary[which(placedstudents.df$Gender =="F")],)
## [1] 253068
average salary of Female is 253068
#3d 4
t.test(Salary~Gender, placedstudents.df)
##
## 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