<p>The technique described in the question is almost correct. Consider a panel data set consisting of three cross-sections ($a$, $b$, and $c$) and three time-periods ($1$, $2$, and $3$). Let <strong>y</strong> denote the column vector with the observations of the dependent variable, <strong>x</strong> the column vector with observations of the first explanatory variable, and <strong>z</strong> the column vector with observations of the second explanatory variable. They take these forms respectively:</p>

<p>$\textbf{y} = 
\begin{bmatrix} y_{a1} \\ y_{a2} \\ y_{a3} \\  y_{b1} \\ y_{b2} \\ y_{b3} \\ y_{c1} \\ y_{c2} \\ y_{c3} \end{bmatrix}$
; $\textbf{x} = \begin{bmatrix} x_{a1} \\ x_{a2} \\ x_{a3} \\  x_{b1} \\ x_{b2} \\ x_{b3} \\ x_{c1} \\ x_{c2} \\ x_{c3} \end{bmatrix}$;  $\textbf{z} = \begin{bmatrix} z_{a1} \\ z_{a2} \\ z_{a3} \\  z_{b1} \\ z_{b2} \\ z_{b3} \\ z_{c1} \\ z_{c2} \\ z_{c3} \end{bmatrix}$.</p>

<p>Let $\bar{y}_{i} = \frac{1}{3}(y_{ai} + y_{bi}+y_{ci})$, with $i = 1, 2, 3$, and equivalently for $x$ and $z$: $\bar{x}_{i} = \frac{1}{3}(x_{ai} + x_{bi}+x_{ci})$ and  $\bar{z}_{i} = \frac{1}{3}(z_{ai} + z_{bi}+z_{ci})$, both for  $i = 1, 2, 3$.</p>

<p>This is the correct way to get the CCEP estimator allowing for one common factor, as in the model described in the question:
\begin{equation*}
\begin{split}
\begin{bmatrix} y_{a1} \\ y_{a2} \\ y_{a3} \\  y_{b1} \\ y_{b2} \\ y_{b3} \\ y_{c1} \\ y_{c2} \\ y_{c3} \end{bmatrix} = \beta_{1} \begin{bmatrix} x_{a1} \\ x_{a2} \\ x_{a3} \\  x_{b1} \\ x_{b2} \\ x_{b3} \\ x_{c1} \\ x_{c2} \\ x_{c3} \end{bmatrix}+\beta_{2}\begin{bmatrix} z_{a1} \\ z_{a2} \\ z_{a3} \\  z_{b1} \\ z_{b2} \\ z_{b3} \\ z_{c1} \\ z_{c2} \\ z_{c3} \end{bmatrix}+
\gamma_{a} \begin{bmatrix} \bar{y}_{1} \\ \bar{y}_{2} \\ \bar{y}_{3} \\  0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \end{bmatrix}
+\gamma_{b} \begin{bmatrix}  0 \\ 0 \\ 0 \\ \bar{y}_{1} \\ \bar{y}_{2} \\ \bar{y}_{3} \\  0 \\ 0 \\ 0 \end{bmatrix} + 
\gamma_{c}  \begin{bmatrix}  0 \\ 0 \\ 0 \\  0 \\ 0 \\ 0 \\ \bar{y}_{1} \\ \bar{y}_{2} \\ \bar{y}_{3}  \end{bmatrix} \\
- \beta_{1}\gamma_{a} \begin{bmatrix} \bar{x}_{1} \\ \bar{x}_{2} \\ \bar{x}_{3} \\  0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \end{bmatrix}
- \beta_{1}\gamma_{b}  \begin{bmatrix}  0 \\ 0 \\ 0 \\ \bar{x}_{1} \\ \bar{x}_{2} \\ \bar{x}_{3} \\  0 \\ 0 \\ 0 \end{bmatrix}
-\beta_{1} \gamma_{c} \begin{bmatrix}  0 \\ 0 \\ 0 \\  0 \\ 0 \\ 0 \\ \bar{x}_{1} \\ \bar{x}_{2} \\ \bar{x}_{3}  \end{bmatrix}
-\beta_{2} \gamma_{a}  \begin{bmatrix} \bar{z}_{1} \\ \bar{z}_{2} \\ \bar{z}_{3} \\  0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \end{bmatrix}
-\beta_{2} \gamma_{b} \begin{bmatrix}  0 \\ 0 \\ 0 \\ \bar{z}_{1} \\ \bar{z}_{2} \\ \bar{z}_{3} \\  0 \\ 0 \\ 0 \end{bmatrix}
-\beta_{2} \gamma_{c} \begin{bmatrix}  0 \\ 0 \\ 0 \\  0 \\ 0 \\ 0 \\ \bar{z}_{1} \\ \bar{z}_{2} \\ \bar{z}_{3}  \end{bmatrix} \\
+ \phi_{a} + \phi_{b} + \phi_{c} + \mu_{it}
\end{split}
\end{equation*}
Here, $\phi_{a},\ \phi_{b},$ and  $\phi_{c}$ are cross-sectional fixed effects and $\mu_{it}$ a well-behaved error-term that does not require any restrictions. </p>

