### Install getcensus from GitHub Source: https://centeronbudget.github.io/getcensus/getting-started.html Install the latest version of getcensus directly from GitHub. This is useful if you need the most up-to-date features. ```stata net install getcensus, from("https://raw.githubusercontent.com/CenterOnBudget/getcensus/master/src") replace__ ``` -------------------------------- ### Update getcensus Installation Source: https://centeronbudget.github.io/getcensus/getting-started.html Run this command to update your existing getcensus installation to the latest available version. ```stata ado update getcensus, update__ ``` -------------------------------- ### Example Usage of Geographic Components Source: https://centeronbudget.github.io/getcensus/geographies.html Demonstrates how to use geographic components with the `geography()` option. This example requests data for states and includes geographic components for metropolitan statistical area status. ```bash getcensus [variable IDs], geography(state) geocomponents(H0 C0) ``` -------------------------------- ### Install getcensus from SSC Source: https://centeronbudget.github.io/getcensus/getting-started.html Use this command to install the getcensus package from the Stata Statistical Software Components (SSC) archive. Requires Stata version 13.1 or later. ```stata ssc install getcensus__ ``` -------------------------------- ### Catalog: All Variables in a Product Type Source: https://centeronbudget.github.io/getcensus/examples.html Retrieve a list of all variables available within a specified product type (e.g., DP for Detailed Profile). ```bash getcensus catalog, product(DP)__ ``` -------------------------------- ### Retrieve Data Using a Keyword Source: https://centeronbudget.github.io/getcensus/examples.html Fetch data by using a keyword that maps to specific variables or tables. ```bash getcensus medinc__ ``` -------------------------------- ### Retrieve Data for Specific Samples Source: https://centeronbudget.github.io/getcensus/examples.html Specify the sample number for data retrieval. The default sample is 1. This can be combined with year specifications. ```bash getcensus B19013, sample(5) ``` ```bash getcensus B19013, sample(3) year(2013)__ ``` -------------------------------- ### Retrieve a Single Table Source: https://centeronbudget.github.io/getcensus/examples.html Use this to fetch all variables from a specific table. ```bash getcensus S2701__ ``` -------------------------------- ### Retrieve Multiple Variables from Different Tables Source: https://centeronbudget.github.io/getcensus/examples.html Fetch variables from multiple tables by specifying their respective codes. ```bash getcensus S1701_C03_001 S2701_C05_001__ ``` -------------------------------- ### Catalog: Variables Matching a Search Term Source: https://centeronbudget.github.io/getcensus/examples.html Search for variables based on a keyword. You can optionally filter by product type or table. ```bash getcensus catalog, search(children) product(ST) ``` ```bash getcensus catalog, search(educational attainment) table(S1701)__ ``` -------------------------------- ### Retrieve ACS Data with getcensus Source: https://centeronbudget.github.io/getcensus/syntax.html Use this syntax to retrieve specific variables, tables, or keywords from the ACS. Ensure variable IDs come from tables of the same product type. Do not suffix variable IDs with 'E' or 'M'. ```bash getcensus {variable IDs, table ID, or keyword} [, options] ``` -------------------------------- ### Search the API Data Dictionary Source: https://centeronbudget.github.io/getcensus/syntax.html Searches the API data dictionary for variables using keywords, table IDs, or product types, with options for year, sample, and caching. ```APIDOC ## Search the API Data Dictionary ### Syntax ``` getcensus catalog [, options] ``` ### Options For a complete description of options, see Options. #### Main `**_year_s(**_numlist_**)`year(s) to retrieve; default is latest available. `**_samp_le(**_integer_**)`1, 3, or 5; default is 1. `**_pr_oduct(**_string_**)`load the API data dictionary for estimates of given product type. `**_t_able(**_string_**)`load the API data dictionary for estimates in a given table. `**search(**_string_**)`load the API data dictionary for estimates with descriptions matching a search term. **`clear`**replace the data in memory, even if the current data have not been saved to disk. **`browse`**browse the retrieved data in the Data Editor after getcensus completes. #### Advanced Options `**_cache_path(**_string_**)`customize where getcensus caches API data dictionaries. ``` -------------------------------- ### Catalog: Variables from a Single Table Source: https://centeronbudget.github.io/getcensus/examples.html Retrieve a list of all variables contained within a specific table. ```bash getcensus catalog, table(S0901)__ ``` -------------------------------- ### Retrieve Data with Geographic Components Source: https://centeronbudget.github.io/getcensus/examples.html Specify geographic components for data retrieval. This is useful for more granular geographic analysis. ```bash getcensus B19013, geocomponents(H0) ``` ```bash getcensus B19013, geocomponents(01 43) statefips(13) ``` ```bash getcensus B19013, sample(5) geography(us) geocomponents(92)__ ``` -------------------------------- ### Retrieve a Single Variable Source: https://centeronbudget.github.io/getcensus/examples.html Use this to fetch a specific variable from a table. ```bash getcensus B19013_001__ ``` -------------------------------- ### Retrieve Data for Multiple Years Source: https://centeronbudget.github.io/getcensus/examples.html Specify multiple years for data retrieval. Years can be provided as a range or a list of discrete years. ```bash getcensus B19013, years(2018/2019) ``` ```bash getcensus B19013, years(2010 2015 2019)__ ``` -------------------------------- ### Search API Data Dictionary with getcensus Source: https://centeronbudget.github.io/getcensus/syntax.html Use this syntax to search the Census Bureau API data dictionary. Options allow filtering by year, product type, table, or search terms. ```bash getcensus catalog [, options] ``` -------------------------------- ### Retrieve Data for a Single Year Source: https://centeronbudget.github.io/getcensus/examples.html Specify a single year to retrieve data for that particular year. If no year is specified, the most recent available year is used. ```bash getcensus B19013, year(2010)__ ``` -------------------------------- ### Retrieve Multiple Variables from a Single Table Source: https://centeronbudget.github.io/getcensus/examples.html Fetch several variables from the same table by listing their codes. ```bash getcensus DP02_0053 DP02_0054 DP02_0055 DP02_0056 DP02_0057__ ``` -------------------------------- ### Load Entire Table with getcensus Source: https://centeronbudget.github.io/getcensus Loads all variables within a specified ACS table. This command retrieves estimates, margins of error, and associated metadata. ```stata getcensus S1701 ``` -------------------------------- ### Search API Data Dictionary with getcensus catalog Source: https://centeronbudget.github.io/getcensus Searches the Census Bureau API data dictionary to find variable IDs, descriptions, and table names. Use the 'product()' option to filter by data product, such as 'ST' for ACS subject tables. ```stata getcensus catalog, product(ST) ``` -------------------------------- ### Retrieve Data for Specific Geography Types Source: https://centeronbudget.github.io/getcensus/examples.html Specify the type of geography for data retrieval. The default geography type is 'state'. ```bash getcensus B19013, geography(us) ``` ```bash getcensus B19013, geography(county) ``` ```bash getcensus B19013, sample(5) geography(sldu) statefips(26)__ ``` -------------------------------- ### Load Specific Variable with getcensus Source: https://centeronbudget.github.io/getcensus Loads a specific variable from the ACS API. By default, it retrieves estimates and margins of error, along with metadata like variable labels and notes. ```stata getcensus S1701_C02_001 ``` -------------------------------- ### Retrieve Data Within a State or Set of States Source: https://centeronbudget.github.io/getcensus/examples.html Filter data retrieval by specifying state FIPS codes. This can be used with specific geography types. ```bash getcensus B19013, statefips(11) ``` ```bash getcensus B19013, geography(county) statefips(04) ``` ```bash getcensus B19013, geography(congressional district) statefips(24 51) ``` ```bash getcensus B19013, sample(5) geography(metro) statefips(06)__ ``` -------------------------------- ### Retrieve Data with Specific GEOIDs Source: https://centeronbudget.github.io/getcensus/examples.html Filter data retrieval using specific GEOIDs. This allows for precise geographic targeting, often in conjunction with state and county FIPS codes. ```bash getcensus B19013, geography(metro) geoids(47900) ``` ```bash getcensus B19013, geography(county) statefips(24) geoids(005 510) ``` ```bash getcensus B19013, sample(5) geography(tract) statefips(01) countyfips(001) geoids(020100)__ ``` -------------------------------- ### Retrieve ACS Data Source: https://centeronbudget.github.io/getcensus/syntax.html Retrieves American Community Survey (ACS) data using variable IDs, table IDs, or keywords, with various options for customization. ```APIDOC ## Retrieve ACS Data ### Syntax ``` getcensus {variable IDs, table ID, or keyword} [, options] ``` Variable IDs | If a list of variable IDs is specified, the variables must come from tables that share the same product type (Data Profile, Subject Table, Comparison Profile, or Detailed Table). For information about ACS tables and product types, see Table IDs Explained on the Census Bureau website. Do not not suffix variable IDs with “E” (for estimate) or “M” (for margin of error). ---|--- Table ID | Only a single table ID may be specified. Keyword | A curated set of variables. See Keywords. ### Options For a complete description of options, see Options. #### Main `**_year_s(**_numlist_**)`year(s) to retrieve; default is the most recent available. `**_samp_le(**_integer_**)`1, 3, or 5; default is 1. `**_geo_graphy(**_string_**)`geography to retrieve; default is state. `**key(**_string_**)`your Census Bureau API key. `**_nolab_el(**_string_**)`do not label variables with associated metadata from the API data dictionary. `**_noerr_or**`do not retrieve margins of error associated with estimates. `**saveas(**_filename_**)`save retrieved data as a Stata dataset. `**_ex_portexcel**`if`saveas()` is specified, also save retrieved data as an Excel spreadsheet. **`replace`**if`saveas()` is specified, overwrite existing files. **`clear`**replace the data in memory, even if the current data have not been saved to disk. **`browse`**browse the retrieved data in the Data Editor after getcensus completes. #### Geography Options `**_st_atefips(**_string_**)`state FIPS codes of states to retrieve; default is usually all. `**_co_untyfips(**_string_**)`county FIPS codes of counties to retrieve; default is usually all. `**_geoid_s(**_string_**)`GEOIDs of geographies to retrieve; default is usually all. `**_geocomp_onents(**_string_**)`geographic component codes of geographies to retrieve. #### Advanced Options `**_cache_path(**_string_**)`customize where getcensus caches API data dictionaries. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.