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.
- Download today's data.
- In QGIS, open the shapefile in queens_airbnb_model.
- Using the field calculator, create two new fields. The new fields should scale each field using
scale_linear
.- First, med_income has a minimum value of 15474, maximum value of 151964, so we use this expression in the field calculator:
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.scale_linear("med_income", 15474, 151964, 1, 0)
- Follow a similar process for n_airbnb (calculated by counting the Airbnb listings per tract):
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.scale_linear("n_airbnb", minimum points, maximum points, 0, 1)
- First, med_income has a minimum value of 15474, maximum value of 151964, so we use this expression in the field calculator:
- Create a graduated style for the tracts. For the column expression, add each of the scaled fields (s_airbnb, s_renters, s_income) together.