This is an R Markdown document displaying the results of t-test performed on Dean’s Dilemma dataset.Also, it shows the calculations performed regarding the mean salaries of Males and Females.
setwd("F:/R-Internship/Course related files")
placed.df<-read.csv(paste("Data - Deans Dilemma.csv",sep=""))
View(placed.df)
aggregate(placed.df$Salary,by=list(placed.df$Gender),FUN=mean)
## Group.1 x
## 1 F 193288.2
## 2 M 231484.8
#ANSWER: 284241.9
#ANSWER: 253068.0
t.test(Salary~Gender,data=placed.df)
##
## Welch Two Sample t-test
##
## data: Salary by Gender
## t = -2.69, df = 278.55, p-value = 0.007577
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -66149.06 -10244.26
## sample estimates:
## mean in group F mean in group M
## 193288.2 231484.8
#ANSWER: The p-value is 0.00234
#ANSWER: The t-test results show that the p-value is less than 0.05 (95% confidence interval). So, there will be a significant difference between the mean difference. Hence, the hyposthesis "The average salary of the male MBAs is higher than the average salary of female MBAs." is true.