BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
BchBnz
Obsidian | Level 7

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
1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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

11 REPLIES 11
Reeza
Super User

Change your sort to

proc sort data=s_basint15;

by cnt int date;

run;

BchBnz
Obsidian | Level 7

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!

Reeza
Super User

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

Reeza
Super User

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?

BchBnz
Obsidian | Level 7

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

Reeza
Super User

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;

BchBnz
Obsidian | Level 7

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?

Reeza
Super User

I think so.

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

BchBnz
Obsidian | Level 7

Thank you a lot for your help, Reeza!

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

BchBnz
Obsidian | Level 7

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 Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

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