Skip to contents

A file, df_data, has grouping variables ar_svr_group and a data variable svr_data (e.g., population), measured at sequential svr_date (e.g., year, month) dates. There might be non-consecutive gaps in svr_data measurements, with missing values in some dates. We compute per-period changes, annualized if the date variable is yearly, between all dates when data is available.

Usage

ff_ppts_pchg(
  df_data,
  ar_svr_group = c("location", "variable"),
  svr_data = c("population"),
  svr_date = c("year"),
  svr_pchg = c("population_pchg_yr"),
  verbose = FALSE
)

Arguments

df_data

data frame with various time-series/panel with missing data

ar_svr_group

array of grouping variable names, panel groups

svr_data

string variable name for data variable

svr_date

string variable name for date variable

svr_pchg

string variable name for variable with storing the per-period percentage change (e.g., annualized changes)

verbose

Boolean print details

Value

A dataset with interpolated values

Author

Fan Wang, http://fanwangecon.github.io