Residential segregation, homeownership, and income inequality

r = getOption("repos")
r["CRAN"] = "http://cran.us.r-project.org"
options(repos = r)

install.packages("tidyverse")
## Installing package into 'C:/Users/canda/AppData/Local/R/win-library/4.3'
## (as 'lib' is unspecified)
## package 'tidyverse' successfully unpacked and MD5 sums checked
## 
## The downloaded binary packages are in
##  C:\Users\canda\AppData\Local\Temp\Rtmps7Yaq8\downloaded_packages
install.packages("ggcorrplot")
## Installing package into 'C:/Users/canda/AppData/Local/R/win-library/4.3'
## (as 'lib' is unspecified)
## package 'ggcorrplot' successfully unpacked and MD5 sums checked
## 
## The downloaded binary packages are in
##  C:\Users\canda\AppData\Local\Temp\Rtmps7Yaq8\downloaded_packages
library(ggcorrplot)
## Warning: package 'ggcorrplot' was built under R version 4.3.2
## Loading required package: ggplot2
## Warning: package 'ggplot2' was built under R version 4.3.2
library(ggplot2)
library(stats)
library(car)
## Loading required package: carData
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following object is masked from 'package:car':
## 
##     recode
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(stargazer)
## 
## Please cite as:
##  Hlavac, Marek (2022). stargazer: Well-Formatted Regression and Summary Statistics Tables.
##  R package version 5.2.3. https://CRAN.R-project.org/package=stargazer
library(lavaan)
## Warning: package 'lavaan' was built under R version 4.3.2
## This is lavaan 0.6-17
## lavaan is FREE software! Please report any bugs.
cities <- read.csv('C:/Users/canda/DEM Dissertation Data/citiesALLYRS.csv', na.strings=c("NA"))
cities <- cities %>% mutate_if(is.character, as.numeric)
## Warning: There were 25 warnings in `mutate()`.
## The first warning was:
## ℹ In argument: `cityname = .Primitive("as.double")(cityname)`.
## Caused by warning:
## ! NAs introduced by coercion
## ℹ Run `dplyr::last_dplyr_warnings()` to see the 24 remaining warnings.
cities$Proximity<-as.factor(ifelse(cities$Proximity==1, "In Proximity", "Not in Prox"))
stargazer(cities, header=FALSE, type='text', title="Descriptive Statistics",digits=2, out="Descript.htm")
## 
## Descriptive Statistics
## ===================================================
## Statistic  N    Mean     St. Dev.   Min      Max   
## ---------------------------------------------------
## Miles     114   6.50       5.53     0.00    21.00  
## gini_20   262   0.42       0.05     0.29    0.54   
## gini_10   264   0.42       0.06     0.26    0.57   
## pboo_20   262   8.42      10.61     0.00    67.12  
## pboo_10   240   8.58      11.03     0.05    65.63  
## pboo_00   256   7.07       9.08     0.00    61.00  
## pboo_90   257   6.45       8.59     0.00    60.64  
## pboo_80   241   5.32       7.07     0.00    33.94  
## chg_t20   235 10,355.00 24,403.75  -3,487  205,129 
## chg_pb20  235   1.08       2.36    -8.59    15.95  
## t_20      261 75,666.40 207,759.00 10,070 2,304,580
## pb_20     261   12.15     11.86     0.03    71.27  
## dbw_20    261   25.38     12.07     0.00    69.14  
## chg_t10   204 12,128.63 26,631.64  -9,504  206,512 
## chg_pb10  204   1.36       3.65    -8.32    23.16  
## t_10      240 70,884.63 194,929.20 10,127 2,099,451
## pb_10     240   11.39     12.10     0.03    69.35  
## dbw_10    240   27.19     14.07     0.00    82.22  
## chg_t00   174 13,749.87 36,706.30  -2,072  323,078 
## chg_pb00  174   1.23       3.85    -5.08    25.02  
## t_00      204 68,784.74 190,685.10 10,302 1,953,631
## pb_00     204   10.19     10.99     0.03    57.26  
## dbw_00    204   30.84     15.98     0.00    75.64  
## chg_t90   153 9,878.79  22,303.25  -4,247  150,053 
## chg_pb90  153   1.49       4.02    -5.08    24.12  
## t_90      180 62,714.99 167,886.90 10,023 1,630,553
## pb_90     180   9.46      10.45     0.00    60.56  
## dbw_90    180   34.40     18.49     0.00    80.76  
## t_80      154 60,676.74 165,936.10 10,197 1,595,138
## pb_80     154   8.62       9.85     0.01    40.12  
## dbw_80    154   43.36     22.13     0.00    93.17  
## ---------------------------------------------------
stargazer(cities[c("pboo_20","dbw_20","gini_20")], header=FALSE, type='text', 
          title="Descriptive Statistics 2020", digits=2,
          covariate.labels=c("Black Homeownership","B-W Dissimilarity","Income Inequality"),
          out="Desc 2020.htm"
          )
## 
## Descriptive Statistics 2020
## =================================================
## Statistic            N  Mean  St. Dev. Min   Max 
## -------------------------------------------------
## Black Homeownership 262 8.42   10.61   0.00 67.12
## B-W Dissimilarity   261 25.38  12.07   0.00 69.14
## Income Inequality   262 0.42    0.05   0.29 0.54 
## -------------------------------------------------
stargazer(cities[c("pboo_10","dbw_10","gini_10")], header=FALSE, type='text', 
          title="Descriptive Statistics 2010", digits=2,
          covariate.labels=c("Black Homeownership","B-W Dissimilarity","Income Inequality"),
          out="Desc 2010.htm"
          )
## 
## Descriptive Statistics 2010
## =================================================
## Statistic            N  Mean  St. Dev. Min   Max 
## -------------------------------------------------
## Black Homeownership 240 8.58   11.03   0.05 65.63
## B-W Dissimilarity   240 27.19  14.07   0.00 82.22
## Income Inequality   264 0.42    0.06   0.26 0.57 
## -------------------------------------------------
stargazer(cities[c("pboo_00","dbw_00")], header=FALSE, type='text', 
          title="Descriptive Statistics 2000", digits=2,
          covariate.labels=c("Black Homeownership","B-W Dissimilarity"),
            out="Desc 2000.htm"
          )
## 
## Descriptive Statistics 2000
## =================================================
## Statistic            N  Mean  St. Dev. Min   Max 
## -------------------------------------------------
## Black Homeownership 256 7.07    9.08   0.00 61.00
## B-W Dissimilarity   204 30.84  15.98   0.00 75.64
## -------------------------------------------------
stargazer(cities[c("pboo_90","dbw_90")], header=FALSE, type='text', 
          title="Descriptive Statistics 1990", digits=2,
          covariate.labels=c("Black Homeownership","B-W Dissimilarity"),
            out="Desc 1990.htm"
          )
## 
## Descriptive Statistics 1990
## =================================================
## Statistic            N  Mean  St. Dev. Min   Max 
## -------------------------------------------------
## Black Homeownership 257 6.45    8.59   0.00 60.64
## B-W Dissimilarity   180 34.40  18.49   0.00 80.76
## -------------------------------------------------
stargazer(cities[c("pboo_80","dbw_80")], header=FALSE, type='text', 
          title="Descriptive Statistics 1980", digits=2,
         covariate.labels=c("Black Homeownership","B-W Dissimilarity"),
           out="Desc 1980.htm"
          )
## 
## Descriptive Statistics 1980
## =================================================
## Statistic            N  Mean  St. Dev. Min   Max 
## -------------------------------------------------
## Black Homeownership 241 5.32    7.07   0.00 33.94
## B-W Dissimilarity   154 43.36  22.13   0.00 93.17
## -------------------------------------------------
object <- sapply(cities, function(x) sum(is.na(x)))


#Cities In Proximity = 1, Cities Not in Proximity = 0

cities$Proximity <- factor(cities$Proximity, ordered = FALSE )# Make "Not in Proximity" the reference category
cities$Proximity <- relevel(cities$Proximity, ref = "Not in Prox")
table(cities$Proximity)
## 
##  Not in Prox In Proximity 
##          162          107
stargazer(cities[c("dbw_80","dbw_90","dbw_00","dbw_10","dbw_20")], header=FALSE, type='text', 
          title="Descriptive Statistics Segregation by Year", digits=2,
          covariate.labels=c("1980","1990","2000","2010","2020"),
          out="Desc Mean DI.htm"
          )
## 
## Descriptive Statistics Segregation by Year
## =======================================
## Statistic  N  Mean  St. Dev. Min   Max 
## ---------------------------------------
## 1980      154 43.36  22.13   0.00 93.17
## 1990      180 34.40  18.49   0.00 80.76
## 2000      204 30.84  15.98   0.00 75.64
## 2010      240 27.19  14.07   0.00 82.22
## 2020      261 25.38  12.07   0.00 69.14
## ---------------------------------------
subset_P1 <- subset(cities, Proximity == "In Proximity")
stargazer(subset_P1[c("dbw_80","dbw_90","dbw_00","dbw_10","dbw_20")], header=FALSE, type='text', 
          title="Segregation by Year for Cities In Proximity to Freedom Colony", digits=2,
          covariate.labels=c("1980","1990","2000","2010","2020"),
          style = "demography",
          out="Desc Mean DI In Prox.htm")
## 
## Segregation by Year for Cities In Proximity to Freedom Colony
## ---------------------------------------
## Statistic  N  Mean  St. Dev. Min   Max 
## ---------------------------------------
## 1980      60  46.92  20.90   8.92 93.17
## 1990      70  37.26  18.30   0.84 80.76
## 2000      81  33.94  16.25   3.74 75.64
## 2010      98  28.63  14.56   0.00 68.57
## 2020      101 26.99  13.18   1.14 64.80
## ---------------------------------------
subset_P2 <- subset(cities, Proximity == "Not in Prox")
stargazer(subset_P2[c("dbw_80","dbw_90","dbw_00","dbw_10","dbw_20")], header=FALSE, type='text', 
          title="Segregation by Year for Cities Not In Proximity to Freedom Colony", digits=2,
          covariate.labels=c("1980","1990","2000","2010","2020"),
          style = "demography",
          out="Desc Mean DI NOTIn Prox.htm")
## 
## Segregation by Year for Cities Not In Proximity to Freedom Colony
## ---------------------------------------
## Statistic  N  Mean  St. Dev. Min   Max 
## ---------------------------------------
## 1980      94  41.08  22.69   0.00 90.50
## 1990      110 32.58  18.45   0.00 69.33
## 2000      123 28.81  15.53   0.00 69.28
## 2010      142 26.21  13.68   3.01 82.22
## 2020      160 24.36  11.25   0.00 69.14
## ---------------------------------------

#log total population due to outliers

hist(cities$t_20)

hist(log(cities$t_20+1), breaks=50)

hist(cities$t_10)

hist(log(cities$t_10+1), breaks=50)

hist(cities$t_00)

hist(log(cities$t_00+1), breaks=50)

hist(cities$t_90)

hist(log(cities$t_90+1), breaks=50)

hist(cities$t_80)

hist(log(cities$t_80+1), breaks=50)

## proximity to freedom colonies and Racial residential segregation

#The correlation between segregation and Black home ownership yielded a weak positive association in all years, decreasing from 1980 to 2020.

cor.test(cities$dbw_20,cities$pboo_20)
## 
##  Pearson's product-moment correlation
## 
## data:  cities$dbw_20 and cities$pboo_20
## t = 0.50531, df = 259, p-value = 0.6138
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.09038165  0.15222271
## sample estimates:
##        cor 
## 0.03138275
plot(cities$dbw_20,cities$pboo_20,pch=20,
     xlab='D index',ylab='Percent Black Homeowners',
     main='Cities by Residential Segregation and Black Homeownership in 2020')

cor.test(cities$dbw_10,cities$pboo_10)
## 
##  Pearson's product-moment correlation
## 
## data:  cities$dbw_10 and cities$pboo_10
## t = 1.3949, df = 238, p-value = 0.1644
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.03700425  0.21423467
## sample estimates:
##        cor 
## 0.09004761
plot(cities$dbw_10,cities$pboo_10,pch=20,
     xlab='D index',ylab='Percent Black Homeowners',
     main='Cities by Residential Segregation and Black Homeownership in 2010')

cor.test(cities$dbw_00,cities$pboo_00)
## 
##  Pearson's product-moment correlation
## 
## data:  cities$dbw_00 and cities$pboo_00
## t = 4.093, df = 198, p-value = 6.198e-05
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.1462256 0.4024463
## sample estimates:
##       cor 
## 0.2793003
plot(cities$dbw_00,cities$pboo_00,pch=20,
     xlab='D index',ylab='Percent Black Homeowners',
     main='Cities by Residential Segregation and Black Homeownership in 2000')

cor.test(cities$dbw_90,cities$pboo_90)
## 
##  Pearson's product-moment correlation
## 
## data:  cities$dbw_90 and cities$pboo_90
## t = 5.3203, df = 177, p-value = 3.103e-07
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.2375754 0.4912287
## sample estimates:
##       cor 
## 0.3713092
plot(cities$dbw_90,cities$pboo_90,pch=20,
     xlab='D index',ylab='Percent Black Homeowners',
     main='Cities by Residential Segregation and Black Homeownership in 1990')

