PANEL Procedure

Two-Way Random-Effects Model (RANTWO Option)

You perform two-way random-effects estimation by specifying the RANTWO option in the MODEL statement (or by specifying nothing, because RANTWO is the default). The specification for the two-way random-effects model is

u Subscript i t Baseline equals nu Subscript i Baseline plus lamda Subscript t Baseline plus e Subscript i t

where the nu Subscript i are iid with zero mean and variance sigma Subscript nu Superscript 2, the lamda Subscript t are iid with zero mean and variance sigma Subscript lamda Superscript 2, and the e Subscript i t are iid with zero mean and variance sigma Subscript e Superscript 2. Furthermore, a random-effects specification assumes that the error terms are mutually uncorrelated and that each error term is uncorrelated with bold upper X.

Estimation proceeds in two steps. First, you obtain estimates of the variance components sigma Subscript nu Superscript 2, sigma Subscript lamda Superscript 2, and sigma Subscript e Superscript 2. The PANEL procedure provides four methods of estimating variance components; these methods are described in the following subsections.

Second, with the variance-component estimates in hand, you transform the data in such a way that estimation can take place using ordinary least squares (OLS). In two-way models with unbalanced data, the transformation is quite complex. Throughout this section, bold y and bold upper X are treated as being sorted first by time, and then by cross section within time. For the definitions of the design matrices bold upper D Subscript upper N and bold upper D Subscript upper T, see the section Two-Way Fixed-Effects Model (FIXTWO Option). The variance of bold y is

bold upper Omega equals sigma Subscript e Superscript 2 Baseline bold upper I Subscript upper M Baseline plus sigma Subscript nu Superscript 2 Baseline bold upper D Subscript upper N Baseline bold upper D Subscript upper N Superscript prime Baseline plus sigma Subscript lamda Superscript 2 Baseline bold upper D Subscript upper T Baseline bold upper D Subscript upper T Superscript prime

and estimation proceeds as OLS regression of ModifyingAbove sigma With caret Subscript e Baseline ModifyingAbove bold upper Omega With caret Superscript negative 1 slash 2 Baseline bold y on ModifyingAbove sigma With caret Subscript e Baseline ModifyingAbove bold upper Omega With caret Superscript negative 1 slash 2 Baseline bold upper X Subscript alpha.

Rather than invert the upper M times upper M matrix ModifyingAbove bold upper Omega With caret directly, Wansbeek and Kapteyn (1989) provide the more convenient form

ModifyingAbove sigma With caret Subscript e Superscript 2 Baseline ModifyingAbove normal upper Omega With caret Superscript negative 1 Baseline equals bold upper V minus bold upper V bold upper D Subscript upper T Baseline bold upper P overTilde Superscript negative 1 Baseline bold upper D Subscript upper T Superscript prime Baseline bold upper V

where

StartLayout 1st Row 1st Column bold upper V 2nd Column equals 3rd Column bold upper I Subscript upper M Baseline minus bold upper D Subscript upper N Baseline normal upper Delta overTilde Subscript upper N Superscript negative 1 Baseline bold upper D prime Subscript upper N 2nd Row 1st Column bold upper P overTilde 2nd Column equals 3rd Column normal upper Delta overTilde Subscript upper T Baseline minus bold upper D Subscript upper T Superscript prime Baseline bold upper D Subscript upper N Baseline normal upper Delta overTilde Subscript upper N Superscript negative 1 Baseline bold upper D Subscript upper N Superscript prime Baseline bold upper D Subscript upper T EndLayout

with normal upper Delta overTilde Subscript upper N Baseline equals bold upper D Subscript upper N Superscript prime Baseline bold upper D Subscript upper N Baseline plus left-parenthesis ModifyingAbove sigma With caret Subscript e Superscript 2 Baseline slash ModifyingAbove sigma With caret Subscript nu Superscript 2 Baseline right-parenthesis bold upper I Subscript upper N and normal upper Delta overTilde Subscript upper T Baseline equals bold upper D Subscript upper T Superscript prime Baseline bold upper D Subscript upper T Baseline plus left-parenthesis ModifyingAbove sigma With caret Subscript e Superscript 2 Baseline slash ModifyingAbove sigma With caret Subscript lamda Superscript 2 Baseline right-parenthesis bold upper I Subscript upper T.

