Open mateoclarke opened 9 years ago
Hi Mateo -
The ACS 3 Year for 2013 can provide you the following variables, which I looked up here: http://api.census.gov/data/2013/acs3/profile/variables.html
Total Population (count) DP05_0001E
Percent of Population in Elementary School -> i.e. does area have a lot of kids, similar to your question under 16 (or 18) DP02_0055PE -> includes grades 1-8
Percent of Multi-family homes vs. single units Sum the following to get total multifamily percentage DP04_0009PE -> 2 units DP04_0010PE -> 3 or 4 units DP04_0011PE -> 5 to 9 units DP04_0012PE -> 10 to 19 units DP04_0013PE -> 20 or more units
Poverty Rate DP03_0119PE -> Percentage of families below poverty line
Percentage of population that has health insurance DP03_0096PE
Let me know if this helps, happy to keep narrowing in on the right variables with you.
Jeff
:smile_cat: puuuurfect. Thanks! This seems like exactly what I needed. I'll let you know if I get stuck on something.
Hey @jmeisel , I'm having an trouble getting an API response that doesn't error.
And the error I'm getting is:
error: error: unknown variable 'DP05_0001E'
This is what my request looks like in app.js:
var sdk = new CitySDK();
var censusModule = sdk.modules.census;
censusModule.enable(config.citySDK_token);
var request = {
"lat": config.city_lat,
"lng": config.city_lng,
"level": "county",
"sublevel": "true",
"year" : 2013,
"api" : "acs3",
"variables": [
"income",
"population",
"poverty",
"DP05_0001E", // 1. Total Population
"DP02_0055PE", // 2. Percent of Population in Elementary School
// 3. Percent of Multi-family homes vs. single units
"DP04_0009PE", // 2 units
"DP04_0010PE", // 3 or 4 units
"DP04_0011PE", // 5 to 9 units
"DP04_0012PE", // 10 to 19 units
"DP04_0013PE", // 20 or more units
"DP03_0119PE", // 4. Percentage of families below poverty line
"DP03_0096PE" // 5. Percentage of population that has health insurance
]
};
censusModule.APIRequest(request, function (response) {
window.CensusData = response;
});
Hey Mateo - let me loop in David my teammate to see if he can assist in debugging. (via email)
Jeff
On Tue, Sep 29, 2015 at 12:24 PM, Mateo Clarke notifications@github.com wrote:
Hey @jmeisel https://github.com/jmeisel , I'm having an trouble getting an API response that doesn't error.
This is the call I'm making:
And the error I'm getting is: error: error: unknown variable 'DP05_0001E'
This is what my request looks like in app.js:
var sdk = new CitySDK(); var censusModule = sdk.modules.census; censusModule.enable(config.citySDK_token);
var request = { "lat": config.city_lat, "lng": config.city_lng, "level": "county", "sublevel": "true", "year" : 2013, "api" : "acs3", "variables": [ "income", "population", "poverty", "DP05_0001E", // 1. Total Population "DP02_0055PE", // 2. Percent of Population in Elementary School // 3. Percent of Multi-family homes vs. single units "DP04_0009PE", // 2 units "DP04_0010PE", // 3 or 4 units "DP04_0011PE", // 5 to 9 units "DP04_0012PE", // 10 to 19 units "DP04_0013PE", // 20 or more units "DP03_0119PE", // 4. Percentage of families below poverty line "DP03_0096PE" // 5. Percentage of population that has health insurance ] };
— Reply to this email directly or view it on GitHub https://github.com/open-austin/atx-citysdk-js/issues/9#issuecomment-144127703 .
@mateoclarke After spending an hour testing, my recommendation is the following:
There is something up when using CitySDK with the 3-Year and DP variables and I haven't root caused it. Making your requests like this using the 5-Year, Aliases, and B variables works fine though:
var request = {
zip: zip.val(),
api: "acs5",
variables: [
"population",
"income",
"poverty_family",
"B01001_004E",
"B01001_028E"
],
level: $("#level option:selected").val()
}
This returns something like this:
ZIP: 78756 Coordinates: +30.3222297, -097.7401666 Population 3233 Median Income: 60456 Number of Families Below Poverty 20 Male Ages 5-9 34 Female Ages 5-9 140
Here's the API doc that describes which variables are available: http://api.census.gov/data/2013/acs5/variables.html
Hey @jmeisel, thanks for trying to debug. This got me 90% of the way there. I'm having trouble finding an appropriate measure of housing density in http://api.census.gov/data/2013/acs5/variables.html
There are just so many variables in the table it's hard to find exactly what you are looking for. I tried "Units in Structure" but most of those deal with tenure, ownership, or cost. Could be overlooking something.
@mateoclarke Housing Units should be this variable: "B25001_001E"
Example request via the variable tester code (provided in the gist above)
var request = {
zip: zip.val(),
"api": "acs5",
variables: [
"population",
"income",
"poverty_family",
"B01001_004E",
"B01001_028E",
"B25001_001E",
],
}
Return values:
ZIP: 78756 Coordinates: +30.3222297, -097.7401666 Population 1337 Median Income: 70563 Number of Families Below Poverty null Male Ages 5-9 34 Female Ages 5-9 110 Unweighted Housing Units 657
@mateoclarke Also I am in the midst of building some tools to help alleviate the painpoint of trying to search those huge variable files to find what you are looking for... I realize that is very annoying.
:+1:
For each Census Tract, we need metrics for at least:
The CitySDK query builder has a handful of variables listed but it looks like we need to dig into the Census API Docs for the right values.
We also may need to sum a list of values (like for
Ages 0-5 + Ages 6-10 + Ages 11-15 + ...
)Also, is it better to use the ACS 3 year or 5 year survey? I was looking at the 3 year for 2013.
Can you point me in the right direction @jmeisel?