We analyze two high-quality Southern Californian earthquake catalogues, one with focal mechanisms, to statistically model and test for dependencies of the earthquake-size distribution, the b values, on both faulting style and depth. In our null hypothesis, b is assumed constant. We then develop and calibrate one model based only on faulting style, another based only on depth dependence and two models that assume a simultaneous dependence on both parameters. We develop a new maximum-likelihood estimator corrected for the degrees of freedom to assess models' performances. Our results show that all models significantly reject the null hypothesis. The best performing is the one that simultaneously takes account of depth and faulting style. Our results suggest that differential stress variations in the Earth's crust systematically influence b values and that this variability should be considered for contemporary seismic hazard studies.