calculate_hedonic_index: Calculate index based on specified method (Fisher, Laspeyres,...

View source: R/calculate_hedonic_index.R

calculate_hedonic_indexR Documentation

Calculate index based on specified method (Fisher, Laspeyres, Paasche, HMTS, Time Dummy, Rolling Time Dummy)

Description

Central hub function to calculate index figures using different methods.

Usage

calculate_hedonic_index(
  dataset,
  method,
  period_variable,
  dependent_variable,
  numerical_variables = NULL,
  categorical_variables = NULL,
  reference_period = NULL,
  number_of_observations = TRUE,
  ...
)

Arguments

dataset

Data frame with input data

method

One of: "fisher", "laspeyres", "paasche", "hmts", "timedummy", "rolling_timedummy", "repricing"

period_variable

A string with the name of the column containing time periods.

dependent_variable

Usually the price

numerical_variables

Vector with numeric quality-determining variables

categorical_variables

Vector with categorical variables (also dummies)

reference_period

Period or group of periods that will be set to 100

number_of_observations

Logical, whether to show number of observations (default = TRUE)

...

Additional method-specific arguments passed to the underlying functions:

  • periods_in_year: (Required for HMTS/Repricing) Number of periods per year (e.g. 12 for months)

  • number_preliminary_periods: (Required for HMTS) Number of preliminary periods

  • production_since: (Optional for HMTS) Start period for production simulation. Default = NULL

  • resting_points: (Optional for HMTS) Whether to return detailed outputs. Default = FALSE

  • imputation: (Optional for Laspeyres/Paasche) Include imputation values? Default = FALSE

  • window_length: (Required for Rolling Time Dummy) Window size in number of periods

Value

A data.frame (or list for HMTS with resting_points = TRUE; or named list if multiple methods are used)

Author(s)

Vivek Gajadhar


REPS documentation built on March 16, 2026, 5:08 p.m.