Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Forecasting
- /
- How to prepare data for a proc panel pooled regression

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 10-17-2016 07:55 AM
(2232 views)

Hi all,

I am trying to run a pooled regression for a sample. here is the code that I have right now:

data have;

input fundid time flow flow_lag return;

datalines;

10001 1 10 . .01

10001 2 12 10 -.03

10001 3 -10 12 .04

10002 1 61 . .03

10002 2 36 61 .04

10002 3 10 36 0.01

;

run;

proc panel data = have;

id fundid time;

model flow = return flow_lag / pooled;

run;

Of course, I have lots of funds and lots of time periods. But I am just showing 2 funds and 3 time periods to understand better how the proc panel works.

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

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

I get this message even when I run on the whole sample, which I know has lots of cross section and time series. As far as I understand, I have both multiple cross sections (two fundids) and multiple time series (three time ids). So I think there should be something about pooled regression that I do not get at all.

Here are my two questions

- How should I arrange my data for the proc panel so that I do not face the above error?
- Is my time id correct? or should it be necessarily a variable with time informat?

If there is any reference that can help me, I would appreciate it if you mention it as well.

thanks a lot,

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

The error message you observed in PROC PANEL is typically due to one of the following two problems:

1) at least one of the cross sections in your input data has only one time series observation, or

2) at least one time series ID value is represented one (or fewer) times in the input data set.

In other words, in order to run your model using PROC PANEL for your current data structure, you need to make sure that every cross section has at least 2 nonmissing observations, and each time ID value appears in at least 2 cross sections. Keep in mind that if any of the regressors in the MODEL statement has a missing for a given observation, then that observation is omitted from the estimation of the model.

Because your current model includes a lagged dependent regressor, your variable FLOW_LAG is set to missing for TIME=1 for all observations in the example data you provided. Because of this, there are no nonmissing observations for TIME=1. In fact, when I run your code in the most current SAS/ETS 14.1 (9.4M3) release, PROC PANEL returns the following, more descriptive error:

ERROR: Each observation for time point time=1 has a missing value for at least one variable in

MODEL statement Model 1.

If I make the following modifications to your code, then PROC PANEL runs without error:

**data** need;

set have(where=(time > **1**));

run;

**proc** **panel** data = need;

id fundid time;

model flow = return flow_lag / pooled;

**run**;

To answer your specific questions:

1. How should I arrange my data for the proc panel so that I do not face the above error?

Your data arrangement is fine, but the data must meet the criteria outlined above.

2. Is my time id correct? or should it be necessarily a variable with time informat?

You can use your Time ID variable as currently specified or use a SAS date or datetime variable, as long as your data meets the criteria outlined above.

I hope this helps!

2 REPLIES 2

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

The error message you observed in PROC PANEL is typically due to one of the following two problems:

1) at least one of the cross sections in your input data has only one time series observation, or

2) at least one time series ID value is represented one (or fewer) times in the input data set.

In other words, in order to run your model using PROC PANEL for your current data structure, you need to make sure that every cross section has at least 2 nonmissing observations, and each time ID value appears in at least 2 cross sections. Keep in mind that if any of the regressors in the MODEL statement has a missing for a given observation, then that observation is omitted from the estimation of the model.

Because your current model includes a lagged dependent regressor, your variable FLOW_LAG is set to missing for TIME=1 for all observations in the example data you provided. Because of this, there are no nonmissing observations for TIME=1. In fact, when I run your code in the most current SAS/ETS 14.1 (9.4M3) release, PROC PANEL returns the following, more descriptive error:

ERROR: Each observation for time point time=1 has a missing value for at least one variable in

MODEL statement Model 1.

If I make the following modifications to your code, then PROC PANEL runs without error:

**data** need;

set have(where=(time > **1**));

run;

**proc** **panel** data = need;

id fundid time;

model flow = return flow_lag / pooled;

**run**;

To answer your specific questions:

1. How should I arrange my data for the proc panel so that I do not face the above error?

Your data arrangement is fine, but the data must meet the criteria outlined above.

2. Is my time id correct? or should it be necessarily a variable with time informat?

You can use your Time ID variable as currently specified or use a SAS date or datetime variable, as long as your data meets the criteria outlined above.

I hope this helps!

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Thanks a lot, DW_SAS.

That was very helpful and solved my issue.

**Available on demand!**

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

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.