If the data are balanced, then the calculations are simplified considerably—the data are transformed from z Subscript i t to z Subscript i t Baseline minus ModifyingAbove theta With caret Subscript 1 Baseline z overbar Subscript i period minus ModifyingAbove theta With caret Subscript 2 Baseline z overbar Subscript period t plus ModifyingAbove theta With caret Subscript 3 Baseline z overbar Subscript period period, where

StartLayout 1st Row 1st Column ModifyingAbove theta With caret Subscript 1 2nd Column equals 1 minus ModifyingAbove sigma With caret Subscript e Baseline left-parenthesis upper T ModifyingAbove sigma With caret Subscript nu Superscript 2 Baseline plus ModifyingAbove sigma With caret Subscript e Superscript 2 Baseline right-parenthesis Superscript negative 1 slash 2 Baseline 2nd Row 1st Column ModifyingAbove theta With caret Subscript 2 2nd Column equals 1 minus ModifyingAbove sigma With caret Subscript e Baseline left-parenthesis upper N ModifyingAbove sigma With caret Subscript lamda Superscript 2 Baseline plus ModifyingAbove sigma With caret Subscript e Superscript 2 Baseline right-parenthesis Superscript negative 1 slash 2 Baseline 3rd Row 1st Column ModifyingAbove theta With caret Subscript 3 2nd Column equals ModifyingAbove theta With caret Subscript 1 Baseline plus ModifyingAbove theta With caret Subscript 2 Baseline plus ModifyingAbove sigma With caret Subscript e Baseline left-parenthesis upper T ModifyingAbove sigma With caret Subscript nu Superscript 2 Baseline plus upper N ModifyingAbove sigma With caret Subscript lamda Superscript 2 Baseline plus ModifyingAbove sigma With caret Subscript e Superscript 2 Baseline right-parenthesis Superscript negative 1 slash 2 Baseline minus 1 EndLayout

The PANEL procedure provides four methods of estimating variance components, as described in the following subsections.

Wallace-Hussain Method

You can use the Wallace-Hussain (1969) method of estimating variance components by specifying the VCOMP=WH option in the MODEL statement. The Wallace-Hussain method is part of a class of methods known as analysis of variance (ANOVA) estimators.

ANOVA estimators obtain variance components by solving a system of equations that is based on expected sums of squares. The following quadratic forms correspond to the two-way within sum of squares, the sum of squares between time periods, and the sum of squares between cross sections, respectively:

StartLayout 1st Row 1st Column q Subscript e 2nd Column equals bold u Superscript prime Baseline bold upper P bold u 2nd Row 1st Column q Subscript lamda 2nd Column equals bold u Superscript prime Baseline bold upper D Subscript upper T Baseline normal upper Delta Subscript upper T Superscript negative 1 Baseline bold upper D Subscript upper T Superscript prime Baseline bold u 3rd Row 1st Column q Subscript nu 2nd Column equals bold u Superscript prime Baseline bold upper D Subscript upper N Baseline normal upper Delta Subscript upper N Superscript negative 1 Baseline bold upper D Subscript upper N Superscript prime Baseline bold u EndLayout

The matrix bold upper P is the two-way within transformation defined in the section Two-Way Fixed-Effects Model (FIXTWO Option), normal upper Delta Subscript upper T Baseline equals bold upper D Subscript upper T Superscript prime Baseline bold upper D Subscript upper T, normal upper Delta Subscript upper N Baseline equals bold upper D Subscript upper N Superscript prime Baseline bold upper D Subscript upper N, and bold u is the vector of true residuals.

The ANOVA methods differ only in how they estimate bold u. The Wallace-Hussain method is an ANOVA method that uses the residuals from pooled (OLS) regression, ModifyingAbove bold u With caret Subscript p, in all three quadratic forms.

The expected values of the quadratic forms are