cor.test(cities$dbw_80,cities$pboo_80)
## 
##  Pearson's product-moment correlation
## 
## data:  cities$dbw_80 and cities$pboo_80
## t = 5.1751, df = 152, p-value = 7.102e-07
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.2438040 0.5137519
## sample estimates:
##       cor 
## 0.3870404
plot(cities$dbw_80,cities$pboo_80,pch=20,
     xlab='D index',ylab='Percent Black Homeowners',
     main='Cities by Residential Segregation and Black Homeownership in 1980')

#The list of cities from the Diversity and Disparities project available for years 1980 - 2020 was used to conduct a binomial regression analysis. Of these cities, 107 were identified as being in proximity to a freedom colony and 162 were not.

table(cities$Proximity)
## 
##  Not in Prox In Proximity 
##          162          107

#The results showed that proximity to freedom colonies INCREASED residential segregation by points in 2020. The results were statistically significant in 2000, but not in 2020, 2010, 1990, or 1980.

fit20=lm(dbw_20 ~ Proximity,cities)
summary(fit20)
## 
## Call:
## lm(formula = dbw_20 ~ Proximity, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -25.847  -9.357  -0.886   8.475  44.775 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             24.364      0.951  25.618   <2e-16 ***
## ProximityIn Proximity    2.625      1.529   1.717   0.0872 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 12.03 on 259 degrees of freedom
##   (8 observations deleted due to missingness)
## Multiple R-squared:  0.01125,    Adjusted R-squared:  0.007434 
## F-statistic: 2.947 on 1 and 259 DF,  p-value: 0.08722
fit10=lm(dbw_10 ~ Proximity,cities)
summary(fit10)
## 
## Call:
## lm(formula = dbw_10 ~ Proximity, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -28.626 -10.226  -1.895   8.190  56.010 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             26.206      1.179  22.233   <2e-16 ***
## ProximityIn Proximity    2.420      1.845   1.312    0.191    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 14.05 on 238 degrees of freedom
##   (29 observations deleted due to missingness)
## Multiple R-squared:  0.00718,    Adjusted R-squared:  0.003008 
## F-statistic: 1.721 on 1 and 238 DF,  p-value: 0.1908
fit00=lm(dbw_00 ~ Proximity,cities)
summary(fit00)
## 
## Call:
## lm(formula = dbw_00 ~ Proximity, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -30.194 -11.511  -1.039  10.575  41.698 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             28.809      1.426  20.197   <2e-16 ***
## ProximityIn Proximity    5.128      2.264   2.265   0.0246 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 15.82 on 202 degrees of freedom
##   (65 observations deleted due to missingness)
## Multiple R-squared:  0.02478,    Adjusted R-squared:  0.01995 
## F-statistic: 5.132 on 1 and 202 DF,  p-value: 0.02455
fit90=lm(dbw_90 ~ Proximity,cities)
summary(fit90)
## 
## Call:
## lm(formula = dbw_90 ~ Proximity, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -36.428 -13.894  -0.428  16.099  43.493 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             32.584      1.754  18.578   <2e-16 ***
## ProximityIn Proximity    4.681      2.812   1.664   0.0978 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 18.39 on 178 degrees of freedom
##   (89 observations deleted due to missingness)
## Multiple R-squared:  0.01532,    Adjusted R-squared:  0.009793 
## F-statistic:  2.77 on 1 and 178 DF,  p-value: 0.09779
fit80=lm(dbw_80 ~ Proximity,cities)
summary(fit80)
## 
## Call:
## lm(formula = dbw_80 ~ Proximity, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -41.083 -13.257  -0.672  13.301  49.413 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             41.083      2.271  18.094   <2e-16 ***
## ProximityIn Proximity    5.835      3.638   1.604    0.111    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 22.01 on 152 degrees of freedom
##   (115 observations deleted due to missingness)
## Multiple R-squared:  0.01665,    Adjusted R-squared:  0.01018 
## F-statistic: 2.573 on 1 and 152 DF,  p-value: 0.1108
stargazer(fit80, fit90, fit00, fit10, fit20,
          type="text", title = "Effect on Dissimilarity Index by Year",
          align=TRUE, dep.var.labels=c("1980","1990","2000","2010","2020"),
          covariate.labels=c("Proximity"), omit.stat=c("LL","ser","f"),no.space=TRUE, style = "demography", out="Proximity and Segregation.htm")
## 
## Effect on Dissimilarity Index by Year
## -------------------------------------------------------------
##               1980      1990      2000      2010      2020   
##              Model 1   Model 2   Model 3   Model 4   Model 5 
## -------------------------------------------------------------
## Proximity     5.835     4.681    5.128*     2.420     2.625  
##              (3.638)   (2.812)   (2.264)   (1.845)   (1.529) 
## Constant    41.083*** 32.584*** 28.809*** 26.206*** 24.364***
##              (2.271)   (1.754)   (1.426)   (1.179)   (0.951) 
## N              154       180       204       240       261   
## R2            0.017     0.015     0.025     0.007     0.011  
## Adjusted R2   0.010     0.010     0.020     0.003     0.007  
## -------------------------------------------------------------
## *p < .05; **p < .01; ***p < .001

#Alternatively, I used Proximity as the dependent (outcome) variable. The results showed that residential segregation INCREASED proximity by 0.0224 points in 2020. The results were statistically significant in 2020 and 2000, but not in 2010.

model20 = glm(Proximity ~ dbw_20,
            data = cities,
            family = binomial(link="logit"))
model10 = glm(Proximity ~ dbw_10,
            data = cities,
            family = binomial(link="logit"))
model00 = glm(Proximity ~ dbw_00,
            data = cities,
            family = binomial(link="logit"))
model90 = glm(Proximity ~ dbw_90,
            data = cities,
            family = binomial(link="logit"))
model80 = glm(Proximity ~ dbw_80,
            data = cities,
            family = binomial(link="logit"))
summary(model20)
## 
## Call:
## glm(formula = Proximity ~ dbw_20, family = binomial(link = "logit"), 
##     data = cities)
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)   
## (Intercept) -0.92335    0.30305  -3.047  0.00231 **
## dbw_20       0.01806    0.01061   1.702  0.08877 . 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 348.37  on 260  degrees of freedom
## Residual deviance: 345.44  on 259  degrees of freedom
##   (8 observations deleted due to missingness)
## AIC: 349.44
## 
## Number of Fisher Scoring iterations: 4
summary(model10)
## 
## Call:
## glm(formula = Proximity ~ dbw_10, family = binomial(link = "logit"), 
##     data = cities)
## 
## Coefficients:
##              Estimate Std. Error z value Pr(>|z|)  
## (Intercept) -0.706519   0.290099  -2.435   0.0149 *
## dbw_10       0.012254   0.009374   1.307   0.1912  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 324.60  on 239  degrees of freedom
## Residual deviance: 322.88  on 238  degrees of freedom
##   (29 observations deleted due to missingness)
## AIC: 326.88
## 
## Number of Fisher Scoring iterations: 4
summary(model00)
## 
## Call:
## glm(formula = Proximity ~ dbw_00, family = binomial(link = "logit"), 
##     data = cities)
## 
## Coefficients:
##              Estimate Std. Error z value Pr(>|z|)   
## (Intercept) -1.055615   0.324821  -3.250  0.00115 **
## dbw_00       0.020365   0.009159   2.224  0.02618 * 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 274.09  on 203  degrees of freedom
## Residual deviance: 269.03  on 202  degrees of freedom
##   (65 observations deleted due to missingness)
## AIC: 273.03
## 
## Number of Fisher Scoring iterations: 4
summary(model90)
## 
## Call:
## glm(formula = Proximity ~ dbw_90, family = binomial(link = "logit"), 
##     data = cities)
## 
## Coefficients:
##              Estimate Std. Error z value Pr(>|z|)   
## (Intercept) -0.936893   0.335291  -2.794   0.0052 **
## dbw_90       0.013888   0.008409   1.651   0.0986 . 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 240.57  on 179  degrees of freedom
## Residual deviance: 237.80  on 178  degrees of freedom
##   (89 observations deleted due to missingness)
## AIC: 241.8
## 
## Number of Fisher Scoring iterations: 4
summary(model80)
## 
## Call:
## glm(formula = Proximity ~ dbw_80, family = binomial(link = "logit"), 
##     data = cities)
## 
## Coefficients:
##              Estimate Std. Error z value Pr(>|z|)   
## (Intercept) -0.983357   0.379342  -2.592  0.00953 **
## dbw_80       0.012146   0.007637   1.590  0.11172   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 205.92  on 153  degrees of freedom
## Residual deviance: 203.34  on 152  degrees of freedom
##   (115 observations deleted due to missingness)
## AIC: 207.34
## 
## Number of Fisher Scoring iterations: 4
Anova(model20,
      type="II",
      test="LR")
## Analysis of Deviance Table (Type II tests)
## 
## Response: Proximity
##        LR Chisq Df Pr(>Chisq)  
## dbw_20    2.929  1      0.087 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Anova(model10,
      type="II",
      test="LR")
## Analysis of Deviance Table (Type II tests)
## 
## Response: Proximity
##        LR Chisq Df Pr(>Chisq)
## dbw_10   1.7182  1     0.1899
Anova(model00,
      type="II",
      test="LR")
## Analysis of Deviance Table (Type II tests)
## 
## Response: Proximity
##        LR Chisq Df Pr(>Chisq)  
## dbw_00   5.0661  1     0.0244 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Anova(model90,
      type="II",
      test="LR")
## Analysis of Deviance Table (Type II tests)
## 
## Response: Proximity
##        LR Chisq Df Pr(>Chisq)  
## dbw_90   2.7681  1    0.09616 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Anova(model80,
      type="II",
      test="LR")
## Analysis of Deviance Table (Type II tests)
## 
## Response: Proximity
##        LR Chisq Df Pr(>Chisq)
## dbw_80   2.5792  1     0.1083

Proximity to freedom colonies and homeownership

#Change proximity to numeric to run correlation matrix

cities <- cities %>% mutate_if(is.character, as.numeric)
cities <- cities %>% mutate_if(is.integer, as.numeric)
cities <- cities %>% mutate_if(is.factor, as.numeric)
cities$t_20 <- log(cities$t_20)

cor_matrix <- cor(cities, use = "pairwise.complete.obs", method = "pearson") %>% 
  ggcorrplot(show.diag=FALSE, type="lower", lab=TRUE, lab_size=2)

print(cor_matrix)

df <- data.frame(cities)

sel20_vars <- c("pboo_20", "t_20","pb_20", "dbw_20")
df_select20 <- df[sel20_vars]

cor_matrix20 <- cor(df_select20, use = "pairwise.complete.obs", method = "pearson") %>% 
  ggcorrplot(show.diag=FALSE, type="lower", lab=TRUE, lab_size=4)
df <- data.frame(cities)

sel80_vars <- c("pboo_80", "t_80","pb_80", "dbw_80")
df_select80 <- df[sel80_vars]

cor_matrix80 <- cor(df_select80, use = "pairwise.complete.obs", method = "pearson") %>% 
  ggcorrplot(show.diag=FALSE, type="lower", lab=TRUE, lab_size=4)

print(cor_matrix20)

print(cor_matrix80)

#Run regression with percent Black population on dissimilarity. Significance 2000 1990 1980

dbwpb20<- lm(dbw_20~pb_20,data=cities)
dbwpb10<- lm(dbw_10~pb_10,data=cities)
dbwpb00<- lm(dbw_00~pb_00,data=cities)
dbwpb90<- lm(dbw_90~pb_90,data=cities)
dbwpb80<- lm(dbw_80~pb_80,data=cities)
summary(dbwpb20)
## 
## Call:
## lm(formula = dbw_20 ~ pb_20, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -24.846  -9.002  -1.198   8.473  44.769 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 24.36207    1.06964  22.776   <2e-16 ***
## pb_20        0.08374    0.06307   1.328    0.185    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 12.06 on 259 degrees of freedom
##   (8 observations deleted due to missingness)
## Multiple R-squared:  0.006759,   Adjusted R-squared:  0.002924 
## F-statistic: 1.763 on 1 and 259 DF,  p-value: 0.1855
summary(dbwpb10)
## 
## Call:
## lm(formula = dbw_10 ~ pb_10, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -28.356 -10.320  -1.567   8.283  56.869 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 25.34306    1.23814  20.469   <2e-16 ***
## pb_10        0.16254    0.07459   2.179   0.0303 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 13.96 on 238 degrees of freedom
##   (29 observations deleted due to missingness)
## Multiple R-squared:  0.01956,    Adjusted R-squared:  0.01544 
## F-statistic: 4.749 on 1 and 238 DF,  p-value: 0.0303
summary(dbwpb00)
## 
## Call:
## lm(formula = dbw_00 ~ pb_00, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -32.280 -10.620  -0.125   9.506  43.200 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 26.04976    1.44882  17.980  < 2e-16 ***
## pb_00        0.47047    0.09678   4.861 2.34e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 15.16 on 202 degrees of freedom
##   (65 observations deleted due to missingness)
## Multiple R-squared:  0.1047, Adjusted R-squared:  0.1003 
## F-statistic: 23.63 on 1 and 202 DF,  p-value: 2.339e-06
summary(dbwpb90)
## 
## Call:
## lm(formula = dbw_90 ~ pb_90, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -44.682 -13.477   0.299  12.288  34.532 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  28.0713     1.7271  16.254  < 2e-16 ***
## pb_90         0.6695     0.1227   5.456 1.61e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 17.16 on 178 degrees of freedom
##   (89 observations deleted due to missingness)
## Multiple R-squared:  0.1433, Adjusted R-squared:  0.1385 
## F-statistic: 29.77 on 1 and 178 DF,  p-value: 1.611e-07
summary(dbwpb80)
## 
## Call:
## lm(formula = dbw_80 ~ pb_80, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -52.393 -12.383   0.966  13.764  54.446 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  35.6242     2.1831  16.318  < 2e-16 ***
## pb_80         0.8968     0.1671   5.367 2.94e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 20.35 on 152 degrees of freedom
##   (115 observations deleted due to missingness)
## Multiple R-squared:  0.1593, Adjusted R-squared:  0.1538 
## F-statistic:  28.8 on 1 and 152 DF,  p-value: 2.939e-07

