BookmarkSubscribeRSS Feed
caveman529
Calcite | Level 5

I have a panel dataset with three dimension: doctor, patient, and year.  I hope to include doctor and year fixed-effect in my regression.  I used

proc sort data=have; by doctor year; run;

proc panel data=HAVE;

     id doctor year;

     model y =  x1 x2 x3 x4 x5 x6 x7 / fixtwo;

run;

PROC TSCSREG DATA=HAVE;

   ID doctor year;

   MODEL y = x1 x2 x3 x4 x5 x6 x7 / fixtwo;

RUN;

But all I get is:

ERROR: Data set is not sorted in ascending sequence with

       respect to time series ID.  The current time period has year=2002 and

       the previous time period has year=2010 in cross section

       doctor=2.

How could I resolve this problem?  Thank you!

6 REPLIES 6
DR_Majeti
Quartz | Level 8

Hi,

Please check that error says dataset is not sorted as per variables in ID statement. .

Sort before this step.

caveman529
Calcite | Level 5

After sorting :

proc sort data=have; by doctor year; run;

it still reports errors...

DR_Majeti
Quartz | Level 8

Can you send me the sample data That i can try the output ..

caveman529
Calcite | Level 5

Hi, Majeti:

Thank you for your help on this!  I have attached the data file in zip. 

DR_Majeti
Quartz | Level 8

Hi ,

I have also got the same error, but I could rectify when only there are no duplicates for the year value. (But i know that it is wrong)

After doing that I got another error: when there is missing values for any observation the model we are applying is not accepting.

Please the check the combination of ID statement. Sorry, i don't have any idea with these kind of analysis.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 1031 views
  • 0 likes
  • 2 in conversation