StartLayout 1st Row 1st Column upper E left-parenthesis ModifyingAbove bold u With caret Subscript p Superscript prime Baseline bold upper P ModifyingAbove bold u With caret Subscript p Baseline right-parenthesis 2nd Column equals d 11 sigma Subscript e Superscript 2 Baseline plus d 12 sigma Subscript nu Superscript 2 Baseline plus d 13 sigma Subscript lamda Superscript 2 Baseline 2nd Row 1st Column upper E left-parenthesis ModifyingAbove bold u With caret Subscript p Superscript prime Baseline bold upper P Subscript lamda Baseline ModifyingAbove bold u With caret Subscript p Baseline right-parenthesis 2nd Column equals d 21 sigma Subscript e Superscript 2 Baseline plus d 22 sigma Subscript nu Superscript 2 Baseline plus d 23 sigma Subscript lamda Superscript 2 Baseline 3rd Row 1st Column upper E left-parenthesis ModifyingAbove bold u With caret Subscript p Superscript prime Baseline bold upper P Subscript nu Baseline ModifyingAbove bold u With caret Subscript p Baseline right-parenthesis 2nd Column equals d 31 sigma Subscript e Superscript 2 Baseline plus d 32 sigma Subscript nu Superscript 2 Baseline plus d 33 sigma Subscript lamda Superscript 2 EndLayout

Define bold upper Sigma equals left-parenthesis bold upper X Subscript alpha Superscript prime Baseline bold upper X Subscript alpha Baseline right-parenthesis Superscript negative 1, which is the inverse crossproducts matrix from pooled regression. Also define bold upper S Subscript nu Baseline equals bold upper X Subscript alpha Superscript prime Baseline bold upper D Subscript upper N Baseline bold upper D Subscript upper N Superscript prime Baseline bold upper X Subscript alpha and bold upper S Subscript lamda Baseline equals bold upper X Subscript alpha Superscript prime Baseline bold upper D Subscript upper T Baseline bold upper D Subscript upper T Superscript prime Baseline bold upper X Subscript alpha, which are the individual-level sum of squares and the time-level sum of squares, respectively. The coefficients are

StartLayout 1st Row 1st Column d 11 2nd Column equals upper M minus upper N minus upper T plus 1 minus normal t normal r left-parenthesis bold upper X Subscript alpha Superscript prime Baseline bold upper P bold upper X Subscript alpha Baseline bold upper Sigma right-parenthesis 2nd Row 1st Column d 12 2nd Column equals normal t normal r left-parenthesis bold upper S Subscript nu Baseline bold upper Sigma bold upper X Subscript alpha Superscript prime Baseline bold upper P bold upper X Subscript alpha Baseline bold upper Sigma right-parenthesis 3rd Row 1st Column d 13 2nd Column equals normal t normal r left-parenthesis bold upper S Subscript lamda Baseline bold upper Sigma bold upper X Subscript alpha Superscript prime Baseline bold upper P bold upper X Subscript alpha Baseline bold upper Sigma right-parenthesis 4th Row 1st Column d 21 2nd Column equals upper T minus normal t normal r left-parenthesis bold upper X Subscript alpha Superscript prime Baseline bold upper P Subscript lamda Baseline bold upper X Subscript alpha Baseline bold upper Sigma right-parenthesis 5th Row 1st Column d 22 2nd Column equals upper T minus 2 normal t normal r left-parenthesis bold upper X Subscript alpha Superscript prime Baseline bold upper P Subscript lamda Baseline bold upper D Subscript upper N Baseline bold upper D Subscript upper N Superscript prime Baseline bold upper X Subscript alpha Baseline bold upper Sigma right-parenthesis plus normal t normal r left-parenthesis bold upper X Subscript alpha Superscript prime Baseline bold upper P Subscript lamda Baseline bold upper X Subscript alpha Baseline bold upper Sigma bold upper S Subscript nu Baseline bold upper Sigma right-parenthesis 6th Row 1st Column d 23 2nd Column equals upper M minus 2 normal t normal r left-parenthesis bold upper S Subscript lamda Baseline bold upper Sigma right-parenthesis plus normal t normal r left-parenthesis bold upper X Subscript alpha Superscript prime Baseline bold upper P Subscript lamda Baseline bold upper X Subscript alpha Baseline bold upper Sigma bold upper S Subscript lamda Baseline bold upper Sigma right-parenthesis 7th Row 1st Column d 31 2nd Column equals upper N minus normal t normal r left-parenthesis bold upper X Subscript alpha Superscript prime Baseline bold upper P Subscript nu Baseline bold upper X Subscript alpha Baseline bold upper Sigma right-parenthesis 8th Row 1st Column d 32 2nd Column equals upper M minus 2 normal t normal r left-parenthesis bold upper S Subscript nu Baseline bold upper Sigma right-parenthesis plus normal t normal r left-parenthesis bold upper X Subscript alpha Superscript prime Baseline bold upper P Subscript nu Baseline bold upper X Subscript alpha Baseline bold upper Sigma bold upper S Subscript nu Baseline bold upper Sigma right-parenthesis 9th Row 1st Column d 33 2nd Column equals upper N minus 2 normal t normal r left-parenthesis bold upper X Subscript alpha Superscript prime Baseline bold upper P Subscript nu Baseline bold upper D Subscript upper T Baseline bold upper D Subscript upper T Superscript prime Baseline bold upper X Subscript alpha Baseline bold upper Sigma right-parenthesis plus normal t normal r left-parenthesis bold upper X Subscript alpha Superscript prime Baseline bold upper P Subscript nu Baseline bold upper X Subscript alpha Baseline bold upper Sigma bold upper S Subscript lamda Baseline bold upper Sigma right-parenthesis EndLayout

