Evaluating Neighborhood Change

Chapter 3 - Predicting Median Home Value Change

This chapter uses the percent change in Median Home Value (MHV) and introduces three control variables: Percent Professionals (p.prof.00), Poverty Rate (pov.rate.00), Percent Unemployment (p.unemp.00) as potential predictors of MHV change in 2010. The variables are tested for skew and multicollinearity, then transformed (if skew is present). Two Diff-in-Diff models, Ordinary Least Squares (OLS) and Fixed Effects (FE) are presented with the goal of achieving a strong model fit.

Part 1 - Data

The following data steps are completed in the source_file_rn.R:

- Create a dataset that includes 2000 and 2010 census variables drop all rural census tracts.
- Create a variable that measures the growth of median home value from 2000 to 2010.
- Omit cases that have a median home value less than $10,000 in 2000. This reduces outliers in the data.
- Omit cases with growth rates above 200%. This reduces outliers in the data.

Load necessary packages:

library( dplyr )
library( here )
library( knitr )
library( pander )
library( stargazer )
library( scales )
library( plm )
library( evaluate )

Load wrangled datasets and prepare variables for analysis:

# load necessary functions and objects ----
# note: all of these are R objects that will be used throughout this .rmd file
import::here("S_TYPE",
             "panel.cor",
             "panel.smooth",
             "jplot",
             "d",
             "df",
             "cbsa_stats_df",
             "mhv.00",
             # notice the use of here::here() that points to the .R file
             # where all these R objects are created
             .from = here::here("labs/wk06/source_file_rn.R"),
             .character_only = TRUE)

df %>% head()

##   MedianHomeValue2000 MedianHomeValue2010 MHV.Change.00.to.10
## 1            98702.93              121500            22797.07
## 2            93935.30              130500            36564.70
## 3           102955.15              118700            15744.85
## 4           115711.79              133500            17788.21
## 5           150236.59              174500            24263.41
## 6            90713.92              129600            38886.08
##   MHV.Growth.00.to.12
## 1            23.09665
## 2            38.92542
## 3            15.29293
## 4            15.37286
## 5            16.15013
## 6            42.86672

Descriptives

stargazer( df, 
           type = S_TYPE, 
           digits = 0, 
           summary.stat = c("min", "p25","median","mean","p75","max") )
Statistic Min Pctl(25) Median Mean Pctl(75) Max
MedianHomeValue2000 11,167 105,661 154,903 187,129 224,337 1,288,551
MedianHomeValue2010 9,999 123,200 193,200 246,570 312,000 1,000,001
MHV.Change.00.to.10 -1,228,651 7,187 36,268 60,047 94,881 1,000,001
MHV.Growth.00.to.12 -97 6 25 33 50 6,059

Metro Level Statistics

# view results
cbsa_stats_df %>% head()

## # A tibble: 6 x 3
##   cbsaname                    metro.mhv.change metro.mhv.growth
##   <chr>                                  <dbl>            <dbl>
## 1 Abilene, TX                           10305.            1814.
## 2 Akron, OH                            -10646.            -887.
## 3 Albany-Schenectady-Troy, NY           54413.            4176.
## 4 Albany, GA                             5547.             646.
## 5 Albuquerque, NM                       27630.            1823.
## 6 Alexandria, LA                        23195.            3289.

Part 2 - Predict MHV Change

Select at least three census variables that you feel will be good predictors of change in MHV between 2000 and 2010.

- Percent Professionals (p.prof.00)
- Poverty Rate (pov.rate.00)
- Percent Unemployment (p.unemp.00)

# create subset to visualize in correlation matrix 
d4 <- select( d, mhv.growth, p.prof.00, pov.rate.00,  p.unemp.00 )

par( mfrow=c(3,2) )

# Unemployment
hist( d4$p.prof.00, breaks=50, col="gray20", border="white",
      yaxt="n", xlab="", ylab="", main="Percent Professionals")
hist( log(d4$p.prof.00+1), breaks=50, col="darkgreen", border="white",
      yaxt="n", xlab="", ylab="", main="Percent Professionals (logged)")
# Vacant
hist( d4$pov.rate.00, breaks=50, col="gray20", border="white",
      yaxt="n", xlab="", ylab="", main="Poverty Rate")
hist( log(d4$pov.rate.00+1), breaks=50, col="darkgreen", border="white",
      yaxt="n", xlab="", ylab="", main="Poverty Rate (logged)")
# White
hist( d4$p.unemp.00, breaks=50, col="gray20", border="white",
      yaxt="n", xlab="", ylab="", main="Percent Unemployment")
hist( log(d4$p.unemp.00+1), breaks=50, col="darkgreen", border="white",
      yaxt="n", xlab="", ylab="", main="Percent Unemployment (logged)")

The distributions above in green were selected by checking for variable skew. Log transformations were used to suppress outliers for all three variables.

Apply log transformations:

# reduce data density for visualization
set.seed( 1234 )

# recode some vars to remove skew
d4$p.prof.00 <- log10( d4$p.prof.00 + 1 )
d4$pov.rate.00 <- log10( d4$pov.rate.00 + 1 )
d4$p.unemp.00 <- log10( d4$p.unemp.00 + 1 )

d4.sample <- sample_n( d4, 5000 ) %>% na.omit()

# correlation plot with transformed variables
pairs( d4.sample, upper.panel=panel.cor, lower.panel=panel.smooth )


