modelToIndex: Convert model results into a house price index

Description Usage Arguments Value Examples

View source: R/modelToIndex.R

Description

Converts model results to standardized index objects

Usage

1
2
modelToIndex(model_obj, max_period = max(model_obj$coefficients$time),
  ...)

Arguments

model_obj

Model results object

max_period

Maximum number of periods that should have been estimated.

...

Additional arguments

Value

'hpiindex' object containing:

name

vector of period names

numeric

vector of period in numeric form

period

vector of period numbers

value

'ts' object of the index values

imputed

vector of binary values indicating imputation

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
 # Load data
 data(ex_sales)

 # With a raw transaction data.frame
 rt_data <- rtCreateTrans(trans_df = ex_sales,
                          prop_id = 'pinx',
                          trans_id = 'sale_id',
                          price = 'sale_price',
                          periodicity = 'monthly',
                          date = 'sale_date')

 # Create model object
 hpi_model <- hpiModel(model_type = 'rt',
                       hpi_df = rt_data,
                       estimator = 'base',
                       log_dep = TRUE)

 # Create Index
 hpi_index <- modelToIndex(hpi_model,
                           max_period = 84)

hpiR documentation built on April 1, 2020, 5:09 p.m.