Human Resources Analytics in R: Exploring Employee Data
HUMAN RESOURCES ANALYTICS IN R: EXPLORING EMPLOYEE DATA
Let's practice!
DataCamp
Human Resources Analytics in R: Exploring Employee Data
HUMAN RESOURCES ANALYTICS IN R: EXPLORING EMPLOYEE DATA
Omitted variable bias Ben Teusch HR Analytics Consultant
DataCamp
Human Resources Analytics in R: Exploring Employee Data
When group compositions differ Two groups of people A: eats little to no meat B: eats normal amount of meat Group A gains weight Conclusion: weight gain plans should exclude meat?
DataCamp
Human Resources Analytics in R: Exploring Employee Data
When group compositions differ Two groups of people A: eats little to no meat B: eats normal amount of meat Group A gains weight Omitted piece of data: group A is made up of infants group B is made up of adults
DataCamp
Human Resources Analytics in R: Exploring Employee Data
Omitted variable bias Omitted variable bias occurs when an omitted variable is correlated with: the dependent variable, and the way the groups are divided
DataCamp
Human Resources Analytics in R: Exploring Employee Data
Visualizing group composition
DataCamp
Human Resources Analytics in R: Exploring Employee Data
DataCamp
100% stacked bar charts > pay %>% + ggplot(aes(x = new_hire, fill = department)) + + geom_bar(position = "fill")
Human Resources Analytics in R: Exploring Employee Data
DataCamp
Human Resources Analytics in R: Exploring Employee Data
HUMAN RESOURCES ANALYTICS IN R: EXPLORING EMPLOYEE DATA
Let's practice!
DataCamp
Human Resources Analytics in R: Exploring Employee Data
HUMAN RESOURCES ANALYTICS IN R: EXPLORING EMPLOYEE DATA
Using linear regression Ben Teusch HR Analytics Consultant
DataCamp
Human Resources Analytics in R: Exploring Employee Data
DataCamp
Human Resources Analytics in R: Exploring Employee Data
Linear regression Focus on testing differences between groups Learn more about other uses and the math under the hood at DataCamp
DataCamp
Human Resources Analytics in R: Exploring Employee Data
DataCamp
Human Resources Analytics in R: Exploring Employee Data
DataCamp
Simple linear regression > lm(salary ~ new_hire, data = pay) %>% + tidy() term estimate std.error statistic p.value 1 (Intercept) 73424.603 577.2369 127.200112 0.00000000 2 new_hireYes 2649.672 1109.3568 2.388476 0.01704414 # A tibble: 2 x 2 new_hire avg_salary 1 No 73424.60 2 Yes 76074.28 > 76074.28 - 73424.60 [1] 2649.68
Human Resources Analytics in R: Exploring Employee Data
DataCamp
Human Resources Analytics in R: Exploring Employee Data
Significance for linear regression > lm(salary ~ new_hire, data = pay) %>% + tidy() term estimate std.error statistic p.value 1 (Intercept) 73424.603 577.2369 127.200112 0.00000000 2 new_hireYes 2649.672 1109.3568 2.388476 0.01704414
DataCamp
Human Resources Analytics in R: Exploring Employee Data