Check for multicollinearity:

d.reg <- d
d.reg$mhv.growth[ d.reg$mhv.growth > 200 ] <- NA
d.reg$p.prof.00 <- log10( d.reg$p.prof.00 + 1 )
d.reg$pov.rate.00 <- log10( d.reg$pov.rate.00 + 1 )
d.reg$p.unemp.00 <- log10( d.reg$p.unemp.00 + 1 )


m1 <- lm( mhv.growth ~  pov.rate.00, data=d.reg ) # suspicious variable
m2 <- lm( mhv.growth ~  p.unemp.00, data=d.reg ) # suspicious variable
m3 <- lm( mhv.growth ~  pov.rate.00 + p.unemp.00, data=d.reg ) # test for multicollinearity

stargazer( m1, m2, m3,
           type = S_TYPE, digits = 2,
           omit.stat = c("rsq","f") )
Dependent variable:
mhv.growth
(1) (2) (3)
pov.rate.00 12.78\*\*\* 9.37\*\*\*
(0.42) (0.61)
p.unemp.00 15.60\*\*\* 6.29\*\*\*
(0.56) (0.83)
Constant 16.76\*\*\* 17.34\*\*\* 15.28\*\*\*
(0.44) (0.46) (0.48)
Observations 58,557 58,557 58,557
Adjusted R2 0.02 0.01 0.02
Residual Std. Error 34.70 (df = 58555) 34.76 (df = 58555) 34.69 (df = 58554)
Note: *p<0.1; **p<0.05; ***p<0.01


**Coefficient sizes are smaller, standard errors increased, and the R-square stayed the same. These indicates that multicollinearity between the two suspicious variables, Poverty Rate and Percent Unemployment, may be a concern. This is expected considering that the variables chosen are different attributes of the same construct - neighborhood home value. **

Run the model while including metro-level fixed effects (cbsa name or FIPS).

model.ols <- lm( mhv.growth ~ p.prof.00 + pov.rate.00 + p.unemp.00, 
                 data = d.reg)

model.fe <- plm( mhv.growth ~ p.prof.00 + pov.rate.00 + p.unemp.00,
               index=c("cbsaname"), 
               data = d.reg)

stargazer( model.ols, model.fe, 
           type = S_TYPE, 
           dep.var.labels = ("Percent MHV Change"),
           column.labels = c("OLS", "Fixed effects"), 
           intercept.bottom = FALSE,
           omit.stat = "all", 
           digits = 2 )
Dependent variable:
Percent MHV Change
OLS panel
linear
OLS Fixed effects
(1) (2)
Constant -53.53\*\*\*
(1.89)
p.prof.00 36.18\*\*\* 9.41\*\*\*
(0.96) (0.79)
pov.rate.00 18.58\*\*\* 14.26\*\*\*
(0.65) (0.54)
p.unemp.00 13.43\*\*\* 0.23
(0.84) (0.70)
Note: *p<0.1; **p<0.05; ***p<0.01
# intercept for each cbsa name, only show first 20 
fixef(model.fe)[1:20]

##                        Abilene, TX                          Akron, OH 
##                          -7.054979                         -34.533701 
##        Albany-Schenectady-Troy, NY                         Albany, GA 
##                          14.106656                         -20.198121 
##                    Albuquerque, NM                     Alexandria, LA 
##                          -8.022383                           1.483466 
##  Allentown-Bethlehem-Easton, PA-NJ                        Altoona, PA 
##                           9.775334                         -12.497203 
##                       Amarillo, TX                           Ames, IA 
##                          -2.977027                         -21.736309 
##                      Anchorage, AK                       Anderson, IN 
##                          17.201883                         -39.684258 
##                       Anderson, SC                      Ann Arbor, MI 
##                         -15.847401                         -32.518676 
##                Anniston-Oxford, AL                       Appleton, WI 
##                          -8.090543                         -13.192102 
##                      Asheville, NC           Athens-Clarke County, GA 
##                          12.911385                           2.139822 
##                    Atlan  City, NJ Atlanta-Sandy Springs-Marietta, GA 
##                          45.834081                         -18.690242

pFtest(model.fe, model.ols) 

## 
##  F test for individual effects
## 
## data:  mhv.growth ~ p.prof.00 + pov.rate.00 + p.unemp.00
## F = 106.14, df1 = 378, df2 = 58175, p-value < 2.2e-16
## alternative hypothesis: significant effects



What are the results? Which factor was most important? Did it meet your expectations? Were there any variables that were not significant that you expected to be?

According to the fixed effects results model, Percent Professional and Poverty Rate coefficients were statistically significant. Poverty Rate had the largest effect on MHV Growth, which matches our expectation since high poverty rates would indicate individuals living in poverty may not be able to afford higher valued homes and therefore affecting the the growth of home values. Percent Unemployment was not significant though it was expected to be.

Explain findings to a general audience:

In the MHV Growth fixed effect model, Percent Professional and Poverty Rate significantly affect MHV Growth. However, we have the problem of multicollinearity since the variables appear to be correlated with each other. While the variables chosen each contribute to median home value growth, Poverty Rate had the largest effect on the MHV Growth.



Chapter References

Code in this chapter was adapted from lab designs by Dr. Jesse Lecy and Professors Courtney Stowers and Christian Nuno at Arizona State University.