ObjectivesEvaluating the costs of illness can provide evidence to improve performance at all levels of health organizations. This study aimed to identify the relationship between the costs of diagnosing and treating patients with gastric cancer and their explanatory variables, using quantile and gamma regressions and comparing the results of the two models. MethodsThis was a cross-sectional and descriptive-analytic study carried out in 2016. In total, 449 patients with gastric cancer were selected at a hospital affiliated with Mashhad University of Medical Sciences. Direct costs and other variables were collected from medical documents. Data were analyzed using the STATA 12 software, using quantile and gamma regression analysis, and the results were compared. ResultsThe highest average cost per patient was related to hospitalization costs in both metastatic (20 911 034 Iranian Rials) and nonmetastatic patients (20 738 062 Iranian Rials). The lowest average cost was related to biopsy services in nonmetastatic patients. The results of the study also showed that quantile regression is an appropriate substitute for gamma regression and, in some cases, can provide more information for the analysis of disease costs. Based on the results of the quantile regression, being a male and having a shorter stay had a positive effect on cost and the age of the patient had a significantly negative effect. ConclusionsExamining the cost of a common illness, such as gastric cancer, is an important economic tool for policy makers and decision makers. It provides evidence-based decision making about resource allocation that they can use for future planning and cost control.