#Run regression with dissimilarity on percent Black population. Significance 2000 1990 1980

pbw20=lm(pb_20 ~ dbw_20,cities)
summary(pbw20)
## 
## Call:
## lm(formula = pb_20 ~ dbw_20, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -15.580  -8.156  -3.711   5.042  59.449 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 10.09991    1.70821   5.913 1.06e-08 ***
## dbw_20       0.08072    0.06080   1.328    0.185    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 11.84 on 259 degrees of freedom
##   (8 observations deleted due to missingness)
## Multiple R-squared:  0.006759,   Adjusted R-squared:  0.002924 
## F-statistic: 1.763 on 1 and 259 DF,  p-value: 0.1855
pbw10=lm(pb_10 ~ dbw_10,cities)
summary(pbw10)
## 
## Call:
## lm(formula = pb_10 ~ dbw_10, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -17.984  -7.739  -3.999   4.522  58.733 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  8.11335    1.69023   4.800  2.8e-06 ***
## dbw_10       0.12036    0.05523   2.179   0.0303 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 12.01 on 238 degrees of freedom
##   (29 observations deleted due to missingness)
## Multiple R-squared:  0.01956,    Adjusted R-squared:  0.01544 
## F-statistic: 4.749 on 1 and 238 DF,  p-value: 0.0303
pbw00=lm(pb_00 ~ dbw_00,cities)
summary(pbw00)
## 
## Call:
## lm(formula = pb_00 ~ dbw_00, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -18.679  -6.716  -2.667   3.797  47.517 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  3.32507    1.59001   2.091   0.0378 *  
## dbw_00       0.22262    0.04579   4.861 2.34e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 10.43 on 202 degrees of freedom
##   (65 observations deleted due to missingness)
## Multiple R-squared:  0.1047, Adjusted R-squared:  0.1003 
## F-statistic: 23.63 on 1 and 202 DF,  p-value: 2.339e-06
pbw90=lm(pb_90 ~ dbw_90,cities)
summary(pbw90)
## 
## Call:
## lm(formula = pb_90 ~ dbw_90, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -14.556  -6.398  -2.256   2.475  53.338 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  2.09644    1.53108   1.369    0.173    
## dbw_90       0.21403    0.03923   5.456 1.61e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.701 on 178 degrees of freedom
##   (89 observations deleted due to missingness)
## Multiple R-squared:  0.1433, Adjusted R-squared:  0.1385 
## F-statistic: 29.77 on 1 and 178 DF,  p-value: 1.611e-07
pbw80=lm(pb_80 ~ dbw_80,cities)
summary(pbw80)
## 
## Call:
## lm(formula = pb_80 ~ dbw_80, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -16.520  -5.913  -2.988   2.842  32.689 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   0.9204     1.6100   0.572    0.568    
## dbw_80        0.1776     0.0331   5.367 2.94e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.059 on 152 degrees of freedom
##   (115 observations deleted due to missingness)
## Multiple R-squared:  0.1593, Adjusted R-squared:  0.1538 
## F-statistic:  28.8 on 1 and 152 DF,  p-value: 2.939e-07

#Run regression with Logged Total city population on Dissimilarity Index/segregation. Significance in all years.

tpop20Bw<- lm(cities$dbw_20 ~ log(cities$t_20))
summary(tpop20Bw)
## 
## Call:
## lm(formula = cities$dbw_20 ~ log(cities$t_20))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -21.249  -8.383  -1.475   7.285  47.127 
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)       -88.616     17.436  -5.082 7.15e-07 ***
## log(cities$t_20)   48.757      7.452   6.543 3.21e-10 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 11.21 on 259 degrees of freedom
##   (8 observations deleted due to missingness)
## Multiple R-squared:  0.1418, Adjusted R-squared:  0.1385 
## F-statistic: 42.81 on 1 and 259 DF,  p-value: 3.206e-10
coef(tpop20Bw)["log(cities$t_20)"]/100
## log(cities$t_20) 
##        0.4875671
tpop10Bw<- lm(cities$dbw_10 ~ log(cities$t_10))
summary(tpop10Bw)
## 
## Call:
## lm(formula = cities$dbw_10 ~ log(cities$t_10))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -23.292 -10.468  -1.869   9.094  59.568 
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      -22.0642     8.8422  -2.495   0.0133 *  
## log(cities$t_10)   4.7609     0.8506   5.597 5.98e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 13.25 on 238 degrees of freedom
##   (29 observations deleted due to missingness)
## Multiple R-squared:  0.1163, Adjusted R-squared:  0.1126 
## F-statistic: 31.33 on 1 and 238 DF,  p-value: 5.984e-08
coef(tpop10Bw)["log(cities$t_10)"]/100
## log(cities$t_10) 
##       0.04760936
tpop00Bw<- lm(cities$dbw_00 ~ log(cities$t_00))
summary(tpop00Bw)
## 
## Call:
## lm(formula = cities$dbw_00 ~ log(cities$t_00))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -26.161 -12.766  -0.462  11.450  48.520 
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)       -17.146     11.352  -1.510    0.133    
## log(cities$t_00)    4.650      1.095   4.247 3.31e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 15.35 on 202 degrees of freedom
##   (65 observations deleted due to missingness)
## Multiple R-squared:  0.08196,    Adjusted R-squared:  0.07741 
## F-statistic: 18.03 on 1 and 202 DF,  p-value: 3.31e-05
coef(tpop00Bw)["log(cities$t_00)"]/100
## log(cities$t_00) 
##       0.04650091
tpop90Bw<- lm(cities$dbw_90 ~ log(cities$t_90))
summary(tpop90Bw)
## 
## Call:
## lm(formula = cities$dbw_90 ~ log(cities$t_90))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -32.940 -14.795  -1.112  12.803  50.992 
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)       -24.070     14.039  -1.714   0.0882 .  
## log(cities$t_90)    5.707      1.364   4.184  4.5e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 17.69 on 178 degrees of freedom
##   (89 observations deleted due to missingness)
## Multiple R-squared:  0.08952,    Adjusted R-squared:  0.08441 
## F-statistic:  17.5 on 1 and 178 DF,  p-value: 4.501e-05
coef(tpop90Bw)["log(cities$t_90)"]/100
## log(cities$t_90) 
##       0.05707379
tpop80Bw<- lm(cities$dbw_80 ~ log(cities$t_80))
summary(tpop80Bw)
## 
## Call:
## lm(formula = cities$dbw_80 ~ log(cities$t_80))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -35.822 -15.178  -0.748  13.757  56.499 
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)       -53.636     17.075  -3.141  0.00202 ** 
## log(cities$t_80)    9.516      1.668   5.706 5.86e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 20.15 on 152 degrees of freedom
##   (115 observations deleted due to missingness)
## Multiple R-squared:  0.1764, Adjusted R-squared:  0.171 
## F-statistic: 32.56 on 1 and 152 DF,  p-value: 5.862e-08
coef(tpop80Bw)["log(cities$t_80)"]/100
## log(cities$t_80) 
##       0.09515862
cities$Proximity<-as.factor(ifelse(cities$Proximity==1, "In Proximity", "Not in Prox"))
str(cities)
## 'data.frame':    269 obs. of  34 variables:
##  $ cityname : num  NA NA NA NA NA NA NA NA NA NA ...
##  $ Proximity: Factor w/ 2 levels "In Proximity",..: 1 2 1 1 1 1 2 1 1 1 ...
##  $ Miles    : num  NA 3 NA NA NA NA 13.7 NA NA NA ...
##  $ FC.name  : num  NA NA NA NA NA NA NA NA NA NA ...
##  $ gini_20  : num  0.45 0.395 0.461 0.423 0.471 0.39 0.456 0.417 0.469 0.44 ...
##  $ gini_10  : num  0.45 0.475 0.42 0.411 0.456 0.358 0.424 0.436 0.457 0.523 ...
##  $ pboo_20  : num  4.74 4.08 0.26 3.13 0.65 6.5 0.13 2.73 3.56 1.08 ...
##  $ pboo_10  : num  4.73 2.53 0.19 3.31 0.57 7.01 0.19 1.49 3.69 1.53 ...
##  $ pboo_00  : num  4.68 1.73 0 4.42 0.48 3.58 0 1.15 3.76 2.69 ...
##  $ pboo_90  : num  5.34 6.51 0 2.63 0.72 2.68 0 0.9 4.06 2.46 ...
##  $ pboo_80  : num  4.36 4.23 0 0.21 0.97 2.14 0 1.03 3.77 2.13 ...
##  $ chg_t20  : num  8119 3605 1140 130 -1213 ...
##  $ chg_pb20 : num  1.34343 5.30048 0.00392 -0.40411 0.14071 ...
##  $ t_20     : num  11.74 9.72 9.88 9.68 9.79 ...
##  $ pb_20    : num  11.36 17.364 0.2 2.406 0.732 ...
##  $ dbw_20   : num  28.7 25 35.3 32.8 38.2 ...
##  $ chg_t10  : num  1133 -1110 3593 1890 94 ...
##  $ chg_pb10 : num  0.925 2.265 0.081 -2.991 -0.15 ...
##  $ t_10     : num  117063 13056 18353 15869 19104 ...
##  $ pb_10    : num  10.017 12.063 0.196 2.811 0.591 ...
##  $ dbw_10   : num  34.8 21.4 55.3 36 27.6 ...
##  $ chg_t00  : num  9276 NA NA 2846 -778 ...
##  $ chg_pb00 : num  2.2753 NA NA 2.1368 -0.0416 ...
##  $ t_00     : num  115930 14166 14760 13979 19010 ...
##  $ pb_00    : num  9.092 9.798 0.115 5.802 0.742 ...
##  $ dbw_00   : num  37.7 38.8 23.4 28.7 27.4 ...
##  $ chg_t90  : num  8339 NA NA -1490 -1173 ...
##  $ chg_pb90 : num  0.2325 NA NA 1.5337 -0.0707 ...
##  $ t_90     : num  106654 NA NA 11133 19788 ...
##  $ pb_90    : num  6.816 NA NA 3.665 0.783 ...
##  $ dbw_90   : num  38.1 NA NA 24.7 41.2 ...
##  $ t_80     : num  98315 NA NA 12623 20961 ...
##  $ pb_80    : num  6.584 NA NA 2.131 0.854 ...
##  $ dbw_80   : num  48.2 NA NA 29.9 52.6 ...

##Logistic Regression

#The models indicate that there is a positive relationship between the percent of Black homeownership and whether the city is within proximity to a freedom colony. Cities with high percent of Black homeowners are more likely to be within proximity to a freedom colony for years 2000, 2010, and 2020.

#model 1 #A multiple regression was performed starting with proximity to freedom colonies (Table 4). This variable proved to yield statistically significant results. Proximity to freedom colonies provided an increase in Black homeownership by 7.935 percentage points.

model1_20<- lm(pboo_20~Proximity,data=cities)
summary(model1_20)
## 
## Call:
## lm(formula = pboo_20 ~ Proximity, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -12.791  -5.199  -2.581   2.164  54.199 
## 
## Coefficients:
##                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            5.6037     0.7887   7.105 1.16e-11 ***
## ProximityNot in Prox   7.3177     1.2703   5.760 2.36e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 10.01 on 260 degrees of freedom
##   (7 observations deleted due to missingness)
## Multiple R-squared:  0.1132, Adjusted R-squared:  0.1098 
## F-statistic: 33.18 on 1 and 260 DF,  p-value: 2.363e-08

#model 2 - add in total popualtion logged #When the logged variable of city population was introduced in Model 2, there was a slight increase in homeownership although population was not statistically significant. Proximity remained a significant factor.

