We developed a hierarchical Bayesian framework to estimate S-factors and thermonuclear rates for the 3 He(d,p) 4 He reaction, which impacts the primordial abundances of 3 He and 7 Li. The available data are evaluated and all direct measurements are taken into account in our analysis for which we can estimate separate uncertainties for systematic and statistical effects. For the nuclear reaction model, we adopt a single-level, two-channel approximation of R-matrix theory, suitably modified to take the effects of electron screening at lower energies into account. In addition to the usual resonance parameters (resonance location and reduced widths for the incoming and outgoing reaction channel), we include the channel radii and boundary condition parameters in the fitting process. Our new analysis of the 3 He(d,p) 4 He S-factor data results in improved estimates for the thermonuclear rates. This work represents the first nuclear rate evaluation using R-matrix theory embedded into a hierarchical Bayesian framework, properly accounting for all known sources of uncertainty. Therefore, it provides a test bed for future studies of more complex reactions.