R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

Task 3a

setwd("F:/!!!rd trimester/Data Analytics/DAY 6")
data.df<-read.csv(paste("Deans Dilemma.csv", sep = ""))

Task 3b

placed<-data.df[which(data.df$Placement_B==1),]
aggregate(placed$Salary,by=list(Gender=placed$Gender),mean)
##   Gender        x
## 1      F 253068.0
## 2      M 284241.9

Task 3c

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

TAsk 3d

aggregate(placed$Salary,by=list(Gender=placed$Gender),mean)
##   Gender        x
## 1      F 253068.0
## 2      M 284241.9
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

p-value = 0.00234

Q6: Interpreting the Results

-The t-test showed there was a significant difference between salary of Males & Females. Males get higher salsry than Females.

-The average salary of the male MBAs is higher at average salary of 284241.9 as compared to the average salary of female MBAs which was 253068.