model2_20 <- lm(pboo_20~Proximity+log(t_20),data=cities)
summary(model2_20)
## 
## Call:
## lm(formula = pboo_20 ~ Proximity + log(t_20), data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -12.924  -4.983  -2.568   2.154  53.931 
## 
## Coefficients:
##                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            -9.916     15.652  -0.634    0.527    
## ProximityNot in Prox    7.131      1.283   5.560 6.74e-08 ***
## log(t_20)               6.678      6.711   0.995    0.321    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 10.02 on 258 degrees of freedom
##   (8 observations deleted due to missingness)
## Multiple R-squared:  0.1155, Adjusted R-squared:  0.1087 
## F-statistic: 16.85 on 2 and 258 DF,  p-value: 1.327e-07

#As established, percent of Black population is highly correlated with Black homeownership. As expected, an initial regression with this variable yielded a significant result, but only a small increase in homeownership. Due to this high correlation, proximity lost its significance when percent of Black population was introduced to the model. Therefore, this variable was omitted from the regression.

citpb20=lm(pboo_20~pb_20,cities)
citpb10=lm(pboo_10~pb_10,cities)
citpb00=lm(pboo_00~pb_00,cities)
citpb90=lm(pboo_90~pb_90,cities)
citpb80=lm(pboo_80~pb_80,cities)
summary(citpb20)
## 
## Call:
## lm(formula = pboo_20 ~ pb_20, data = cities)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -15.0194  -1.2180   0.5173   1.5513  12.6654 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -1.9730     0.2680  -7.362 2.41e-12 ***
## pb_20         0.8585     0.0158  54.322  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.021 on 259 degrees of freedom
##   (8 observations deleted due to missingness)
## Multiple R-squared:  0.9193, Adjusted R-squared:  0.919 
## F-statistic:  2951 on 1 and 259 DF,  p-value: < 2.2e-16
summary(citpb10)
## 
## Call:
## lm(formula = pboo_10 ~ pb_10, data = cities)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -13.6954  -1.2473   0.3532   1.4362  13.3214 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -1.4811     0.2406  -6.155 3.17e-09 ***
## pb_10         0.8834     0.0145  60.941  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.713 on 238 degrees of freedom
##   (29 observations deleted due to missingness)
## Multiple R-squared:  0.9398, Adjusted R-squared:  0.9395 
## F-statistic:  3714 on 1 and 238 DF,  p-value: < 2.2e-16
summary(citpb00)
## 
## Call:
## lm(formula = pboo_00 ~ pb_00, data = cities)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -16.5147  -0.8487   0.2933   0.8873  14.6523 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) -0.83415    0.23633   -3.53 0.000518 ***
## pb_00        0.82406    0.01565   52.64  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.441 on 198 degrees of freedom
##   (69 observations deleted due to missingness)
## Multiple R-squared:  0.9333, Adjusted R-squared:  0.933 
## F-statistic:  2771 on 1 and 198 DF,  p-value: < 2.2e-16
summary(citpb90)
## 
## Call:
## lm(formula = pboo_90 ~ pb_90, data = cities)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -15.9046  -0.7423   0.2832   0.7728   8.9028 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) -0.66915    0.20261  -3.303  0.00116 ** 
## pb_90        0.86542    0.01436  60.287  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.004 on 177 degrees of freedom
##   (90 observations deleted due to missingness)
## Multiple R-squared:  0.9536, Adjusted R-squared:  0.9533 
## F-statistic:  3634 on 1 and 177 DF,  p-value: < 2.2e-16
summary(citpb80)
## 
## Call:
## lm(formula = pboo_80 ~ pb_80, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.9313 -0.4940  0.0426  0.3423  5.6163 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) -0.10014    0.13794  -0.726    0.469    
## pb_80        0.78014    0.01056  73.888   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.286 on 152 degrees of freedom
##   (115 observations deleted due to missingness)
## Multiple R-squared:  0.9729, Adjusted R-squared:  0.9727 
## F-statistic:  5459 on 1 and 152 DF,  p-value: < 2.2e-16

#model 3 add in segregation #In Model 3, the DI measure of residential segregation for each city was added to the regression. Residential segregation caused a decrease in homeownership by -0.029. This result was not statistically significant but provides a different outcome than the previous analysis comparing cities near and not near freedom colonies

m1a <- lm(pboo_20~Proximity,data=cities)
m2a <- lm(pboo_20~Proximity+log(t_20),data=cities)
m3a <- lm(pboo_20~Proximity+log(t_20)+dbw_20,data=cities)

stargazer(m1a, m2a, m3a,
          type="text", title="Regression Results",
          align=TRUE, dep.var.labels=c("Percent Black Homeownership 2020"),
          covariate.labels=c("Proximity","City Population 2020","Dissimilarity Index 2020"), style = "demography", out="main2020.htm")
## 
## Regression Results
## ------------------------------------------------------------------------------------------------
##                                             Percent Black Homeownership 2020                    
##                                  Model 1                 Model 2                 Model 3        
## ------------------------------------------------------------------------------------------------
## Proximity                       7.318***                7.131***                7.172***        
##                                  (1.270)                 (1.283)                 (1.288)        
## City Population 2020                                      6.678                   7.932         
##                                                          (6.711)                 (7.231)        
## Dissimilarity Index 2020                                                         -0.026         
##                                                                                  (0.056)        
## Constant                        5.604***                 -9.916                  -12.198        
##                                  (0.789)                (15.652)                (16.409)        
## N                                  262                     261                     261          
## R2                                0.113                   0.116                   0.116         
## Adjusted R2                       0.110                   0.109                   0.106         
## Residual Std. Error         10.008 (df = 260)       10.021 (df = 258)       10.037 (df = 257)   
## F Statistic              33.183*** (df = 1; 260) 16.848*** (df = 2; 258) 11.272*** (df = 3; 257)
## ------------------------------------------------------------------------------------------------
## *p < .05; **p < .01; ***p < .001
m1a <- lm(pboo_20~Proximity,data=cities)
m2a <- lm(pboo_20~Proximity+log(t_20),data=cities)
m3a <- lm(pboo_20~Proximity+log(t_20)+dbw_20,data=cities)
summary(m1a)
## 
## Call:
## lm(formula = pboo_20 ~ Proximity, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -12.791  -5.199  -2.581   2.164  54.199 
## 
## Coefficients:
##                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            5.6037     0.7887   7.105 1.16e-11 ***
## ProximityNot in Prox   7.3177     1.2703   5.760 2.36e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 10.01 on 260 degrees of freedom
##   (7 observations deleted due to missingness)
## Multiple R-squared:  0.1132, Adjusted R-squared:  0.1098 
## F-statistic: 33.18 on 1 and 260 DF,  p-value: 2.363e-08
summary(m2a)
## 
## Call:
## lm(formula = pboo_20 ~ Proximity + log(t_20), data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -12.924  -4.983  -2.568   2.154  53.931 
## 
## Coefficients:
##                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            -9.916     15.652  -0.634    0.527    
## ProximityNot in Prox    7.131      1.283   5.560 6.74e-08 ***
## log(t_20)               6.678      6.711   0.995    0.321    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 10.02 on 258 degrees of freedom
##   (8 observations deleted due to missingness)
## Multiple R-squared:  0.1155, Adjusted R-squared:  0.1087 
## F-statistic: 16.85 on 2 and 258 DF,  p-value: 1.327e-07
summary(m3a)
## 
## Call:
## lm(formula = pboo_20 ~ Proximity + log(t_20) + dbw_20, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -12.866  -4.863  -2.590   2.276  53.731 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)          -12.19763   16.40888  -0.743    0.458    
## ProximityNot in Prox   7.17174    1.28753   5.570 6.41e-08 ***
## log(t_20)              7.93160    7.23067   1.097    0.274    
## dbw_20                -0.02623    0.05577  -0.470    0.639    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 10.04 on 257 degrees of freedom
##   (8 observations deleted due to missingness)
## Multiple R-squared:  0.1163, Adjusted R-squared:  0.106 
## F-statistic: 11.27 on 3 and 257 DF,  p-value: 5.684e-07
m1b <- lm(pboo_10~Proximity,data=cities)
m2b <- lm(pboo_10~Proximity+log(t_10),data=cities)
m3b <- lm(pboo_10~Proximity+log(t_10)+dbw_10,data=cities)
summary(m1b)
## 
## Call:
## lm(formula = pboo_10 ~ Proximity, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -12.938  -5.166  -2.531   2.086  52.542 
## 
## Coefficients:
##                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            5.4656     0.8723   6.266 1.72e-09 ***
## ProximityNot in Prox   7.6226     1.3650   5.584 6.39e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 10.39 on 238 degrees of freedom
##   (29 observations deleted due to missingness)
## Multiple R-squared:  0.1158, Adjusted R-squared:  0.1121 
## F-statistic: 31.18 on 1 and 238 DF,  p-value: 6.385e-08
summary(m2b)
## 
## Call:
## lm(formula = pboo_10 ~ Proximity + log(t_10), data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -13.161  -4.841  -2.446   2.067  52.513 
## 
## Coefficients:
##                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           -1.3310     6.9367  -0.192    0.848    
## ProximityNot in Prox   7.4978     1.3709   5.469 1.15e-07 ***
## log(t_10)              0.6618     0.6701   0.988    0.324    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 10.39 on 237 degrees of freedom
##   (29 observations deleted due to missingness)
## Multiple R-squared:  0.1195, Adjusted R-squared:  0.112 
## F-statistic: 16.08 on 2 and 237 DF,  p-value: 2.832e-07
summary(m3b)
## 
## Call:
## lm(formula = pboo_10 ~ Proximity + log(t_10) + dbw_10, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -13.692  -5.202  -2.409   1.831  52.696 
## 
## Coefficients:
##                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)          -0.52764    7.03364  -0.075    0.940    
## ProximityNot in Prox  7.44166    1.37456   5.414 1.52e-07 ***
## log(t_10)             0.49032    0.71218   0.688    0.492    
## dbw_10                0.03656    0.05098   0.717    0.474    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 10.41 on 236 degrees of freedom
##   (29 observations deleted due to missingness)
## Multiple R-squared:  0.1214, Adjusted R-squared:  0.1102 
## F-statistic: 10.87 on 3 and 236 DF,  p-value: 1.03e-06
m1c <- lm(pboo_00~Proximity,data=cities)
m2c <- lm(pboo_00~Proximity+log(t_00),data=cities)
m3c <- lm(pboo_00~Proximity+log(t_00)+dbw_00,data=cities)
summary(m1c)
## 
## Call:
## lm(formula = pboo_00 ~ Proximity, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -11.406  -4.122  -1.990   1.631  49.594 
## 
## Coefficients:
##                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             4.290      0.673   6.374 8.63e-10 ***
## ProximityNot in Prox    7.116      1.077   6.609 2.27e-10 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 8.406 on 254 degrees of freedom
##   (13 observations deleted due to missingness)
## Multiple R-squared:  0.1467, Adjusted R-squared:  0.1434 
## F-statistic: 43.67 on 1 and 254 DF,  p-value: 2.267e-10
summary(m2c)
## 
## Call:
## lm(formula = pboo_00 ~ Proximity + log(t_00), data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -12.294  -4.269  -2.274   1.733  49.544 
## 
## Coefficients:
##                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           -0.8651     6.5636  -0.132    0.895    
## ProximityNot in Prox   7.0641     1.2818   5.511 1.11e-07 ***
## log(t_00)              0.5552     0.6374   0.871    0.385    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 8.765 on 197 degrees of freedom
##   (69 observations deleted due to missingness)
## Multiple R-squared:  0.1445, Adjusted R-squared:  0.1358 
## F-statistic: 16.63 on 2 and 197 DF,  p-value: 2.112e-07
summary(m3c)
## 
## Call:
## lm(formula = pboo_00 ~ Proximity + log(t_00) + dbw_00, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -11.381  -4.448  -2.252   1.847  49.708 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           1.173053   6.450149   0.182  0.85588    
## ProximityNot in Prox  6.444154   1.268515   5.080 8.76e-07 ***
## log(t_00)            -0.006646   0.648026  -0.010  0.99183    
## dbw_00                0.129736   0.040949   3.168  0.00178 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 8.57 on 196 degrees of freedom
##   (69 observations deleted due to missingness)
## Multiple R-squared:  0.1862, Adjusted R-squared:  0.1737 
## F-statistic: 14.94 on 3 and 196 DF,  p-value: 8.449e-09
m1d <- lm(pboo_90~Proximity,data=cities)
m2d <- lm(pboo_90~Proximity+log(t_90),data=cities)
m3d <- lm(pboo_90~Proximity+log(t_90)+dbw_90,data=cities)
summary(m1d)
## 
## Call:
## lm(formula = pboo_90 ~ Proximity, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -10.564  -3.830  -2.390   2.436  50.076 
## 
## Coefficients:
##                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            3.8299     0.6342   6.039 5.46e-09 ***
## ProximityNot in Prox   6.7342     1.0167   6.623 2.07e-10 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 7.947 on 255 degrees of freedom
##   (12 observations deleted due to missingness)
## Multiple R-squared:  0.1468, Adjusted R-squared:  0.1434 
## F-statistic: 43.87 on 1 and 255 DF,  p-value: 2.069e-10
summary(m2d)
## 
## Call:
## lm(formula = pboo_90 ~ Proximity + log(t_90), data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -12.459  -4.348  -2.059   2.303  49.229 
## 
## Coefficients:
##                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           -0.7818     6.8735  -0.114    0.910    
## ProximityNot in Prox   7.1279     1.3429   5.308 3.31e-07 ***
## log(t_90)              0.5418     0.6767   0.801    0.424    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 8.582 on 176 degrees of freedom
##   (90 observations deleted due to missingness)
## Multiple R-squared:  0.1534, Adjusted R-squared:  0.1438 
## F-statistic: 15.94 on 2 and 176 DF,  p-value: 4.331e-07
summary(m3d)
## 
## Call:
## lm(formula = pboo_90 ~ Proximity + log(t_90) + dbw_90, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -12.289  -4.693  -1.687   2.367  50.433 
## 
## Coefficients:
##                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           3.14686    6.49777   0.484    0.629    
## ProximityNot in Prox  6.73156    1.26268   5.331 2.98e-07 ***
## log(t_90)            -0.40265    0.66266  -0.608    0.544    
## dbw_90                0.17106    0.03429   4.988 1.46e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 8.053 on 175 degrees of freedom
##   (90 observations deleted due to missingness)
## Multiple R-squared:  0.2588, Adjusted R-squared:  0.2461 
## F-statistic: 20.36 on 3 and 175 DF,  p-value: 2.291e-11
m1e <- lm(pboo_80~Proximity,data=cities)
m2e <- lm(pboo_80~Proximity+log(t_80),data=cities)
m3e <- lm(pboo_80~Proximity+log(t_80)+dbw_80,data=cities)
summary(m1e)
## 
## Call:
## lm(formula = pboo_80 ~ Proximity, data = cities)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -8.199 -3.475 -2.315  2.175 29.635 
## 
## Coefficients:
##                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            3.4750     0.5519   6.296 1.45e-09 ***
## ProximityNot in Prox   4.7242     0.8837   5.346 2.10e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6.691 on 239 degrees of freedom
##   (28 observations deleted due to missingness)
## Multiple R-squared:  0.1068, Adjusted R-squared:  0.1031 
## F-statistic: 28.58 on 1 and 239 DF,  p-value: 2.099e-07
summary(m2e)
## 
## Call:
## lm(formula = pboo_80 ~ Proximity + log(t_80), data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -11.256  -4.013  -2.072   3.440  28.003 
## 
## Coefficients:
##                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           -4.3137     6.1444  -0.702    0.484    
## ProximityNot in Prox   5.7188     1.2114   4.721 5.32e-06 ***
## log(t_80)              0.8547     0.6068   1.408    0.161    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 7.209 on 151 degrees of freedom
##   (115 observations deleted due to missingness)
## Multiple R-squared:  0.1546, Adjusted R-squared:  0.1434 
## F-statistic:  13.8 on 2 and 151 DF,  p-value: 3.125e-06
summary(m3e)
## 
## Call:
## lm(formula = pboo_80 ~ Proximity + log(t_80) + dbw_80, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -11.147  -4.408  -1.674   2.692  27.227 
## 
## Coefficients:
##                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           2.31953    5.93737   0.391    0.697    
## ProximityNot in Prox  5.40689    1.13826   4.750 4.71e-06 ***
## log(t_80)            -0.32359    0.62305  -0.519    0.604    
## dbw_80                0.12681    0.02727   4.650 7.22e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6.762 on 150 degrees of freedom
##   (115 observations deleted due to missingness)
## Multiple R-squared:  0.2611, Adjusted R-squared:  0.2463 
## F-statistic: 17.67 on 3 and 150 DF,  p-value: 7.136e-10
m1a <- lm(pboo_20~Proximity,data=cities)
m2a <- lm(pboo_20~Proximity+log(t_20),data=cities)
m3a <- lm(pboo_20~Proximity+dbw_20,data=cities)

