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)

TASK 3-d:

Question 1: (To create a table showing the mean salary of males and females, who were placed)

aggregate(placed.df$Salary,by=list(placed.df$Gender),FUN=mean)
##   Group.1        x
## 1       F 193288.2
## 2       M 231484.8

Question 2: (What is the average salary of male MBAs who were placed?)

#ANSWER: 284241.9

Question 3: (What is the average salary of female MBAs who were placed?)

#ANSWER: 253068.0

Question 4: (To run a t-test for the Hypothesis “The average salary of the male MBAs is higher than the average salary of female MBAs.”)

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

Question 5: (What is the p-value based on the t-test?)

#ANSWER: The p-value is 0.00234

Question 6: (To interpret the meaning of the t-test, as applied to the average salaries of male and female MBAs.)

#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.