BookmarkSubscribeRSS Feed
Calcite | Level 5

Hi all,


I am trying to run a proc panel data model but I am encountering a problem. Here is the code I have right now:


data have;
input ID date indepvar depvar;
10001 02-02-2017 100 87
10001 02-06-2017 80 87
10001 02-08-2017 110  88
10002 02-05-2017 70 67
10002 02-08-2017 90 68
10002 02-011-2017 140 68
proc panel data = have;
id ID date;
model indepvar = depvar / FIXTWO;


When I run the above regression, I get the error:

There is only one cross section or time series observation. Computations will be terminated


There are no missing values in any of the variables and I have only selected date values with ≥2 observations.


I have searched this forum and there are others who have encountered this problem, but none of the solutions given solved the error. How should I arrange my data for the proc panel so that I do not face the above error?


Thanks in advance

Super User

if INDEPVAR is an independent variable and DEPVAR is dependent then you probably should reverse them on the model statement.

Generally the SAS MODEL statements are Model dependent = independents /options.


The example that you show only has one common date element

From the documentation:

The PANEL procedure also verifies that the time series ID values are the same for all cross sections


If you go to as one example note that "time period" variable values are 1 to 15 for each firm ID value.

Suggest: copy the data and code from that example and then remove ONE record for ONE firm and see the result.


Note that your example data does not run as you did not provide an informat for date that would work for the given code. All values would have generated errors of invalid data for date. And even with an appropriate informat

10002 02-011-2017 140 68 would be an error because either mmddyy10 or ddmmyy10 would choke on the 3 digit middle value.


Instructions here: will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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
  • 1 reply
  • 2 in conversation