Analysis overview and configuration
| Parameter | Value | _row |
|---|---|---|
| cards | c("dept_breakdown", "income_by_dept", "income_by_age", "income_satisfaction_tenure", "age_vs_income", "income_by_education", "age_histogram", "attrition_by_travel", "distance_income", "satisfaction_by_role_years", "income_wlb_by_level", "experience_vs_income", "income_by_marital", "income_histogram", "edu_satisfaction_heatmap", "job_role_stats", "dept_summary"), c("bar", "bar", "line", "line", "scatter", "box", "histogram", "bar", "line", "line", "line", "scatter", "box", "histogram", "heatmap", "table", "table"), c("Employees by Department", "Average Monthly Income by Department", "Average Income by Age", "Income & Satisfaction by Years at Company", "Age vs Monthly Income", "Income Distribution by Education Level", "Age Distribution", "Attrition Count by Business Travel", "Average Income by Distance from Home", "Job Satisfaction by Years in Current Role", "Income & Work-Life Balance by Job Level", "Total Working Years vs Monthly Income", "Income Distribution by Marital Status", "Monthly Income Distribution", "Education Level vs Job Satisfaction", "Job Role Summary Statistics", "Department Summary"), c("Department", "Department", "Age", "Years at Company", "Age", "Education", "Age", "Business Travel", "Distance (miles)", "Years in Current Role", "Job Level", "Total Working Years", "Marital Status", "Monthly Income", "Education Level", NA, NA), c("Count", "Avg Monthly Income", "Avg Monthly Income", "Avg Monthly Income", "Monthly Income", "Monthly Income", "Count", "Attrition Count", "Avg Monthly Income", "Avg Satisfaction", "Avg Monthly Income", "Monthly Income", "Monthly Income", "Count", "Job Satisfaction", NA, NA), c("\n freq <- as.data.frame(table(df$Department), stringsAsFactors = FALSE)\n colnames(freq) <- c('category', 'value')\n freq[order(-freq$value), ]\n ", "\n agg <- aggregate(MonthlyIncome ~ Department, data = df, FUN = mean)\n data.frame(category = agg$Department, value = round(agg$MonthlyIncome, 0))\n ", "\n agg <- aggregate(MonthlyIncome ~ Age, data = df, FUN = mean)\n agg <- agg[order(agg$Age), ]\n data.frame(x = agg$Age, y = round(agg$MonthlyIncome, 0))\n ", "\n agg1 <- aggregate(MonthlyIncome ~ YearsAtCompany, data = df, FUN = mean)\n agg2 <- aggregate(JobSatisfaction ~ YearsAtCompany, data = df, FUN = mean)\n merged <- merge(agg1, agg2, by = 'YearsAtCompany')\n merged <- merged[order(merged$YearsAtCompany), ]\n data.frame(x = merged$YearsAtCompany, y = round(merged$MonthlyIncome, 0), y2 = round(merged$JobSatisfaction, 2))\n ", "\n data.frame(x = df$Age, y = df$MonthlyIncome)\n ", "\n edu_labels <- c('1' = 'Below College', '2' = 'College', '3' = 'Bachelor', '4' = 'Master', '5' = 'Doctor')\n data.frame(group = edu_labels[as.character(df$Education)], value = df$MonthlyIncome)\n ", "\n data.frame(value = df$Age)\n ", "\n att <- df[df$Attrition == 'Yes', ]\n freq <- as.data.frame(table(att$BusinessTravel), stringsAsFactors = FALSE)\n colnames(freq) <- c('category', 'value')\n freq[order(-freq$value), ]\n ", "\n agg <- aggregate(MonthlyIncome ~ DistanceFromHome, data = df, FUN = mean)\n agg <- agg[order(agg$DistanceFromHome), ]\n data.frame(x = agg$DistanceFromHome, y = round(agg$MonthlyIncome, 0))\n ", "\n agg <- aggregate(JobSatisfaction ~ YearsInCurrentRole, data = df, FUN = mean)\n agg <- agg[order(agg$YearsInCurrentRole), ]\n data.frame(x = agg$YearsInCurrentRole, y = round(agg$JobSatisfaction, 2))\n ", "\n agg1 <- aggregate(MonthlyIncome ~ JobLevel, data = df, FUN = mean)\n agg2 <- aggregate(WorkLifeBalance ~ JobLevel, data = df, FUN = mean)\n merged <- merge(agg1, agg2, by = 'JobLevel')\n merged <- merged[order(merged$JobLevel), ]\n data.frame(x = merged$JobLevel, y = round(merged$MonthlyIncome, 0), y2 = round(merged$WorkLifeBalance, 2))\n ", "\n data.frame(x = df$TotalWorkingYears, y = df$MonthlyIncome)\n ", "\n data.frame(group = df$MaritalStatus, value = df$MonthlyIncome)\n ", "\n data.frame(value = df$MonthlyIncome)\n ", "\n ct <- as.data.frame(table(Education = df$Education, Satisfaction = df$JobSatisfaction), stringsAsFactors = FALSE)\n data.frame(x = ct$Education, y = ct$Satisfaction, z = ct$Freq)\n ", "\n roles <- unique(df$JobRole)\n do.call(rbind, lapply(roles, function(r) {\n subset_df <- df[df$JobRole == r, ]\n data.frame(\n JobRole = r,\n Count = nrow(subset_df),\n AvgIncome = round(mean(subset_df$MonthlyIncome), 0),\n AvgAge = round(mean(subset_df$Age), 1),\n AvgSatisfaction = round(mean(subset_df$JobSatisfaction), 2),\n stringsAsFactors = FALSE\n )\n }))\n ", "\n depts <- unique(df$Department)\n do.call(rbind, lapply(depts, function(d) {\n subset_df <- df[df$Department == d, ]\n data.frame(\n Department = d,\n Employees = nrow(subset_df),\n AvgIncome = round(mean(subset_df$MonthlyIncome), 0),\n AttritionRate = round(sum(subset_df$Attrition == 'Yes') / nrow(subset_df) * 100, 1),\n AvgTenure = round(mean(subset_df$YearsAtCompany), 1),\n stringsAsFactors = FALSE\n )\n }))\n " ), c(NA, NA, NA, "Avg Job Satisfaction", NA, NA, NA, NA, NA, NA, "Avg Work-Life Balance", NA, NA, NA, NA, NA, NA) | cards |
Data preprocessing and column mapping
| Metric | Value |
|---|---|
| Initial Rows | 500 |
| Final Rows | 500 |
| Rows Removed | 0 |
| Retention Rate | 100% |
Employees by Department
Average Monthly Income by Department
Attrition Count by Business Travel
Average Income by Age
Average Income by Distance from Home
Job Satisfaction by Years in Current Role
Income & Satisfaction by Years at Company
Income & Work-Life Balance by Job Level
Age vs Monthly Income
Total Working Years vs Monthly Income
Income Distribution by Education Level
Income Distribution by Marital Status
Age Distribution
Monthly Income Distribution
Education Level vs Job Satisfaction
Job Role Summary Statistics
| JobRole | Count | AvgIncome | AvgAge | AvgSatisfaction |
|---|---|---|---|---|
| Sales Executive | 108 | 6916 | 36.1 | 2.94 |
| Research Scientist | 99 | 3345 | 34.3 | 2.75 |
| Laboratory Technician | 93 | 3126 | 34.3 | 2.85 |
| Manufacturing Director | 48 | 6576 | 37.7 | 2.75 |
| Healthcare Representative | 40 | 8150 | 41.5 | 2.85 |
| Manager | 42 | 16714 | 46.1 | 2.81 |
| Sales Representative | 30 | 2557 | 30.2 | 2.53 |
| Research Director | 29 | 15901 | 43.4 | 2.76 |
| Human Resources | 11 | 4454 | 35.8 | 2.55 |
Department Summary
| Department | Employees | AvgIncome | AttritionRate | AvgTenure |
|---|---|---|---|---|
| Sales | 153 | 6966 | 19 | 7.5 |
| Research & Development | 333 | 6397 | 13.5 | 6.9 |
| Human Resources | 14 | 7383 | 28.6 | 6.1 |