This study examines the complex interplay of gender and other demographics on continuation rates in high school physics. Using a diverse dataset that combines demographics from the Canadian Census and eleven years of gendered enrolment data from the Ontario Ministry of Education, we track student cohorts as they transition from mandatory science to elective physics courses. We then employ hierarchical linear modelling to quantify the interaction effects between gender and other demographics, providing a detailed perspective on the on continuation in physics. Our results indicate the racial demographics of a school’s neighbourhood have a limited impact on continuation once controlling for other factors such as socioeconomic status, though neighbourhoods with a higher Black population were a notable exception, consistently exhibiting significantly lower continuation rates for both male and female students. A potential role model effect related to parental education was also found as the proportion of parents with science, technology, engineering, and mathematics (STEM) degrees correlates positively with increased continuation rates, whereas an increase in non-STEM degrees corresponds with a reduced student continuation rate. The most pronounced effects are school-level factors. Continuation rates in physics are very strongly correlated with continuation in chemistry or calculus — effects that much stronger for male than female students. Conversely, continuation in biology positively correlates with the continuation of female students in physics, with little to no effect found for male students. Nevertheless, the effect sizes observed for chemistry and calculus markedly outweigh that for biology. This is further evidence that considering STEM as a homogeneous subject when examining gender disparities is misguided. These insights can guide future education policies and initiatives to increase continuation rates and foster greater gender equity and inclusivity in physics education.