hpiR v0.2.0

0

Monthly downloads

0th

Percentile

House Price Indexes

Compute house price indexes and series using a variety of different methods and models common through the real estate literature. Evaluate index 'goodness' based on accuracy, volatility and revision statistics. Background on basic model construction for repeat sales models can be found at: Case and Quigley (1991) <doi:10.2307/2109686> and for hedonic pricing models at: Bourassa et al (2006) <doi:10.1016/j.jhe.2006.03.001>.

Readme

Travis-CI Build Status

hpiR

This package intends to simplify and standardize the creation of house price indexes in R. It also provides a framework for judging the 'quality' of a given index by testing for predictive accuracy, volatility and revision. By providing these metrics various index methods (and estimators) can be accurately compared against each other.

While there are a (ever-increasing) variety of methods and models to use in house price index creation, this initial version (0.2.0) focuses on the two most common: repeat sales (transactions) and hedonic price. Base, robust and weighted estimators are provided when appropriate.

The package also includes a dataset of single family and townhome sales from the City of Seattle during 2010-2016 time period.

Please see the vignette for more information on using the package.

Also, please log issues or pull requests on this github page.

Installation

You can install hpiR from github with:

Install the released version from CRAN

  install.packages("hpiR")

Development version from GitHub:

  #install.packages("devtools")
  devtools::install_github("andykrause/hpiR")

Example

This is a basic example which shows you how to solve a common problem:


  library(hpiR)

  # Load prepared data
  data(ex_rtdata)

  # Create an index
  hpi <- rtIndex(trans_df = ex_rtdata,
                 estimator = 'robust',
                 log_dep = TRUE,
                 trim_model = TRUE,
                 smooth = TRUE)

Functions in hpiR

Name Description
ex_sales Subset of Seattle Home Sales
createSeries Create a series of indexes
calcVolatility Calculate index volatility
hedIndex Create a full index object by hedonic approach
checkDate Validate the date argument
hedModel Estimate hedonic model for index creation
rtTimeMatrix Create model matrix for repeat transaction approach
hpiModel.rtdata Specific method for hpi modeling (rt approach)
seattle_sales Seattle Home Sales
hpiModel.heddata Specific method for hpi modeling (hed) approach)
createKFoldData Create data for KFold error test
hedCreateTrans Create data for `hed` approach
dateToPeriod Convert dates to a relative period
calcInSampleError.rtdata Calculate index errors in sample (rt approach)
rtModel.robust Repeat transaction model approach with robust estimator
rtModel.weighted Repeat transaction model approach with weighted estimator
plot.hpiaccuracy Plot method for `hpiaccuracy` object
plot.hpiindex Plot method for `hpiindex` object
hpiR hpiR: A package for house price indexes
hedModel.robust Hedonic model approach with robust estimator
hedModel.base Hedonic model approach with base estimator
plot.seriesrevision Plot method for `seriesrevision` object
plot.serieshpi Plot method for `serieshpi` object
createKFoldData.rtdata Create data for KFold error test (rt approach)
smoothSeries Smooth all indexes in a series
smoothIndex Smooth an index
calcSeriesAccuracy Calculate the accuracy of a series of indexes
modelToIndex Convert model results into a house price index
rtModel Estimate repeat transaction model for index creation
plot.hpi Plot method for `hpi` object
calcSeriesVolatility Calculate volatility of a series of indexes
matchKFold Helper function to make KFold data
matchKFold.heddata Helper function to make KFold data
rtCreateTrans Create transaction data for rt approach
matchKFold.rtdata Helper function to make KFold data
rtIndex Create a full index object by repeat transaction approach
rtModel.base Repeat transaction model approach with base estimator
hedModel.weighted Hedonic model approach with weighted estimator
hpiModel Wrapper to estimate model approaches (generic method)
plot.indexvolatility Plot method for `indexvolatility` object
plot.seriesaccuracy Plot method for `seriesaccuracy` object
calcKFoldError Calculate index error with FKold (out of sample)
buildForecastIDs Create the row IDs for forecast accuracy
calcInSampleError.heddata Calculate index errors in sample (hed approach)
buildForecastIDs.rtdata Create the row IDs for forecast accuracy (rt approach)
buildForecastIDs.heddata Create the row IDs for forecast accuracy (hed approach)
calcRevision Calculate revision values of an index
calcAccuracy Calculate the accuracy of an index
calcForecastError Calculate the forecast accuracy of series of indexes
calcInSampleError Calculate index errors in sample
No Results!

Vignettes of hpiR

Name
classstructure.Rmd
introduction.Rmd
No Results!

Last month downloads

Details

Type Package
License GPL-3
Encoding UTF-8
LazyData true
URL https://www.github.com/andykrause/hpiR
RoxygenNote 6.0.1
VignetteBuilder knitr
NeedsCompilation no
Packaged 2018-08-05 19:18:32 UTC; andyx
Repository CRAN
Date/Publication 2018-08-08 16:40:03 UTC

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/hpiR)](http://www.rdocumentation.org/packages/hpiR)