<p>An interesting remark is that if the six $\beta$s that appear together with the $\gamma$s are not restricted to be equal to each other <em>and</em> equal to the first two $\beta$s,   more than one common factor is allowed.</p>

CC BY-SA 3.0
2016-03-16T12:56:58.193Z
2016-03-16T12:56:58.193Z
Wecon
<p>I intend to use Pesaran's (2006) common correlated effects pooled (CCEP) estimator. However, I'm not yet very familiar with advanced econometrics and advanced use of eviews. More specifically I want to estimate this model:
\begin{equation} 
y_{it} = \alpha_{i} + \beta_{1}x_{1,it} + \beta_{2}x_{2,it}+\gamma_{i}F_{t}+\epsilon_{it}
\end{equation} 
in which $F_{t}$ is an unobserved common factor and $\gamma_{i}$ is a country-specific factor loading. We were taught that $F_{t}$ can be proxied by:
\begin{equation}
F_{t}=\frac{(\bar{y_{t}}-\bar{\alpha}-\beta_{1} \bar{x}_{{1,t}} -\beta_{2} \bar{x}_{{2,t}}-\bar{\epsilon}_{{t}})}{\bar{\gamma}},
\end{equation}
in which $\bar{y_{t}} = \frac{1}{N}\sum_{i=1}^{N} y_{it}$, and $\bar{\gamma_{}}=\frac{1}{N}\sum_{i=1}^{N} \gamma_{i}$, with $N$ the number of cross-sections.</p>

<p>Substituting the second equation into the first yields: 
\begin{equation}
y_{it} = \alpha_{i}-\frac{\gamma_{i}}{\bar{\gamma}}+\beta_{1} x_{1,it} +\beta_{2} x_{2,it} +\frac{\gamma_{i}}{\bar{\gamma}}\bar{y_{t}} - \beta_{1} \frac{\gamma_{i}}{\bar{\gamma}} \bar{x}_{1,t} -\beta_{2}\frac{\gamma_{i}}{\bar{\gamma}}\bar{x}_{2,t}+\epsilon_{it}-\frac{\gamma_{i}}{\bar{\gamma}}\bar{\epsilon_{t}}
\end{equation}
or with $\alpha_{i}-\frac{\gamma_{i}}{\bar{\gamma}}=\alpha'_{i}$ and $\frac{\gamma_{i}}{\bar{\gamma}}=\gamma'_{i}$:
\begin{equation}
y_{it} = \alpha'_{i}
+\beta_{1} x_{1,it} 
+\beta_{2} x_{2,it} 
+\gamma'_{i}\bar{y_{t}} 
- \beta_{1} \gamma'_{i} \bar{x}_{1,t}
-\beta_{2}\gamma'_{i}\bar{x}_{2,t}
+\epsilon_{it}-\gamma'_{i}\bar{\epsilon_{t}}.
\end{equation}</p>

