I have a set A. For example, the set of high school graduates.
I have a subset $B \subset A$. For example, the enrollees in STEM college majors.
I have a dummy variable $G$. For example, gender.
I want to test whether females enroll in STEM majors at a lower rate than what they are represented in high school graduate class.
So, I want to test whether the mean or the median of $G$ is statistically different across the two groups.
Are the samples from the two groups independent?
What test should I use?