Demetri Pananos
Demetri Pananos

Reputation: 7404

How should I format my dates to use proc x11?

My data looks like

APR2014 78786281
APR2015 78472563
APR2016 72620634
AUG2014 83340290
AUG2015 82721358
AUG2016 77990574
DEC2014 82563116

(this is only a subset)

I'd like to use proc x11 to remove any seasonality in the data. When I use the procedure in the following way:

proc x11 data=datas noprint;
monthly date = mth;
var fuel;
output out=out b1 = fuel d10= seasonality d11 = adjusted d12=trend;
run;

I get an error saying that ERROR: Variable mth in list does not match type prescribed for this list.

How should I format my dates to use proc x11?

Upvotes: 1

Views: 167

Answers (1)

Joe
Joe

Reputation: 63424

If mth is a character variable, you need to input it to a numeric date variable for PROC X11 to use it properly.

You should determine if using the first of the month is valid for the analysis you're doing, or if you need to impute the date some other way. My guess is that it's fine, but I don't really know much about PROC X11.

If the first of the month is okay, then you can do this:

data want;
  set have;
  mth_n = input(mth,MONYY.);
  format mth_n MONYY.;
run;

Then use mth_n in your analysis. It will assume the first of the month, if that is relevant.

Upvotes: 1

Related Questions