1) Read the data using read.csv

dean_dil.df <- read.csv(“Data - Deans Dilemma.csv”)

2) View the data frame

View(dean_dil.df)

3)Summarize the data set using summary()

summary(dean_dil.df)

4)Summarize the data set using describe()

library(psych) describe(dean_dil.df)

5)Measure median salary of the students

summary(dean_dil.df$Salary)

6)Measure the percentage of students who were placed, correct to 2 decimal places

table5 <- prop.table(table(dean_dil.df$Placement_B))*100 round(table5, digits=2)

7)Create placed dataframe that contains a subset of only placed students

placed.df<- dean_dil.df[ which(dean_dil.df$Placement_B==‘1’), ] View(placed.df)

8) Measure the median salary of students who were placed.

summary(placed.df$Salary)

9) Create a table showing the mean salary of males and females, who were placed.

aggregate(placed.df\(Salary, by=list(Gender=placed.df\)Gender), mean)

10) Generate histogram showing breakup of the MBA performance of placed students

hist(placed.df$Percent_MBA, main= “MBA performance of placed students”, xlab= “MBA Percentage”, ylab= “Count”, xlim= c(50,80), ylim= c(0,150), breaks = 2, col= “gray” )

11) Create notplaced dataframe that contains a subset of only students not placed

notplaced.df<- dean_dil.df[ which(dean_dil.df$Placement_B==‘0’), ] View(notplaced.df)

12) Draw two histograms comparing MBA performance of Placed & Not Placed students, as follows:

par(mfrow=c(1,2))

hist(placed.df$Percent_MBA, main= “MBA performance of placed students”, xlab= “MBA Percentage”, ylab= “Count”, xlim= c(50,80), ylim= c(0,150), breaks = 2, col= “gray” )

hist(notplaced.df$Percent_MBA, main= “MBA performance of not placed students”, xlab= “MBA Percentage”, ylab= “Count”, xlim= c(50,80), ylim= c(0,30), breaks = 2, col= “gray” ) par(mfrow=c(1,1))

13) Draw two boxplots comparing salary distribution of placed males and females

boxplot(placed.df\(Salary~placed.df\)Gender, horizontal= TRUE, yaxt=“n”, main= “Comparison of Salaries of Males and Females”, xlab= “Salary”, ylab= “Gender” ) axis(side=2, at=c(1,2), labels=c(“Females”, “Males”))

14) Create a dataframe placedET representing students placed after the MBA and

gave MBA entrance test before admission

placedET.df<- dean_dil.df[ which(dean_dil.df\(Placement_B=='1'& dean_dil.df\)S.TEST==‘1’ ), ] View(placedET.df)

15) Draw a Scatter Plot Matrix {Salary, Percent_MBA, Percentile_ET} with placedET.

library(car) scatterplotMatrix(formula= ~ Salary + Percent_MBA + Percentile_ET, cex=1.0, data= placedET.df, main= “Scatter Plot Matrix” ) #16) 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. t.test(placed.df\(Salary~placed.df\)Gender)