3a.Reading the ‘Deans Dilemma.csv’ file in to R.

The RMD document contains the t-test Analysis of the Deans Dilemma Case Study.

JainU_Data <- read.csv(paste("Data-Deans Dilemma.csv",sep = ""))
attach(JainU_Data)

3b.Average salary of Male and Female Students who were placed.

Placed <- subset(JainU_Data,Placement=='Placed')
aggregate(Salary~Gender,data=Placed,FUN = mean)
##   Gender   Salary
## 1      F 253068.0
## 2      M 284241.9

Since the average salary of males is tend to be slightly more than females. Their accounts to a slight amount of Gender gap.

3c.Use R to run a t-test to test the following hypothesis:

H1: The average salary of the male MBAs is higher than the average salary of female MBAs. Assumtions made: #The variables are continuous and independent #The variables are normally distributed #The variances in each group are equal

If we consider both placed and not placed MBA male and female students.

t.test(Salary~Gender,data = JainU_Data)
## 
##  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

Here P(Value)<0.05,we can reject the null hypothers.

And, if we take into account of only placed MBA male and Female Students.

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

As P(value)<0.05, we can reject the null hypothesis.

SO our assumption the Average salary of the male MBAs is higher than the female students is TRUE.

3d

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

Placed <- subset(JainU_Data,Placement=='Placed')
aggregate(Salary~Gender,data=Placed,FUN = mean)
##   Gender   Salary
## 1      F 253068.0
## 2      M 284241.9

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

284241.9

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

253068

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.(Who are placed)”

t.test(Salary~Gender,data = JainU_Data)
## 
##  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
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

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

0.0075 (both Placed and Not Placed) 0.00234 (only Placed)

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

As P(value)<0.05, we can reject the null hypothesis. SO our assumption the Average salary of the male MBAs is higher than the female students is TRUE.