Q1

# Data Cleaning and Wrangling
data <- data %>%
  
  mutate(Salary_Normalized = scale(Salary_USD)) %>%
  
  mutate(Salary_Range = case_when(
    Salary_USD < 60000 ~ "Low",
    Salary_USD >= 60000 & Salary_USD < 100000 ~ "Medium",
    Salary_USD >= 100000 ~ "High"
  )) %>%
  
  # Create a binary variable for High Automation Risk
  mutate(High_Automation_Risk = if_else(Automation_Risk == "High", 1, 0))

glimpse(data)
## Rows: 500
## Columns: 13
## $ Job_Title             <chr> "Cybersecurity Analyst", "Marketing Specialist",…
## $ Industry              <chr> "Entertainment", "Technology", "Technology", "Re…
## $ Company_Size          <chr> "Small", "Large", "Large", "Small", "Small", "La…
## $ Location              <chr> "Dubai", "Singapore", "Singapore", "Berlin", "To…
## $ AI_Adoption_Level     <chr> "Medium", "Medium", "Medium", "Low", "Low", "Med…
## $ Automation_Risk       <chr> "High", "High", "High", "High", "Low", "Medium",…
## $ Required_Skills       <chr> "UX/UI Design", "Marketing", "UX/UI Design", "Pr…
## $ Salary_USD            <dbl> 111392.17, 93792.56, 107170.26, 93027.95, 87752.…
## $ Remote_Friendly       <chr> "Yes", "No", "Yes", "No", "Yes", "No", "Yes", "Y…
## $ Job_Growth_Projection <chr> "Growth", "Decline", "Growth", "Growth", "Declin…
## $ Salary_Normalized     <dbl[,1]> <matrix[26 x 1]>
## $ Salary_Range          <chr> "High", "Medium", "High", "Medium", "Medium"…
## $ High_Automation_Risk  <dbl> 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, …

Q2

summary_stats <- data %>%
  group_by(AI_Adoption_Level) %>%
  summarise(
    Mean_Salary = mean(Salary_USD, na.rm = TRUE),
    SD_Salary = sd(Salary_USD, na.rm = TRUE),
    Min_Salary = min(Salary_USD, na.rm = TRUE),
    Q1_Salary = quantile(Salary_USD, 0.25, na.rm = TRUE),
    Median_Salary = median(Salary_USD, na.rm = TRUE),
    Q3_Salary = quantile(Salary_USD, 0.75, na.rm = TRUE),
    Max_Salary = max(Salary_USD, na.rm = TRUE)
  )

# Display the summary statistics table
summary_stats %>% 
  kable(caption = "Summary Statistics for Salary_USD by AI Adoption Level") %>% 
  kable_styling(full_width = FALSE)
Summary Statistics for Salary_USD by AI Adoption Level
AI_Adoption_Level Mean_Salary SD_Salary Min_Salary Q1_Salary Median_Salary Q3_Salary Max_Salary
High 87583.42 21021.20 41298.73 74216.26 86379.88 101357.0 155209.8
Low 93353.60 20864.83 31969.53 79016.97 95700.14 105165.4 140476.0
Medium 92139.14 19412.02 35963.30 81055.99 92891.89 105665.0 134822.7

The summary statistics for Salary_USD grouped by AI_Adoption_Level reveal the following patterns:

Mean and Median Salaries:

Low AI Adoption has the highest mean salary ($93,353.60) and median salary ($95,700.14), suggesting that these jobs generally offer the best compensation. Medium AI Adoption follows with a mean salary of $92,139.14 and median salary of $92,891.89, showing slightly lower pay than the “Low” group. High AI Adoption has the lowest mean ($87,583.42) and median ($86,379.88) salaries, despite having the highest maximum salary ($155,209.80). Insight: Higher AI adoption levels do not correlate with higher average salaries. This could indicate that high-AI adoption jobs are more common in industries with entry-level or support roles, while low-AI adoption jobs are likely in traditional, well-compensated fields.

Salary Variability:

High AI Adoption has the largest standard deviation ($21,021.20) and range ($41,298.73 to $155,209.80), indicating significant variability in pay. This reflects a mix of both high-paying specialized roles and lower-paying positions. Low AI Adoption also has substantial variability (SD: $20,864.83) but shows more consistent compensation in the higher salary ranges (Q3: $105,165.40). Medium AI Adoption has the lowest standard deviation ($19,412.02) and a tighter range of salaries, suggesting more consistency in pay structures. Insight: High salary variability in “High AI Adoption” jobs reflects diverse roles, ranging from lower-tier positions to highly specialized, high-paying roles.

Five-Number Summary:

Low AI Adoption has the highest Q1 ($79,016.97) and Q3 ($105,165.40), indicating that salaries in this group are generally higher across the board. High AI Adoption has a lower Q1 ($74,216.26) and median, with a large portion of salaries in the lower range, despite the highest maximum. Medium AI Adoption offers consistent middle-range pay, with Q1 ($81,055.99) and Q3 ($105,665.00) values close to its median.

Q3

ggplot(data, aes(x = AI_Adoption_Level, y = Salary_USD, fill = AI_Adoption_Level)) +
  geom_boxplot() +
  labs(title = "Salary by AI Adoption Level", x = "AI Adoption Level", y = "Salary (USD)") +
  theme_minimal()

ggplot(data, aes(x = Company_Size, y = Salary_USD, fill = Company_Size)) +
  geom_boxplot() +
  labs(title = "Salary by Company Size", x = "Company Size", y = "Salary (USD)") +
  theme_minimal()

ggplot(data, aes(x = Automation_Risk, fill = Job_Growth_Projection)) +
  geom_bar(position = "dodge") +
  labs(title = "Job Growth Projection by Automation Risk", x = "Automation Risk", y = "Count") +
  theme_minimal()

ggplot(data, aes(x = AI_Adoption_Level, y = Salary_USD, color = AI_Adoption_Level)) +
  geom_jitter(width = 0.2) +
  labs(title = "Scatter Plot of Salary vs AI Adoption Level", x = "AI Adoption Level", y = "Salary (USD)") +
  theme_minimal()

Salary by AI Adoption Level (Boxplot):

Median salaries are highest for “Low AI Adoption” and lowest for “High AI Adoption.” Insight: Traditional, low-AI industries may prioritize human expertise, resulting in better compensation, while high-AI adoption jobs might include more entry-level roles.

Salary by Company Size (Boxplot):

Larger companies offer higher median salaries and a broader salary range. Insight: Larger organizations likely invest in specialized, high-paying roles.

Job Growth Projection by Automation Risk (Bar Chart):

Jobs with “High Automation Risk” have the highest likelihood of decline, while “Low Automation Risk” jobs exhibit stronger growth potential. Insight: Automation risk inversely correlates with job growth.

Scatter Plot of Salary vs AI Adoption Level:

Salaries in “High AI Adoption” environments show significant variability, including some very high-paying roles. Insight: High-AI adoption environments may include both entry-level and specialized roles, leading to this spread in pay.