This is the analysis of data available on a B-school.
The median of salary is:
median(dilemma.df$Salary)
## [1] 240000
The percentage of students who were placed: correct to 2 decimal places.
mytable<-prop.table(table(dilemma.df$Placement_B))*100
format(round(mytable, 2), nsmall = 2)
##
## 0 1
## "20.20" "79.80"
placed <- dilemma.df[ which(dilemma.df$Placement_B=="1"), ]
The median salary of students who were placed:
median(placed$Salary)
## [1] 260000
Table showing the mean salary of males and females, who were placed:
aggregate(placed$Salary,by=list(Gender=placed$Gender),mean)
## Gender x
## 1 F 253068.0
## 2 M 284241.9
hist(placed$Percent_MBA,breaks = 3,col = "lightblue3",main = "MBA Performance of placed students",xlab = "MBA Percentage",ylab = "Count")
notplaced<-dilemma.df[which(dilemma.df$Placement_B=="0"),]
hist(placed$Percent_MBA,breaks = 3,col = "lightblue3",main = "MBA Performance of placed students",xlab = "MBA Percentage",ylab = "Count")
hist(notplaced$Percent_MBA,breaks = 3,col = "lightblue3",main = "MBA Performance of notplaced students",xlab = "MBA Percentage",ylab = "Count")
boxplot(Salary ~ Gender, data=placed, horizontal=TRUE, yaxt="n",
ylab="Gender", xlab="Salary",
main="Comparision of Salaries of Males and Females")
axis(side=2, at=c(1,2), labels=c("Females", "Males"))
placedET<-placed[which(placed$S.TEST=="1"),]
scatterplotMatrix(formula = ~ Salary + Percent_MBA + Percentile_ET, cex=0.6,data=placedET,
diagonal="density",main="Sactter Plot Matrix")