Background:To help broaden the use of machine-learning approaches in health services research, we provide an easy-to-follow framework on the implementation of random forests and apply it to identify quality of care (QC) patterns correlated with treatment receipt among Medicare disabled patients with hepatitis C virus (HCV).Methods:Using Medicare claims 2006-2009, we identified 1936 patients with 6 months continuous enrollment before HCV diagnosis. We ran a random forest on 14 pretreatment QC indicators, extracted the forest's representative tree, and aggregated its terminal nodes into 4 QC groups predictive of treatment. To explore determinants of differential QC receipt, we compared patient-level and county-level (linked AHRF data) characteristics across QC groups.Results:The strongest predictors of treatment included liver biopsy, HCV genotype testing, specialist visit, HCV viremia confirmation, and iron overload testing. High QC [n=360, proportion treated (pt)=33.3%] was defined for patients with at least 2 from the above-mentioned metrics. Good QC patients (n=302, pt=12.3%) had either HCV genotype testing or specialist visit, whereas fair QC (n=282, pt=7.1%) only had HCV viremia confirmation. Low QC patients (n=992, pt=2.5%) had none of the selected metrics. The algorithm accuracy of predicting treatment was 70% sensitivity and 78% specificity. HIV coinfection, drug abuse, and residence in counties with higher supply of hospitals with immunization and AIDS services correlated with lower QC.Conclusions:Machine-learning techniques could be useful in exploring patterns of care. Among Medicare disabled HCV patients, the receipt of more QC indicators was associated with higher treatment rates. Future research is needed to assess determinants of differential QC receipt.