View source: R/gen_movereg_holiday.r
gen_movereg_holiday | R Documentation |
Generates a matrix with holiday regressors as defined within the BLS weekly adjustment program Movereg
gen_movereg_holiday(hol_n, hol_index, hol_wt, hol_type, this_week, this_year)
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. |
this_year |
Numeric vector; Year of each observation. |
Generate matrix of holiday regressors as defined within the BLS weekly adjustment program Movereg
ic_easter <- gen_movereg_holiday(hol_n = 8, hol_index = 8, hol_wt = c(1, 0, 0, 0, 0, 0, 0, 0), hol_type = 'easter', this_week = ic_week, this_year = ic_year) ic_labor <- gen_movereg_holiday(hol_n = 2, hol_index = 2, hol_wt = c(0, 1), hol_type = 'labor', this_week = ic_week, this_year = ic_year) ic_thanksgiving <- gen_movereg_holiday(hol_n = 1, hol_index = 1, hol_wt = array(1, dim=1), hol_type = 'thanksgiving', this_week = ic_week, this_year = ic_year) ic_holiday_matrix_reduced <- cbind(ic_easter, ic_labor, ic_thanksgiving) colnames(ic_holiday_matrix_reduced) <- c('easter', 'labor', 'thanksgiving')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.