Information is collected via a questionnaire or some other method within the context of a particular statistical program run by a federal or state agency or some other organization or researcher.
Example questions from Department of Health and Human Services. Substance Abuse and Mental Health Services Administration. 2007 National Survey on Drug Use and Health, CAI Specifications for Programming:
The data from the statistical program are disseminated. The data may be made available as microdata, a.k.a. raw data. Microdata are the actual responses rather than data aggregated into groups. Efforts might be undertaken to protect privacy.
The microdata might look something like this:
19872624 828 1 1092714 4 15 ...
12764198 828 0 1092793 2 13 ...
26874202 653 1 1426167 3 08 ...
The data from the statistical program are disseminated. The data may sometimes be aggregated, summarized, and/or tabulated.
Example table from the Substance Abuse and Mental Health Data Archive:
The data from the statistical program are disseminated. The most useful/popular statistical tables may be published in statistical reports and other publications. This is the most common and easiest way to collect statistics.
Example table from Department of Health and Human Services. Substance Abuse and Mental Health Services Administration. Office of Applied Studies. 2007 National Survey on Drug Use & Health: Detailed Tables.
Statistical data from various statistical programs may be republished, reaggregated, or retabulated in statistical compendia.
Compendia present a wide variety of data and cite the source of the data. Thus, they can be used to find out what agencies and programs produce what statistics. The original source from which the data are taken often include much more detailed data than the compendium.
Example from Department of Commerce. Census Bureau. Statistical Abstract of the United States, 2010:
Presentation is based on that of Sherry DeDecker and Eric Forte. "Statistical Information from the Government: Teaching the General Reference Librarian." DttP: Documents to the People 34, no. 2 (Summer 2006): 16.