2024-06-04

Overview

  • Dataset
  • Data Cleaning
  • Gender Distribution in STEM
  • Gender Scatter Plot
  • Statistical Analysis
  • Comparison of STEM Participation by Gender
  • Conclusion

Dataset

df <- read.csv("women-stem.csv", header = TRUE) # Read in the CSV file
head(df) # View the first few rows of the data
##   Rank Major_code                                     Major Major_category
## 1    1       2419                     PETROLEUM ENGINEERING    Engineering
## 2    2       2416            MINING AND MINERAL ENGINEERING    Engineering
## 3    3       2415                 METALLURGICAL ENGINEERING    Engineering
## 4    4       2417 NAVAL ARCHITECTURE AND MARINE ENGINEERING    Engineering
## 5    5       2418                       NUCLEAR ENGINEERING    Engineering
## 6    6       2405                      CHEMICAL ENGINEERING    Engineering
##   Total   Men Women ShareWomen Median
## 1  2339  2057   282  0.1205643 110000
## 2   756   679    77  0.1018519  75000
## 3   856   725   131  0.1530374  73000
## 4  1258  1123   135  0.1073132  70000
## 5  2573  2200   373  0.1449670  65000
## 6 32260 21239 11021  0.3416305  65000

Data Cleaning

Data cleaning involves handling missing values, duplicates, and ensuring consistency in the dataset.

# Clean and prepare the data
data_clean <- df %>%
  select(Major_category, Total, Men, Women, ShareWomen) %>%
  mutate(ShareWomen = Women / Total)
head(data_clean) #View the cleaned data
##   Major_category Total   Men Women ShareWomen
## 1    Engineering  2339  2057   282  0.1205643
## 2    Engineering   756   679    77  0.1018519
## 3    Engineering   856   725   131  0.1530374
## 4    Engineering  1258  1123   135  0.1073132
## 5    Engineering  2573  2200   373  0.1449670
## 6    Engineering 32260 21239 11021  0.3416305

Gender Distribution in STEM

Here’s the plot for the distribution of women in STEM by major category:

Share of Women in STEM by Major Category

Here’s the plot for the share of women in STEM by major category:

Gender Scatter Plot

An interactive scatter plot that visualizes the distribution of women and men across various STEM major categories. Each point on the scatter plot represents a specific major category, with the x-axis showing the number of women and the y-axis showing the number of men.

This plot allows us to observe the gender distribution in STEM fields. We can identify major categories with a high number of women compared to men and vice versa. By exploring the plot, we can gain insights into gender diversity in various STEM disciplines.

plot_ly(data_clean, x = ~Women, y = ~Men, type = 'scatter',
mode = 'markers', color = ~Major_category) %>%
  layout(xaxis = list(title = 'Number of Women'),
         yaxis = list(title = 'Number of Men'))

Statistical Analysis

Mean Calculation

Let’s calculate the mean of women’s participation in STEM across different major categories.

\[ \text{Mean} = \frac{1}{n} \sum_{i=1}^{n} x_i \]

Mean of Women in STEM

mean_women <- mean(data_clean$Women, na.rm = TRUE)
mean_women
## [1] 12714.53

Variance Calculation

Let’s calculate the variance of women’s participation in STEM across different major categories.

\[ \text{Variance} = \frac{1}{n} \sum_{i=1}^{n} (x_i - \text{Mean})^2 \]

Variance of Women in STEM

variance_women <- var(data_clean$Women, na.rm = TRUE)
variance_women
## [1] 844251992

Comparison of STEM Participation by Gender

Conclusion

Statistical analysis and visualizations provide deep insights into the trends and participation of women in STEM fields. This analysis helps identify where efforts are needed to improve gender diversity and representation in various STEM disciplines.