library(tidyverse)
library(readxl)
library(sf)
library(RColorBrewer)
library(tmap)
library(plotly)
source("functions.R")
Setting up CEJST data
Investigating the relationship between black population and disadvantaged population
## [1] 0.2613683
##
## Pearson's product-moment correlation
##
## data: j3$blackpct and j3$dispct
## t = 15.382, df = 3227, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.2289383 0.2932187
## sample estimates:
## cor
## 0.2613683
##
## Call:
## lm(formula = dispct ~ blackpct, data = j3)
##
## Residuals:
## Min 1Q Median 3Q Max
## -87.078 -31.736 -7.105 28.555 59.323
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 40.67731 0.72590 56.04 <2e-16 ***
## blackpct 0.65299 0.04245 15.38 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 35.37 on 3227 degrees of freedom
## (5 observations deleted due to missingness)
## Multiple R-squared: 0.06831, Adjusted R-squared: 0.06802
## F-statistic: 236.6 on 1 and 3227 DF, p-value: < 2.2e-16
## tmap mode set to interactive viewing