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.
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;
Change your sort to
proc sort data=s_basint15;
by cnt int date;
run;
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!
Post the full log when sorted with my suggestion above please.
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?
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
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;
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?
I think so.
You can test it by removing duplicates or adding another variable to uniquely identify a timepoint.
Thank you a lot for your help, Reeza!
How do you suggest I create a variable to uniquely identify a timepoint??
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.
Hello -
This example may be useful: http://support.sas.com/documentation/cdl/en/etsug/63348/HTML/default/viewer.htm#etsug_panel_sect054....
Thanks,
Udo
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.