<p>To estimate this in eviews, I had the following idea</p>

<p>The cross-sectional averages $\bar{y_{t}}$, $\bar{x}_{{1,t}}$, and $\bar{x}_{{2,t}}$ can be easily calculated from the dataset. I would use cross-sectional fixed effects to estimate all $\alpha'_{i}$. Next, I would need $N$ terms to estimate all $N$ $\gamma'_{i}$. To do this, I would include these $N$ terms: $\gamma'_{A}\bar{y}_{t}dum_{A} + \gamma'_{B}\bar{y}_{t}dum_{B} + ... + \gamma'_{N}\bar{y}_{t}dum_{N}$, in which each capital letter denotes one of the $N$ cross-sections and the dummy variable takes the value of $1$ once for each cross-section. Then, for each averaged explanatory  variable, $\bar{x}_{1t}$ and $\bar{x}_{2t}$, I would include these $2 \times N$ terms: $\beta_{1}\gamma'_{A}\bar{x}_{1,t} + \beta_{1}\gamma'_{B}\bar{x}_{1,t}+ ... + \beta_{1}\gamma'_{N}\bar{x}_{1,t}$ and $\beta_{2}\gamma'_{A}\bar{x}_{2,t} + \beta_{2}\gamma'_{B}\bar{x}_{2,t}+ ... + \beta_{2}\gamma'_{N}\bar{x}_{2,t}$.</p>

<p>So, to sum up, my suggested input for eviews (to estimate with cross-sectional fixed effects) is the following:
<code>y = c(1)*x1 + c(2)*x2 + c(3)*y_avg*dumA + c(4)*y_avg*dumB + c(5)*y_avg*dumC + ... + c(1)*c(3)*x1_avg + c(1)*c(4)*x1_avg + c(1)*c(5)*x1_avg + ... + c(2)*c(3)*x2_avg + c(2)*c(4)*x2_avg + c(2)*c(5)*x2_avg + ....</code>.</p>

<p>In this equation:</p>

<ul>
<li><code>c(1)</code> = $\beta_{1}$;</li>
<li><code>c(2)</code> = $\beta_{2}$;</li>
<li><code>c(3)</code> = $\gamma'_{A}$;</li>
<li><code>c(4)</code> = $\gamma'_{B}$;</li>
<li><code>c(5)</code> = $\gamma'_{C}$.</li>
</ul>

<p>These are my questions regarding this estimation:</p>

<ul>
<li>First of all, confirmation of the correctness of my derivation would be welcome;</li>
<li>Would the estimation in eviews I suggest do the trick?</li>
<li>If so, should I include an intercept in the fixed-effects estimation?</li>
<li>If not, is there an alternative procedure to implement the CCEP estimator in eviews?</li>
<li>The estimated error terms should be $\epsilon-\gamma'_{i}\bar{\epsilon}$, is this structure automatically obtained? Or should this be imposed one way or another?</li>
<li>The same question for $\alpha'_{i}$: it should equal $\alpha_{i}-\frac{\gamma_{i}}{\bar{\gamma}}$. Should this condition be imposed, or is it automatically fulfilled when inputting my suggested input in eviews;</li>
<li>Other suggestions regarding the use of CCEP estimator in eviews are certainly welcome.</li>
</ul>

<p>Any help, also partial answers, is appreciated!</p>

CC BY-SA 3.0
2016-02-28T19:43:45.017Z
Since this question has received no answers... Have you considered posting this on the official EViews user forum? _Hint:_ that's a very good resource for users of EViews.
Graeme Walsh
CC BY-SA 3.0
2016-02-29T08:57:18.787Z
Indeed, yesterday I decided that the question may actually be more fitted to the eviews forum than  to econimics.se. This is the link to the post: http://forums.eviews.com/viewtopic.php?f=7&t=14075. If any answer appears there, I'll bring it to this site as well. Thanks for the hint though!
Wecon
<econometrics><paneldata>
Pesaran's CCEP estimator in eviews
Wecon
# Pesaran's CCEP estimator in eviews

