View source: R/gen_movereg_holiday_xts.r
gen_movereg_holiday_xts | R Documentation |
Generates a matrix with holiday regressors as defined within the BLS weekly adjustment program Movereg
gen_movereg_holiday_xts( hol_n, hol_index, hol_wt, hol_type, this_week, this_year, return_xts = FALSE )
hol_n |
Numeric scalar; number of weights for this particular holiday |
hol_index |
Numeric scalar; position of holiday within the weight vector |
hol_wt |
Numeric vector; weight vector for holiday effect |
hol_type |
Character scalar; Type of holiday ( |
this_week |
Numeric vector; Week of the year for each observation, stored as an |
this_year |
Numeric vector; Year of each observation, stored as an |
return_xts |
Logical scalar; return matrix as an |
Generate matrix of holiday regressors as defined within the BLS weekly adjustment program Movereg
ic_easter_xts <- gen_movereg_holiday_xts(hol_n = 8, hol_index = 8, hol_wt = c(1, 0, 0, 0, 0, 0, 0, 0), hol_type = 'easter', this_week = ic_week_xts, this_year = ic_year_xts) ic_labor_xts <- gen_movereg_holiday_xts(hol_n = 2, hol_index = 2, hol_wt = c(0, 1), hol_type = 'labor', this_week = ic_week_xts, this_year = ic_year_xts) ic_thanksgiving_xts <- gen_movereg_holiday_xts(hol_n = 1, hol_index = 1, hol_wt = array(1, dim=1), hol_type = 'thanksgiving', this_week = ic_week_xts, this_year = ic_year_xts) ic_holiday_matrix_reduced_xts <- cbind(ic_easter_xts, ic_labor_xts, ic_thanksgiving_xts) colnames(ic_holiday_matrix_reduced_xts) <- c('easter', 'labor', 'thanksgiving')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.