This is an R Markdown document which has a couple of commands related to the case A Dean’s Dilemma.

Opening and Viewing the Dean’s Dilemma dataset in R

setwd("D:/R Internship")
mba.df<-read.csv(paste("Data - Deans Dilemma.csv",sep = ""))
placed<-mba.df[mba.df$Placement_B==1,]
View(placed)

TASK 3d

1.Submit your R code that creates a table showing the mean salary of males and females, who were placed.

placed$Gender.B=factor(placed$Gender.B, levels = c(0,1), 
                       labels =c("Male","Female"))
aggregate(placed$Salary, by=list(Gender.B=placed$Gender.B),mean)
##   Gender.B        x
## 1     Male 284241.9
## 2   Female 253068.0

2.What is the average salary of male MBAs who were placed?

The average salary of male MBAs is Rs.284241.9.

3.What is the average salary of female MBAs who were placed?

The average salary of female MBAs is Rs.253068.0.

4.Submit R code 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)
## 
##  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

5.What is the p-value based on the t-test?

The p-value is 0.00234

6.Please interpret the meaning of the t-test, as applied to the average salaries of male and female MBAs.

The t-test results show that the p-value is less than 0.05 (95% confidence interval). This means that the alternate hypothesis is true, which is that there is a significant difference between the salaries of Men and Women. Going by the average salaries given above for both genders, we can safely conclude that the average salaries of male MBAs are significantly higher than those of female MBAs.