d.df<-read.csv("Data - Deans Dilemma.csv", sep = ",")
summary(d.df$Salary)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0 172800 240000 219078 300000 940000
mytable <- with(d.df, table(Salary))
mytable # frequencies
## Salary
## 0 120000 132000 144000 150000 156000 162000 168000 177600 180000
## 79 5 1 2 7 1 2 1 1 24
## 185000 190000 192000 198000 200000 204000 210000 216000 218000 220000
## 1 1 1 2 7 4 5 7 2 7
## 224000 225000 230000 231000 233000 235000 236000 240000 250000 252000
## 1 1 2 1 1 1 2 28 29 4
## 255000 260000 263000 264000 265000 267000 268000 270000 275000 276000
## 1 10 1 2 8 1 1 9 7 3
## 278000 280000 282000 285000 287000 290000 295000 300000 320000 325000
## 1 5 1 1 1 3 2 43 2 2
## 330000 336000 340000 350000 360000 366000 375000 380000 385000 390000
## 1 3 2 7 9 1 1 1 1 2
## 393000 400000 411000 420000 425000 426000 428000 450000 476000 480000
## 1 8 1 1 1 1 1 4 1 1
## 500000 530000 550000 650000 690000 940000
## 3 1 1 1 2 1
mytable <- with(d.df, table(Placement))
mytable # frequencies
## Placement
## Not Placed Placed
## 79 312
x=aggregate(d.df$Salary, by=list(d.df$Gender), FUN=mean)
mytable <- xtabs(~ Gender+Salary+Placement, data=d.df)
mytable
## , , Placement = Not Placed
##
## Salary
## Gender 0 120000 132000 144000 150000 156000 162000 168000 177600 180000
## F 30 0 0 0 0 0 0 0 0 0
## M 49 0 0 0 0 0 0 0 0 0
## Salary
## Gender 185000 190000 192000 198000 200000 204000 210000 216000 218000
## F 0 0 0 0 0 0 0 0 0
## M 0 0 0 0 0 0 0 0 0
## Salary
## Gender 220000 224000 225000 230000 231000 233000 235000 236000 240000
## F 0 0 0 0 0 0 0 0 0
## M 0 0 0 0 0 0 0 0 0
## Salary
## Gender 250000 252000 255000 260000 263000 264000 265000 267000 268000
## F 0 0 0 0 0 0 0 0 0
## M 0 0 0 0 0 0 0 0 0
## Salary
## Gender 270000 275000 276000 278000 280000 282000 285000 287000 290000
## F 0 0 0 0 0 0 0 0 0
## M 0 0 0 0 0 0 0 0 0
## Salary
## Gender 295000 300000 320000 325000 330000 336000 340000 350000 360000
## F 0 0 0 0 0 0 0 0 0
## M 0 0 0 0 0 0 0 0 0
## Salary
## Gender 366000 375000 380000 385000 390000 393000 400000 411000 420000
## F 0 0 0 0 0 0 0 0 0
## M 0 0 0 0 0 0 0 0 0
## Salary
## Gender 425000 426000 428000 450000 476000 480000 500000 530000 550000
## F 0 0 0 0 0 0 0 0 0
## M 0 0 0 0 0 0 0 0 0
## Salary
## Gender 650000 690000 940000
## F 0 0 0
## M 0 0 0
##
## , , Placement = Placed
##
## Salary
## Gender 0 120000 132000 144000 150000 156000 162000 168000 177600 180000
## F 0 1 0 1 4 0 1 0 1 8
## M 0 4 1 1 3 1 1 1 0 16
## Salary
## Gender 185000 190000 192000 198000 200000 204000 210000 216000 218000
## F 1 1 0 1 4 1 4 4 1
## M 0 0 1 1 3 3 1 3 1
## Salary
## Gender 220000 224000 225000 230000 231000 233000 235000 236000 240000
## F 3 0 0 2 0 0 0 1 10
## M 4 1 1 0 1 1 1 1 18
## Salary
## Gender 250000 252000 255000 260000 263000 264000 265000 267000 268000
## F 9 2 0 4 0 1 0 0 0
## M 20 2 1 6 1 1 8 1 1
## Salary
## Gender 270000 275000 276000 278000 280000 282000 285000 287000 290000
## F 0 1 1 1 1 0 0 1 1
## M 9 6 2 0 4 1 1 0 2
## Salary
## Gender 295000 300000 320000 325000 330000 336000 340000 350000 360000
## F 1 13 1 0 0 1 0 2 2
## M 1 30 1 2 1 2 2 5 7
## Salary
## Gender 366000 375000 380000 385000 390000 393000 400000 411000 420000
## F 1 1 0 0 0 1 1 0 0
## M 0 0 1 1 2 0 7 1 1
## Salary
## Gender 425000 426000 428000 450000 476000 480000 500000 530000 550000
## F 0 0 0 1 0 0 0 0 0
## M 1 1 1 3 1 1 3 1 1
## Salary
## Gender 650000 690000 940000
## F 1 0 0
## M 0 2 1
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:
summary(cars)
## speed dist
## Min. : 4.0 Min. : 2.00
## 1st Qu.:12.0 1st Qu.: 26.00
## Median :15.0 Median : 36.00
## Mean :15.4 Mean : 42.98
## 3rd Qu.:19.0 3rd Qu.: 56.00
## Max. :25.0 Max. :120.00
You can also embed plots, for example:
Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.