DOI: 10.7910/dvn/ixp4ti
title: New York City Housing and Vacancy Survey (NYCHVS)

description: &lt;h3 class="post-title entry-title" itemprop="name"&gt; analyze the new york city housing and vacancy survey (nychvs) with r &lt;/h3&gt; for those interested in the real estate and rental markets of the big apple, the census bureau's nyc housing and vacancy survey might be your key to the city. if you care about how many new york residents live more than one person per room (a lot), how many structures are dilapidated (a few, phew), or what rent prices run these days (cha-ching), start here. way back
in 1965, &lt;a href="http://www.census.gov/housing/nychvs/about/faq.html#Q4"&gt;new york law&lt;/a&gt; began requiring the enumeration of the city's heavily-regulated rental market, establishing this complex sample survey of about twenty thousand households, both occupied and vacant. nowadays it's triennial, it's publicly-downloadable, and it's free n easy to analyze with the r language.&lt;br /&gt; &lt;br /&gt; although the census bureau employs the survey administrators and produces the main how-to documents (both
&lt;a href="http://www.census.gov/housing/nychvs/about/faq.html"&gt;faq&lt;/a&gt; and &lt;a href="http://www.census.gov/housing/nychvs/about/"&gt;overviews&lt;/a&gt;), city government actually pays the bill and gets the glory: &lt;a href="http://www.nyc.gov/html/hpd/downloads/pdf/HPD-2011-HVS-Selected-Findings-Tables.pdf"&gt;the preliminary 2011 report with all the fun facts&lt;/a&gt; and &lt;a href="http://www.nyc.gov/html/hpd/html/pr/HVS-Archive.shtml"&gt;the older but more complete 2008 report&lt;/a&gt;. the microdata include four exciti
ng files: a person-level file for occupied units, a household-level file for occupied units, a household-level file for vacant units, and a household-level file for units that didn't yield an interview (solely for
&lt;a href="http://www.nyc.gov/html/hpd/downloads/pdf/HVS-Appendix-D.pdf#page=6"&gt;adjusting the vacant-unit statistics&lt;/a&gt;). most urban planning and policy wonks &lt;a href="http://stat.ethz.ch/R-manual/R-patched/library/base/html/cbind.html"&gt;line up&lt;/a&gt; the occupied and vacant household-level files to calculate a &lt;a href="http://www.nyc.gov/html/hpd/downloads/pdf/HPD-2011-HVS-Selected-Findings-Tables.pdf#page=3"&gt;vacancy rate&lt;/a&gt;, but depending on your mission, you might need some person-level action
as well. by the way, the nyc.gov report is six months older than
&lt;a href="http://www.census.gov/housing/nychvs/data/2011/?C=M;O=A"&gt;the latest 2011 microdata&lt;/a&gt;, so don't panic if your stats are off by a whisker. this new github repository contains three scripts:&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;b&gt;2002 - 2011 - download all microdata.R&lt;/b&gt;&lt;br /&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://stat.ethz.ch/R-manual/R-patched/library/utils/html/download.file.html"&gt;download&lt;/a&gt;, &lt;a href="http://cran.r-project.org/web/packages/SAScii/index.html"&gt;import&lt;/a&gt;, &lt;a href="http://stat.ethz.ch/R-manual/
R-patched/library/base/html/save.html"&gt;save&lt;/a&gt; each of the four data files into a single year-specific .rda file back to 2002&lt;/li&gt; &lt;li&gt;bumper sticker idea for nychvs data users: if you can read this, thank a &lt;a href="http://furmancenter.org/"&gt;furman center&lt;/a&gt; for the sas import scripts.&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; &lt;b&gt;2011 analysis examples.R&lt;/b&gt;&lt;br /&gt; &lt;ul&gt; &lt;li&gt;load all available tables for a single year of data&lt;/li&gt; &lt;li&gt;construct the &lt;a href="http://faculty.washington.edu/tlumley/survey/html/svydesign.h
tml"&gt;complex sample survey object&lt;/a&gt;, but it's fake - see note below.&lt;/li&gt; &lt;li&gt;run example analyses that calculate perfect means, medians, quantiles, totals&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; &lt;b&gt;replicate contract items 2008.R&lt;/b&gt;&lt;br /&gt; &lt;ul&gt; &lt;li&gt;load all available tables for a single year of data&lt;/li&gt; &lt;li&gt;construct the &lt;a href="http://faculty.washington.edu/tlumley/survey/html/svydesign.html"&gt;complex sample survey object&lt;/a&gt;, but it's fake - see note below.&lt;/li&gt; &lt;li&gt;thoroughly explain a back-of-the-envelope cal
culation for standard errors, confidence intervals, variances &lt;/li&gt; &lt;li&gt;print statistics that match exactly - and confidence intervals more conservative than - the &lt;a href="http://www.census.gov/housing/nychvs/data/2008/contract_items_2008.xls"&gt;target replication table&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;a href="https://github.com/ajdamico/usgsd/tree/master/New%20York%20City%20Housing%20and%20Vacancy%20Survey"&gt;click here to view these three scripts&lt;/a&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; for more detail
about the new york city housing and vacancy survey, visit:&lt;br /&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://www.census.gov/housing/nychvs/"&gt;the census bureau's nychvs homepage&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://www.nyc.gov/html/hpd/html/home/home.shtml"&gt;the new york city government's housing policy analysis homepage&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; &lt;br /&gt; notes:&lt;br /&gt; &lt;br /&gt; hint for statistical illiterates: if the data point you're looking for isn't in the nyc.gov grand report, check the census bureau's copious &lt;a href="http://
www.census.gov/housing/nychvs/data/2011/userinfo.html"&gt;online tables
&lt;/a&gt; too.&lt;br /&gt; &lt;br /&gt; as described in detail in the comments of the replication script, it's impossible to exactly match the census-published confidence intervals. here's one &lt;a href="https://github.com/ajdamico/usgsd/blob/master/New%20York%20City%20Housing%20and%20Vacancy%20Survey/the%20census%20bureau%20and%20the%20impossible%20to%20reproduce%20SEs.pdf?raw=true"&gt;snippet of a longer conversation&lt;/a&gt; about how users cannot automate the computation of standard errors (discussed at &lt;a href="h
ttp://www.nyc.gov/html/hpd/downloads/pdf/HPD-2011-HVS-Selected-Findings-Tables.pdf#page=10"&gt;footnote five
&lt;/a&gt;) with the nychvs. the `segment` variable (mentioned in the e-mail) does not get released due to confidentiality concerns. either calculate them by hand with the infuriating generalized variance formula recommended in each year's source and accuracy statement (&lt;a href="http://www.census.gov/housing/nychvs/data/2008/S&amp;A_2008.pdf"&gt;2008&lt;/a&gt;, &lt;a href="http://www.census.gov/housing/nychvs/data/2011/S&amp;A_2011.pdf"&gt;2011&lt;/a&gt;) or use the back-of-the-envelope method i invented that approxi
mates &lt;a href="http://www.census.gov/housing/nychvs/data/2008/contract_items_2008.xls"&gt;census-published confidence intervals&lt;/a&gt; conservatively. when i learned that users couldn't automate the matching of census-published numbers, i tried to be a bootstrapping young lad and come up with some fancy standard error computation methodology. but it turns out that multiplying the un-adjusted errors by two gets as close to the right answer as anything else. if you're writing the final draft of
a research product destined to get heavy exposure, you might have to calculate confidence intervals by hand or pay the census bureau for a custom run. but for those of us who can live with an occasional false negative in our lives, try it my way.
&lt;br /&gt; &lt;br /&gt; confidential to sas, spss, stata, and sudaan users: i look at you the way new yorkers look at jersey. time to transition to r. :D &lt;span class="post-author vcard"&gt; &lt;/span&gt;