ImportanceThe association between cancer mortality and risk factors may vary by geography. However, conventional methodological approaches rarely account for this variation.ObjectiveTo identify geographic variations in the association between risk factors and cancer mortality.Design, Setting, and ParticipantsThis geospatial cross-sectional study used county-level data from the National Center for Health Statistics for individuals who died of cancer from 2008 to 2019. Risk factor data were obtained from County Health Rankings & Roadmaps, Health Resources and Services Administration, and Centers for Disease Control and Prevention. Analyses were conducted from October 2021 to July 2022.Main Outcomes and MeasuresConventional random forest models were applied nationwide and by US region, and the geographical random forest model (accounting for local variation of association) was applied to assess associations between a wide range of risk factors and cancer mortality.ResultsThe study included 7 179 201 individuals (median age, 70-74 years; 3 409 508 women [47.5%]) who died from cancer in 3108 contiguous US counties during 2008 to 2019. The mean (SD) county-level cancer mortality rate was 177.0 (26.4) deaths per 100 000 people. On the basis of the variable importance measure, the random forest models identified multiple risk factors associated with cancer mortality, including smoking, receipt of Supplemental Nutrition Assistance Program (SNAP) benefits, and obesity. The geographical random forest model further identified risk factors that varied at the county level. For example, receipt of SNAP benefits was a high-importance factor in the Appalachian region, North and South Dakota, and Northern California; smoking was of high importance in Kentucky and Tennessee; and female-headed households were high-importance factors in North and South Dakota. Geographic areas with certain high-importance risk factors did not consistently have a corresponding high prevalence of the same risk factors.Conclusions and RelevanceIn this cross-sectional study, the associations between cancer mortality and risk factors varied by geography in a way that did not correspond strictly to risk factor prevalence. The degree to which other place-specific characteristics, observed and unobserved, modify risk factor effects should be further explored, and this work suggests that risk factor importance may be a preferable paradigm for selecting cancer control interventions compared with risk factor prevalence.