sas - How to use Indicator variable in PROC UCM? -
i want use indicator variables in proc ucm. have weekly volume , want use days indicator variables because if public holiday fall in wednesdays or thursday rate of decrease in volume , higher friday holiday impact.so how can create indicator variable weekdays. mon tue wen thu fri.i making mon=1 if holiday on mon else 0 same rule all.will there issue of dummy trap if include variable.
you should able safely use variables; however, recommend trying use trigonometric cyclical component of period 7 , seeing how fares. if you'd dummy approach, can in data step prior running model:
data want; set have; array weekday[*] mon tue wed thu fri sat = 1 6; weekday[i] = (weekday(date) = i); end; thxgiving = (date = holiday('thanksgiving', year(date) ) ); run; proc ucm data=want; model y = mon tue wed thu fri sat thxgiving; level; irregular; run; your mon-sat variables capture daily effects, while thxgiving capture unique effect of both natural thursday demand , thanksgiving. not expect dummy trap problem here, because normal thursdays not able predict thanksgiving demand, , vis-versa.
again, first recommend trying include cyclical trig pattern weekday before going dummy variable route.
proc ucm data=want; model y = thxgiving; cycle period=7; level; irregular; run;
Comments
Post a Comment