## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

## ----setup, include=FALSE-----------------------------------------------------
library(REPS)
data("data_constraxion")

## -----------------------------------------------------------------------------
# Example dataset (you should already have this loaded)
head(data_constraxion)

## -----------------------------------------------------------------------------
dataset <- data_constraxion
dataset$floor_area <- log(dataset$floor_area)

## -----------------------------------------------------------------------------
Tbl_TD <- REPS::calculate_hedonic_index(
  dataset = dataset,
  method = "timedummy",
  period_variable = "period",
  dependent_variable = "price",
  numerical_variables = c("floor_area", "dist_trainstation"),
  categorical_variables = c("dummy_large_city", "neighbourhood_code"),
  reference_period = 2015,
  number_of_observations = FALSE
)

head(Tbl_TD)

## -----------------------------------------------------------------------------
multi_result <- REPS::calculate_hedonic_index(
  method = c("fisher","hmts", "laspeyres", "paasche", "repricing", "timedummy", "rolling_timedummy"),
  dataset = dataset,
  period_variable = "period",
  dependent_variable = "price",
  numerical_variables = c("floor_area", "dist_trainstation"),
  categorical_variables = c("neighbourhood_code", "dummy_large_city"),
  reference_period = "2015",
  number_of_observations = FALSE,
  periods_in_year = 4,
  number_preliminary_periods = 1,
  window_length = 4,
  production_since = NULL,
  resting_points = FALSE,
  imputation = FALSE
)

head(multi_result$fisher)

## ----echo=FALSE, out.width="100%", fig.align="center"-------------------------
knitr::include_graphics("multi_index.png")