(Asked by: username_0 on 2016-02-26)

I intend to use Pesaran's (2006) common correlated effects pooled (CCEP) estimator. However, I'm not yet very familiar with advanced econometrics and advanced use of eviews. More specifically I want to estimate this model:
\begin{equation}
y\_{it} = \alpha\_{i} + \beta\_{1}x\_{1,it} + \beta\_{2}x\_{2,it}+\gamma\_{i}F\_{t}+\epsilon\_{it}
\end{equation}
in which $F\_{t}$ is an unobserved common factor and $\gamma\_{i}$ is a country-specific factor loading. We were taught that $F\_{t}$ can be proxied by:
\begin{equation}
F\_{t}=\frac{(\bar{y\_{t}}-\bar{\alpha}-\beta\_{1} \bar{x}\_{{1,t}} -\beta\_{2} \bar{x}\_{{2,t}}-\bar{\epsilon}\_{{t}})}{\bar{\gamma}},
\end{equation}
in which $\bar{y\_{t}} = \frac{1}{N}\sum\_{i=1}^{N} y\_{it}$, and $\bar{\gamma\_{}}=\frac{1}{N}\sum\_{i=1}^{N} \gamma\_{i}$, with $N$ the number of cross-sections.

Substituting the second equation into the first yields:
\begin{equation}
y\_{it} = \alpha\_{i}-\frac{\gamma\_{i}}{\bar{\gamma}}+\beta\_{1} x\_{1,it} +\beta\_{2} x\_{2,it} +\frac{\gamma\_{i}}{\bar{\gamma}}\bar{y\_{t}} - \beta\_{1} \frac{\gamma\_{i}}{\bar{\gamma}} \bar{x}\_{1,t} -\beta\_{2}\frac{\gamma\_{i}}{\bar{\gamma}}\bar{x}\_{2,t}+\epsilon\_{it}-\frac{\gamma\_{i}}{\bar{\gamma}}\bar{\epsilon\_{t}}
\end{equation}
or with $\alpha\_{i}-\frac{\gamma\_{i}}{\bar{\gamma}}=\alpha'\_{i}$ and $\frac{\gamma\_{i}}{\bar{\gamma}}=\gamma'\_{i}$:
\begin{equation}
y\_{it} = \alpha'\_{i}
+\beta\_{1} x\_{1,it}
+\beta\_{2} x\_{2,it}
+\gamma'\_{i}\bar{y\_{t}}
- \beta\_{1} \gamma'\_{i} \bar{x}\_{1,t}
-\beta\_{2}\gamma'\_{i}\bar{x}\_{2,t}
+\epsilon\_{it}-\gamma'\_{i}\bar{\epsilon\_{t}}.
\end{equation}

To estimate this in eviews, I had the following idea

The cross-sectional averages $\bar{y\_{t}}$, $\bar{x}\_{{1,t}}$, and $\bar{x}\_{{2,t}}$ can be easily calculated from the dataset. I would use cross-sectional fixed effects to estimate all $\alpha'\_{i}$. Next, I would need $N$ terms to estimate all $N$ $\gamma'\_{i}$. To do this, I would include these $N$ terms: $\gamma'\_{A}\bar{y}\_{t}dum\_{A} + \gamma'\_{B}\bar{y}\_{t}dum\_{B} + ... + \gamma'\_{N}\bar{y}\_{t}dum\_{N}$, in which each capital letter denotes one of the $N$ cross-sections and the dummy variable takes the value of $1$ once for each cross-section. Then, for each averaged explanatory variable, $\bar{x}\_{1t}$ and $\bar{x}\_{2t}$, I would include these $2 \times N$ terms: $\beta\_{1}\gamma'\_{A}\bar{x}\_{1,t} + \beta\_{1}\gamma'\_{B}\bar{x}\_{1,t}+ ... + \beta\_{1}\gamma'\_{N}\bar{x}\_{1,t}$ and $\beta\_{2}\gamma'\_{A}\bar{x}\_{2,t} + \beta\_{2}\gamma'\_{B}\bar{x}\_{2,t}+ ... + \beta\_{2}\gamma'\_{N}\bar{x}\_{2,t}$.