Wansbeek-Kapteyn Method

You can use the Wansbeek-Kapteyn method of estimating variance components by specifying the VCOMP=WK option in the MODEL statement. The method is a specialization (Baltagi and Chang 1994) of the approach used by Wansbeek and Kapteyn (1989) for unbalanced two-way models.

The Wansbeek-Kapteyn method is an ANOVA method that uses the within residuals from two-way fixed effects, ModifyingAbove bold u With caret Subscript f, in all three quadratic forms.

The expected values of the quadratic forms are

StartLayout 1st Row 1st Column upper E left-parenthesis ModifyingAbove bold u With caret Subscript f Superscript prime Baseline bold upper P ModifyingAbove bold u With caret Subscript f Baseline right-parenthesis 2nd Column equals left-parenthesis upper M minus upper N minus upper T minus upper K plus 1 right-parenthesis sigma Subscript e Superscript 2 Baseline 2nd Row 1st Column upper E left-parenthesis ModifyingAbove bold u With caret Subscript f Superscript prime Baseline bold upper P Subscript lamda Baseline ModifyingAbove bold u With caret Subscript f Baseline right-parenthesis 2nd Column equals left-parenthesis upper T plus k Subscript upper N Baseline minus k 0 right-parenthesis sigma Subscript e Superscript 2 Baseline plus left-parenthesis upper T minus delta Subscript upper N Baseline right-parenthesis sigma Subscript nu Superscript 2 Baseline plus left-parenthesis upper M minus delta Subscript upper T Baseline right-parenthesis sigma Subscript lamda Superscript 2 Baseline 3rd Row 1st Column upper E left-parenthesis ModifyingAbove bold u With caret Subscript f Superscript prime Baseline bold upper P Subscript nu Baseline ModifyingAbove bold u With caret Subscript f Baseline right-parenthesis 2nd Column equals left-parenthesis upper N plus k Subscript upper T Baseline minus k 0 right-parenthesis sigma Subscript e Superscript 2 Baseline plus left-parenthesis upper M minus delta Subscript upper N Baseline right-parenthesis sigma Subscript nu Superscript 2 Baseline plus left-parenthesis upper N minus delta Subscript upper T Baseline right-parenthesis sigma Subscript lamda Superscript 2 EndLayout

where delta Subscript upper N Baseline equals upper M Superscript negative 1 Baseline sigma-summation Underscript i equals 1 Overscript upper N Endscripts upper T Subscript i Superscript 2 and delta Subscript upper T Baseline equals upper M Superscript negative 1 Baseline sigma-summation Underscript t equals 1 Overscript upper T Endscripts upper N Subscript t Superscript 2. The other constants are defined by

StartLayout 1st Row 1st Column k 0 2nd Column equals 1 plus upper M Superscript negative 1 Baseline bold j Subscript upper M Superscript prime Baseline bold upper X left-parenthesis bold upper X Superscript prime Baseline bold upper P bold upper X right-parenthesis Superscript negative 1 Baseline bold upper X Superscript prime Baseline bold j Subscript upper M Baseline 2nd Row 1st Column k Subscript upper N 2nd Column equals normal t normal r StartSet left-parenthesis bold upper X Superscript prime Baseline bold upper P bold upper X right-parenthesis Superscript negative 1 Baseline bold upper X Superscript prime Baseline bold upper P Subscript lamda Baseline bold upper X EndSet 3rd Row 1st Column k Subscript upper T 2nd Column equals normal t normal r StartSet left-parenthesis bold upper X Superscript prime Baseline bold upper P bold upper X right-parenthesis Superscript negative 1 Baseline bold upper X Superscript prime Baseline bold upper P Subscript nu Baseline bold upper X EndSet EndLayout