m1b <- lm(pboo_10~Proximity,data=cities)
m2b <- lm(pboo_10~Proximity+log(t_10),data=cities)
m3b <- lm(pboo_10~Proximity+log(t_10)+dbw_10,data=cities)

m1c <- lm(pboo_00~Proximity,data=cities)
m2c <- lm(pboo_00~Proximity+log(t_00),data=cities)
m3c <- lm(pboo_00~Proximity+log(t_00)+dbw_00,data=cities)

m1d <- lm(pboo_90~Proximity,data=cities)
m2d <- lm(pboo_90~Proximity+log(t_90),data=cities)
m3d <- lm(pboo_90~Proximity+log(t_90)+dbw_90,data=cities)

m1e <- lm(pboo_80~Proximity,data=cities)
m2e <- lm(pboo_80~Proximity+log(t_80),data=cities)
m3e <- lm(pboo_80~Proximity+log(t_80)+dbw_80,data=cities)
stargazer(m1e, m2e, m3e, m1d, m2d, m3d, m1c, m2c, m3c,
          type="text", title="Regression Results - Black Homeownership",
          align=TRUE, dep.var.labels=c("1980","1990","2000"),
          covariate.labels=c("Proximity","City Population 1980","Dissimilarity Index 1980","City Population 1990","Dissimilarity Index 1990","City Population 2000","Dissimilarity Index 2000"), 
          omit.stat=c("LL","ser","f"), no.space=TRUE, style = "demography", out="main00-80.htm") 
## 
## Regression Results - Black Homeownership
## ---------------------------------------------------------------------------------------------------------
##                                     1980                       1990                       2000           
##                          Model 1  Model 2  Model 3  Model 4  Model 5  Model 6  Model 7  Model 8  Model 9 
## ---------------------------------------------------------------------------------------------------------
## Proximity                4.724*** 5.719*** 5.407*** 6.734*** 7.128*** 6.732*** 7.116*** 7.064*** 6.444***
##                          (0.884)  (1.211)  (1.138)  (1.017)  (1.343)  (1.263)  (1.077)  (1.282)  (1.269) 
## City Population 1980               0.855    -0.324                                                       
##                                   (0.607)  (0.623)                                                       
## Dissimilarity Index 1980                   0.127***                                                      
##                                            (0.027)                                                       
## City Population 1990                                          0.542    -0.403                            
##                                                              (0.677)  (0.663)                            
## Dissimilarity Index 1990                                              0.171***                           
##                                                                       (0.034)                            
## City Population 2000                                                                     0.555    -0.007 
##                                                                                         (0.637)  (0.648) 
## Dissimilarity Index 2000                                                                         0.130** 
##                                                                                                  (0.041) 
## Constant                 3.475***  -4.314   2.320   3.830***  -0.782   3.147   4.290***  -0.865   1.173  
##                          (0.552)  (6.144)  (5.937)  (0.634)  (6.873)  (6.498)  (0.673)  (6.564)  (6.450) 
## N                          241      154      154      257      179      179      256      200      200   
## R2                        0.107    0.155    0.261    0.147    0.153    0.259    0.147    0.144    0.186  
## Adjusted R2               0.103    0.143    0.246    0.143    0.144    0.246    0.143    0.136    0.174  
## ---------------------------------------------------------------------------------------------------------
## *p < .05; **p < .01; ***p < .001
stargazer(m1b, m2b, m3b, m1a, m2a, m3a, 
          type="text", title="Regression Results - Black Homeownership",
          align=TRUE, dep.var.labels=c("2010","2020"),
          covariate.labels=c("Proximity", "City Population 2010","Dissimilarity Index 2010","City Population 2020","Dissimilarity Index 2020"),
          omit.stat=c("LL","ser","f"), no.space=TRUE, style = "demography",
                             out="main 2010 - 2020.htm") 
## 
## Regression Results - Black Homeownership
## ------------------------------------------------------------------------------
##                                     2010                       2020           
##                          Model 1  Model 2  Model 3  Model 4  Model 5  Model 6 
## ------------------------------------------------------------------------------
## Proximity                7.623*** 7.498*** 7.442*** 7.318*** 7.131*** 7.293***
##                          (1.365)  (1.371)  (1.375)  (1.270)  (1.283)  (1.283) 
## City Population 2010               0.662    0.490                             
##                                   (0.670)  (0.712)                            
## Dissimilarity Index 2010                    0.037                             
##                                            (0.051)                            
## City Population 2020                                          6.678           
##                                                              (6.711)          
## Dissimilarity Index 2020                                               -0.004 
##                                                                       (0.052) 
## Constant                 5.466***  -1.331   -0.528  5.604***  -9.916  5.727***
##                          (0.872)  (6.937)  (7.034)  (0.789)  (15.652) (1.492) 
## N                          240      240      240      262      261      261   
## R2                        0.116    0.119    0.121    0.113    0.116    0.112  
## Adjusted R2               0.112    0.112    0.110    0.110    0.109    0.105  
## ------------------------------------------------------------------------------
## *p < .05; **p < .01; ***p < .001

Proximity to freedom colonies as the mediator

Causal mediation analysis

install.packages("semTools")
## Installing package into 'C:/Users/canda/AppData/Local/R/win-library/4.3'
## (as 'lib' is unspecified)
## package 'semTools' successfully unpacked and MD5 sums checked
## 
## The downloaded binary packages are in
##  C:\Users\canda\AppData\Local\Temp\Rtmps7Yaq8\downloaded_packages
install.packages("tidyverse")
## Installing package into 'C:/Users/canda/AppData/Local/R/win-library/4.3'
## (as 'lib' is unspecified)
## package 'tidyverse' successfully unpacked and MD5 sums checked
## 
## The downloaded binary packages are in
##  C:\Users\canda\AppData\Local\Temp\Rtmps7Yaq8\downloaded_packages
library(lavaan)
library(stargazer)
library(semTools)
## Warning: package 'semTools' was built under R version 4.3.2
## 
## ###############################################################################
## This is semTools 0.5-6
## All users of R (or SEM) are invited to submit functions or ideas for functions.
## ###############################################################################
library(dplyr)

#linear regression model path c

fit.totaleffect20=lm(pboo_20~dbw_20,cities)
summary(fit.totaleffect20)
## 
## Call:
## lm(formula = pboo_20 ~ dbw_20, data = cities)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -9.494 -6.204 -3.776  3.361 58.777 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  7.75619    1.53393   5.056 8.09e-07 ***
## dbw_20       0.02759    0.05460   0.505    0.614    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 10.63 on 259 degrees of freedom
##   (8 observations deleted due to missingness)
## Multiple R-squared:  0.0009849,  Adjusted R-squared:  -0.002872 
## F-statistic: 0.2553 on 1 and 259 DF,  p-value: 0.6138
fit.totaleffect10=lm(pboo_10~dbw_10,cities)
summary(fit.totaleffect10)
## 
## Call:
## lm(formula = pboo_10 ~ dbw_10, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -12.414  -6.611  -4.047   3.222  57.349 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  6.65783    1.54930   4.297 2.52e-05 ***
## dbw_10       0.07062    0.05063   1.395    0.164    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 11.01 on 238 degrees of freedom
##   (29 observations deleted due to missingness)
## Multiple R-squared:  0.008109,   Adjusted R-squared:  0.003941 
## F-statistic: 1.946 on 1 and 238 DF,  p-value: 0.1644
fit.totaleffect00=lm(pboo_00~dbw_00,cities)
summary(fit.totaleffect00)
## 
## Call:
## lm(formula = pboo_00 ~ dbw_00, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -13.879  -5.553  -2.565   2.516  53.694 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  2.47709    1.42056   1.744   0.0828 .  
## dbw_00       0.16763    0.04096   4.093  6.2e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.076 on 198 degrees of freedom
##   (69 observations deleted due to missingness)
## Multiple R-squared:  0.07801,    Adjusted R-squared:  0.07335 
## F-statistic: 16.75 on 1 and 198 DF,  p-value: 6.198e-05

#homeownership and percent black significant because they are highly correlated

fit.totaleffect2_20=lm(pb_20~pboo_20,cities)
summary(fit.totaleffect2_20)
## 
## Call:
## lm(formula = pb_20 ~ pboo_20, data = cities)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -11.0656  -2.3158  -0.6632   1.6532  16.8647 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  3.09306    0.26722   11.57   <2e-16 ***
## pboo_20      1.07084    0.01971   54.32   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.374 on 259 degrees of freedom
##   (8 observations deleted due to missingness)
## Multiple R-squared:  0.9193, Adjusted R-squared:  0.919 
## F-statistic:  2951 on 1 and 259 DF,  p-value: < 2.2e-16
fit.totaleffect2_10=lm(pb_10~pboo_10,cities)
summary(fit.totaleffect2_10)
## 
## Call:
## lm(formula = pb_10 ~ pboo_10, data = cities)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -11.2387  -1.9058  -0.6333   1.3838  15.1023 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  2.26128    0.24360   9.283   <2e-16 ***
## pboo_10      1.06376    0.01746  60.941   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.977 on 238 degrees of freedom
##   (29 observations deleted due to missingness)
## Multiple R-squared:  0.9398, Adjusted R-squared:  0.9395 
## F-statistic:  3714 on 1 and 238 DF,  p-value: < 2.2e-16
fit.totaleffect2_00=lm(pb_00~pboo_00,cities)
summary(fit.totaleffect2_00)
## 
## Call:
## lm(formula = pb_00 ~ pboo_00, data = cities)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -13.4643  -1.5188  -0.6209   1.2338  19.8202 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  1.63249    0.26102   6.254 2.42e-09 ***
## pboo_00      1.13258    0.02152  52.641  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.862 on 198 degrees of freedom
##   (69 observations deleted due to missingness)
## Multiple R-squared:  0.9333, Adjusted R-squared:  0.933 
## F-statistic:  2771 on 1 and 198 DF,  p-value: < 2.2e-16