So, to sum up, my suggested input for eviews (to estimate with cross-sectional fixed effects) is the following:
`y = c(1)*x1 + c(2)*x2 + c(3)*y_avg*dumA + c(4)*y_avg*dumB + c(5)*y_avg*dumC + ... + c(1)*c(3)*x1_avg + c(1)*c(4)*x1_avg + c(1)*c(5)*x1_avg + ... + c(2)*c(3)*x2_avg + c(2)*c(4)*x2_avg + c(2)*c(5)*x2_avg + ....`.

In this equation:

* `c(1)` = $\beta\_{1}$;
* `c(2)` = $\beta\_{2}$;
* `c(3)` = $\gamma'\_{A}$;
* `c(4)` = $\gamma'\_{B}$;
* `c(5)` = $\gamma'\_{C}$.

These are my questions regarding this estimation:

* First of all, confirmation of the correctness of my derivation would be welcome;
* Would the estimation in eviews I suggest do the trick?
* If so, should I include an intercept in the fixed-effects estimation?
* If not, is there an alternative procedure to implement the CCEP estimator in eviews?
* The estimated error terms should be $\epsilon-\gamma'\_{i}\bar{\epsilon}$, is this structure automatically obtained? Or should this be imposed one way or another?
* The same question for $\alpha'\_{i}$: it should equal $\alpha\_{i}-\frac{\gamma\_{i}}{\bar{\gamma}}$. Should this condition be imposed, or is it automatically fulfilled when inputting my suggested input in eviews;
* Other suggestions regarding the use of CCEP estimator in eviews are certainly welcome.

Any help, also partial answers, is appreciated!

**Tags:** econometrics, paneldata

> **Comments:**
> **username_1**: Since this question has received no answers... Have you considered posting this on the official EViews user forum? _Hint:_ that's a very good resource for users of EViews.  
> **username_0**: Indeed, yesterday I decided that the question may actually be more fitted to the eviews forum than  to econimics.se. This is the link to the post: http://forums.eviews.com/viewtopic.php?f=7&t=14075. If any answer appears there, I'll bring it to this site as well. Thanks for the hint though!  

---

## 1 answers

### Answer by username_0 on 2016-03-16. Score: 4 | Accepted answer

The technique described in the question is almost correct. Consider a panel data set consisting of three cross-sections ($a$, $b$, and $c$) and three time-periods ($1$, $2$, and $3$). Let **y** denote the column vector with the observations of the dependent variable, **x** the column vector with observations of the first explanatory variable, and **z** the column vector with observations of the second explanatory variable. They take these forms respectively:

$\textbf{y} =
\begin{bmatrix} y\_{a1} \\ y\_{a2} \\ y\_{a3} \\ y\_{b1} \\ y\_{b2} \\ y\_{b3} \\ y\_{c1} \\ y\_{c2} \\ y\_{c3} \end{bmatrix}$
; $\textbf{x} = \begin{bmatrix} x\_{a1} \\ x\_{a2} \\ x\_{a3} \\ x\_{b1} \\ x\_{b2} \\ x\_{b3} \\ x\_{c1} \\ x\_{c2} \\ x\_{c3} \end{bmatrix}$; $\textbf{z} = \begin{bmatrix} z\_{a1} \\ z\_{a2} \\ z\_{a3} \\ z\_{b1} \\ z\_{b2} \\ z\_{b3} \\ z\_{c1} \\ z\_{c2} \\ z\_{c3} \end{bmatrix}$.

