Data sources
tulsa_grid_all <- st_read("D:/google_drive/00_city_logistics/01_production/shapefiles/eua/tulsa_grid_all.shp")
tulsa_ware <- st_read("D:/google_drive/00_city_logistics/01_production/shapefiles/eua/tulsa_ware.shp")
tulsa_poi <- st_read("D:/google_drive/00_city_logistics/01_production/shapefiles/eua/tulsa_poi.shp")
tulsa_road <- st_read("D:/google_drive/00_city_logistics/01_production/shapefiles/eua/tulsa_road.shp")
tulsa_grid_all <- tulsa_grid_all[,-c(1,2,3, 5, 6, 7, 8)]
names(tulsa_grid_all) <- c("id", "poi", "km", "wh", "avg_price", "sum_size", "avg_size", "area", "geometry")
tulsa_grid_all <- mutate(tulsa_grid_all, ipoi = poi/1741)
tulsa_grid_all <- mutate(tulsa_grid_all, ikm = km/59391.01)
tulsa_grid_all <- mutate(tulsa_grid_all, iwh = wh/45)
tulsa_grid_all <- mutate(tulsa_grid_all, iprice = avg_price/0.4763347)
tulsa_grid_all <- mutate(tulsa_grid_all, isize = avg_size/70073.35)
tulsa_grid_all <- mutate(tulsa_grid_all, wh_per_poi = wh/poi)
tulsa_grid_all <- mutate(tulsa_grid_all, wh_per_km = wh/km)
km proportion
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> 1.415e-06 6.463e-04 9.605e-04 1.163e-03 1.313e-03 9.732e-03
> Concentration of POI is much more intense than of km in Tulsa.
Regression models
lm1 <- lm(wh ~ poi + km + avg_price, data=tulsa_grid_all)
summary(lm1)
#>
#> Call:
#> lm(formula = wh ~ poi + km + avg_price, data = tulsa_grid_all)
#>
#> Residuals:
#> Min 1Q Median 3Q Max
#> -2.3462 0.0098 0.0135 0.0157 5.5595
#>
#> Coefficients:
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) -9.823e-03 1.795e-02 -0.547 0.584
#> poi 1.074e-02 1.625e-03 6.608 6.77e-11 ***
#> km -9.399e-05 2.599e-04 -0.362 0.718
#> avg_price 4.997e+00 1.671e-01 29.899 < 2e-16 ***
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#>
#> Residual standard error: 0.2879 on 869 degrees of freedom
#> Multiple R-squared: 0.6515, Adjusted R-squared: 0.6503
#> F-statistic: 541.4 on 3 and 869 DF, p-value: < 2.2e-16
lm2 <- lm(wh ~ poi + avg_price, data=tulsa_grid_all)
summary(lm2)
#>
#> Call:
#> lm(formula = wh ~ poi + avg_price, data = tulsa_grid_all)
#>
#> Residuals:
#> Min 1Q Median 3Q Max
#> -2.3425 0.0152 0.0152 0.0152 5.5536
#>
#> Coefficients:
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) -0.015223 0.009958 -1.529 0.127
#> poi 0.010314 0.001133 9.106 <2e-16 ***
#> avg_price 4.980772 0.160642 31.005 <2e-16 ***
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#>
#> Residual standard error: 0.2878 on 870 degrees of freedom
#> Multiple R-squared: 0.6514, Adjusted R-squared: 0.6506
#> F-statistic: 812.9 on 2 and 870 DF, p-value: < 2.2e-16
lm3 <- lm(iwh ~ iprice, data=tulsa_grid_all)
summary(lm3)
#>
#> Call:
#> lm(formula = iwh ~ iprice, data = tulsa_grid_all)
#>
#> Residuals:
#> Min 1Q Median 3Q Max
#> -0.061701 0.000017 0.000017 0.000017 0.121506
#>
#> Coefficients:
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) -1.661e-05 2.285e-04 -0.073 0.942
#> iprice 5.968e-02 1.589e-03 37.552 <2e-16 ***
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#>
#> Residual standard error: 0.006689 on 871 degrees of freedom
#> Multiple R-squared: 0.6182, Adjusted R-squared: 0.6177
#> F-statistic: 1410 on 1 and 871 DF, p-value: < 2.2e-16
lm4 <- lm(iprice ~ ipoi, data=tulsa_grid_all)
summary(lm4)
#>
#> Call:
#> lm(formula = iprice ~ ipoi, data = tulsa_grid_all)
#>
#> Residuals:
#> Min 1Q Median 3Q Max
#> -0.70421 -0.00622 -0.00622 -0.00622 1.38706
#>
#> Coefficients:
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 0.006216 0.004404 1.411 0.159
#> ipoi 11.573348 0.780197 14.834 <2e-16 ***
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#>
#> Residual standard error: 0.1274 on 871 degrees of freedom
#> Multiple R-squared: 0.2017, Adjusted R-squared: 0.2008
#> F-statistic: 220 on 1 and 871 DF, p-value: < 2.2e-16
lm5 <- lm(iprice ~ ikm, data=tulsa_grid_all)
summary(lm5)
#>
#> Call:
#> lm(formula = iprice ~ ikm, data = tulsa_grid_all)
#>
#> Residuals:
#> Min 1Q Median 3Q Max
#> -0.45869 -0.02815 -0.00499 0.01813 1.29744
#>
#> Coefficients:
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) -0.058972 0.006178 -9.545 <2e-16 ***
#> ikm 68.482539 3.979960 17.207 <2e-16 ***
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#>
#> Residual standard error: 0.1232 on 871 degrees of freedom
#> Multiple R-squared: 0.2537, Adjusted R-squared: 0.2528
#> F-statistic: 296.1 on 1 and 871 DF, p-value: < 2.2e-16
lm6 <- lm(iprice ~ iwh + ikm +ipoi, data=tulsa_grid_all)
summary(lm6)
#>
#> Call:
#> lm(formula = iprice ~ iwh + ikm + ipoi, data = tulsa_grid_all)
#>
#> Residuals:
#> Min 1Q Median 3Q Max
#> -0.71555 -0.01402 -0.00477 0.00410 1.14917
#>
#> Coefficients:
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) -0.020453 0.005326 -3.840 0.000132 ***
#> iwh 9.585743 0.320609 29.899 < 2e-16 ***
#> ikm 27.420207 4.522396 6.063 1.99e-09 ***
#> ipoi -2.150736 0.863985 -2.489 0.012985 *
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#>
#> Residual standard error: 0.08613 on 869 degrees of freedom
#> Multiple R-squared: 0.6361, Adjusted R-squared: 0.6349
#> F-statistic: 506.4 on 3 and 869 DF, p-value: < 2.2e-16
lm7 <- lm(iprice ~ iwh + ikm , data=tulsa_grid_all)
summary(lm7)
#>
#> Call:
#> lm(formula = iprice ~ iwh + ikm, data = tulsa_grid_all)
#>
#> Residuals:
#> Min 1Q Median 3Q Max
#> -0.67640 -0.01120 -0.00472 0.00189 1.16333
#>
#> Coefficients:
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) -0.013661 0.004587 -2.978 0.00298 **
#> iwh 9.404558 0.313169 30.030 < 2e-16 ***
#> ikm 19.521115 3.231866 6.040 2.28e-09 ***
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#>
#> Residual standard error: 0.08639 on 870 degrees of freedom
#> Multiple R-squared: 0.6335, Adjusted R-squared: 0.6327
#> F-statistic: 752.1 on 2 and 870 DF, p-value: < 2.2e-16