Quartz | Level 8

## Proc panel

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.

7 REPLIES 7
Diamond | Level 26

## Re: Proc panel

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
Quartz | Level 8

## Re: Proc panel

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.

Diamond | Level 26

## Re: Proc panel

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
Quartz | Level 8

## Proc panel: First Difference Method

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.

Super User

## Re: Proc panel: First Difference Method

Better post it at Forecast Forum .since it is about SAS/ETS

## Re: Proc panel: First Difference Method

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

Community Manager

## Re: Proc panel: First Difference Method

I have now merged these two topics into one thread.

Discussion stats
• 7 replies
• 515 views
• 3 likes
• 5 in conversation