← Methods 3

In-class Exercises

Modeling

In this part we will make a simple model. We will attempt to make a model that can predict where there will be more pressure on renters due to Airbnb listings in their neighborhoods.

  1. Download today's data.
  2. In QGIS, open the shapefile in queens_airbnb_model.
  3. Using the field calculator, create two new fields. The new fields should scale each field using scale_linear.
    1. First, med_income has a minimum value of 15474, maximum value of 151964, so we use this expression in the field calculator:
      scale_linear("med_income", 
          15474, 151964,
          1, 0)
      Add an s_ at the beginning of the new field name to indicate that it is scaled. In this case, med_income becomes s_income (since you can only use 10 characters in a name). s_income should be a decimal number field with length 10 and precision 8.
    2. Follow a similar process for n_airbnb (calculated by counting the Airbnb listings per tract):
      scale_linear("n_airbnb", 
          minimum points, maximum points,
          0, 1)
      You'll need to find the minimum and maximum values for n_airbnb. Make the resulting field s_airbnb, also a decimal number with length 10 and precision 8.
  4. Create a graduated style for the tracts. For the column expression, add each of the scaled fields (s_airbnb, s_renters, s_income) together.