#Proximity as the mediator

cities$Proximity <- as.ordered(cities$Proximity)
class(cities$Proximity)
## [1] "ordered" "factor"
summary(cities$Proximity)
## In Proximity  Not in Prox 
##          162          107
specmod20 <- "
#Path c
pboo_20 ~ c*dbw_20

#Path a
Proximity ~ a*dbw_20

#Path b
pboo_20 ~ b*Proximity

#Indirect effect (a*b)
ab :=a*b
"
specmod10 <- "
#Path c
pboo_10 ~ c*dbw_10

#Path a
Proximity ~ a*dbw_10

#Path b
pboo_10 ~ b*Proximity

#Indirect effect (a*b)
ab :=a*b
"
specmod00 <- "
#Path c
pboo_00 ~ c*dbw_00

#Path a
Proximity ~ a*dbw_00

#Path b
pboo_00 ~ b*Proximity

#Indirect effect (a*b)
ab :=a*b
"

specmod90 <- "
#Path c
pboo_90 ~ c*dbw_90

#Path a
Proximity ~ a*dbw_90

#Path b
pboo_90 ~ b*Proximity

#Indirect effect (a*b)
ab :=a*b
"

specmod80 <- "
#Path c
pboo_80 ~ c*dbw_80

#Path a
Proximity ~ a*dbw_80

#Path b
pboo_80 ~ b*Proximity

#Indirect effect (a*b)
ab :=a*b
"

#without equality constraints

fitmodel20<- sem(specmod20, data=cities)
fitmodel10<- sem(specmod10, data=cities)
fitmodel00<- sem(specmod00, data=cities)
fitmodel90<- sem(specmod90, data=cities)
fitmodel80<- sem(specmod80, data=cities)
summary(fitmodel20,fit.measures=TRUE, rsquare=TRUE)
## lavaan 0.6.17 ended normally after 16 iterations
## 
##   Estimator                                       DWLS
##   Optimization method                           NLMINB
##   Number of model parameters                         6
## 
##                                                   Used       Total
##   Number of observations                           261         269
## 
## Model Test User Model:
##                                               Standard      Scaled
##   Test Statistic                                 0.000       0.000
##   Degrees of freedom                                 0           0
## 
## Model Test Baseline Model:
## 
##   Test statistic                                47.852      47.852
##   Degrees of freedom                                 1           1
##   P-value                                        0.000       0.000
##   Scaling correction factor                                  1.000
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    1.000       1.000
##   Tucker-Lewis Index (TLI)                       1.000       1.000
##                                                                   
##   Robust Comparative Fit Index (CFI)                            NA
##   Robust Tucker-Lewis Index (TLI)                               NA
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000       0.000
##   90 Percent confidence interval - lower         0.000       0.000
##   90 Percent confidence interval - upper         0.000       0.000
##   P-value H_0: RMSEA <= 0.050                       NA          NA
##   P-value H_0: RMSEA >= 0.080                       NA          NA
##                                                                   
##   Robust RMSEA                                                  NA
##   90 Percent confidence interval - lower                        NA
##   90 Percent confidence interval - upper                        NA
##   P-value H_0: Robust RMSEA <= 0.050                            NA
##   P-value H_0: Robust RMSEA >= 0.080                            NA
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000       0.000
## 
## Parameter Estimates:
## 
##   Parameterization                               Delta
##   Standard errors                           Robust.sem
##   Information                                 Expected
##   Information saturated (h1) model        Unstructured
## 
## Regressions:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   pboo_20 ~                                           
##     dbw_20     (c)   -0.025    0.052   -0.480    0.631
##   Proximity ~                                         
##     dbw_20     (a)    0.011    0.006    1.715    0.086
##   pboo_20 ~                                           
##     Proximity  (b)    4.715    0.682    6.917    0.000
## 
## Intercepts:
##                    Estimate  Std.Err  z-value  P(>|z|)
##    .pboo_20           7.756    1.905    4.071    0.000
## 
## Thresholds:
##                    Estimate  Std.Err  z-value  P(>|z|)
##     Proximity|t1      0.571    0.183    3.127    0.002
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##    .pboo_20          89.900    7.233   12.429    0.000
##    .Proximity         1.000                           
## 
## R-Square:
##                    Estimate
##     pboo_20           0.199
##     Proximity         0.018
## 
## Defined Parameters:
##                    Estimate  Std.Err  z-value  P(>|z|)
##     ab                0.052    0.031    1.677    0.094
summary(fitmodel10,fit.measures=TRUE, rsquare=TRUE)
## lavaan 0.6.17 ended normally after 19 iterations
## 
##   Estimator                                       DWLS
##   Optimization method                           NLMINB
##   Number of model parameters                         6
## 
##                                                   Used       Total
##   Number of observations                           240         269
## 
## Model Test User Model:
##                                               Standard      Scaled
##   Test Statistic                                 0.000       0.000
##   Degrees of freedom                                 0           0
## 
## Model Test Baseline Model:
## 
##   Test statistic                                48.420      48.420
##   Degrees of freedom                                 1           1
##   P-value                                        0.000       0.000
##   Scaling correction factor                                  1.000
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    1.000       1.000
##   Tucker-Lewis Index (TLI)                       1.000       1.000
##                                                                   
##   Robust Comparative Fit Index (CFI)                            NA
##   Robust Tucker-Lewis Index (TLI)                               NA
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000       0.000
##   90 Percent confidence interval - lower         0.000       0.000
##   90 Percent confidence interval - upper         0.000       0.000
##   P-value H_0: RMSEA <= 0.050                       NA          NA
##   P-value H_0: RMSEA >= 0.080                       NA          NA
##                                                                   
##   Robust RMSEA                                                  NA
##   90 Percent confidence interval - lower                        NA
##   90 Percent confidence interval - upper                        NA
##   P-value H_0: Robust RMSEA <= 0.050                            NA
##   P-value H_0: Robust RMSEA >= 0.080                            NA
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000       0.000
## 
## Parameter Estimates:
## 
##   Parameterization                               Delta
##   Standard errors                           Robust.sem
##   Information                                 Expected
##   Information saturated (h1) model        Unstructured
## 
## Regressions:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   pboo_10 ~                                           
##     dbw_10     (c)    0.032    0.047    0.690    0.490
##   Proximity ~                                         
##     dbw_10     (a)    0.008    0.006    1.318    0.188
##   pboo_10 ~                                           
##     Proximity  (b)    5.025    0.722    6.958    0.000
## 
## Intercepts:
##                    Estimate  Std.Err  z-value  P(>|z|)
##    .pboo_10           6.658    2.102    3.168    0.002
## 
## Thresholds:
##                    Estimate  Std.Err  z-value  P(>|z|)
##     Proximity|t1      0.440    0.178    2.469    0.014
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##    .pboo_10          94.947    8.134   11.673    0.000
##    .Proximity         1.000                           
## 
## R-Square:
##                    Estimate
##     pboo_10           0.216
##     Proximity         0.011
## 
## Defined Parameters:
##                    Estimate  Std.Err  z-value  P(>|z|)
##     ab                0.038    0.029    1.299    0.194
summary(fitmodel00,fit.measures=TRUE, rsquare=TRUE)
## lavaan 0.6.17 ended normally after 18 iterations
## 
##   Estimator                                       DWLS
##   Optimization method                           NLMINB
##   Number of model parameters                         6
## 
##                                                   Used       Total
##   Number of observations                           200         269
## 
## Model Test User Model:
##                                               Standard      Scaled
##   Test Statistic                                 0.000       0.000
##   Degrees of freedom                                 0           0
## 
## Model Test Baseline Model:
## 
##   Test statistic                                42.125      42.125
##   Degrees of freedom                                 1           1
##   P-value                                        0.000       0.000
##   Scaling correction factor                                  1.000
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    1.000       1.000
##   Tucker-Lewis Index (TLI)                       1.000       1.000
##                                                                   
##   Robust Comparative Fit Index (CFI)                            NA
##   Robust Tucker-Lewis Index (TLI)                               NA
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000       0.000
##   90 Percent confidence interval - lower         0.000       0.000
##   90 Percent confidence interval - upper         0.000       0.000
##   P-value H_0: RMSEA <= 0.050                       NA          NA
##   P-value H_0: RMSEA >= 0.080                       NA          NA
##                                                                   
##   Robust RMSEA                                                  NA
##   90 Percent confidence interval - lower                        NA
##   90 Percent confidence interval - upper                        NA
##   P-value H_0: Robust RMSEA <= 0.050                            NA
##   P-value H_0: Robust RMSEA >= 0.080                            NA
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000       0.000
## 
## Parameter Estimates:
## 
##   Parameterization                               Delta
##   Standard errors                           Robust.sem
##   Information                                 Expected
##   Information saturated (h1) model        Unstructured
## 
## Regressions:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   pboo_00 ~                                           
##     dbw_00     (c)    0.105    0.042    2.523    0.012
##   Proximity ~                                         
##     dbw_00     (a)    0.016    0.006    2.612    0.009
##   pboo_00 ~                                           
##     Proximity  (b)    4.013    0.618    6.490    0.000
## 
## Intercepts:
##                    Estimate  Std.Err  z-value  P(>|z|)
##    .pboo_00           2.477    1.861    1.331    0.183
## 
## Thresholds:
##                    Estimate  Std.Err  z-value  P(>|z|)
##     Proximity|t1      0.757    0.210    3.601    0.000
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##    .pboo_00          65.443    5.638   11.607    0.000
##    .Proximity         1.000                           
## 
## R-Square:
##                    Estimate
##     pboo_00           0.260
##     Proximity         0.057
## 
## Defined Parameters:
##                    Estimate  Std.Err  z-value  P(>|z|)
##     ab                0.063    0.025    2.487    0.013
summary(fitmodel90,fit.measures=TRUE, rsquare=TRUE)
## lavaan 0.6.17 ended normally after 19 iterations
## 
##   Estimator                                       DWLS
##   Optimization method                           NLMINB
##   Number of model parameters                         6
## 
##                                                   Used       Total
##   Number of observations                           179         269
## 
## Model Test User Model:
##                                               Standard      Scaled
##   Test Statistic                                 0.000       0.000
##   Degrees of freedom                                 0           0
## 
## Model Test Baseline Model:
## 
##   Test statistic                                47.177      47.177
##   Degrees of freedom                                 1           1
##   P-value                                        0.000       0.000
##   Scaling correction factor                                  1.000
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    1.000       1.000
##   Tucker-Lewis Index (TLI)                       1.000       1.000
##                                                                   
##   Robust Comparative Fit Index (CFI)                            NA
##   Robust Tucker-Lewis Index (TLI)                               NA
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000       0.000
##   90 Percent confidence interval - lower         0.000       0.000
##   90 Percent confidence interval - upper         0.000       0.000
##   P-value H_0: RMSEA <= 0.050                       NA          NA
##   P-value H_0: RMSEA >= 0.080                       NA          NA
##                                                                   
##   Robust RMSEA                                                  NA
##   90 Percent confidence interval - lower                        NA
##   90 Percent confidence interval - upper                        NA
##   P-value H_0: Robust RMSEA <= 0.050                            NA
##   P-value H_0: Robust RMSEA >= 0.080                            NA
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000       0.000
## 
## Parameter Estimates:
## 
##   Parameterization                               Delta
##   Standard errors                           Robust.sem
##   Information                                 Expected
##   Information saturated (h1) model        Unstructured
## 
## Regressions:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   pboo_90 ~                                           
##     dbw_90     (c)    0.151    0.040    3.814    0.000
##   Proximity ~                                         
##     dbw_90     (a)    0.008    0.005    1.591    0.112
##   pboo_90 ~                                           
##     Proximity  (b)    4.132    0.602    6.869    0.000
## 
## Intercepts:
##                    Estimate  Std.Err  z-value  P(>|z|)
##    .pboo_90           1.135    2.026    0.560    0.575
## 
## Thresholds:
##                    Estimate  Std.Err  z-value  P(>|z|)
##     Proximity|t1      0.569    0.209    2.729    0.006
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##    .pboo_90          56.677    4.987   11.365    0.000
##    .Proximity         1.000                           
## 
## R-Square:
##                    Estimate
##     pboo_90           0.338
##     Proximity         0.024
## 
## Defined Parameters:
##                    Estimate  Std.Err  z-value  P(>|z|)
##     ab                0.035    0.022    1.592    0.111
summary(fitmodel80,fit.measures=TRUE, rsquare=TRUE)
## lavaan 0.6.17 ended normally after 22 iterations
## 
##   Estimator                                       DWLS
##   Optimization method                           NLMINB
##   Number of model parameters                         6
## 
##                                                   Used       Total
##   Number of observations                           154         269
## 
## Model Test User Model:
##                                               Standard      Scaled
##   Test Statistic                                 0.000       0.000
##   Degrees of freedom                                 0           0
## 
## Model Test Baseline Model:
## 
##   Test statistic                                22.933      22.933
##   Degrees of freedom                                 1           1
##   P-value                                        0.000       0.000
##   Scaling correction factor                                  1.000
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    1.000       1.000
##   Tucker-Lewis Index (TLI)                       1.000       1.000
##                                                                   
##   Robust Comparative Fit Index (CFI)                            NA
##   Robust Tucker-Lewis Index (TLI)                               NA
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000       0.000
##   90 Percent confidence interval - lower         0.000       0.000
##   90 Percent confidence interval - upper         0.000       0.000
##   P-value H_0: RMSEA <= 0.050                       NA          NA
##   P-value H_0: RMSEA >= 0.080                       NA          NA
##                                                                   
##   Robust RMSEA                                                  NA
##   90 Percent confidence interval - lower                        NA
##   90 Percent confidence interval - upper                        NA
##   P-value H_0: Robust RMSEA <= 0.050                            NA
##   P-value H_0: Robust RMSEA >= 0.080                            NA
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000       0.000
## 
## Parameter Estimates:
## 
##   Parameterization                               Delta
##   Standard errors                           Robust.sem
##   Information                                 Expected
##   Information saturated (h1) model        Unstructured
## 
## Regressions:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   pboo_80 ~                                           
##     dbw_80     (c)    0.113    0.026    4.429    0.000
##   Proximity ~                                         
##     dbw_80     (a)    0.008    0.005    1.567    0.117
##   pboo_80 ~                                           
##     Proximity  (b)    3.061    0.639    4.789    0.000
## 
## Intercepts:
##                    Estimate  Std.Err  z-value  P(>|z|)
##    .pboo_80           0.719    1.723    0.417    0.676
## 
## Thresholds:
##                    Estimate  Std.Err  z-value  P(>|z|)
##     Proximity|t1      0.613    0.239    2.563    0.010
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##    .pboo_80          41.867    4.871    8.596    0.000
##    .Proximity         1.000                           
## 
## R-Square:
##                    Estimate
##     pboo_80           0.306
##     Proximity         0.027
## 
## Defined Parameters:
##                    Estimate  Std.Err  z-value  P(>|z|)
##     ab                0.023    0.015    1.572    0.116

