deans.df<- read.csv(paste("Data - Deans Dilemma.csv",sep = ""))
placed.df <- deans.df[which(deans.df$Placement_B==1),]
View(placed.df)
salary.mean <- aggregate(Salary ~ Gender, data = placed.df,mean )
salary.mean
## Gender Salary
## 1 F 253068.0
## 2 M 284241.9
mean(placed.df$Salary[placed.df$Gender=="M"])
## [1] 284241.9
mean(placed.df$Salary[placed.df$Gender=="F"])
## [1] 253068
library(MASS)
library(psych)
t.test(Salary ~ Gender, data = placed.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
p-value = 0.00234 (p<0.05)
Since the p-value is very less 0.05, we wil reject the null hyposthesis.