Which test to compare the difference between the amount of job categories for men and women

I have a dataset with men and women (independent variable) and want to know if the job spectrum (dependent variable) of the men is broader than the job spectrum of the women. Their jobs are categorized according to a reliable multinominal categorisation system (ISCO). Some men and women have a job in the same category. In some categories there are only men, in some only women. I found that the jobs the men (N=417) have fall in 34 distinct categories whereas the jobs that the women (N=121) have fall in 19 distinct categories. I want to know if this difference is significant. I am not interested in the difference between the categories but in the difference in the amount of categories. I have no covariate or moderator. Which test do I use?

The chi-square seems most promising but this is a comparison between cells, not necessarily between distributions? A multinomial regression falls flat because many cells have a count of zero. Binominal analyses don't make sense because I'd be comparing an independent variable with two cases (male or female) with a range of categories (19 vs 34).

• Can you be more precise about what is "job spectrum"? What does "difference in the amount of categories" mean? Say jobs were completely segregated by gender and half the job categories were filled in by men, the rest by women. That's the same number of categories for both genders; is the "spectrum" different or the same in this case? Aug 18, 2022 at 15:30
• The bootstrap technique might be an option to gain confidence intervals for the male and female group. Aug 18, 2022 at 15:59
• Occupations were divided into 96 possible categories (managers, service workers, machine operators, etc) not all 96 categories were present in my dataset. For some job categories there were both men and women (teachers) for some only men (machine operators). Men were represented in 34 different categories, women in 19 different categories. Aug 18, 2022 at 16:05
• Thank you for adding more detail about what you observe in the data. However, this still doesn't clarify the meaning of job spectrum. It seems you've come upon an aspect of the data that makes men and women employment appear particularly different and now you want give this data-generated hypothesis the "statistically significant" label. Aug 18, 2022 at 16:37
• @dipetkov thank you for thinking with me. It was a hypothesis that I had before writing (I preregistered it on OSF!) and I had decided on a chi square but now I have the data I am unsure whether my interpretation is right. Because I know it as a test to find differences between cells while I am looking for a difference in distribution. bmj.com/about-bmj/resources-readers/publications/… seems to indicate I am on the right track after all but I am in doubt Aug 18, 2022 at 17:20

Context: I have doubts that "number of distinct job categories with at least one person employed" can be meaningfully interpreted as "variety in occupations". Consider for example, that a single woman can increase the "job spectrum" for women by 5% by getting employed in a job without previous reports of female employment.

With that caveat aside, you could compare the number of occupations that employ men and women with the bootstrap as suggested by @Scriddie.

The challenge is that there are 417 reports of male employment and 121 reports of female employment, ie., there are 3.5 times more men than women in the dataset. (An interesting observation that may be saying something about employment equality on its own?)

It's reasonable to assume that if we were to receive ~300 additional reports of female employment, the job spectrum for women would increase. What we can do instead is to draw bootstrap samples (ie. with replacement) of size n = 121 from the observed distribution of male employment. Then we can assess how often we observe 19 or fewer distinct job categories in a sample of n = 121 jobs by men.

Here is how this test can be implemented in R.

k_f <- 19 # occupations that employ women
k_m <- 34 # occupations that employ men
n_f <- 121 # women in dataset
n_m <- 417 # men in dataset

# I don't have the actual data, so simulate fake employment data,
# under one of two conditions.

# (a) All 34 categories with men employed are equally likely.
# In this case, men have a wider job spectrum.
# prob <- rep(1, k_m)

# (b) Only 10 of job categories have significant male employment.
# In this case, women have a wider job spectrum.
prob <- c(rep(1, 10), rep(0.01, k_m - 10))

set.seed(1234)

# Create a sample of size = n_m jobs by men.
occupations_men <- c(seq(k_m), sample.int(k_m, n_m - k_m, replace = TRUE, prob = prob))

# Define a function to draw bootstrap samples of size = n_j
# and count the number of unique job categories in the bootstrap sample.
bootstrap_men_jobs <- function() {
x <- sample(occupations_men, n_f, replace = TRUE)
length(unique(x))
}

# Generate many bootstrap samples.
boot_reps <- 1000
boot_sample <- replicate(boot_reps, bootstrap_men_jobs())

# The p-value is the probability of observing 19 or fewer jobs which employ men.
mean(boot_sample <= k_f)
#> [1] 0.627

• thank you for clarifying Scriddies suggestion and giving me an example. I have not tried bootstrapping before but I see how this can answer my question. Many thanks! Aug 19, 2022 at 14:35