MONTHLY INCOME IN A COMPANY
Instructor: Tan Do Duc
Course: OSTA
Members of group 5:
| Name | ID Student | |
|---|---|---|
| 1 | Phan Mai Dinh | 10622009 |
| 2 | Nguyen Linh Phuong | 10322020 |
| 3 | Bui Huynh Truc Anh | 10622005 |
| 4 | Ha Kieu Anh | 10622002 |
| 5 | Nguyen Minh Quoc | 10322022 |
| 6 | Tran Anh Minh | 10222041 |
Human Resource (HR) analytics plays a crucial role in gaining
insights into various aspects of human resources within an organization.
The analysis of HR data provides valuable information that can lead to
informed decision-making and strategic planning in areas such as talent
management, employee engagement, and organizational effectiveness. In
line with this, our team has chosen to work with a comprehensive HR
analytics data set to devel into the complexities of managing human
capital within a company.
Analyzing this data set is of paramount importance as it allows us to
understand the drivers of employee engagement, retention, and
productivity. By delving into the various features within the dataset,
such as age, education, and job involvement, we can identify patterns
and correlations that shed light on the factors impacting employee
performance and satisfaction. Additionally, the data set equips HR
professionals with the necessary information to make data-driven
decisions related to talent management, compensation, and career
development within the company.
The features included in the data set offer a comprehensive view of
the factors that can significantly affect various aspects of human
resources management. For instance, the employee’s age can provide
insights into generational differences and their impact on job
satisfaction and performance. The department and job level variables
offer valuable data for understanding the distribution of talent and
skills across different organizational levels. Furthermore, the monthly
income and education level columns provide essential information for
evaluating compensation structures and potential correlations between
educational attainment and job performance.
By leveraging the wealth of information embedded in this data set, HR
professionals can gain a holistic understanding of the workforce,
enabling them to optimize talent management strategies, address
potential issues related to employee satisfaction and performance, and
align HR initiatives with the company’s overall strategic
objectives.
In summary, the HR analytics data set serves as a valuable resource for gaining insights into critical aspects of human resources management within an organization. Through comprehensive analysis, the data set promises to unveil crucial patterns and correlations that can inform strategic decision-making, ultimately contributing to the enhancement of organizational effectiveness and employee well-being.
The data set was collected from www.Kaggle.com and was adjusted afterward to be more suitable. The data set was created as a project to focus on HR analytics and aims to provide insights about various aspects of human resources within an organization. This data contains 1480 data points, equivalent to each of the employees from the organization. Originally, the data set contained 38 variables, however, 10 of them are chosen to be the key points of this report which include employee ID, age, department, education, gender, job involvement, job level, monthly income, performance rating and satisfaction.
First, our team observed some charts to identify next statistical steps.
There is a significant difference between the 3 departments: Human
Resources is the lowest with under 500 000, the second position is Sales
with over 3 000 000 and the highest with over 6 000 000 is the Research
& Development department. However, this difference in the total
income per month in each department is because of the difference in the
number of employees in each department. The monthly total income is
nearly proportional to the number of employees in each department.
As we can see from the boxplot, there is evidence to support our belief
that the average income in the 3 departments are nearly the same. We
will test this statement in the further analysis section.
According to the two bar charts above, we can infer that job
satisfaction by gender is nearly proportional to the quantity of
employees in each gender. Thus, it can be observed that job satisfaction
is not dependent on the gender of employees.
The full version of the data set is displayed at the “Appendix”
section.
The relevance of this data set to HR analytics is substantial, as the ability to interpret and analyze employee-related trends is crucial for effective human resource management. By leveraging this data set, organizations can identify patterns and correlations that may contribute to attrition rates, allowing for the development of targeted strategies to enhance employee retention and satisfaction.
The data consist of 11 variables:
EmpID: Employee ID.
Age: Age of the employee.
Department: Department in which the employee
works.
Education: Level of education attained by the
employee. There are 5 levels of education and the higher level, the
higher education.
Gender: Gender of the employee.
JobInvolvement: Employee’s level of job involvement.
There are 4 levels of job involvement and the higher level, the more
contribute work.
JobLevel: Level of the employee’s job position.
There are 5 levels of job and the higher level, the higher
position.
MonthlyIncome: Monthly income of the employee. In
this data set, we do not have the index of monthly income. However,
because of this company is in United Kingdom, we assume that the income
is in pounds
PerformanceRating: Performance rating of the
employee. There are 2 rating which is 3 and 4. The higher rating, the
more effective performance.
JobSatisfaction: Employee’s satisfaction level with
their job. There are 4 levels of satisfaction and the higher level, the
more satisfaction in job.
Satisfied_in_job: From 10th variable from the data set, we add a column to data set which show whether the employee satisfied in job or not. If employee’s satisfaction level is larger than or equal to 3, we consider this employee Satisfies in the job.
The purpose of this part is to visualize the data to gain insights that will help us realize what factors affect the monthly income of employee in this company.
Job level:
Each job level corresponds to a specific monthly income, with higher job levels associated with greater monthly earnings. Notably, job level 5 stands out as the highest, yielding an impressive monthly income of around $19,000. It can be seen clearly that job level have a effect on monthly income.
In figure 7, there is a significant difference in monthly income between each Job Level, but in the average monthly incomes between 3 departments in a Job Level are nearly the same.
Education level:
The majority of the highest average monthly incomes were observed in Education Level 5, exceeding 8,000. In contrast, the average monthly incomes across the other four education levels were relatively consistent, ranging between approximately 5,800 and 6,900(Figure 8). At first glance, it appears that Education Level may influence average monthly income.
Examining figure 7 and figure 9 reveals a discernible trend: as the job or education level increases, the average monthly income also rises across three distinct departments—Human Resources, Research and Development, and Sales. Noteworthy instances include the highest average monthly income of approximately around 10,000 within Sales at Education Level 4. Our team will test if there is any difference between three departments at a Education Level in the further analysis section.
Performance Rating:
Generally, the average monthly income between the two performance
ratings in the 3 departments: Human Resources, Research &
Development, and Sales are considerably the same.
Job Involvement:
Figure 12 verifies that Human Resources, specifically in Job Involvement
4, outperformed all other departments across all four Job Involvement
categories. It recorded the highest average monthly income, exceeding
8,000, while the lowest average, approximately 4,800, was observed in
Job Involvement 4 within the Research and Development department.
Overall, the Research & Development department and Sales department
in the all 4 job involvements are nearly the same, only Human Resources
department has the most different performance.
Our team uses the one-factor analysis of variances technique to compare employees’ monthly income in three departments. After the test, if the monthly income of employees in three departments are different, we use Tukey multiple comparisons procedure to construct the confidence intervals.
We aim to test whether the average monthly incomes of employees in the three departments are the same. As a result, we develop the following testing hypothesis: \[ H_o: \mu_1 = \mu_2 = \mu_3 \textit{ versus } H_a: \textit{at least one pair of means are different from each other} \] The formulas:
SSTr: Sum of squares for treatments:
\[ \text{SSTr }= \sum_{i=1}^{k}n_i \overline{x_i}^2-n_T\overline{x}^2 \] \(k-1\): the degrees of freedom for the sum of squares for treatments.
\(n_T\): the total sample size of the data set.
SSE: Sum of squares for error:
\[ \text{SSE }= \sum_{i=1}^{k}\sum_{j=1}^{n_i}x_\textit{ij}^2-\sum_{i=1}^{k}n_i \overline{x_i}^2 \] \(n_T-k\): the degrees of freedom for the sum of squares for error.
SST: Total sum of squares:
\[ \text{SST }= \text{SSTr }+\text{SSE }=\sum_{i=1}^{k}\sum_{j=1}^{n_i}x_\textit{ij}^2 -n_T\overline{x}^2 \] MSTr: Mean squares for treatments:
\[ \text{MSTr }= \frac{\text{SSTr} }{\text{degrees of freedom}}= \frac{\text{SSTr}}{k-1} \] MSE: Mean squares error:
\[ \text{MSE }= \frac{\text{SSE} }{\text{degrees of freedom}}= \frac{\text{SSE}}{n_T - k} \] F-statistic
\[ \textit{F }= \frac{\text{MSTr} }{\text{MSE}} \backsim\textit{F }_{\text{k-1,}n_T-k} \] p_value:
\[ \textit{p_value}= P(X\geq \textit{F }) \] The form of an analysis of variance table:
| Source | Degrees of freedom | Sum of squares | Mean squares | F-statistic | p_value |
|---|---|---|---|---|---|
| Treatments | \(k-1\) | SSTr | \(\text{MSTr }= \frac{\text{SSTr}}{k-1}\) | \(\textit{F }= \frac{\text{MSTr} }{\text{MSE}}\) | \(P(\textit{F }_{\text{k-1,}n_T-k}\geq \textit{F })\) |
| Error | \(n_T-k\) | SSE | \(\text{MSE }= \frac{\text{SSE}}{n_T - k}\) | ||
| Total | \(n_T-1\) | SST |
Hypothesis testing at a 5% significance level (\(\alpha\) = 0.05):
\[ H_o: \mu_1 = \mu_2 = \mu_3 \textit{ versus } H_a: \textit{at least one pair of means are different from each other}\\ \] \(\mu_1 : \textit{the mean of employee's monthly income in Research } \& \textit{Development} \\\) \(\mu_2 : \textit{the mean of employee's monthly income in Sales} \\\) \(\mu_3 : \textit{the mean of employee's monthly income in Human Resources} \\\)
We use the R to compute calculations. The code is as follows:
# Fit the ANOVA model(the one-factor analysis of variances technique)
hypothesis1 <- data.frame(Department=Data$Department,
MonthlyIncome=Data$MonthlyIncome)
model <- aov(MonthlyIncome ~ Department, data = hypothesis1)
#Construct to table
summary_table <- summary(model)
anova_df_1 <- data.frame(
Source = rownames(summary_table[[1]]),
Degrees_of_freedom = summary_table[[1]][, "Df"],
Sum_of_Squares = summary_table[[1]][, "Sum Sq"],
Mean_square = summary_table[[1]][, "Mean Sq"],
F_statistic= summary_table[[1]][, "F value"],
P_Value = summary_table[[1]][, "Pr(>F)"]
)
knitr::kable(anova_df_1)
| Source | Degrees_of_freedom | Sum_of_Squares | Mean_square | F_statistic | P_Value |
|---|---|---|---|---|---|
| Department | 2 | 146144668 | 73072334 | 3.317937 | 0.0364977 |
| Residuals | 1477 | 32528599567 | 22023426 | NA | NA |
From the table, we have:
F-statistic:
## [1] 3.317937
p_value:
## [1] 0.03649772
Since \(\textit{p_value } = 0.03649772 <
0.05\),
the null hypothesis is rejected at the 5% significance level. Thus,
there is sufficient evidence that at least the monthly incomes of one
pair department are different.
We additionally perform the Tukey multiple comparison procedure to identify any differences among means values and quantify the extent of those differences. The R code for this procedure is as follows:
hsd_results <- TukeyHSD(model,conf.level=.95)
# Extract results to a data frame
tukey_df <- as.data.frame(hsd_results$Department)
tukey_df$CI_low <- hsd_results$lower[, "lwr"]
tukey_df$CI_high <- hsd_results$upper[, "upr"]
# View the data frame
knitr::kable(tukey_df)
| diff | lwr | upr | p adj | |
|---|---|---|---|---|
| Research & Development-Human Resources | -374.1429 | -1805.73254 | 1057.447 | 0.8129594 |
| Sales-Human Resources | 312.2298 | -1168.80611 | 1793.266 | 0.8739024 |
| Sales-Research & Development | 686.3727 | 58.09903 | 1314.646 | 0.0282345 |
The 95% confidence interval for the difference between Research & Development and Human Resources is
\[ \mu_1 -\mu_3 \in (-1805.73254,1057.447) \]
Since the confidence interval contains 0, there is evidence that Research & Development and Human Resources do not have significant difference in monthly incomes with 95% confidence interval.
The 95% confidence interval for the difference between Sales and Human Resources is \[ \mu_2 -\mu_3 \in (-1168.80611,1793.266) \] Since the confidence interval contains 0, there is evidence that Sales and Human Resources do not have significant difference in monthly incomes with 95% confidence interval. However, according to the plot 1, the average income in Sales is likely greater than in Human Resources.
The 95% confidence interval for the difference between Sales and Research & Development is \[ \mu_2 -\mu_1 \in (58.09903,1314.646) \] Since the confidence interval does not contain 0, it is plausible that Sales and Research & Development have different monthly incomes with 95% confidence level. Additionally,the employees in Sales department earn more than those in Research & Development
After using the ANOVA technique, we can conclude that the average income of the 3 departments are not the same and the Tukey multiple comparison procedure showed that the Sales department has the highest average income among all.
In this part, our team will test whether the monthly incomes between job levels are different or not. If they are not the same, we will continue to test the monthly incomes between 3 departments in the same Job Level.
To compare monthly incomes based on job levels we apply the same
method as part 1. We want to test whether the means of the monthly
income between each job levels are the same.
Hence, we formulate the testing hypothesis at the 1% significance level
as follows:
\[ H_o: \mu_1 = \mu_2 = \mu_3 = \mu_4 =\mu_5 \textit{ versus } H_a: \textit{at least one pair of means are different from each other}\\ \] \(\mu_1 : \textit{the mean of employee's monthly income of Employees with Job Level 1}\\\) \(\mu_2 : \textit{the mean of employee's monthly income of Employees with Job Level 2} \\\) \(\mu_3 : \textit{the mean of employee's monthly income of Employees with Job Level 3} \\\) \(\mu_4 : \textit{the mean of employee's monthly income of Employees with Job Level 4 } \\\) \(\mu_5 : \textit{the mean of employee's monthly income of Employees with Job Level 5} \\\)
The boxplot distribute the monthly income of each job level are generated:
It is cleared that when the job level is higher, the monthly salary
increases.
The code for computation is:
# Perform the ANOVA
dt = Data
Hypothesis2 <- data.frame(Joblevel = dt$JobLevel, Income = dt$MonthlyIncome)
Hypothesis2$Joblevel <- as.character(Hypothesis2$Joblevel)
tryCatch({
Model <- aov(Income ~ Joblevel, data = Hypothesis2)
# Generate the summary table
Summary_table <- summary(Model)
}, error = function(e) {
print(paste("An error occurred: ", e$message))
})
# Convert the summary to a data frame
Modl_table <- data.frame(Summary_table[[1]])
colnames(Modl_table) <- c("Degrees_of_freedom", "Sum_of_Squares",
"Mean_square", "F_statistic", "P_Value")
knitr::kable(Modl_table)
| Degrees_of_freedom | Sum_of_Squares | Mean_square | F_statistic | P_Value | |
|---|---|---|---|---|---|
| Joblevel | 4 | 30195334992 | 7548833748 | 4490.799 | 0 |
| Residuals | 1475 | 2479409243 | 1680955 | NA | NA |
From the table, we have:
F-statistic:
## [1] 4490.799
p_value:
## [1] 0
Since \[\textit{p_value } = 0 < 0.01,\]
the null hypothesis is rejected at the 1% significance level. Thus, there is sufficient evidence that at least the monthly incomes of one pair job levels are different.
We additionally perform the Tukey multiple comparison procedure to
identify any differences among means values and quantify the extent of
those differences. The R code for this procedure is as follows:
#Tukey
hsd_results <- TukeyHSD(Model,conf.level=.99)
# Extract results to a data frame
tukey_df <- as.data.frame(hsd_results$Joblevel)
tukey_df$CI_low <- hsd_results$lower[, "lwr"]
tukey_df$CI_high <- hsd_results$upper[, "upr"]
# View the data frame
knitr::kable(tukey_df)
| diff | lwr | upr | p adj | |
|---|---|---|---|---|
| 2-1 | 2714.930 | 2458.123 | 2971.738 | 0 |
| 3-1 | 7033.679 | 6695.999 | 7371.360 | 0 |
| 4-1 | 12682.252 | 12235.240 | 13129.264 | 0 |
| 5-1 | 16402.751 | 15862.561 | 16942.941 | 0 |
| 3-2 | 4318.749 | 3980.528 | 4656.970 | 0 |
| 4-2 | 9967.322 | 9519.902 | 10414.741 | 0 |
| 5-2 | 13687.821 | 13147.293 | 14228.348 | 0 |
| 4-3 | 5648.573 | 5150.313 | 6146.832 | 0 |
| 5-3 | 9369.072 | 8785.763 | 9952.380 | 0 |
| 5-4 | 3720.499 | 3067.782 | 4373.216 | 0 |
The result is showed in this chart:
#draw
plot(hsd_results, las =1, col = "blue")+ title(sub="Plot 2.1a")
According to the table and the chart above, since all the confidence intervals do not contain 0, it is plausible that the monthly incomes of 5 job levels are different with 99% confidence level. Additionally, the monthly income is likely to scale with the job level. Thus, the means of employees’ monthly income in Job Level 5 is the highest in 5 job levels.
After using ANOVA test, we can see that there is a large difference
in mean of monthly incomes between 5 job levels. Next, we continue to
use ANOVA to check whether in the Job Level 5, there is any difference
in monthly incomes between 3 departments.
Hypothesis testing at a 10% significance level (\(\alpha\) = 0.1):
\[ H_o: \mu_1 = \mu_2 = \mu_3 \textit{ versus } H_a: \textit{at least one pair of means are different from each other}\\ \]
\(\mu_1 : \textit{the mean of employee's monthly income with Job Level 5 in Sales department}\\\) \(\mu_2 : \textit{the mean of employee's monthly income with Job Level 5 in Human Resources department} \\\) \(\mu_3 : \textit{the mean of employee's monthly income with Job Level 5 in Research and Development } \\\)
Based on the boxplot, it can be observed that the means of monthly
incomes in three departments with the same job level are nearly
identical.
We use the R to compute calculations. The code is as follows:
# Perform the ANOVA of department
Hypothesis3 <-filter(dt, JobLevel == "5")
Hypothesis3 <- data.frame(MonthlyIncome=Hypothesis3$MonthlyIncome,
Department=Hypothesis3$Department)
tryCatch({
Model_1 <- aov(MonthlyIncome ~ Department, data = Hypothesis3)
Sum_table <- summary(Model_1)
}, error = function(e) {
print(paste("An error occurred: ", e$message))
})
Modl_table_1 <- data.frame(Sum_table[[1]])
colnames(Modl_table_1) <- c("Degrees_of_freedom", "Sum_of_Squares",
"Mean_square", "F_statistic", "P_Value")
knitr::kable(Modl_table_1)
| Degrees_of_freedom | Sum_of_Squares | Mean_square | F_statistic | P_Value | |
|---|---|---|---|---|---|
| Department | 2 | 175282.8 | 87641.41 | 0.32722 | 0.7220879 |
| Residuals | 66 | 17677197.1 | 267836.32 | NA | NA |
From the table, we have:
F-statistic:
## [1] 0.32722
p_value:
## [1] 0.7220879
Since \[\textit{p_value } = 0.7220879 > 0.1\]
the null hypothesis is accepted at the 10% significance level. Thus, we do not have enough evidence to reject the null hypothesis. It means we can accept that the monthly incomes between 3 departments in a job level is the same.
In this part, our team uses the 2-sample t-test technique to compare
employees’ monthly with two different performance ratings. We aim to
test whether the average monthly incomes of employees do not depend on
the performance rating.
We develop the following testing hypothesis:
\[
H_o: \mu_\text{A} - \mu_\text{B} = \delta \textit{ versus }
H_a:\mu_\text{A} -\mu_\text{B}\neq \delta
\] for some fixed value \(\delta\) of interest (usually \(\delta = 0\)),
A size hypothesis test accepts the null hypothesis if p-value \(\geq \alpha\) and rejects the null hypothesis if p-value \(< \alpha\)
| Sample Size | Sample Mean | Standard deviation | |
|---|---|---|---|
| A | n | \(\overline{x}\) | \(s_x\) |
| B | m | \(\overline{y}\) | \(s_y\) |
The variance:
\[ s^2= \frac{\sum_{i=1}^n {(x_i-\overline{x})}^2}{n-1} \]
Standard error:
\[ s.e.( \overline{ x } -\overline{ y } )= \sqrt{ \frac{{s_x}^2 }{n}+\frac{{s_y}^2 }{m}} \] The degrees of freedom:
\[ \upsilon =\frac{{( \frac{{s_x}^2 }{n}+\frac{{s_y}^2 }{m}) }^2}{{ \frac{{s_x}^4 }{n^2(n-1)}+\frac{{s_y}^4 }{m^2(m-1)} }} \]
t-statistic:
\[ t=\frac{\overline{ x } -\overline{ y }-\delta}{{ \frac{{s_x}^2 }{n}+\frac{{s_y}^2 }{m} }} \] p_value:
\[ \textit{p_value}= 2 \times P(t_{ \upsilon}\geq |t|) \]
The table of Summary statistics for analysis of two independent samples:
R3 <- filter(Data, PerformanceRating == "3")
R4 <- filter(Data, PerformanceRating == "4")
t_test_df <- data.frame(
PerformanceRating = c(3, 4),
Sample_size = c(nrow(R3), nrow(R4)),
Sample_mean = c(mean(R3$MonthlyIncome), mean(R4$MonthlyIncome)),
Sample_standard_deviation = c(sd(R3$MonthlyIncome), sd(R4$MonthlyIncome))
)
knitr::kable(t_test_df)
| PerformanceRating | Sample_size | Sample_mean | Sample_standard_deviation |
|---|---|---|---|
| 3 | 1253 | 6539.742 | 4707.915 |
| 4 | 227 | 6313.137 | 4663.439 |
One side hypothesis testing at \(\alpha = 0.1\) \[ H_o: \mu_\text{r3} = \mu_\text{r4} \textit{ versus } H_a:\mu_\text{r3} \neq \mu_\text{r4} \]
\(\mu_\text{r3} : \textit{the mean of employee's monthly whose performance rating is 3} \\\) \(\mu_\text{r4} : \textit{the mean of employee's monthly whose performance rating is 4} \\\)
The code for the 2-sample t-test is as follows:
combined_data_z <-rbind(R3,R4)
ttest1 <-t.test(MonthlyIncome ~ PerformanceRating, data = combined_data_z,conf.level = 0.9,
var.equal = FALSE, alternative = "two.sided")
ttest1
##
## Welch Two Sample t-test
##
## data: MonthlyIncome by PerformanceRating
## t = 0.67264, df = 315.22, p-value = 0.5017
## alternative hypothesis: true difference in means between group 3 and group 4 is not equal to 0
## 90 percent confidence interval:
## -329.1598 782.3711
## sample estimates:
## mean in group 3 mean in group 4
## 6539.742 6313.137
Since
\[ \text{p_value} = 0.5017 > 0.1, \] we do not have enough evidence to believe the mean of monthly incomes between the 2 performance ratings are different. It means that the statement the means of monthly incomes between 2 performance ratings are the same can be accepted.
In this part, our team will continue to use the ANOVA technique to
test the means of monthly incomes between 4 levels of Job
Involvement.
Hypothesis testing at a 10% significance level (\(\alpha\) = 0.1): \[ H_o: \mu_1 = \mu_2 = \mu_3 = \mu_4 \textit{ versus } H_a: \textit{at least one pair of means are different from each other}\\ \] \(\mu_1 : \textit{the mean of employee's monthly income of Employees with Job Involvement 1}\\\) \(\mu_2 : \textit{the mean of employee's monthly income of Employees with Job Involvement 2} \\\) \(\mu_3 : \textit{the mean of employee's monthly income of Employees with JobInvolvement 3} \\\) \(\mu_4 : \textit{the mean of employee's monthly income of Employees with Job Involvement 4 } \\\)
The boxplot grouped by the Education Level is generated :
It is cleared that there is no significant difference in the means of
monthly incomes between 4 levels of Job Involvement.
We use R, a programming language, to compute calculations. The code is as follows:
# Perform the ANOVA
Hypothesis4 <- data.frame(JobInvolvement = dt$JobInvolvement,
Income = dt$MonthlyIncome)
Hypothesis4$JobInvolvement <- as.character(Hypothesis4$JobInvolvement)
tryCatch({
Model1 <- aov(Income ~ JobInvolvement, data = Hypothesis4)
# Generate the summary table
Summary_table <- summary(Model1)
}, error = function(e) {
print(paste("An error occurred: ", e$message))
})
# Convert the summary to a data frame
Modl_table1 <- data.frame(Summary_table[[1]])
colnames(Modl_table1) <- c("Degrees_of_freedom", "Sum_of_Squares",
"Mean_square", "F_statistic", "P_Value")
knitr::kable(Modl_table1)
| Degrees_of_freedom | Sum_of_Squares | Mean_square | F_statistic | P_Value | |
|---|---|---|---|---|---|
| JobInvolvement | 3 | 27629228 | 9209743 | 0.4163792 | 0.74127 |
| Residuals | 1476 | 32647115007 | 22118642 | NA | NA |
From the table, we have:
F-statistic:
## [1] 0.4163792
p_value:
## [1] 0.74127
Since \(\textit{p_value } = 0.74127 >
0.1\),
the null hypothesis is accepted at the 10% significance level. We do not
have enough evidence to believe the mean of monthly incomes between the
4 job involvements are different. It means that the statement the means
of monthly incomes between the 4 job involvements are the same can be
accepted.
Similarly 2.1, in this part, our team will test whether the monthly incomes between education levels are different or not. If they are not the same, we will continue to test the monthly incomes between 3 departments in the same Education Level.
To compare monthly incomes based on education levels, we apply the same method as part 1.
Hypothesis testing at a 1% significance level (\(\alpha\) = 0.01): \[ H_o: \mu_1 = \mu_2 = \mu_3 = \mu_4 =\mu_5 \textit{ versus } H_a: \textit{at least one pair of means are different from each other}\\ \]
\(\mu_1 : \textit{the mean of employee's monthly income of Employees with Education Level 1}\\\) \(\mu_2 : \textit{the mean of employee's monthly income of Employees with Education Level 2} \\\) \(\mu_3 : \textit{the mean of employee's monthly income of Employees with Education Level 3} \\\) \(\mu_4 : \textit{the mean of employee's monthly income of Employees with Education Level 4 } \\\) \(\mu_5 : \textit{the mean of employee's monthly income of Employees with Education Level 5} \\\)
The boxplot distribute the monthly income of each education level are generated:
It is cleared that when the education level is higher, the monthly
salary increases.
# Fit the ANOVA model(the one-factor analysis of variances technique)
hypothesis_education <- data.frame(Education=data$Education,
MonthlyIncome=data$MonthlyIncome)
hypothesis_education$Education <- as.character(hypothesis_education$Education)
model_education <- aov(MonthlyIncome ~ Education, data = hypothesis_education)
#Construct to table
summary_table_education <- summary(model_education)
anova_df_edu <- data.frame(
Source = rownames(summary_table_education[[1]]),
Degrees_of_freedom = summary_table_education[[1]][, "Df"],
Sum_of_Squares = summary_table_education[[1]][, "Sum Sq"],
Mean_square = summary_table_education[[1]][, "Mean Sq"],
F_statistic= summary_table_education[[1]][, "F value"],
P_Value = summary_table_education[[1]][, "Pr(>F)"]
)
knitr::kable(anova_df_edu)
| Source | Degrees_of_freedom | Sum_of_Squares | Mean_square | F_statistic | P_Value |
|---|---|---|---|---|---|
| Education | 4 | 326364378 | 81591094 | 3.720337 | 0.0050967 |
| Residuals | 1475 | 32348379857 | 21931105 | NA | NA |
From the table, we have:
F-statistic:
## [1] 3.720337
p_value:
## [1] 0.005096654
Since \(\textit{p_value } = 0.005096654 < 0.01\), the null hypothesis is rejected at the 1% significance level. Thus, there is sufficient evidence that at least the monthly incomes of one pair education levels are different.
We additionally perform the Tukey multiple comparison procedure to identify any differences among means values and quantify the extent of those differences. The R code for this procedure is as follows:
results_edu <- TukeyHSD(model_education,conf.level=.99)
# Extract results to a data frame
tukey_df_edu <- as.data.frame(results_edu$Education)
tukey_df_edu$CI_low <- results_edu$lower[, "lwr"]
tukey_df_edu$CI_high <- results_edu$upper[, "upr"]
# View the data frame
knitr::kable(tukey_df_edu)
| diff | lwr | upr | p adj | |
|---|---|---|---|---|
| 2-1 | 510.7105 | -965.62697 | 1987.048 | 0.7917482 |
| 3-1 | 815.2646 | -511.02963 | 2141.559 | 0.2643268 |
| 4-1 | 1121.7470 | -271.10435 | 2514.598 | 0.0662234 |
| 5-1 | 2574.6284 | 81.96362 | 5067.293 | 0.0069491 |
| 3-2 | 304.5541 | -803.29809 | 1412.406 | 0.8983015 |
| 4-2 | 611.0365 | -575.68798 | 1797.761 | 0.4473669 |
| 5-2 | 2063.9179 | -319.70493 | 4447.541 | 0.0386644 |
| 4-3 | 306.4824 | -687.39838 | 1300.363 | 0.8529277 |
| 5-3 | 1759.3638 | -534.35409 | 4053.082 | 0.0909035 |
| 5-4 | 1452.8814 | -879.95385 | 3785.717 | 0.2517269 |
The 99% confidence interval for the difference between 5 and 1: \[ \mu_5 -\mu_1 \in (81.96362,5067.293) \] Since the only confidence interval does not contain 0, we can conclude that Education level 5 and level 1 have differences in means of monthly incomes with 99% confidence interval. In addition, the 99% confidence interval is positive, we can conclude that the mean of monthly incomes in Education Level 5 is larger than in Education Level 1.
Beside that, the rest 99% confidence intervals contain 0, but they are likely to be positive, so we can accept that with the higher education level, the employees have the higher monthly income.
After using ANOVA test, we can see that there is a large difference
in mean of monthly incomes between 5 education levels. Next, we continue
to use ANOVA to check whether in the Education Level 5, there is any
difference in monthly incomes between 3 departments.
\[ H_o: \mu_1 = \mu_2 = \mu_3 \textit{ versus } H_a: \textit{at least one pair of means are different from each other}\\ \]
\(\mu_1 : \textit{the mean of employee's monthly income with Education Level 5 in Sales}\\\) \(\mu_2 : \textit{the mean of employee's monthly income with Education Level 5 in Human Resources} \\\) \(\mu_3 : \textit{the mean of employee's monthly income with Education Level 5 in Research and Development} \\\)
Based on the boxplot, there is not a significant difference between the
means of monthly incomes in three departments with the same education
level.
We use the R to compute calculations. The code is as follows:
# Fit the ANOVA model(the one-factor analysis of variances technique)
model_education5_department <- aov(MonthlyIncome ~ Department, data = hypothesis_education5_department)
#Construct to table
summary_table_education5_dpm <- summary(model_education5_department)
anova_df_edu5_dpm <- data.frame(
Source = rownames(summary_table_education5_dpm[[1]]),
Degrees_of_freedom = summary_table_education5_dpm[[1]][, "Df"],
Sum_of_Squares = summary_table_education5_dpm[[1]][, "Sum Sq"],
Mean_square = summary_table_education5_dpm[[1]][, "Mean Sq"],
F_statistic= summary_table_education5_dpm[[1]][, "F value"],
P_Value = summary_table_education5_dpm[[1]][, "Pr(>F)"] )
knitr::kable(anova_df_edu5_dpm)
| Source | Degrees_of_freedom | Sum_of_Squares | Mean_square | F_statistic | P_Value |
|---|---|---|---|---|---|
| Department | 2 | 37218405 | 18609202 | 0.7176822 | 0.4933808 |
| Residuals | 45 | 1166831292 | 25929584 | NA | NA |
From the table, we have:
F-statistic:
## [1] 0.7176822
p_value:
## [1] 0.4933808
\(\text{Since } \textit{p_value } = 0.4933808 > 0.1 \text{, the null hypothesis is accepted at the 10% significance level. }\)
Thus, we do not have enough evidence to reject the null hypothesis. It means we can accept that the monthly incomes between 3 departments in a education level is the same.
In conclusion, after we test on all 4 factors, we can conclude that the Performance and Job Involvement do not affect the monthly income. Meanwhile, the monthly income is strongly affected by the Job Level and Education Level. More specifically, in the same education or job level, all the 3 departments have the nearly same amount of average income.
Our team uses the comparing two population proportions technique to
compare the satisfaction between 2 genders. We aim to test whether the
satisfaction do not depend on gender. As a result, we develop the
following testing hypothesis:
\[
H_o: p_\text{A} = p_\text{B} \textit{ versus } H_a:p_\text{A} \neq
p_\text{B}
\]
A size hypothesis test accepts the null hypothesis if p-value \(\geq \alpha\) and rejects the null hypothesis if p-value \(< \alpha\)
X and Y are two random variable: \[ X\sim B(n,p_A) \] \[ Y\sim B(m,p_B) \] The unbiased point estimates of the two population proportions are \[ \widehat{p_A} =\frac{x}{n} \text{ and } \widehat{p_B} =\frac{y}{m} \]
The pooled estimate:
\[ \widehat{p} = \frac{x+y}{n+m} \]
Z-statistic:
\[ z=\frac{\widehat{p_a}-\widehat{p_B}}{\sqrt{\widehat{p}\times(1-\widehat{p})\times(\frac{1}{n}+\frac{1}{m})}} \] p_value: \[ \text{p_value} = 2\times \Phi (-|z|) \]
\(1-\alpha \text{ }\) confidence interval: \[ p_A -p_B \in (\widehat{p_a}-\widehat{p_B}-z_\frac{\alpha}{2}\times\sqrt{\frac{x(n-x)}{n^3}+\frac{y(m-y)}{m^3}},\widehat{p_a}-\widehat{p_B}+z_\frac{\alpha}{2}\times\sqrt{\frac{x(n-x)}{n^3}+\frac{y(m-y)}{m^3}}) \]
Hypothesis testing at a 10% significance level (α = 0.1):
\[ H_o: p_1 = p_2 \textit{ versus } H_a: p_1 \neq\ p_2 \] \(p_1 : \textit{The proportion of satisfied females}\\\)
\(p_2 : \textit{The proportion of satisfied males} \\\)
pr_df <- table(data$Gender, data$Satisfied_in_job)
knitr::kable(pr_df)
| No | Yes | |
|---|---|---|
| Female | 238 | 353 |
| Male | 337 | 552 |
prop_test_result <- prop.test(pr_df[, 2], n = rowSums(pr_df),conf.level=.90)
print(prop_test_result)
##
## 2-sample test for equality of proportions with continuity correction
##
## data: pr_df[, 2] out of rowSums(pr_df)
## X-squared = 0.73785, df = 1, p-value = 0.3903
## alternative hypothesis: two.sided
## 90 percent confidence interval:
## -0.06767004 0.02041072
## sample estimates:
## prop 1 prop 2
## 0.5972927 0.6209224
Since the \(\textit{p_value } = 0.3903 > 0.1\) (greater than the common significance level of 10%), there is not enough evidence to suggest a significant difference in job satisfaction proportions between the two genders.
The 90% confidence interval ( -0.06767004, 0.02041072 ) includes zero, indicating that the true difference in proportions could be zero (no difference). This is consistent with the interpretation from the p-value.
The finding that job satisfaction is equal between individuals of different genders implies that, at least superficially, both genders are enjoying comparable levels of contentment and fulfillment in their roles within the organization. This equality in job satisfaction can serve as a positive signal for the overall work environment and organizational culture. Therefore, it can be inferred that the company did not engage in sexist behavior. It sets the stage for a myriad of positive outcomes. This ethos fosters a diverse mix of perspectives, skills, and experiences, enhancing creativity and problem-solving within the organization. This contributes to elevated employee morale as individuals feel valued and respected in a fair and gender-neutral environment. The company’s reputation for gender equality and fairness becomes a powerful magnet for diverse talent, aligning with a progressive and socially responsible image. Improved job satisfaction and a sense of fairness also translate into enhanced employee retention, reducing turnover costs and preserving valuable institutional knowledge. Furthermore, adherence to legal standards ensures a stable and compliant operating environment, while a commitment to gender equality enhances the company’s public image, fostering brand loyalty and positive relationships with stakeholders. The inclusive environment not only sparks innovation through the convergence of varied backgrounds but also nurtures strong team dynamics, promoting collaboration, communication, and cohesion among team members. Lastly, proactive efforts to address and prevent discrimination mitigate biases in decision-making processes, ensuring that key decisions are based on merit and qualifications rather than gender, fostering an equitable and forward-thinking workplace.
After all the analysis, we can see clearly that the average incomes
per month of all three departments are not the same and the budget
salary of this company is concentrated in the Sales department. This
will encourage the Sales department to work more effectively to generate
real revenue for the company. Moreover, based on the fact that job
satisfaction between both genders is the same, we can conclude that the
company does not discriminate between men and women which lead to
several positive outcomes can be expected. These are two good points
that the company needs to continue to promote.
However, the factors that have strong impacts on this are the Education
Level and Job Level, while the Performance and the Job Involvement are
not seriously considered enough. We believe that this is a problem in
the company that we should seriously consider, because the Performance
and the Job Involvement are the two factors that can affect the quality
of work in the long term instead of just paid employees based on their
education level.
…
…