<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to prepare data for a proc  panel pooled regression in SAS Forecasting and Econometrics</title>
    <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/How-to-prepare-data-for-a-proc-panel-pooled-regression/m-p/305053#M1974</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to run a pooled regression for a sample. here is the code that I have right now:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have; &lt;BR /&gt; input fundid time flow flow_lag return; &lt;BR /&gt; datalines;&lt;BR /&gt; 10001 1 10 . .01&lt;BR /&gt; 10001 2 12 10 -.03&lt;BR /&gt; 10001 3 -10 12 .04&lt;BR /&gt; 10002 1 61 . .03&lt;BR /&gt; 10002 2 36 61 .04&lt;BR /&gt; 10002 3 10 36 0.01&lt;BR /&gt; ; &lt;BR /&gt;run;&lt;BR /&gt;proc panel data = have;&lt;BR /&gt; id fundid time;&lt;BR /&gt; model flow = return flow_lag / pooled;&lt;BR /&gt;run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I run the above regression, I get the error:&lt;/P&gt;
&lt;PRE&gt;There is only one cross section or time series observation. Computations will be terminated.
&lt;/PRE&gt;
&lt;P&gt;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). &amp;nbsp;So I think there should be something about pooled regression that I do not get at all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are my two questions&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;How should I arrange my data for the proc panel&amp;nbsp;so that I do not face the above error?&lt;/LI&gt;
&lt;LI&gt;Is my time id correct? or should it be necessarily a variable with time informat?&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;If there is any reference that can help me, I would appreciate it if you mention it as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks a lot,&lt;/P&gt;</description>
    <pubDate>Mon, 17 Oct 2016 11:55:50 GMT</pubDate>
    <dc:creator>Shayan2012</dc:creator>
    <dc:date>2016-10-17T11:55:50Z</dc:date>
    <item>
      <title>How to prepare data for a proc  panel pooled regression</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/How-to-prepare-data-for-a-proc-panel-pooled-regression/m-p/305053#M1974</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to run a pooled regression for a sample. here is the code that I have right now:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have; &lt;BR /&gt; input fundid time flow flow_lag return; &lt;BR /&gt; datalines;&lt;BR /&gt; 10001 1 10 . .01&lt;BR /&gt; 10001 2 12 10 -.03&lt;BR /&gt; 10001 3 -10 12 .04&lt;BR /&gt; 10002 1 61 . .03&lt;BR /&gt; 10002 2 36 61 .04&lt;BR /&gt; 10002 3 10 36 0.01&lt;BR /&gt; ; &lt;BR /&gt;run;&lt;BR /&gt;proc panel data = have;&lt;BR /&gt; id fundid time;&lt;BR /&gt; model flow = return flow_lag / pooled;&lt;BR /&gt;run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I run the above regression, I get the error:&lt;/P&gt;
&lt;PRE&gt;There is only one cross section or time series observation. Computations will be terminated.
&lt;/PRE&gt;
&lt;P&gt;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). &amp;nbsp;So I think there should be something about pooled regression that I do not get at all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are my two questions&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;How should I arrange my data for the proc panel&amp;nbsp;so that I do not face the above error?&lt;/LI&gt;
&lt;LI&gt;Is my time id correct? or should it be necessarily a variable with time informat?&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;If there is any reference that can help me, I would appreciate it if you mention it as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks a lot,&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2016 11:55:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/How-to-prepare-data-for-a-proc-panel-pooled-regression/m-p/305053#M1974</guid>
      <dc:creator>Shayan2012</dc:creator>
      <dc:date>2016-10-17T11:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to prepare data for a proc  panel pooled regression</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/How-to-prepare-data-for-a-proc-panel-pooled-regression/m-p/305431#M1980</link>
      <description>&lt;P&gt;The error message you observed in PROC PANEL is typically due to one of the following two problems:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1)&amp;nbsp; at least one of the cross sections in your input data has only one time series observation, or&lt;/P&gt;
&lt;P&gt;2)&amp;nbsp; at least one time series ID value is represented one (or fewer) times in the input data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&amp;nbsp; Keep in mind that if any of the regressors in the MODEL statement&amp;nbsp;has a&amp;nbsp;missing for a given observation, then that observation is omitted from the estimation of the model.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Because your current model includes a lagged dependent regressor,&amp;nbsp;your variable FLOW_LAG&amp;nbsp;is set to missing for TIME=1 for all observations in the example data you provided.&amp;nbsp; Because of this, there are no nonmissing observations for TIME=1.&amp;nbsp; 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:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR: Each observation for time point time=1 has a missing value for at least one variable in&lt;/P&gt;
&lt;P&gt;MODEL statement Model 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I make the following modifications to your code, then PROC PANEL runs without error:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; need;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; have(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;where&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;=(time &amp;gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;));&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;run&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;panel&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; data = need;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;id&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; fundid time;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;model&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; flow = return flow_lag / pooled;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To answer your specific questions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. How should I arrange my data for the proc panel&amp;nbsp;so that I do not face the above error?&lt;/P&gt;
&lt;P&gt;Your data arrangement is fine, but&amp;nbsp;the data must meet the criteria outlined above.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2.&amp;nbsp;Is my time id correct? or should it be necessarily a variable with time informat?&lt;/P&gt;
&lt;P&gt;You can use your Time ID variable as currently specified or&amp;nbsp;use a SAS date or datetime variable, as long as your data meets the criteria outlined above.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2016 16:46:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/How-to-prepare-data-for-a-proc-panel-pooled-regression/m-p/305431#M1980</guid>
      <dc:creator>dw_sas</dc:creator>
      <dc:date>2016-10-18T16:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to prepare data for a proc  panel pooled regression</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/How-to-prepare-data-for-a-proc-panel-pooled-regression/m-p/306569#M1991</link>
      <description>&lt;P&gt;Thanks a lot, DW_SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That was &amp;nbsp;very helpful and solved my issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Oct 2016 18:32:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/How-to-prepare-data-for-a-proc-panel-pooled-regression/m-p/306569#M1991</guid>
      <dc:creator>Shayan2012</dc:creator>
      <dc:date>2016-10-22T18:32:29Z</dc:date>
    </item>
  </channel>
</rss>

