=======================================================================================================
For many years the Census department has gather data by race in the United States. For example, population density by race and mobility by race. The information gather by the us census can show changes in density in a certain part of a city. Adding a heat map to a geographical map can show the density of population in a particular part of the city. Not till recently where software is more available to analyze large amount of data can this be more helpful in analyzing census data. This page gathers the data from the US census American Community Survey for people who classified themselves as Hispanic/Latino. The R code for gathering the data is shown bellow and the parameters. The data then is transform into a data table using the DT package in r.
## R code for getting the census ACS data
The fallowing R code is use to gather the data from the US census. The census “tract”" is an area equivalent to a neighborhood that is established by census department to help analyze and understand the population of a county. The census tract covers an area of population around 2,775 people. Census tract are smaller than the size of the county.
his.mobi <- get_acs(geography = "tract", # Requestion Census tract.
variables = "B07004I_001", #
state = "CA", # 2 digit abribiation of US state.
county = "Los Angeles County", # County must match state it is in.
year = 2017, # Year of the data.
survey = "acs5", # acs5 = five year survey.
geometry = T, # Must be true to get the geometry configerations for the data.
moe_level = 95, # The confidence level in percentage.
summary_var = "B07004I_001", # Geographical Mobility in the Past Year (Hispanic or Latino) for Current Residence in the United States.
cache_table = T, # To save the data ones is called the first time.
output = "tidy") # Type of output
Below is the data table of the census Hispanic geographical mobility in the past Year for Current Residence in the United States. ID is the observation number. GEOID is the census geographical identifier. Census Tract is the number given by the Census to tract the Estimate. It also shows the location. ACS Code is the code use by the Census to classify the question given in the ACS survey. Estimate is the Census estimate gather from the survey. MOE is the margin of error. Summary Estimate is the total of the ACS code. For example, ACS code B07004I_003 is Hispanic mobility in county while B07004I_001 is the total of Hispanic mobility including from out of state and country. Finally, Summary MOE is the margin of error for the observation Summary Estimate.
Data Table for B07004I
Hispanic Americans
Movement of Hispanic Americans in LA County