/Hypothesis-Testing

Testing if "Towns with universities have their mean housing prices less effected by recessions" using real world data. ---------- Method used: t-testing

Primary LanguageJupyter Notebook

Hypothesis-Testing

The ipynb above has the genral procedure to test out a hypothesis using a student-t test

This is a part of the course: Introduction to Data Science in Python

Particulars about the notebook:

Definitions:

  • A quarter is a specific three month period, Q1 is January through March, Q2 is April through June, Q3 is July through September, Q4 is October through December.
  • A recession is defined as starting with two consecutive quarters of GDP decline, and ending with two consecutive quarters of GDP growth.
  • A recession bottom is the quarter within a recession which had the lowest GDP.
  • A university town is a city which has a high percentage of university students compared to the total population of the city.

Hypothesis: University towns have their mean housing prices less effected by recessions. Run a t-test to compare the ratio of the mean price of houses in university towns the quarter before the recession starts compared to the recession bottom. (price_ratio=quarter_before_recession/recession_bottom)

The following data files were used for the testing:

  • From the Zillow research data site there is housing data for the United States. In particular the datafile for all homes at a city level, City_Zhvi_AllHomes.csv, has median home sale prices at a fine grained level.
  • From the Wikipedia page on college towns is a list of university towns in the United States
  • From Bureau of Economic Analysis, US Department of Commerce, the GDP over time of the United States in current dollars (chained value in 2009 dollars is used), in quarterly intervals, in the file gdplev.xls. Note: for this test only GDP data from the first quarter of 2000 onward is used.