Addind a dummy variable

Reply
Frequent Contributor
Posts: 91

Addind a dummy variable

Hi,

I have a data set which contains daily data. I am gonna put an ARCH model to this data set.

How can I add a dummy variable to the heteroskedastic error part of garch model (sigma squared) so that the dummy variable equals to 1 for every Monday?

Thanks

PROC Star
Posts: 7,477

Re: Addind a dummy variable

Posted in reply to malakaext

You could use the weekday function with an ifn function.  e.g.:

data have;

  format date date9.;

  input date date9.;

  dummy=ifn(weekday(date)=2,1,0);

  cards;

4nov2012

5nov2012

6nov2012

;

Frequent Contributor
Posts: 91

Re: Addind a dummy variable

Thank you for your input.

I have found an easier way to do it using the hetero statement in SAS.

However, to do that in the last column of the attached data set I need to have 1s for Mondays and Zero for other days. Is there an easier way to do it?

Thanks.

Attachment
Ask a Question
Discussion stats
  • 2 replies
  • 175 views
  • 3 likes
  • 2 in conversation