#with fixed parameters

pars.factors20 <- standardizedSolution(fitmodel20)[standardizedSolution(fitmodel20)[,'op']=='=~']
pars.factors10 <- standardizedSolution(fitmodel10)[standardizedSolution(fitmodel10)[,'op']=='=~']
pars.factors00 <- standardizedSolution(fitmodel00)[standardizedSolution(fitmodel00)[,'op']=='=~']
pars.factors90 <- standardizedSolution(fitmodel90)[standardizedSolution(fitmodel90)[,'op']=='=~']
pars.factors80 <- standardizedSolution(fitmodel80)[standardizedSolution(fitmodel80)[,'op']=='=~']


pars.regressions20 <- standardizedSolution(fitmodel20)[ standardizedSolution(fitmodel20)[,'op']=='~', c(3, 4, 5, 7)]
pars.regressions10 <- standardizedSolution(fitmodel10)[ standardizedSolution(fitmodel10)[,'op']=='~', c(3, 4, 5, 7)]
pars.regressions00 <- standardizedSolution(fitmodel00)[ standardizedSolution(fitmodel00)[,'op']=='~', c(3, 4, 5, 7)]
pars.regressions90 <- standardizedSolution(fitmodel90)[ standardizedSolution(fitmodel90)[,'op']=='~', c(3, 4, 5, 7)]
pars.regressions80 <- standardizedSolution(fitmodel80)[ standardizedSolution(fitmodel80)[,'op']=='~', c(3, 4, 5, 7)]
#stargazer(pars.factors, rownames = FALSE, summary=FALSE, type='text', style = "demography", title='Factor loadings')


stargazer(pars.regressions80, rownames = FALSE, initial.zero=FALSE, type='text', title='Path Coefficients Table 1980', style = "demography", out = "predictingY80.htm", summary = FALSE)
## 
## Path Coefficients Table 1980
## -----------------------------
## rhs       label est.std   z  
## -----------------------------
## dbw_80      c    .322   5.385
## dbw_80      a    .165   1.611
## Proximity   b    .400   5.666
## -----------------------------
stargazer(pars.regressions90, rownames = FALSE, initial.zero=FALSE, type='text', title='Path Coefficients Table 1990', style = "demography", out = "predictingY90.htm", summary = FALSE)
## 
## Path Coefficients Table 1990
## -----------------------------
## rhs       label est.std   z  
## -----------------------------
## dbw_90      c    .303   4.397
## dbw_90      a    .153   1.629
## Proximity   b    .452   7.642
## -----------------------------
stargazer(pars.regressions00, rownames = FALSE, initial.zero=FALSE, type='text', title='Path Coefficients Table 2000', style = "demography", out = "predictingY00.htm", summary = FALSE)
## 
## Path Coefficients Table 2000
## -----------------------------
## rhs       label est.std   z  
## -----------------------------
## dbw_00      c    .175   2.659
## dbw_00      a    .238   2.770
## Proximity   b    .439   6.977
## -----------------------------
stargazer(pars.regressions10, rownames = FALSE, initial.zero=FALSE, type='text', title='Path Coefficients Table 2010', style = "demography", out = "predictingY10.htm", summary = FALSE)
## 
## Path Coefficients Table 2010
## -----------------------------
## rhs       label est.std   z  
## -----------------------------
## dbw_10      c    .041   .697 
## dbw_10      a    .106   1.333
## Proximity   b    .459   7.565
## -----------------------------
stargazer(pars.regressions20, rownames = FALSE, initial.zero=FALSE, type='text', title='Path Coefficients Table 2020', style = "demography", out = "predictingY20.htm", summary = FALSE)
## 
## Path Coefficients Table 2020
## -----------------------------
## rhs       label est.std   z  
## -----------------------------
## dbw_20      c    -.028  -.479
## dbw_20      a    .133   1.746
## Proximity   b    .449   7.409
## -----------------------------

#Black-to-white racial residential segregation is positively associated with racial income inequality.

stargazer(cities[c("dbw_10","gini_10")], header=FALSE, type='text', 
          title="Descriptive Statistics 2010", digits=3,
          covariate.labels=c("B-W Dissimilarity","Gini Index"),
          out="Desc Inequality 2010.htm"
          )
## 
## Descriptive Statistics 2010
## ==================================================
## Statistic          N   Mean  St. Dev.  Min   Max  
## --------------------------------------------------
## B-W Dissimilarity 240 27.194  14.067  0.000 82.216
## Gini Index        264 0.418   0.060   0.260 0.569 
## --------------------------------------------------
stargazer(cities[c("dbw_20","gini_20")], header=FALSE, type='text', 
          title="Descriptive Statistics 2020", digits=3,
          covariate.labels=c("B-W Dissimilarity","Gini Index"),
          out="Desc Inequality 2020.htm"
          )
## 
## Descriptive Statistics 2020
## ==================================================
## Statistic          N   Mean  St. Dev.  Min   Max  
## --------------------------------------------------
## B-W Dissimilarity 261 25.379  12.075  0.000 69.139
## Gini Index        262 0.424   0.050   0.292 0.545 
## --------------------------------------------------
cities$Proximity <- factor(cities$Proximity, ordered = FALSE )# Make "Not in Proximity" the reference category
cities$Proximity <- relevel(cities$Proximity, ref = "Not in Prox")
table(cities$Proximity)
## 
##  Not in Prox In Proximity 
##          107          162
plot(cities$dbw_10,cities$gini_10,pch=20,
     xlab='D index',ylab='Gini index',
     main='Cities by Residential Segregation and Income Inequality in 2010')

plot(cities$dbw_20,cities$gini_20,pch=20,
     xlab='D index',ylab='Gini index',
     main='Cities by Residential Segregation and Income Inequality in 2020')

#outcome = inequality

subset_P3 <- subset(cities, Proximity == "In Proximity")
stargazer(subset_P3[c("gini_10","gini_20")], header=FALSE, type='text', 
          title="Income Inequality by Year for Cities In Proximity to Freedom Colony", digits=4,
          covariate.labels=c("2010","2020"),initial.zero=FALSE,
          style = "demography",
          out="Desc Mean gini In Prox.htm")
## 
## Income Inequality by Year for Cities In Proximity to Freedom Colony
## ----------------------------------------
## Statistic  N  Mean  St. Dev.  Min   Max 
## ----------------------------------------
## 2010      160 .4181  .0591   .2600 .5340
## 2020      161 .4243  .0488   .2920 .5450
## ----------------------------------------
subset_P4 <- subset(cities, Proximity == "Not in Prox")
stargazer(subset_P4[c("gini_10","gini_20")], header=FALSE, type='text', 
          title="Income Inequality by Year for Cities Not In Proximity to Freedom Colony", digits=4,
          covariate.labels=c("2010","2020"),initial.zero=FALSE,
          style = "demography",
          out="Desc Mean gini NOTIn Prox.htm")
## 
## Income Inequality by Year for Cities Not In Proximity to Freedom Colony
## ----------------------------------------
## Statistic  N  Mean  St. Dev.  Min   Max 
## ----------------------------------------
## 2010      104 .4190  .0607   .2660 .5690
## 2020      101 .4246  .0532   .3130 .5450
## ----------------------------------------
m5a <- lm(gini_10~dbw_10,data=cities)
summary(m5a)
## 
## Call:
## lm(formula = gini_10 ~ dbw_10, data = cities)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.128300 -0.034858 -0.001421  0.034283  0.151779 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 0.3772492  0.0073349  51.432  < 2e-16 ***
## dbw_10      0.0016617  0.0002397   6.933 3.84e-11 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.05212 on 238 degrees of freedom
##   (29 observations deleted due to missingness)
## Multiple R-squared:  0.168,  Adjusted R-squared:  0.1645 
## F-statistic: 48.07 on 1 and 238 DF,  p-value: 3.845e-11
m5b <- lm(gini_20~dbw_20,data=cities)
summary(m5b)
## 
## Call:
## lm(formula = gini_20 ~ dbw_20, data = cities)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.106555 -0.030176  0.004545  0.031145  0.101210 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 0.3718508  0.0063533  58.529   <2e-16 ***
## dbw_20      0.0020690  0.0002261   9.149   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.04403 on 259 degrees of freedom
##   (8 observations deleted due to missingness)
## Multiple R-squared:  0.2443, Adjusted R-squared:  0.2413 
## F-statistic: 83.71 on 1 and 259 DF,  p-value: < 2.2e-16

##Regression results

stargazer(m5a,m5b,
          type="text", title="Regression Results",
          align=TRUE, dep.var.labels=c("Income Inequality 2010","Income Inequality 2020"),
          covariate.labels=c("Dissimilarity Index 2010","Dissimilarity Index 2020"),omit.stat=c("LL","ser","f"),initial.zero=FALSE, no.space=TRUE, style = "demography", out="Gini20202010.htm")
## 
## Regression Results
## ----------------------------------------------------------------------
##                          Income Inequality 2010 Income Inequality 2020
##                                 Model 1                Model 2        
## ----------------------------------------------------------------------
## Dissimilarity Index 2010        .002***                               
##                                 (.0002)                               
## Dissimilarity Index 2020                               .002***        
##                                                        (.0002)        
## Constant                        .377***                .372***        
##                                  (.007)                 (.006)        
## N                                 240                    261          
## R2                                .168                   .244         
## Adjusted R2                       .165                   .241         
## ----------------------------------------------------------------------
## *p < .05; **p < .01; ***p < .001
m6a1 <- lm(gini_10~dbw_10,data=cities)
m7a2 <- lm(gini_10~dbw_10+Proximity,data=cities)
m8a3 <- lm(gini_10~dbw_10+Proximity+log(t_10),data=cities)
m9a4 <- lm(gini_10~dbw_10+Proximity+log(t_10)+pboo_10,data=cities)

stargazer(m6a1, m7a2, m8a3, m9a4, 
          type="text", title="Regression Results - Income Inequality",
          align=TRUE, dep.var.labels=c("2010"),
          covariate.labels=c("Dissimilarity Index 2010",
                             "Proximity",
                             "City Population 2010",
                             "Black Homeownership 2010"), initial.zero=FALSE,
          omit.stat=c("LL","ser","f"), no.space=TRUE, style = "demography",out="Inequality outcome.htm") 
