Description Usage Arguments Value Examples
Generic method to estimate modeling approaches for indexes
1 2 |
model_type |
Type of model to estimate ('rt', 'hed', 'rf') |
hpi_df |
Dataset created by one of the *CreateTrans() function in this package. |
estimator |
Type of estimator to be used ('base', 'weighted', 'robust') |
log_dep |
default TRUE, should the dependent variable (change in price) be logged? |
trim_model |
default TRUE, should excess be trimmed from model results ('lm' or 'rlm' object)? |
mod_spec |
Model specification |
... |
Additional Arguments |
hpimodel object consisting of:
Type of estimator
Data.frame of coefficient
class 'rtmodel' or 'hedmodel'
Full model specification
Binary: is the dependent variable in logged format
Mean price in the base period
'data.frame' of periods
Type of model used
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | # 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)
# For custom weighted repeat transaction model
hpi_model_wgt <- hpiModel(model_type = 'rt',
hpi_df = rt_data,
estimator = 'weighted',
weights = runif(nrow(rt_data), 0, 1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.