-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCEO_Compensation_EDA.Rmd
236 lines (190 loc) · 7.59 KB
/
CEO_Compensation_EDA.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
---
title: "CEO Compensation EDA"
author: "Afsar Ali"
output:
prettydoc::html_pretty:
theme: Cayman
highlight: github
df_print: paged
toc: yes
toc_depth: '4'
---
```{r echo=TRUE}
# Course: BUAN 5210
# Title: CEO Compensation EDA
# Purpose: Final Project StoryTelling
# Date: Dec 7th, 2017
# Author: Afsar Ali
```
```{r echo=TRUE, message=FALSE, warning=FALSE}
# Clear working environment
#m(list=ls(all=TRUE))
# The tidyverse package contains ggplot2, tibble, tidyr, readr, purr, and dplyr among others
library(tidyverse)
# The gridExtra package contains grid.arrange function used to combine plots
library(gridExtra)
# The GGally package contains ggpairs which is a custom correlation graph for ggplot2
library(GGally)
# Load gridExtra so can plot more than one graph with grid.arrange
library(gridExtra)
#load other packages
library(psych)
```
```{r echo=TRUE, message=FALSE, warning=FALSE}
#Load and Review data
dat <- read.csv("ECON5100_project_data.csv", header = TRUE)
#Make a subset of relevent data
dat1 <- select(dat, "AT","NI", "CH", "DLTT", "PRCH_C", "PRCL_C", "TDC2", "SALARY", "BONUS", "OTHCOMP", "AGE", "GENDER")
dat1<- mutate (dat1, ageg = cut(AGE, 6)) #grouping age by 6
datm <- dat1 %>% filter(GENDER =="MALE") #male only
datf <- dat1 %>% filter(GENDER =="FEMALE") #female only
#attach the file for use
attach(dat1)
```
##Executive Summary
The focus of this analysis is to determine compensation of Chief Executive Officers (CEOs) in US publicly traded companies by age and gender. The data set is consisted of 114 factors (columns) and 8300 data points (rows). Following are the initial exploratory data analysis.
###Age and Gender Distribution
Let's explore Salary and Gender Distribution by Age
+ The CEO Compensation Data shows:
- 93% of the CEOs are middle-aged men
- Only 508 Female CEOs
```{r echo=TRUE, message=FALSE, warning=FALSE}
grid.arrange(
ggplot(dat, aes(x = AGE, y = SALARY, color = GENDER)) +
geom_point() +
stat_density2d() +
ggtitle("Mostly Middle aged Men", sub = "Small number of Female observations"),
ggplot(dat, aes(x = AGE, y = SALARY, color = GENDER)) +
geom_point() +
stat_density2d(aes(fill =..density..), geom = "raster", contour = FALSE) +
ggtitle("Mostly Middle aged Men", sub = "Heat map, light color indicates more observations"),
ncol = 2
)
```
###CEO Average Compensation by Gender and Age group
+ Male CEO has larger outliers
+ Average female compensation seems lower than men
Let's look closely to find deeper insight
```{r echo=TRUE, message=FALSE, warning=FALSE}
ggplot(dat1, aes(ageg, TDC2, fill= GENDER)) +
geom_boxplot() +
theme(axis.text.x = element_text(angle=65, vjust=0.6)) +
labs(fill = "Gender") +
# Add and improve titles and labels
ggtitle("Average female compensation seems lower than men") +
ylab("Average Compensation by Thousands") +
xlab("Age Group") +
scale_x_discrete(labels=c("Under 40", "40 to 51", "51 to 62", "62 to 73", "73 to 84", "84 +", "NA")) +
ylim(-5000, 30000)
```
###Male Vs Female Average Compensation
Let's look at the difference in compensation by Gender
+ Older females has higher compensation although they account for very small share of our observation
+ Middle age males has higher compensation
Why are older females observed to have higher compensation?
```{r echo=TRUE, message=FALSE, warning=FALSE}
grid.arrange(
#Male Data
datf %>%
group_by(ageg) %>%
summarise(Avg_Com = mean(TDC2)) %>%
ggplot(aes(x = ageg, y = Avg_Com, )) +
geom_bar(stat="identity", position = "dodge", color = "black") +
labs(fill = "Gender") +
# Add and improve titles and labels
ggtitle("Older female higher compensation") +
ylab("Average Compensation by Thousands") +
xlab("Female Age Group") +
scale_x_discrete(labels=c("Under 40", "40 to 51", "51 to 62", "62 to 73", "73 to 84", "84 +", "NA")) +
ylim(0, 6000) +
theme_classic() +
theme(axis.ticks.x = element_blank(),
axis.ticks.y = element_blank(),),
#Female Data
datm %>%
group_by(ageg) %>%
summarise(Avg_Com = mean(TDC2)) %>%
ggplot(aes(x = ageg, y = Avg_Com, )) +
geom_bar(stat="identity", position = "dodge", color = "black") +
labs(fill = "Gender") +
# Add and improve titles and labels
ggtitle("Middle-age males higher compensation") +
ylab("Average Compensation by Thousands") +
xlab("Male Age Group") +
scale_x_discrete(labels=c("Under 40", "40 to 51", "51 to 62", "62 to 73", "73 to 84", "84 +", "NA")) +
ylim(0, 6000) +
theme_classic() +
theme( axis.ticks.x = element_blank(),
axis.title.y = element_blank(),
axis.text.y = element_blank(),
axis.ticks.y = element_blank()),
# panel.background = element_blank()),
ncol = 2
)
```
###Average compensation for both genders
Let's compare total compensation side by side
+ There are no female executives over 84
+ Female age group has larger growth from 62-73 to 73-84
```{r echo=TRUE, message=FALSE, warning=FALSE}
# Average profit by region and category
dat1 %>%
group_by(ageg, GENDER) %>%
summarise(Avg_Com = mean(TDC2)) %>%
ggplot(aes(x = ageg, y = Avg_Com, fill = reorder(GENDER, desc(Avg_Com)))) +
geom_bar(stat="identity", position = "dodge", color = "black") +
geom_hline(yintercept = 0, color = "black") +
labs(fill = "Gender") +
# Add and improve titles and labels
ggtitle("Middle age female age groups has a high compensation") +
ylab("Average Compensation by Thousands") +
xlab("Age Group") +
scale_x_discrete(labels=c("Under 40", "40 to 51", "51 to 62", "62 to 73", "73 to 84", "84 +", "NA")) +
scale_fill_manual(values = c("blue", "grey70"))+
theme_classic() +
theme(axis.ticks.x = element_blank(),
axis.ticks.y = element_blank(),)
```
###Older females observed to have significantly higher bonus
+ Older females receive high bonus compared to males and other females
+ Older females high bonus makes the largest impact on why older females observed to have higher compensation.
```{r echo=TRUE, message=FALSE, warning=FALSE}
grid.arrange(
#Male Data
datf %>%
group_by(ageg) %>%
summarise(Avg_Com = mean(BONUS)) %>%
ggplot(aes(x = ageg, y = Avg_Com, )) +
geom_bar(stat="identity", position = "dodge", color = "black") +
# Add and improve titles and labels
ggtitle("Female 73 to 84 gets a large Bonus") +
ylab("Average Bonus by Thousands") +
xlab("Female Age Group") +
scale_x_discrete(labels=c("Under 40", "40 to 51", "51 to 62", "62 to 73", "73 to 84", "84 +", "NA")) +
ylim(0, 2000) +
theme_classic() +
theme(axis.ticks.x = element_blank(),
axis.ticks.y = element_blank(),),
#Female Data
datm %>%
group_by(ageg) %>%
summarise(Avg_Com = mean(BONUS)) %>%
ggplot(aes(x = ageg, y = Avg_Com, )) +
geom_bar(stat="identity", position = "dodge", color = "black") +
# Add and improve titles and labels
ggtitle("Male Bonus similar accross age group") +
ylab("Average Compensation by Thousands") +
xlab("Male Age Group") +
scale_x_discrete(labels=c("Under 40", "40 to 51", "51 to 62", "62 to 73", "73 to 84", "84 +", "NA")) +
ylim(0, 2000) +
theme_classic() +
theme( axis.ticks.x = element_blank(),
axis.title.y = element_blank(),
axis.text.y = element_blank(),
axis.ticks.y = element_blank()),
# panel.background = element_blank()),
ncol = 2
)
```
##Final Thoughts
Analysis of Chief Executive Officers (CEOs) compensation seems to show us that Males and Females has different average compensation distribution. Older females having higher average compensation and Males having a normal distribution, due to higher bonus observed for older females