BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Am_fr
Calcite | Level 5

Hello,

 

I am currently working on daily returns of several different REITs and I have a problem when I run my panel regression, it keeps showing the same error message : 

"ERROR: The data set THESIS.DIVERSIFIED_RETURNS is not sorted in ascending sequence with respect to the time series ID. The current time period has date=31DEC2014 and the previous time period has date=31DEC2014 in cross-section CONM=AGELLAN COMMERCIAL REIT."

 

here is my code :

proc sort data=thesis.diversified_returns out=thesis.diversified_returns;
by company date;
run;

proc panel data=thesis.diversified_returns;
id company date;
model log_return=log_growth_in_cases log_AT log_FFO log_CASSET log_MVASSET/
fixtwo;
run;

 

here is an overview of my database:

datalines;
31DEC2009 60101010 ONE LIBERTY PROPERTIES INC 9.1800 2010 -1.453636611 -2.679457736 0 6.012947135 
31DEC2009 60101010 PS BUSINESS PARKS 49.1800 2010 -0.24792172 -2.016888923 0 7.3555273585 
05JAN2010 60101010 ONE LIBERTY PROPERTIES INC 9.7900 2010 -1.453636611 -2.679457736 0 6.012947135 
05JAN2010 60101010 PS BUSINESS PARKS 48.2900 2010 -0.24792172 -2.016888923 0 7.3555273585 
06JAN2010 60101010 ONE LIBERTY PROPERTIES INC 10.0400 2010 -1.453636611 -2.679457736 0 6.012947135
 
Thank you ! 
1 ACCEPTED SOLUTION

Accepted Solutions
sbxkoenk
SAS Super FREQ

Hello @Am_fr ,

 

Here's the code :

( Remark that PROC TIMESERIES is making the timestamp equally spaced, i.e. it fills gaps (with missings when using setmissing=missing) )

proc sort data=work.have 
     /* no out=  needed if input and output datasets are the same */ ;
 by cross_section timestamp;
run;

proc timeseries data=work.have out=work.dseries;
   by cross_section;
   id timestamp interval=day
                accumulate=median
                setmiss=missing
             /* start='01jan1998'd */
             /* end  ='31dec2000'd */ ;
   var item1-item8;
run;
/* end of program */

If it works now, you might want to use another accumulation statistic.

See here for your choices :

SAS/ETS 15.2 User's Guide
The TIMESERIES Procedure
ID Statement
Look for the ACCUMULATE=option !
https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/etsug/etsug_timeseries_syntax08.htm

 

Cheers,

Koen

View solution in original post

5 REPLIES 5
PaigeMiller
Diamond | Level 26

From now on, please, when an ERROR appears in the log, show us the ENTIRE log for that PROC or DATA step, not just a few lines.

 

The current time period has date=31DEC2014 and the previous time period has date=31DEC2014

I'm not really a heavy user of PROC PANEL, but I don't think two observations with the exact same date are allowed.

--
Paige Miller
sbxkoenk
SAS Super FREQ

Hello,

 

You have duplicate dates within the same cross-section.

Might be a data quality problem.

 

If not, you can de-duplicate by taking the median (or whatever summary statistic) per cross-section (like company , firm, country , subject_id , ...) for the same dates.

 

You can do the latter using :

  • PROC TIMESERIES or
  • PROC TIMEDATA (or timeData cas action)

It's pretty easy, but let us know if you need an example !

 

Cheers,

Koen

Am_fr
Calcite | Level 5

thank you for your answer !!

 

but i believe I really don't have duplicate dates within the same cross-section.

 

when It is ordered by company name and date, the first lines of my table are these ones (where i don't see any duplicate) : 

datalines;
017187 31JAN2014 60101010 AGELLAN COMMERCIAL REIT 7.7170 2014 -1.009485011
017187 03FEB2014 60101010 AGELLAN COMMERCIAL REIT 7.8444 2014 -1.009485011 
017187 11FEB2014 60101010 AGELLAN COMMERCIAL REIT 8.5922 2014 -1.009485011 
017187 23JUL2014 60101010 AGELLAN COMMERCIAL REIT 8.6800 2014 -1.009485011 
017187 24JUL2014 60101010 AGELLAN COMMERCIAL REIT 8.6790 2014 -1.009485011 
 
and it still returns the error message : 
 
ERROR: The data set THESIS.DIVERSIFIED_RETURNS is not sorted in ascending sequence with respect to the time series ID. The current time period has date=31DEC2014 and the previous time period has date=31DEC2014 in cross section CONM=AGELLAN COMMERCIAL REIT.
 
However, it would be really helpful if you could provide me with an example of proc timeseries, to try your solution 
 
thank you !!
sbxkoenk
SAS Super FREQ

Hello @Am_fr ,

 

Here's the code :

( Remark that PROC TIMESERIES is making the timestamp equally spaced, i.e. it fills gaps (with missings when using setmissing=missing) )

proc sort data=work.have 
     /* no out=  needed if input and output datasets are the same */ ;
 by cross_section timestamp;
run;

proc timeseries data=work.have out=work.dseries;
   by cross_section;
   id timestamp interval=day
                accumulate=median
                setmiss=missing
             /* start='01jan1998'd */
             /* end  ='31dec2000'd */ ;
   var item1-item8;
run;
/* end of program */

If it works now, you might want to use another accumulation statistic.

See here for your choices :

SAS/ETS 15.2 User's Guide
The TIMESERIES Procedure
ID Statement
Look for the ACCUMULATE=option !
https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/etsug/etsug_timeseries_syntax08.htm

 

Cheers,

Koen

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

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
  • 5 replies
  • 7043 views
  • 1 like
  • 4 in conversation