setwd("C:/Office")
read.csv("Data - Deans Dilemma.csv")
DataDeansDilemma.df<-read.csv(paste("Data - Deans Dilemma.csv"), sep=",")
View(DataDeansDilemma.df)
placed.df <- DataDeansDilemma.df[which(DataDeansDilemma.df$Placement_B ==1),]
Task 3d. 1.
aggregate(placed.df$Salary~placed.df$Gender, FUN = mean)
Task 3d. 2.
Mean Salary of males who were placed = 284241.9
Task 3d. 3
Mean Salary of females who were placed = 253068
Task 3d. 4 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(placed.df$Salary~placed.df$Gender, var.equal = TRUE)
##
## Two Sample t-test
##
## data: placed.df$Salary by placed.df$Gender
## t = -2.7597, df = 310, p-value = 0.00613
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -53400.627 -8947.012
## sample estimates:
## mean in group F mean in group M
## 253068.0 284241.9
Task 3d. 5
p-value based on the t-test = 0.00613
Task 3d. 6 The t-test shows that there is a significant difference between mean salaries of male and female. Male MBAs earn more that Female MBAs.