## 
## Regression Results - Income Inequality
## --------------------------------------------------------
##                                       2010              
##                          Model 1 Model 2 Model 3 Model 4
## --------------------------------------------------------
## Dissimilarity Index 2010 .002*** .002*** .002*** .002***
##                          (.0002) (.0002) (.0003) (.0003)
## Proximity                         .006    .006    -.001 
##                                  (.007)  (.007)  (.007) 
## City Population 2010                      .004    .005  
##                                          (.004)  (.004) 
## Black Homeownership 2010                         -.001**
##                                                  (.0003)
## Constant                 .377*** .373*** .330*** .337***
##                          (.007)  (.009)  (.036)  (.035) 
## N                          240     240     240     240  
## R2                        .168    .171    .176    .207  
## Adjusted R2               .165    .164    .165    .194  
## --------------------------------------------------------
## *p < .05; **p < .01; ***p < .001
m6b5 <- lm(gini_20~dbw_20,data=cities)
m7b6 <- lm(gini_20~dbw_20+Proximity,data=cities)
m8b7 <- lm(gini_20~dbw_20+Proximity+log(t_20),data=cities)
m9b8 <- lm(gini_20~dbw_20+Proximity+log(t_20)+pboo_20,data=cities)

stargazer(m6b5, m7b6, m8b7, m9b8,
          type="text", title="Regression Results - Income Inequality",
          align=TRUE, dep.var.labels=c("2020"),
          covariate.labels=c( "Dissimilarity Index 2020",
                              "Proximity",
                             "City Population 2020",
                             "Black Homeownership 2020",
                             "Constant"), initial.zero=FALSE,
          omit.stat=c("LL","ser","f"), no.space=TRUE, style = "demography",out="Inequality outcome20.htm") 
## 
## Regression Results - Income Inequality
## ---------------------------------------------------------
##                                        2020              
##                          Model 1 Model 2 Model 3 Model 4 
## ---------------------------------------------------------
## Dissimilarity Index 2020 .002*** .002*** .002*** .002*** 
##                          (.0002) (.0002) (.0002) (.0002) 
## Proximity                         .005    .005    -.002  
##                                  (.006)  (.006)   (.006) 
## City Population 2020                     -.00003   .008  
##                                          (.032)   (.031) 
## Black Homeownership 2020                         -.001***
##                                                  (.0003) 
## Constant                 .372*** .368*** .368*** .363*** 
##                          (.006)  (.008)  (.073)   (.071) 
## N                          261     261     261     261   
## R2                        .244    .247    .247     .282  
## Adjusted R2               .241    .241    .238     .271  
## ---------------------------------------------------------
## *p < .05; **p < .01; ***p < .001

#percent Black population with inequality as outcome. No significance for 2010, low sig 2020

m10a <- lm(gini_20~pb_20,data=cities)
summary(m10a)
## 
## Call:
## lm(formula = gini_20 ~ pb_20, data = cities)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.133079 -0.032519 -0.001667  0.034255  0.135233 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  0.4307733  0.0044585  96.619   <2e-16 ***
## pb_20       -0.0005279  0.0002629  -2.008   0.0457 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.05026 on 259 degrees of freedom
##   (8 observations deleted due to missingness)
## Multiple R-squared:  0.01533,    Adjusted R-squared:  0.01153 
## F-statistic: 4.032 on 1 and 259 DF,  p-value: 0.04569
m10b <- lm(gini_10~pb_10,data=cities)
summary(m10b)
## 
## Call:
## lm(formula = gini_10 ~ pb_10, data = cities)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.15540 -0.03681 -0.00019  0.04235  0.14526 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  0.4258257  0.0050589  84.174   <2e-16 ***
## pb_10       -0.0002976  0.0003048  -0.976     0.33    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.05703 on 238 degrees of freedom
##   (29 observations deleted due to missingness)
## Multiple R-squared:  0.00399,    Adjusted R-squared:  -0.0001951 
## F-statistic: 0.9534 on 1 and 238 DF,  p-value: 0.3298

#outcome = segregation

m12a <- lm(dbw_20~gini_20,data=cities)
summary(m12a)
## 
## Call:
## lm(formula = dbw_20 ~ gini_20, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -22.168  -7.256  -1.223   6.250  41.274 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -24.720      5.514  -4.483 1.11e-05 ***
## gini_20      118.059     12.903   9.149  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 10.52 on 259 degrees of freedom
##   (8 observations deleted due to missingness)
## Multiple R-squared:  0.2443, Adjusted R-squared:  0.2413 
## F-statistic: 83.71 on 1 and 259 DF,  p-value: < 2.2e-16
m12b <- lm(dbw_10~gini_10,data=cities)
summary(m12b)
## 
## Call:
## lm(formula = dbw_10 ~ gini_10, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -27.987  -8.574  -0.795   7.034  46.673 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -15.522      6.217  -2.497   0.0132 *  
## gini_10      101.117     14.585   6.933 3.84e-11 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 12.86 on 238 degrees of freedom
##   (29 observations deleted due to missingness)
## Multiple R-squared:  0.168,  Adjusted R-squared:  0.1645 
## F-statistic: 48.07 on 1 and 238 DF,  p-value: 3.845e-11
m13a <- lm(dbw_20~Proximity,data=cities)
m14a <- lm(dbw_20~Proximity+log(t_20),data=cities)
m15a <- lm(dbw_20~Proximity+log(t_20)+pboo_20,data=cities)
m16a <- lm(dbw_20~Proximity+log(t_20)+pboo_20+gini_20,data=cities)

m13b <- lm(dbw_10~Proximity,data=cities)
m14b <- lm(dbw_10~Proximity+log(t_10),data=cities)
m15b <- lm(dbw_10~Proximity+log(t_10)+pboo_10,data=cities)
m16b <- lm(dbw_10~Proximity+log(t_10)+pboo_10+gini_10,data=cities)
stargazer(m13a, m14a, m15a, m16a, m13b, m14b, m15b, m16b,
          type="text", title="Regression Results",
          align=TRUE, dep.var.labels=c("Dissimilarity Index 2020","Dissimilarity Index 2010"),
          covariate.labels=c("Proximity","City Population 2020","Black Homeownership","Income Inequality","City Population 2010","Black Homeownership","Income Inequality"), initial.zero=FALSE, omit.stat=c("LL","ser","f"), no.space=TRUE, style = "demography", out="Segregation.htm") 
## 
## Regression Results
## -------------------------------------------------------------------------------------------------------
##                               Dissimilarity Index 2020                  Dissimilarity Index 2010       
##                       Model 1   Model 2    Model 3     Model 4    Model 5  Model 6  Model 7   Model 8  
## -------------------------------------------------------------------------------------------------------
## Proximity             -2.625     -1.536     -1.770     -1.191     -2.420    -1.535   -1.089    -.845   
##                       (1.529)   (1.434)    (1.520)     (1.343)    (1.845)  (1.748)  (1.857)   (1.718)  
## City Population 2020           47.799***  48.018***   36.414***                                        
##                                 (7.503)    (7.529)     (6.778)                                         
## Black Homeownership                         -.033       .078                                           
##                                             (.070)     (.063)                                          
## Income Inequality                                    108.708***                                        
##                                                       (12.624)                                         
## City Population 2010                                                       4.692*** 4.652***  3.507*** 
##                                                                             (.855)   (.857)    (.813)  
## Black Homeownership                                                                   .059      .141   
##                                                                                      (.083)    (.078)  
## Income Inequality                                                                            92.373*** 
##                                                                                               (14.427) 
## Constant             26.988*** -85.436*** -85.527*** -105.820*** 28.626*** -20.440* -20.807* -48.824***
##                       (1.197)   (17.683)   (17.710)   (15.802)    (1.419)  (9.038)  (9.062)   (9.453)  
## N                       261       261        261         261        240      240      240       240    
## R2                     .011       .146       .146       .338       .007      .119     .121      .252   
## Adjusted R2            .007       .139       .136       .328       .003      .112     .110      .239   
## -------------------------------------------------------------------------------------------------------
## *p < .05; **p < .01; ***p < .001

#outcome = homeownership

plot(cities$pboo_10,cities$gini_10,pch=20,
     xlab='Homeownership',ylab='Gini index',
     main='Cities by Black Homeownership and Income Inequality in 2010')

plot(cities$pboo_20,cities$gini_20,pch=20,
     xlab='Homeownership',ylab='Gini index',
     main='Cities by Black Homeownership and Income Inequality in 2020')

m17a <- lm(pboo_10~gini_10,data=cities)
summary(m17a)
## 
## Call:
## lm(formula = pboo_10 ~ gini_10, data = cities)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -10.567  -6.707  -3.943   2.528  55.439 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)    20.24       5.29   3.826 0.000167 ***
## gini_10       -27.60      12.41  -2.224 0.027084 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 10.94 on 238 degrees of freedom
##   (29 observations deleted due to missingness)
## Multiple R-squared:  0.02036,    Adjusted R-squared:  0.01624 
## F-statistic: 4.946 on 1 and 238 DF,  p-value: 0.02708
m17b <- lm(pboo_20~gini_20,data=cities)
summary(m17b)
## 
## Call:
## lm(formula = pboo_20 ~ gini_20, data = cities)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -9.757 -6.354 -3.521  2.900 56.998 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   24.301      5.483   4.432 1.38e-05 ***
## gini_20      -37.412     12.830  -2.916  0.00386 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 10.46 on 260 degrees of freedom
##   (7 observations deleted due to missingness)
## Multiple R-squared:  0.03167,    Adjusted R-squared:  0.02794 
## F-statistic: 8.503 on 1 and 260 DF,  p-value: 0.003856
stargazer(m17a, m17b,
          type="text", title="Effects on Black Homeownership",
          align=TRUE, dep.var.labels=c("2010","2020"),
          covariate.labels=c("Income Inequality 2010", "Income Inequality 2020"), omit.stat=c("LL","ser","f"), initial.zero=FALSE, no.space=TRUE, style = "demography", out="Homeownership.htm") 
## 
## Effects on Black Homeownership
## ------------------------------------------
##                          2010      2020   
##                         Model 1   Model 2 
## ------------------------------------------
## Income Inequality 2010 -27.603*           
##                        (12.411)           
## Income Inequality 2020           -37.412**
##                                  (12.830) 
## Constant               20.239*** 24.301***
##                         (5.290)   (5.483) 
## N                         240       262   
## R2                       .020      .032   
## Adjusted R2              .016      .028   
## ------------------------------------------
## *p < .05; **p < .01; ***p < .001
m18a <- lm(pboo_10~Proximity,data=cities)
m19a <- lm(pboo_10~Proximity+log(t_10),data=cities)
m20a <- lm(pboo_10~Proximity+log(t_10)+dbw_10,data=cities)
m21a <- lm(pboo_10~Proximity+log(t_10)+dbw_10+gini_10,data=cities)

m18b <- lm(pboo_20~Proximity,data=cities)
m19b <- lm(pboo_20~Proximity+log(t_20),data=cities)
m20b <- lm(pboo_20~Proximity+log(t_20)+dbw_20,data=cities)
m21b <- lm(pboo_20~Proximity+log(t_20)+dbw_20+gini_20,data=cities)
stargazer(m18a, m19a, m20a, m21a, m18b, m19b, m20b, m21b,
          type="text", title="Regression Results - Black Homeownership",
          align=TRUE, dep.var.labels=c("Black Homeownership 2010","Black Homeownership 2020"),
          covariate.labels=c("Proximity","City Population 2010","Dissimilarity Index","Income Inequality","City Population 2020","Dissimilarity Index","Income Inequality"), initial.zero=FALSE, omit.stat=c("LL","ser","f"), no.space=TRUE, style = "demography",  out="Homeownership full.htm") 
## 
## Regression Results - Black Homeownership
## -----------------------------------------------------------------------------------------------------
##                             Black Homeownership 2010                 Black Homeownership 2020        
##                       Model 1   Model 2   Model 3   Model 4   Model 5   Model 6   Model 7   Model 8  
## -----------------------------------------------------------------------------------------------------
## Proximity            -7.623*** -7.498*** -7.442*** -7.193*** -7.318*** -7.131*** -7.172*** -6.917*** 
##                       (1.365)   (1.371)   (1.375)   (1.353)   (1.270)   (1.283)   (1.288)   (1.261)  
## City Population 2010             .662      .490      .663                                            
##                                 (.670)    (.712)    (.702)                                           
## Dissimilarity Index                        .037      .098                                            
##                                           (.051)    (.054)                                           
## Income Inequality                                  -38.970**                                         
##                                                    (12.780)                                          
## City Population 2020                                                     6.678     7.932     7.930   
##                                                                         (6.711)   (7.231)   (7.072)  
## Dissimilarity Index                                                                -.026      .077   
##                                                                                   (.056)     (.062)  
## Income Inequality                                                                          -49.316***
##                                                                                             (13.877) 
## Constant             13.088***   6.167     6.914    19.775*  12.921***  -2.785    -5.026     13.131  
##                       (1.050)   (7.086)   (7.170)   (8.212)   (.996)   (15.816)  (16.541)   (16.967) 
## N                       240       240       240       240       262       261       261       261    
## R2                     .116      .119      .121      .155      .113      .116      .116       .158   
## Adjusted R2            .112      .112      .110      .140      .110      .109      .106       .145   
## -----------------------------------------------------------------------------------------------------
## *p < .05; **p < .01; ***p < .001