Exercise 4: Geodemographic Analysis of Los Angeles

Instructions

  1. Using the DataStore for geosnap at /srv/data/geonsap extract census tract data for Los Angeles using the ACS 2021 dataset.
  2. Define a list called cluster_variables containing the following variables:
    • “median_household_income”,
    • “median_home_value”,
    • “p_edu_college_greater”,
    • “p_edu_hs_less”,
    • “p_nonhisp_white_persons”,
    • “p_nonhisp_black_persons”,
    • “p_hispanic_persons”,
    • “p_asian_persons”,
  3. Create a new GeoDataFrame that subsets the cluster_variables.
  4. Add the variable n_total_pop to the new GeoDataFrame.
  5. Fill any NAN values with 0
  6. Plot a map of the geometries
  7. Create a Queen contiguity spatial weights object for this dataframe
  8. Create a new geodataframe by dropping the Channel Island tracts.
  9. Recreate the Queen weights for the new geodataframe
  10. Using small multiples, create choropleth maps using quintiles for each of the variables.
  11. Create a pairplot using seaborn for the cluster variables.
  12. Determine the number of neighborhoods that would be required if each neighborhood had an average of 8000 total population. Let this be the integer valued variable n_hoods
  13. Using KMeans, define neighborhoods with k=n_hoods.
  14. Using Agglomerative Clustering, define neighborhoods with the number of clusters equal to n_hoods
  15. Add a contiguity constraint to Agglomerative clustering and generate new neighborhood definitions.
  16. Using MaxP, define neighborhoods using the cluster_variables with a threshold of 8000 for the n_total_pop variable.
  17. Compare all four cluster solutions by using small multiples to plot four categorical maps of the clusters.
  18. Compare all four cluster solutions using the Rand Index. Comment on which solutions are most similar. Why might this be?
  19. Compare all four cluster solutions based on silhouette scores. Comment on the rankings of the four methods in terms of these scores. Provide an explanation for your findings.

Export your notebook as a pdf and submit on Canvas.

Due April 11 midnight