We investigate the role of public research investment (R&D) and learning by doing (LBD) in improving productivity through an empirical examination of the US agricultural production sector. We construct a dual model and track R&D and LBD impacts on returns to scale, production cost, and input demand utilizing data for more than a century. A Bayesian approach is used to maintain regularity conditions implied by economic theory. We find that US agriculture shows significant evidence of increasing returns to scale when both R&D and LBD are included in the production process. R&D and LBD are complementary in reducing cost as an increase in one stock significantly strengthens the cost-reducing effect of the other. The direct impacts of R&D and LBD on scale economies, cost, and input demands are sensitive to choices of R&D lag structure, LBD proxy, LBD knowledge depreciation rate, and data period. But input demand price elasticities are highly robust across model specification.