Skip to contents

Performs the standard log-log OLS scaling fit $$\log y_i = \log Y_0 + \beta \log p_i + \varepsilon_i,$$ where \(y_i\) is the crime count and \(p_i\) is the population of ward i. \(\beta > 1\) indicates super-linear (crime grows faster than population), \(\beta = 1\) linear, and \(\beta < 1\) sub-linear (protective) scaling (Bettencourt et al. 2007; D'Orsogna & Perc 2015 sec. 4.1).

Usage

morie_tps_urban_scaling_beta(
  category = "Assault",
  year = 2024L,
  save_fig = TRUE,
  fig_dir = NULL
)

Arguments

category

TPS category name.

year

Reference year used to choose the appropriate population and crime columns.

save_fig

Whether to write a log-log scatter + fit PNG.

fig_dir

Directory to write the PNG into; NULL (the default) skips writing and says so in the result.

Value

A morie_rich_result with \(\hat\beta\), its standard error, R-squared, the back-transformed prefactor \(Y_0\), and a regime label (sub-linear, linear, super-linear).

References

Bettencourt LMA, Lobo J, Helbing D, Kuhnert C, West GB (2007). Growth, innovation, scaling, and the pace of life in cities. PNAS 104: 7301-7306.

Examples

# \donttest{
  rr <- morie_tps_urban_scaling_beta("Assault", year = 2024,
                                      save_fig = FALSE)
  print(rr$summary_lines)
#> $Method
#> [1] "Bettencourt 2007 OLS log-log scaling"
#> 
#> $crime_col
#> [1] "ASSAULT_2024"
#> 
#> $pop_col
#> [1] "POPULATION_2025"
#> 
#> $n_wards
#> [1] 158
#> 
#> $beta
#> [1] 1.092
#> 
#> $SE_beta
#> [1] 0.112
#> 
#> $R2
#> [1] 0.379
#> 
#> $Y0
#> [1] 0.0027
#> 
#> $Regime
#> [1] "super-linear (beta > 1)"
#> 
#> $Figure
#> [1] "(skipped)"
#> 
# }