TASK 3d

List of questions based on “A Dean’s Dilemma: Selection of Students for the MBA Program”

mbadean<-read.csv("Data - Deans Dilemma.csv")
View(mbadean)

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

mean(mbadean$Salary)
## [1] 219078.3
malesalary <- mbadean[ which(mbadean$Gender=='M' & mbadean$Placement_B== 1), ]
femalesalary <- mbadean[ which(mbadean$Gender=='F' & mbadean$Placement_B== 1), ]

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

mean(malesalary$Salary)
## [1] 284241.9
mean(femalesalary$Salary)
## [1] 253068
x <- (malesalary$Salary)
y <- (femalesalary$Salary)
boxplot(mbadean$Salary~mbadean$Gender,horizontal=TRUE,yaxt="n",ylab="Gender",xlab ="salary of the employee",main="salaries of the employees based on gender")
axis(side=2,at=c(1,2),labels = c("female","male"))

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 = mbadean)
## 
##  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