validate_input: Validate Input Data for Hedonic Index Calculation

View source: R/utils.R

validate_inputR Documentation

Validate Input Data for Hedonic Index Calculation

Description

This function checks whether the dataset contains all required variables, whether the dependent and numerical variables are numeric, and whether the period variable is formatted correctly (e.g., "2020Q1", "2020M01", or just "2015"). It also performs soft-matching to adjust a provided reference_period to align with the dataset.

Usage

validate_input(
  dataset,
  period_variable,
  dependent_variable,
  numerical_variables,
  categorical_variables,
  reference_period = NULL
)

Arguments

dataset

A data.frame containing the dataset to be validated.

period_variable

A string specifying the name of the period variable column.

dependent_variable

A string specifying the name of the dependent variable (usually the sale price).

numerical_variables

A character vector with names of numeric quality-determining variables.

categorical_variables

A character vector with names of categorical variables (including dummies).

reference_period

Optional string for the base period to normalize index values (e.g., "2015", "2020Q1").

Author(s)

David Pietersz, Vivek Gajadhar


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