Watts-College / cpp-529-spr-2022

https://watts-college.github.io/cpp-529-spr-2022/
0 stars 2 forks source link

Median Home Values 2010 #23

Open ndavis4904 opened 2 years ago

ndavis4904 commented 2 years ago

What variable do we use for median home value for 2010? I had this problem in lab 5 and found what I felt was the workaround by using the 2012 ACS data for 2008 to 2012, but now am questioning whether that is the most appropriate choice. I have been using the variable mhmval00 (and mhmval12 previously). Is there a better option that I have passed over? Or would this be the reason for the creation of pov.rate? Thanks

JasonSills commented 2 years ago

The variables for mhv are in the code supplied for Lab 5 (see the code chunk below). We want to know about change so we are using both 00 and 10.

Note how we are creating mhv.00 and mhv.10:

adjust 2000 home values for inflation

mhv.00 <- d$mhmval00 * 1.28855
mhv.10 <- d$mhmval12

d <- select( d, tractid, 
             mhmval00, mhmval12, 
             hinc00, 
             hu00, vac00, own00, rent00, h30old00,
             empclf00, clf00, unemp00, prof00,  
             dpov00, npov00,
             ag25up00, hs00, col00, 
             pop00.x, nhwht00, nhblk00, hisp00, asian00,
             cbsa, cbsaname )

d <- 
  d %>%
  mutate( # percent white in 2000
          p.white = 100 * nhwht00 / pop00.x,
          # percent black in 2000
          p.black = 100 * nhblk00 / pop00.x,
          # percent hispanic in 2000
          p.hisp = 100 * hisp00 / pop00.x, 
          # percent asian in 2000
          p.asian = 100 * asian00 / pop00.x,
          # percent high school grads by age 25 in 2000 
          p.hs = 100 * (hs00+col00) / ag25up00,
          # percent pop with college degree in 2000
          p.col = 100 * col00 / ag25up00,
          # percent employed in professional fields in 2000
          p.prof = 100 * prof00 / empclf00,
          # percent unemployment  in 2000
          p.unemp = 100 * unemp00 / clf00,
          # percent of housing lots in tract that are vacant in 2000
          p.vacant = 100 * vac00 / hu00,
          # dollar change in median home value 2000 to 2010 
          pov.rate = 100 * npov00 / dpov00,
          ## percent 25 and up in population
          p.25andUp = 100 * ag25up00 / pop00.x)

adjust 2000 home values for inflation 
mhv.00 <- d$mhmval00 * 1.28855  
mhv.10 <- d$mhmval12

# change in MHV in dollars
mhv.change <- mhv.10 - mhv.00

# drop low 2000 median home values
# to avoid unrealistic growth rates.
#
# tracts with homes that cost less than
# $1,000 are outliers
mhv.00[ mhv.00 < 1000 ] <- NA

# change in MHV in percent
mhv.growth <- 100 * ( mhv.change / mhv.00 )

d$mhv.00 <- mhv.00
d$mhv.10 <- mhv.10
d$mhv.change <- mhv.change
d$mhv.growth <- mhv.growth 
lecy commented 2 years ago

Also note that a five-year ACS variable pulled from 2012 is centered at 2010, (years 2008-2012), so it can be thought of conceptually as a 2010 variable.