BookmarkSubscribeRSS Feed
Golf
Pyrite | Level 9

Hello,

I use balance panel with 22 cross section units and 9 years.

When I apply first difference method to my model, it should be 22*(9-1) = 176 observations applied to estimate the model.

I use the following procedure:

proc panel data= ex1;
id cross  time;
model y= d2001 d2002 d2003 d2004 d2005 d2006 d2007 dfemale  /fdone ;
run;

I understand that  SAS use 167 observations to estimate the model (Consider from Den DF in the output below).    When I use other software, it uses 176 observations as I expected and this make the SAS results different from other softwares.   

      What wrong to my SAS code?   

Thank You.

Capture.PNG

 

7 REPLIES 7
PaigeMiller
Diamond | Level 26

Although I am not very familiar with PROC PANEL, the DFE (degrees of freedom for error) seems like 167 is correct, you have 198 total observations, 197 degrees of freedom total, 22 degrees of freedom for the cross section units, so that leaves 175 degrees of freedom, you are estimating 8 model terms, and so ... you do the math ...

 


@Golf wrote:

Hello,

I use balance panel with 22 cross section units and 9 years.

When I apply first difference method to my model, it should be 22*(9-1) = 176 observations applied to estimate the model.

I use the following procedure:

proc panel data= ex1;
id cross  time;
model y= d2001 d2002 d2003 d2004 d2005 d2006 d2007 dfemale  /fdone ;
run;

I understand that  SAS use 167 observations to estimate the model (Consider from Den DF in the output below).    When I use other software, it uses 176 observations,

 


"Other software"? What other software?

--
Paige Miller
Golf
Pyrite | Level 9

STATA and Eviews give the same outputs and show that 176 observations were used.   

I understand that the first year for each cross section unit will be missing value, this lead to 176 will be adopted.   I'm really want to know what's wrong to my SAS code.

Thanks.

PaigeMiller
Diamond | Level 26

 


STATA and Eviews give the same outputs and show that 176 observations were used. I understand that the first year for each cross section unit will be missing value, this lead to 176 will be adopted. I'm really want to know what's wrong to my SAS code.

"... show that 176 observations were used" is not the same as 176 degrees of freedom for error, and there is no inherent conflict between using 176 observations and 167 degrees of freedom for error, which is what SAS is showing you.


again, I'm not an expert in PROC PANEL, but I don't see a problem with your SAS code. How do you know your code in the other software is correct?

--
Paige Miller
Golf
Pyrite | Level 9

I use balance panel with 22 cross section units and 9 years.

When I apply first difference method to my model, it should be 22*(9-1) = 176 observations applied to estimate the model.

I use the following procedure:

proc panel data= ex1;
id cross  time;
model y= d2001 d2002 d2003 d2004 d2005 d2006 d2007 dfemale  /fdone ;
run;

I understand that  SAS use 167 observations to estimate the model (Consider from Den DF in the output below).    When I use other software, it uses 176 observations as I expected and this make the SAS results different from other softwares.   

      What wrong to my SAS code?   

Thank You.

Capture.PNG

 

 

Ksharp
Super User
Better post it at Forecast Forum .since it is about SAS/ETS
SteveDenham
Jade | Level 19

I moved this over per @Ksharp , but see that there is an identical question already in the forum, and I can't figure out how to merge.

 

It appears that 188 degrees of freedom are available for testing the covariates in your model (num df + den df).  With 9 time points (8 df) that are absorbed in the timeseries estimation, that is 196 degrees of freedom, plus one more for panel, and I get 197 df, which is 22*9 - 1.  This may be coincidence, but it appears to follow the examples in the Details part of the documentation for PROC PANEL.

 

SteveDenham

ShelleySessoms
Community Manager

I have now merged these two topics into one thread.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 7 replies
  • 1103 views
  • 3 likes
  • 5 in conversation