Forecasting using SAS Forecast Server, SAS/ETS, and more

GMM- Data set is not sorted in ascending sequence with respect to time series ID.

Accepted Solution Solved
Reply
Contributor
Posts: 56
Accepted Solution

GMM- Data set is not sorted in ascending sequence with respect to time series ID.

Hello everyone,

I have a question regarding GMM estimation with SAS.

I sorted my data and ran the GMM estimation but I am still getting an error message. I made sure that the time series is the same for all contracts.

Here is my model:

proc sort data=s_basint15;

by date cnt int;

run;

proc panel data =s_basint15 plot(unpackpanel)=all;

id cnt int; 

model BASw = tod1-tod33 /gmm twostep maxband=5 nolevels noint;

run;

And here is the error I am getting back

Data set WORK.S_BASINT15 is not sorted in ascending sequence with respect to time

       series ID.  The current time period has int=1 and the previous time period has int=1 in

       cross section cnt=ABE.

I included a picture of my data.

Thank you all for your precious help.




Screenshot 2014-04-22 17.30.03.png

Accepted Solutions
Solution
‎07-07-2017 09:01 AM
Super User
Posts: 19,791

Re: GMM- Data set is not sorted in ascending sequence with respect to time series ID.

This is the issue (as above):

The current time period has int=1 and the previous time period has int=1 in

       cross section cnt=ABE.

Also looks like you may have duplicate ID's? Check the data for that timepoint.

data test;

set have;

where cnt='ABE' and int=1;

run;

View solution in original post


All Replies
Super User
Posts: 19,791

Re: GMM- Data set is not sorted in ascending sequence with respect to time series ID.

Change your sort to

proc sort data=s_basint15;

by cnt int date;

run;

Contributor
Posts: 56

Re: GMM- Data set is not sorted in ascending sequence with respect to time series ID.

Hello Reeza,

Thanks for your suggestion but I tried sorting my data by cnt int date but it is always bringing back the same error!

Super User
Posts: 19,791

Re: GMM- Data set is not sorted in ascending sequence with respect to time series ID.

Post the full log when sorted with my suggestion above please.

Super User
Posts: 19,791

Re: GMM- Data set is not sorted in ascending sequence with respect to time series ID.

The current time period has int=1 and the previous time period has int=1 in

       cross section cnt=ABE.

Also looks like you may have duplicate ID's?

Contributor
Posts: 56

Re: GMM- Data set is not sorted in ascending sequence with respect to time series ID.

Here you go:

707  proc sort data=s_basint15;

708  by cnt int date;

709  run;

NOTE: There were 70884 observations read from the data set WORK.S_BASINT15.

NOTE: The data set WORK.S_BASINT15 has 70884 observations and 43 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           1.88 seconds

      cpu time            0.39 seconds

710  proc panel data =s_basint15 plot(unpackpanel)=all;

711  id cnt int;

712  model BASw = tod1-tod33 /gmm twostep maxband=5 nolevels noint;

713  run;

NOTE: GMM has been requested without an associated instruments statement. PROC PANEL will

      estimate under the assumptions of strict exogeneity and non-correlatedness in the right

      hand side variables.

ERROR: Data set WORK.S_BASINT15 is not sorted in ascending sequence with respect to time

       series ID.  The current time period has int=1 and the previous time period has int=1 in

       cross section cnt=ABE.

NOTE: The SAS System stopped processing this step because of errors.

NOTE: PROCEDURE PANEL used (Total process time):

      real time           0.02 seconds

      cpu time            0.01 seconds

Solution
‎07-07-2017 09:01 AM
Super User
Posts: 19,791

Re: GMM- Data set is not sorted in ascending sequence with respect to time series ID.

This is the issue (as above):

The current time period has int=1 and the previous time period has int=1 in

       cross section cnt=ABE.

Also looks like you may have duplicate ID's? Check the data for that timepoint.

data test;

set have;

where cnt='ABE' and int=1;

run;

Contributor
Posts: 56

Re: GMM- Data set is not sorted in ascending sequence with respect to time series ID.

I am not sure what you mean by duplicate ID's. Could you please explain?

I have intraday data so the time series int =1 to 33 is repeated in different days for each contracts.

Would that be the problem?

Super User
Posts: 19,791

Re: GMM- Data set is not sorted in ascending sequence with respect to time series ID.

I think so.

You can test it by removing duplicates or adding another variable to uniquely identify a timepoint.

Contributor
Posts: 56

Re: GMM- Data set is not sorted in ascending sequence with respect to time series ID.

Thank you a lot for your help, Reeza!

How do you suggest I create a variable to uniquely identify a timepoint??

Contributor
Posts: 56

Re: GMM- Data set is not sorted in ascending sequence with respect to time series ID.

Hello Reeza,

I create a variable that combines both contracts and dates (I hope this is what you meant by uniquely identifying a timepoint) and I ran the GMM.

However, I still get an error message. Do I need to have an instrument variable??

Here a copy of the log:

246  proc panel data =s_basint15;

247  id cntd int;

248  model BASw = tod1-tod33 /gmm twostep maxband=5 nolevels noint;

249  run;

NOTE: GMM has been requested without an associated instruments statement. PROC PANEL will

      estimate under the assumptions of strict exogeneity and non-correlatedness in the right

      hand side variables.

ERROR: The required statement INSTRUMENTS is missing for the model . This model will be

       skipped.

NOTE: PROCEDURE PANEL used (Total process time):

      real time           0.15 seconds

      cpu time            0.14 seconds

Thank you very much for your help.

SAS Employee
Posts: 416

Re: GMM- Data set is not sorted in ascending sequence with respect to time series ID.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 11 replies
  • 2546 views
  • 3 likes
  • 3 in conversation