02-04-2014 12:27 AM
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;
PROC TSCSREG DATA=HAVE;
ID doctor year;
MODEL y = x1 x2 x3 x4 x5 x6 x7 / fixtwo;
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
How could I resolve this problem? Thank you!
02-04-2014 08:42 AM
Please check that error says dataset is not sorted as per variables in ID statement. .
Sort before this step.
02-05-2014 01:20 AM
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.