Let $\bar{y}\_{i} = \frac{1}{3}(y\_{ai} + y\_{bi}+y\_{ci})$, with $i = 1, 2, 3$, and equivalently for $x$ and $z$: $\bar{x}\_{i} = \frac{1}{3}(x\_{ai} + x\_{bi}+x\_{ci})$ and $\bar{z}\_{i} = \frac{1}{3}(z\_{ai} + z\_{bi}+z\_{ci})$, both for $i = 1, 2, 3$.

This is the correct way to get the CCEP estimator allowing for one common factor, as in the model described in the question:
\begin{equation\*}
\begin{split}
\begin{bmatrix} y\_{a1} \\ y\_{a2} \\ y\_{a3} \\ y\_{b1} \\ y\_{b2} \\ y\_{b3} \\ y\_{c1} \\ y\_{c2} \\ y\_{c3} \end{bmatrix} = \beta\_{1} \begin{bmatrix} x\_{a1} \\ x\_{a2} \\ x\_{a3} \\ x\_{b1} \\ x\_{b2} \\ x\_{b3} \\ x\_{c1} \\ x\_{c2} \\ x\_{c3} \end{bmatrix}+\beta\_{2}\begin{bmatrix} z\_{a1} \\ z\_{a2} \\ z\_{a3} \\ z\_{b1} \\ z\_{b2} \\ z\_{b3} \\ z\_{c1} \\ z\_{c2} \\ z\_{c3} \end{bmatrix}+
\gamma\_{a} \begin{bmatrix} \bar{y}\_{1} \\ \bar{y}\_{2} \\ \bar{y}\_{3} \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \end{bmatrix}
+\gamma\_{b} \begin{bmatrix} 0 \\ 0 \\ 0 \\ \bar{y}\_{1} \\ \bar{y}\_{2} \\ \bar{y}\_{3} \\ 0 \\ 0 \\ 0 \end{bmatrix} +
\gamma\_{c} \begin{bmatrix} 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ \bar{y}\_{1} \\ \bar{y}\_{2} \\ \bar{y}\_{3} \end{bmatrix} \\
- \beta\_{1}\gamma\_{a} \begin{bmatrix} \bar{x}\_{1} \\ \bar{x}\_{2} \\ \bar{x}\_{3} \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \end{bmatrix}
- \beta\_{1}\gamma\_{b} \begin{bmatrix} 0 \\ 0 \\ 0 \\ \bar{x}\_{1} \\ \bar{x}\_{2} \\ \bar{x}\_{3} \\ 0 \\ 0 \\ 0 \end{bmatrix}
-\beta\_{1} \gamma\_{c} \begin{bmatrix} 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ \bar{x}\_{1} \\ \bar{x}\_{2} \\ \bar{x}\_{3} \end{bmatrix}
-\beta\_{2} \gamma\_{a} \begin{bmatrix} \bar{z}\_{1} \\ \bar{z}\_{2} \\ \bar{z}\_{3} \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \end{bmatrix}
-\beta\_{2} \gamma\_{b} \begin{bmatrix} 0 \\ 0 \\ 0 \\ \bar{z}\_{1} \\ \bar{z}\_{2} \\ \bar{z}\_{3} \\ 0 \\ 0 \\ 0 \end{bmatrix}
-\beta\_{2} \gamma\_{c} \begin{bmatrix} 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ \bar{z}\_{1} \\ \bar{z}\_{2} \\ \bar{z}\_{3} \end{bmatrix} \\
+ \phi\_{a} + \phi\_{b} + \phi\_{c} + \mu\_{it}
\end{split}
\end{equation\*}
Here, $\phi\_{a},\ \phi\_{b},$ and $\phi\_{c}$ are cross-sectional fixed effects and $\mu\_{it}$ a well-behaved error-term that does not require any restrictions.

An interesting remark is that if the six $\beta$s that appear together with the $\gamma$s are not restricted to be equal to each other *and* equal to the first two $\beta$s, more than one common factor is allowed.


---

