A survey was conducted to determine how satisfied employees are with their current role and employer and to study the key factors that affect employee engagement.
The below graphs represent the cross-sectional differences among the 25 employees who responded to this survey:
data <- read.csv("survey.csv")
library(dplyr)
library(stringr)
library(ggplot2)
library(fBasics)
library(data.table)
names(data)
data <- data %>% rename(Age = What.age.group.do.you.belong.to.,
Gender = What.gender.do.you.associate.yourself.with,
Score_Satisfied = How.satisfied.are.you.with.your.current.role.and.employer.,
Salary = What.is.your.current.annual.gross.salary.,
Factors = Mark.the.top.6.factors.that.you.feel.are.important.in.keeping.you.engaged.at.your.current.firm.,
Score_Survey = How.do.you.rate.this.survey.)
data$Income<-str_detect(data$Factors,"Income")
data$Working_Hours<-str_detect(data$Factors,"Working hours")
data$Career_Growth<-str_detect(data$Factors,"Career growth")
data$Ease_of_movement_within_organization<-str_detect(data$Factors,"Ease of movement within the organization")
data$Employee_Development_Programs<-str_detect(data$Factors,"Employee Development Programs")
data$Paid_Leaves<-str_detect(data$Factors,"Paid leaves")
data$Dining_Options<-str_detect(data$Factors,"Dining options")
data$Maternity_Paternity<-str_detect(data$Factors,"Maternity/Paternity")
data$K401_Insurance_Benefits<-str_detect(data$Factors,"401K, Insurance, and other benefits")
data$Offsites<-str_detect(data$Factors,"Offsites")
data$Visa_Sponsorship<-str_detect(data$Factors,"Visa Sponsorship")
data$Percent_Females<-str_detect(data$Factors,"Percentage of females to males")
data$Proximity_Commute<-str_detect(data$Factors,"Proximity to your home / Commute options")
data$Number_Diversity_Projects<-str_detect(data$Factors,"Number and diversity of projects")
data$Promotions<-str_detect(data$Factors,"Promotions")
data$WFH<-str_detect(data$Factors,"Work from home")
data$Diversity<-str_detect(data$Factors,"Diversity")
data$Vacation<-str_detect(data$Factors,"Vacation")
data$Stock_Options<-str_detect(data$Factors,"Stock options")
data$Other<-str_detect(data$Factors,"Other")
data$Salary <- factor(data$Salary,labels=c("0 - 25,000","25,000 - 50,000","50,000 - 75,000","75,000 - 100,000",
"100,000 - 150,000","150,000 - 200,000"))tab1a <- table(data$Gender)
barplot(tab1a,
names.arg=rownames(tab1a),
col=c("maroon","steelblue","gold"),
ylab="Frequency",
xlab="Gender")There is good diversity in the terms of the gender of the respondents, with 12 females, 11 males, and 2 respondents who didn’t prefer to disclose their gender.
tab2a <- with(data,table(Gender,Age))
barplot(tab2a,
beside=TRUE,
ylim=c(0,15),
col=c("maroon","steelblue","gold"),
ylab="Number of Participants",
xlab = "Age groups",
legend.text=rownames(tab2a),
args.legend=list(x="topleft"))Most of the survey respondents belong to the 26-35 age group, as expected. All the males who responded to this survey belong to this age group. Among respondents who didn’t want to disclose their gender, 1 belonged to this age group, while 1 belonged to the 16-25 age group. 3 females who responded to this survey belonged to the 16-25 age group, 8 to the 26-35 age group, while 1 belonged to the 36-50 age group. There doesn’t seem to be much diversity in terms of age groups.
ggplot(data, aes(x=Age)) + geom_bar(aes(fill=factor(Gender))) + facet_grid(Salary ~ Gender)All the employees who responded to this survey, who are below the age of 26, make more than $75,000 anually. More than a half of the respondents make more than $100,000 annually.
par(mfrow = c(1,2))
ggplot(data, aes(x=Gender, y=Score_Satisfied)) + geom_boxplot()ggplot(data, aes(x = Score_Satisfied)) + geom_density(aes(fill=factor(Gender), alpha = 0.4))Females in general seem to be more satisfied with their current role/employer. A high percentage of males have responded to this survey with an employee satisfaction score of 7.
ggplot(data, aes(x=Score_Survey)) + geom_bar(aes(fill=factor(Gender))) + facet_grid(Salary ~ Gender)Males and employees with the highest salaries seem to have a greater appreciation for this survey.
The most important factors that influence employee engagement are summarized below:
stats <- t(basicStats(data[,9:ncol(data)])[c("Sum"),])
stats <- as.data.frame(stats)
setDT(stats, keep.rownames = TRUE)[]
library("wordcloud")
library("RColorBrewer")par(mfrow = c(1,1))
par(mar = rep(0,4))
set.seed(1)
wordcloud(words = stats$rn, freq = stats$Sum, scale=c(2,0.01),
random.order=FALSE,
colors=brewer.pal(8, "Dark2"))ggplot(data, aes(x=Visa_Sponsorship)) + geom_bar(aes(fill=factor(Gender))) + facet_grid(Salary ~ Score_Satisfied)Males, employees with the highest salaries, and those who are relatively satisfied with their current role/employer think that Visa Sponsorship is an important factor that contributes to employee satisfaction.
ggplot(data, aes(x=Career_Growth)) + geom_bar(aes(fill=factor(Gender))) + facet_grid(Salary ~ Score_Satisfied)Males, employees who make more than $100K annually, and those who are highly satisfied with their current role/employer think that Career Growth is an important factor that contributes to employee satisfaction.
ggplot(data, aes(x=Working_Hours)) + geom_bar(aes(fill=factor(Gender))) + facet_grid(Salary ~ Score_Satisfied)Employees who are relatively satisfied with their current role/employer think that the number of hours they work is an important factor that contributes to employee satisfaction.
ggplot(data, aes(x=Income)) + geom_bar(aes(fill=factor(Gender))) + facet_grid(Salary ~ Score_Satisfied)Males, employees with the highest salaries, and those who are relatively satisfied with their current role/employer think that Income is an important factor that contributes to employee satisfaction.
ggplot(data, aes(x=Paid_Leaves)) + geom_bar(aes(fill=factor(Gender))) + facet_grid(Salary ~ Score_Satisfied)Males and employees with mid-range salaries think that the number of paid leaves they get is an important factor that contributes to employee satisfaction.
ggplot(data, aes(x=K401_Insurance_Benefits)) + geom_bar(aes(fill=factor(Gender))) + facet_grid(Salary ~ Score_Satisfied)Males, employees with the highest salaries, and those who are relatively satisfied with their current role/employer think that 401K, Insurance, and other Benefits are important factors that contributes to employee satisfaction.