The agencies vary significantly in terms of how productive they are and how successful their patents are. Some agencies in particular, such as the National Institute of Biomedical Imaging and Bioengineering (NIBIB) have exceptional records for producing research that is widely useful: NIBIB is estimated to spur an additional $578.2 million, or 25 patents, for every $100 million in R&D expenditures. The DoD and NASA, on the other hand, are less efficient at producing patents at only around 2-3 patents per $100 million in R&D expenditures. (although, as the report notes, defense spending is more likely to be classified and thus not patentable)
Patent output per research dollar compares favorably with private-sector cost efficiency in many agencies. According to the Brookings Institution, private sector R&D spending averages $3.5 million per patent. The Batelle report, however, estimates that federal R&D spending averaged $3.1 million per patent across all NIH agencies.
For the full report: http://www.battelle.org/docs/tpp/battelle_2015_patents_as_proxies.pdf?sfvrsn=2