When the NOINT option is specified, the variance-component equations change slightly: k 0, delta Subscript upper N, and delta Subscript upper T are all replaced by 0.

The Wansbeek-Kapteyn method is the default method when the data are unbalanced.

Fuller-Battese Method

You can use the Fuller-Battese (1974) method of estimating variance components by specifying the VCOMP=FB option in the MODEL statement. Following the discussion in Baltagi, Song, and Jung (2002), the Fuller-Battese method is a variation of the two ANOVA methods discussed previously in this section.

The quadratic form, q Subscript e, is the same as in the previous methods, and bold u is estimated by the two-way within residuals ModifyingAbove bold u With caret Subscript f. The other two quadratic forms, q Subscript lamda and q Subscript nu, are replaced by the error sums of squares from one-way fixed-effects estimations.

The resulting system of equations is

StartLayout 1st Row 1st Column upper E left-parenthesis ModifyingAbove bold u With caret Subscript f Superscript prime Baseline bold upper P ModifyingAbove bold u With caret Subscript f Baseline right-parenthesis 2nd Column equals left-parenthesis upper M minus upper N minus upper T minus upper K plus 1 right-parenthesis sigma Subscript e Superscript 2 Baseline 2nd Row 1st Column upper E left-parenthesis bold u overTilde Subscript lamda Superscript prime Baseline bold u overTilde Subscript lamda Baseline right-parenthesis 2nd Column equals left-parenthesis upper M minus upper T minus upper K right-parenthesis sigma Subscript e Superscript 2 Baseline plus left-bracket upper M minus upper T minus normal t normal r StartSet bold upper X Superscript prime Baseline bold upper W Subscript lamda Baseline bold upper D Subscript upper N Baseline bold upper D Subscript upper N Superscript prime Baseline bold upper W Subscript lamda Baseline bold upper X left-parenthesis bold upper X Superscript prime Baseline bold upper W Subscript lamda Baseline bold upper X right-parenthesis Superscript negative 1 Baseline EndSet right-bracket sigma Subscript nu Superscript 2 Baseline 3rd Row 1st Column upper E left-parenthesis bold u overTilde Subscript nu Superscript prime Baseline bold u overTilde Subscript nu Baseline right-parenthesis 2nd Column equals left-parenthesis upper M minus upper N minus upper K right-parenthesis sigma Subscript e Superscript 2 Baseline plus left-bracket upper M minus upper N minus normal t normal r StartSet bold upper X Superscript prime Baseline bold upper W Subscript nu Baseline bold upper D Subscript upper T Baseline bold upper D Subscript upper T Superscript prime Baseline bold upper W Subscript nu Baseline bold upper X left-parenthesis bold upper X Superscript prime Baseline bold upper W Subscript nu Baseline bold upper X right-parenthesis Superscript negative 1 Baseline EndSet right-bracket sigma Subscript lamda Superscript 2 EndLayout

where bold upper W Subscript lamda Baseline equals bold upper I Subscript upper M Baseline minus bold upper P Subscript lamda, bold upper W Subscript nu Baseline equals bold upper I Subscript upper M Baseline minus bold upper P Subscript nu, bold u overTilde Subscript lamda are the residuals from a one-way model with time fixed effects, and bold u overTilde Subscript nu are the residuals from a one-way model with individual fixed effects.

The Fuller-Battese method is the default method when the data are balanced.

Nerlove Method

You can use the Nerlove (1971) method of estimating variance components by specifying the VCOMP=NL option in the MODEL statement.

You begin by fitting a two-way fixed-effects model. The estimator of the error variance is

ModifyingAbove sigma With caret Subscript e Superscript 2 Baseline equals upper M Superscript negative 1 Baseline ModifyingAbove bold u With caret Subscript f Superscript prime Baseline bold upper P ModifyingAbove bold u With caret Subscript f

You obtain ModifyingAbove sigma With caret Subscript nu Superscript 2 as the sample variance of the N estimated individual effects, and ModifyingAbove sigma With caret Subscript lamda Superscript 2 as the sample variance of the T estimated time effects.

Last updated: June 19, 2025