Skip to main content

Seemingly Unrelated Regression: Do General Electric and Westinghouse Invest Alike?

Seemingly unrelated regression (SUR) in R, by hand and with systemfit, on Grunfeld’s investment data of US firms (1935-1954), the example of Zellner’s original paper: why equations with correlated errors should be estimated together, feasible GLS with the Kronecker product, when SUR gives the same as OLS, the Breusch-Pagan test, tests between equations, iterated SUR and maximum likelihood, a simulation of the gain and of standard errors that are too small, and APA reporting.

The question: two firms, two equations, one economy

General Electric and Westinghouse were the two giants of electrical engineering in the United States. How much did each of them invest in new equipment every year, and what did it depend on? Grunfeld’s theory says: on the value of the firm (what the market expects of it) and on the capital that it already has (which must be replaced). So there is a regression for each firm:

\[\begin{aligned} \text{invest}_{GE,t} &= \beta_{1} + \beta_{2}\,\text{value}_{GE,t} + \beta_{3}\,\text{capital}_{GE,t} + \varepsilon_{GE,t} \\ \text{invest}_{W,t} &= \gamma_{1} + \gamma_{2}\,\text{value}_{W,t} + \gamma_{3}\,\text{capital}_{W,t} + \varepsilon_{W,t} \end{aligned}\]

The two equations have nothing in common. Different firms, different outcomes, different predictors, different coefficients. They seem unrelated. But both firms lived through the same years. A good year for the whole industry, which neither value nor capital explains, makes both errors positive. Then the error of one equation contains information about the error of the other.

Arnold Zellner (1962) showed how to use this information. His method, seemingly unrelated regressions (SUR), estimates the equations together and gets more precise coefficients than separate regressions. His example was this one, with these two firms.

SUR is the neighbor of multivariate regression. There, all equations have the same predictors, and joint estimation changes nothing. Here the predictors differ, and it does.

Code
library(ggplot2)
library(systemfit)   # systems of equations: OLS, SUR and others
library(lmtest)      # dwtest(): autocorrelation

firm_colours <- c("General Electric" = "#2a78d6", "Westinghouse" = "#eb6834")

# number formats for the text
f1   <- function(x) formatC(x, format = "f", digits = 1, big.mark = ",")
f2   <- function(x) formatC(x, format = "f", digits = 2, big.mark = ",")
f3   <- function(x) formatC(x, format = "f", digits = 3, big.mark = ",")
f4   <- function(x) formatC(x, format = "f", digits = 4, big.mark = ",")
# no leading zero
nz <- function(x, d = 2) sub("^(-?)0", "\\1", formatC(x, format = "f", digits = d))
pval <- function(p) if (p < .001) "< .001" else paste("=", nz(p, 3))

1. The data

Grunfeld’s data have been used in so many textbooks that several wrong versions went around. Kleiber and Zeileis (2010) went back to the original and corrected them. Their version is in the R package AER, and as a CSV file in the Rdatasets collection:

Code
grunfeld <- read.csv("https://vincentarelbundock.github.io/Rdatasets/csv/AER/Grunfeld.csv")
head(grunfeld[, c("firm", "year", "invest", "value", "capital")], 3)
            firm year invest  value capital
1 General Motors 1935  317.6 3078.5     2.8
2 General Motors 1936  391.8 4661.7    52.6
3 General Motors 1937  410.6 5387.1   156.9
Code
ge <- subset(grunfeld, firm == "General Electric")
wh <- subset(grunfeld, firm == "Westinghouse")
all(ge$year == wh$year)
[1] TRUE
Code
c(years = nrow(ge), from = min(ge$year), to = max(ge$year))
years  from    to 
   20  1935  1954 

There are 20 years, 1935 to 1954, for each firm. All amounts are in millions of dollars, in constant prices. invest is the gross investment of the year, value the market value of the firm at the beginning of the year and capital its stock of plant and equipment.


2. Look at the data

Code
both <- rbind(ge, wh)
ggplot(both, aes(year, invest, colour = firm)) +
  geom_line(linewidth = 0.9) + geom_point(size = 2) +
  scale_colour_manual(values = firm_colours, name = NULL) +
  labs(title = "Investment of the two firms", x = NULL, y = "million dollars (constant prices)") +
  theme_bw() + theme(legend.position = "bottom")

Plot: 2. Look at the data

General Electric is the larger firm, and the two series move together. But do the errors of the two regressions move together? That is what matters.

Code
ols_ge <- lm(invest ~ value + capital, data = ge)
ols_wh <- lm(invest ~ value + capital, data = wh)
round(
  rbind(GE = coef(summary(ols_ge))["value", ], Westinghouse = coef(summary(ols_wh))["value", ]),
  4
)
             Estimate Std. Error t value Pr(>|t|)
GE             0.0266     0.0156  1.7057   0.1063
Westinghouse   0.0529     0.0157  3.3677   0.0037
Code
r_errors <- cor(resid(ols_ge), resid(ols_wh))
r_errors
[1] 0.728965
Code
errors <- data.frame(year = ge$year, GE = resid(ols_ge), W = resid(ols_wh))
ggplot(errors, aes(GE, W)) +
  geom_hline(yintercept = 0, colour = "grey70") + geom_vline(xintercept = 0, colour = "grey70") +
  geom_point(size = 2, colour = "grey25") +
  geom_text(aes(label = year), size = 2.8, nudge_y = 1.4, colour = "grey40") +
  labs(title = "Residuals of the two separate regressions",
       x = "General Electric (million dollars)", y = "Westinghouse (million dollars)") +
  theme_bw()

Residuals – 2. Look at the data

They do: the residuals of the two regressions correlate at 0.73. In 1941 and 1947, for example, both firms invested more than their values and capitals explain, and in 1950 both invested less. The two regressions are not unrelated at all.


3. The model step by step, with formulas

Step 1: the errors of one year are correlated

Let \(m\) be the number of equations (firms) and \(T\) the number of years. Within a year, the errors of the equations have a covariance matrix \(\Sigma\). Between years, the errors are independent:

\[\text{Cov}(\varepsilon_{it}, \varepsilon_{jt}) = \sigma_{ij}, \qquad \text{Cov}(\varepsilon_{it}, \varepsilon_{js}) = 0 \;\text{ for } t \ne s\]

Step 2: stack the equations

Write the two outcomes one below the other, and the predictors in blocks:

\[\underbrace{\begin{pmatrix} y_{GE} \\ y_W \end{pmatrix}}_{y} = \underbrace{\begin{pmatrix} X_{GE} & 0 \\ 0 & X_W \end{pmatrix}}_{X} \begin{pmatrix} \beta \\ \gamma \end{pmatrix} + \begin{pmatrix} \varepsilon_{GE} \\ \varepsilon_W \end{pmatrix}, \qquad \text{Cov}(\varepsilon) = \Sigma \otimes I_T\]

The Kronecker product \(\Sigma \otimes I_T\) is a matrix of \(2 \times 2\) blocks: in each block, \(\sigma_{ij}\) on the diagonal, because only errors of the same year are related. It is now one regression with correlated errors, which is generalized least squares (see this page):

\[\hat\beta_{SUR} = \big(X^\top (\Sigma^{-1} \otimes I)\, X\big)^{-1} X^\top (\Sigma^{-1} \otimes I)\, y, \qquad \text{Var}(\hat\beta_{SUR}) = \big(X^\top (\Sigma^{-1} \otimes I)\, X\big)^{-1}\]

Step 3: \(\Sigma\) is unknown, so estimate it

  1. Estimate each equation by OLS, and keep the residuals.
  2. \(\hat\sigma_{ij} = \sum_t e_{it} e_{jt} / T\). (Dividing by \(T - k\) instead, with \(k\) coefficients per equation, is the other common choice.)
  3. Put \(\hat\Sigma\) into the formula: feasible GLS.

The step from 1 to 3 can be repeated with the new residuals until nothing changes. The end is the maximum likelihood estimate for normal errors.

Step 4: where the gain comes from

Suppose the residual of General Electric in 1946 is large and positive. Because the errors correlate, we expect a positive error for Westinghouse in 1946, too. SUR takes that expected error out of Westinghouse’s investment before it looks for the slope. It is like a covariate that OLS does not have.

Step 5: when there is nothing to gain

Two cases give exactly the OLS estimates:

  • The errors are uncorrelated (\(\sigma_{ij} = 0\)): no information to pass on.
  • All equations have the same predictors: the covariate of step 4 would be orthogonal to the predictors by construction.

The gain is largest when the errors are highly correlated and the predictors are not.


4. The estimates by hand

Code
X_ge <- model.matrix(ols_ge); X_wh <- model.matrix(ols_wh)
Tn <- nrow(X_ge); k <- ncol(X_ge)
Z  <- matrix(0, Tn, k)
X  <- rbind(cbind(X_ge, Z), cbind(Z, X_wh))                            # the block matrix of step 2
y  <- c(ge$invest, wh$invest)
colnames(X) <- c(
  paste0("GE_", c("intercept", "value", "capital")),
  paste0("W_", c("intercept", "value", "capital"))
)

E     <- cbind(GE = resid(ols_ge), W = resid(ols_wh))
Sigma <- crossprod(E) / Tn
round(Sigma, 1)
      GE     W
GE 660.8 176.4
W  176.4  88.7
Code
W     <- kronecker(solve(Sigma), diag(Tn))                             # inverse of Sigma ⊗ I
V_sur <- solve(t(X) %*% W %*% X)
b_sur <- drop(V_sur %*% t(X) %*% W %*% y)
cbind(OLS = c(coef(ols_ge), coef(ols_wh)), SUR = b_sur, SE_SUR = sqrt(diag(V_sur)))
                    OLS          SUR      SE_SUR
(Intercept) -9.95630645 -27.71931712 27.03282800
value        0.02655119   0.03831021  0.01329011
capital      0.15169387   0.13903627  0.02303559
(Intercept) -0.50939018  -1.25198823  6.95634669
value        0.05289413   0.05762980  0.01341101
capital      0.09240649   0.06397807  0.04890100

With the package, the equations are a list of formulas. The data must be in wide form, one row per year:

Code
wide <- data.frame(year = ge$year,
                   invest_ge = ge$invest, value_ge = ge$value, capital_ge = ge$capital,
                   invest_wh = wh$invest, value_wh = wh$value, capital_wh = wh$capital)
equations <- list(GE = invest_ge ~ value_ge + capital_ge,
                  W  = invest_wh ~ value_wh + capital_wh)
ols <- systemfit(equations, method = "OLS", data = wide)
# divide by T, as by hand
sur <- systemfit(equations, method = "SUR", data = wide, methodResidCov = "noDfCor")
max(abs(coef(sur) - b_sur))
[1] 6.06093e-12
Code
max(abs(sqrt(diag(vcov(sur))) - sqrt(diag(V_sur))))
[1] 5.400125e-13

The differences are zero. methodResidCov = "noDfCor" divides by \(T\). The default of systemfit(), "geomean", divides by the degrees of freedom. It leaves the estimates as they are when all equations have the same number of coefficients, and it makes the standard errors a little larger. With 20 years that is the safer choice, so we use it from here on:

Code
sur <- systemfit(equations, method = "SUR", data = wide)
summary(sur)

systemfit results 
method: SUR 

        N DF     SSR detRCov   OLS-R2 McElroy-R2
system 40 34 15589.7 35640.6 0.698968   0.615103

    N DF     SSR     MSE    RMSE       R2   Adj R2
GE 20 17 13788.4 811.081 28.4795 0.692557 0.656388
W  20 17  1801.3 105.959 10.2936 0.740401 0.709860

The covariance matrix of the residuals used for estimation
        GE       W
GE 777.446 207.587
W  207.587 104.308

The covariance matrix of the residuals
        GE       W
GE 811.081 224.278
W  224.278 105.959

The correlations of the residuals
         GE        W
GE 1.000000 0.765043
W  0.765043 1.000000


SUR estimates for 'GE' (equation 1)
Model Formula: invest_ge ~ value_ge + capital_ge

               Estimate  Std. Error  t value   Pr(>|t|)    
(Intercept) -27.7193171  29.3212188 -0.94537   0.357716    
value_ge      0.0383102   0.0144152  2.65763   0.016575 *  
capital_ge    0.1390363   0.0249856  5.56466 3.4234e-05 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 28.479483 on 17 degrees of freedom
Number of observations: 20 Degrees of Freedom: 17 
SSR: 13788.375833 MSE: 811.080931 Root MSE: 28.479483 
Multiple R-Squared: 0.692557 Adjusted R-Squared: 0.656388 


SUR estimates for 'W' (equation 2)
Model Formula: invest_wh ~ value_wh + capital_wh

              Estimate Std. Error  t value  Pr(>|t|)   
(Intercept) -1.2519882  7.5452174 -0.16593 0.8701684   
value_wh     0.0576298  0.0145463  3.96182 0.0010072 **
capital_wh   0.0639781  0.0530406  1.20621 0.2442559   
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 10.293633 on 17 degrees of freedom
Number of observations: 20 Degrees of Freedom: 17 
SSR: 1801.300878 MSE: 105.958875 Root MSE: 10.293633 
Multiple R-Squared: 0.740401 Adjusted R-Squared: 0.70986 
Code
b <- coef(sur); se <- sqrt(diag(vcov(sur))); se_ols <- sqrt(diag(vcov(ols)))

How to read the output

  • Covariance of the residuals used for estimation is \(\hat\Sigma\) from the OLS residuals, and ... correlations of the residuals shows the link between the equations, after the final fit.
  • The coefficients of each equation are read as in any regression. One million dollars more in the value of General Electric goes with 0.038 million more investment in the year, and for Westinghouse with 0.058.
  • McElroy R² is a single \(R^2\) for the whole system. The \(R^2\) of an equation can be lower than with OLS, because OLS makes each \(R^2\) as large as possible, and SUR does not aim for that.
Code
gain <- data.frame(
  term = names(b),
  OLS = coef(ols),
  SE_OLS = se_ols,
  SUR = b,
  SE_SUR = se,
  ratio = se / se_ols,
  row.names = NULL
)
print(cbind(term = gain$term, round(gain[, -1], 4)), row.names = FALSE)
           term     OLS  SE_OLS      SUR  SE_SUR  ratio
 GE_(Intercept) -9.9563 31.3742 -27.7193 29.3212 0.9346
    GE_value_ge  0.0266  0.0156   0.0383  0.0144 0.9261
  GE_capital_ge  0.1517  0.0257   0.1390  0.0250 0.9720
  W_(Intercept) -0.5094  8.0153  -1.2520  7.5452 0.9414
     W_value_wh  0.0529  0.0157   0.0576  0.0145 0.9261
   W_capital_wh  0.0924  0.0561   0.0640  0.0530 0.9455
Code
rows <- c("GE_value_ge", "GE_capital_ge", "W_value_wh", "W_capital_wh")
plot_data <- rbind(
  data.frame(term = rows, est = coef(ols)[rows], se = se_ols[rows], method = "OLS"),
  data.frame(term = rows, est = b[rows], se = se[rows], method = "SUR")
)
plot_data$label <- factor(
  plot_data$term,
  levels = rev(rows),
  labels = rev(c("GE: value", "GE: capital", "Westinghouse: value", "Westinghouse: capital"))
)
t_crit <- qt(0.975, Tn - k)

ggplot(plot_data, aes(est, label, colour = method)) +
  geom_vline(xintercept = 0, colour = "grey60") +
  geom_pointrange(
    aes(xmin = est - t_crit * se, xmax = est + t_crit * se),
    position = position_dodge(width = 0.5),
    linewidth = 0.8
  ) +
  scale_colour_manual(values = c(OLS = "#eb6834", SUR = "#2a78d6"), name = NULL) +
  labs(
    title = "Separate (OLS) and joint (SUR) estimates with 95% intervals",
    x = "coefficient",
    y = NULL
  ) +
  theme_bw() +
  theme(legend.position = "bottom")

Gain chart – How to read the output

The standard errors of SUR are 2.8 to 7.4% smaller for the slopes. The estimates move too: the slope of value for General Electric goes from 0.027 (t = 1.71) to 0.038 (t = 2.66).


5. Tests

Do the two firms invest alike?

The question of the title compares coefficients between equations. Separate regressions cannot do it properly: the two estimates are correlated. In the system it is an ordinary linear hypothesis, with the covariance matrix of all six coefficients:

\[H_0:\; \beta_2 = \gamma_2 \;\text{ and }\; \beta_3 = \gamma_3\]

Code
equal_slopes <- linearHypothesis(
  sur,
  c("GE_value_ge - W_value_wh = 0", "GE_capital_ge - W_capital_wh = 0"),
  test = "F"
)
equal_slopes
Linear hypothesis test (F statistic of a Wald test)

Hypothesis:
GE_value_ge - W_value_wh = 0
GE_capital_ge - W_capital_wh = 0

Model 1: restricted model
Model 2: sur

  Res.Df Df      F Pr(>F)
1     36                 
2     34  2 2.0004 0.1509
Code
difference <- function(term_a, term_b) {
  d <- b[[term_a]] - b[[term_b]]
  s <- sqrt(vcov(sur)[term_a, term_a] + vcov(sur)[term_b, term_b] - 2 * vcov(sur)[term_a, term_b])
  c(difference = d, SE = s, t = d / s)
}
diffs <- rbind(
  value = difference("GE_value_ge", "W_value_wh"),
  capital = difference("GE_capital_ge", "W_capital_wh")
)
diffs
         difference         SE         t
value   -0.01931959 0.01170707 -1.650250
capital  0.07505821 0.04514405  1.662638

We cannot say that the slopes differ, F(2, 34) = 2.00, p = .151. That is not evidence that they are the same: with 20 years the standard errors of the differences are large. If theory says that the slopes are equal, we can impose it, and estimate them with both firms’ data:

Code
restricted <- systemfit(
  equations,
  method = "SUR",
  data = wide,
  restrict.matrix = c("GE_value_ge - W_value_wh = 0", "GE_capital_ge - W_capital_wh = 0")
)
round(coef(summary(restricted))[c("GE_value_ge", "GE_capital_ge"), 1:2], 4)
              Estimate Std. Error
GE_value_ge     0.0352     0.0088
GE_capital_ge   0.1410     0.0249

Iterating to maximum likelihood

Code
iterated <- systemfit(
  equations,
  method = "SUR",
  data = wide,
  methodResidCov = "noDfCor",
  maxiter = 500,
  tol = 1e-8
)
cbind(two_steps = coef(sur), iterated = coef(iterated))
                  two_steps     iterated
GE_(Intercept) -27.71931712 -30.74846289
GE_value_ge      0.03831021   0.04051069
GE_capital_ge    0.13903627   0.13593073
W_(Intercept)   -1.25198823  -1.70160988
W_value_wh       0.05762980   0.05935211
W_capital_wh     0.06397807   0.05573547
Code
c(iterations = iterated$iter)
iterations 
        13 

Iterating changes the estimates a little. Both versions are equally good in large samples.


6. When does SUR help? Experiments

The same predictors: nothing happens

If each firm had all four predictors (its own and the other’s), the equations would have identical right-hand sides:

Code
same_rhs <- list(GE = invest_ge ~ value_ge + capital_ge + value_wh + capital_wh,
                 W  = invest_wh ~ value_ge + capital_ge + value_wh + capital_wh)
max(abs(
  coef(systemfit(same_rhs, method = "OLS", data = wide)) -
    coef(systemfit(same_rhs, method = "SUR", data = wide))
))
[1] 1.193534e-11

The largest difference between OLS and SUR is zero, up to rounding, although the errors are correlated. This is the case of multivariate regression.

A known truth: how large is the gain, and are the standard errors right?

We take the predictors of the real data, a truth equal to our SUR estimates, and errors with a chosen correlation. For each correlation we simulate 1,000 histories of 20 years, and compare the true spread of the estimates of one slope with the standard errors that the programs report:

Code
set.seed(12)
truth <- b_sur
sds   <- sqrt(diag(Sigma))
fit_both <- function(yy) {
  b_o <- c(qr.coef(qr(X_ge), yy[1:Tn]), qr.coef(qr(X_wh), yy[Tn + 1:Tn]))
  e <- matrix(yy - X %*% b_o, Tn)
  S <- crossprod(e) / (Tn - k) # the cautious version, with degrees of freedom
  Si <- solve(S)
  A <- rbind(
    cbind(Si[1, 1] * crossprod(X_ge), Si[1, 2] * crossprod(X_ge, X_wh)),
    cbind(Si[2, 1] * crossprod(X_wh, X_ge), Si[2, 2] * crossprod(X_wh))
  )
  y1 <- yy[1:Tn]
  y2 <- yy[Tn + 1:Tn]
  V <- solve(A)
  b_s <- V %*%
    c(
      Si[1, 1] * crossprod(X_ge, y1) + Si[1, 2] * crossprod(X_ge, y2),
      Si[2, 1] * crossprod(X_wh, y1) + Si[2, 2] * crossprod(X_wh, y2)
    )
  c(
    ols = b_o[[2]],
    sur = b_s[[2]],
    se_ols = sqrt(S[1, 1] * solve(crossprod(X_ge))[2, 2]),
    se_sur = sqrt(V[2, 2])
  )
}
rhos <- c(0, 0.3, 0.5, 0.73, 0.9)
experiment <- do.call(rbind, lapply(rhos, function(rho) {
  S0 <- diag(sds) %*% matrix(c(1, rho, rho, 1), 2) %*% diag(sds)
  L  <- t(chol(S0))
  r  <- replicate(1000, fit_both(drop(X %*% truth) + as.vector(t(L %*% matrix(rnorm(2 * Tn), 2)))))
  data.frame(rho, SD_OLS = sd(r["ols", ]), SD_SUR = sd(r["sur", ]),
             reported_OLS = mean(r["se_ols", ]), reported_SUR = mean(r["se_sur", ]))
}))
experiment$gain <- 1 - experiment$SD_SUR / experiment$SD_OLS
round(experiment, 4)
   rho SD_OLS SD_SUR reported_OLS reported_SUR    gain
1 0.00 0.0147 0.0148       0.0142       0.0141 -0.0031
2 0.30 0.0141 0.0141       0.0141       0.0139 -0.0040
3 0.50 0.0148 0.0147       0.0143       0.0138  0.0038
4 0.73 0.0142 0.0134       0.0142       0.0130  0.0589
5 0.90 0.0151 0.0124       0.0142       0.0110  0.1745
Code
sim_long <- rbind(
  data.frame(rho = rhos, sd = experiment$SD_OLS, what = "OLS: true spread"),
  data.frame(rho = rhos, sd = experiment$SD_SUR, what = "SUR: true spread"),
  data.frame(rho = rhos, sd = experiment$reported_SUR, what = "SUR: reported standard error")
)
ggplot(sim_long, aes(rho, sd, colour = what, linetype = what)) +
  geom_line(linewidth = 1) +
  geom_point(size = 2.2) +
  scale_colour_manual(
    values = c("#eb6834", "#2a78d6", "#2a78d6"),
    name = NULL,
    breaks = c("OLS: true spread", "SUR: true spread", "SUR: reported standard error")
  ) +
  scale_linetype_manual(
    values = c("solid", "solid", "dashed"),
    name = NULL,
    breaks = c("OLS: true spread", "SUR: true spread", "SUR: reported standard error")
  ) +
  scale_y_continuous(limits = c(0, NA)) +
  labs(
    title = "The slope of value for General Electric, 1,000 simulations each",
    x = "correlation of the errors of the two equations",
    y = "standard deviation of the estimate"
  ) +
  theme_bw() +
  theme(legend.position = "bottom", legend.direction = "vertical")

Simulation chart – A known truth: how large is the gain, and are the standard errors right?

  • With uncorrelated errors SUR gains nothing (-0.3%). It even loses a little, because it estimates a correlation that is zero.
  • With the correlation of our data (0.73) the estimates are 5.9% more precise, and with 0.9, 17.4%.
  • The reported standard errors of SUR are smaller than the true spread: 0.0130 against 0.0134 at 0.73. The formula takes \(\hat\Sigma\) for the true \(\Sigma\). With 20 years and two equations the error is small. It grows with the number of equations, as the third experiment shows.

Five firms

Code
five <- c("General Motors", "Chrysler", "General Electric", "Westinghouse", "US Steel")
fits <- lapply(five, function(f) lm(invest ~ value + capital, data = subset(grunfeld, firm == f)))
R5 <- cor(sapply(fits, resid)); dimnames(R5) <- list(five, five)
round(R5, 2)
                 General Motors Chrysler General Electric Westinghouse US Steel
General Motors             1.00    -0.27             0.28         0.16    -0.26
Chrysler                  -0.27     1.00            -0.07         0.12     0.34
General Electric           0.28    -0.07             1.00         0.73     0.43
Westinghouse               0.16     0.12             0.73         1.00     0.61
US Steel                  -0.26     0.34             0.43         0.61     1.00
Code
lm5 <- Tn * sum(R5[lower.tri(R5)]^2)
c(LM = lm5, df = 10, p = pchisq(lm5, 10, lower.tail = FALSE))
          LM           df            p 
29.321519845 10.000000000  0.001105083 
Code
panel5 <- plm::pdata.frame(
  subset(grunfeld, firm %in% five)[, c("firm", "year", "invest", "value", "capital")],
  index = c("firm", "year")
)
sur5 <- systemfit(invest ~ value + capital, method = "SUR", data = panel5)
ols5 <- systemfit(invest ~ value + capital, method = "OLS", data = panel5)
ratio5 <- sqrt(diag(vcov(sur5)) / diag(vcov(ols5)))
ge_rows <- c("General.Electric_value", "General.Electric_capital")
data.frame(
  two_firms = se[c("GE_value_ge", "GE_capital_ge")],
  five_firms = sqrt(diag(vcov(sur5)))[ge_rows],
  row.names = c("GE value", "GE capital")
)
            two_firms five_firms
GE value   0.01441515 0.01309729
GE capital 0.02498560 0.02361724

With five firms there are 10 correlations to estimate from 20 years. They range from -0.27 to 0.73: the electrical firms and US Steel go together, the car makers hardly go with them. The reported standard errors of General Electric get smaller with more firms. Can we believe them?

Many equations: the standard errors stop being true

Again a known truth: the predictors of 2, 5 and 10 of the firms, their OLS coefficients, and errors that correlate at 0.4 between all the firms. How does the reported standard error of the slope of value (first firm) compare with the true spread of the estimates?

Code
set.seed(13)
firms <- setdiff(unique(grunfeld$firm), "American Steel")             # ten firms
many <- function(m, reps = 500) {
  d <- lapply(c("General Electric", setdiff(firms, "General Electric"))[1:m], function(f) {
    subset(grunfeld, firm == f)
  })
  Xs <- lapply(d, function(z) cbind(1, z$value, z$capital))
  fits <- lapply(seq_len(m), function(j) lm.fit(Xs[[j]], d[[j]]$invest))
  mu <- sapply(fits, function(f) f$fitted.values)
  s0 <- sapply(fits, function(f) sqrt(sum(f$residuals^2) / (Tn - k)))
  R <- matrix(0.4, m, m)
  diag(R) <- 1
  L <- t(chol(diag(s0) %*% R %*% diag(s0)))
  r <- replicate(reps, {
    Ys <- mu + t(L %*% matrix(rnorm(m * Tn), m))
    Es <- sapply(seq_len(m), function(j) lm.fit(Xs[[j]], Ys[, j])$residuals)
    Si <- solve(crossprod(Es) / (Tn - k))
    A <- do.call(
      rbind,
      lapply(1:m, function(i) {
        do.call(cbind, lapply(1:m, function(j) Si[i, j] * crossprod(Xs[[i]], Xs[[j]])))
      })
    )
    v <- do.call(
      c,
      lapply(1:m, function(i) {
        rowSums(sapply(1:m, function(j) Si[i, j] * crossprod(Xs[[i]], Ys[, j])))
      })
    )
    V <- solve(A)
    c(est = sum(V[2, ] * v), se = sqrt(V[2, 2]))
  })
  data.frame(
    equations = m,
    covariances = m * (m + 1) / 2,
    true_spread = sd(r["est", ]),
    reported_SE = mean(r["se", ]),
    ratio = mean(r["se", ]) / sd(r["est", ])
  )
}
trap <- do.call(rbind, lapply(c(2, 5, 10), many))
round(trap, 4)
  equations covariances true_spread reported_SE  ratio
1         2           3      0.0141      0.0145 1.0321
2         5          15      0.0144      0.0124 0.8599
3        10          55      0.0144      0.0103 0.7110

With two equations the reported standard error is 1.03 times the true one, with five 0.86 and with ten 0.71. With ten firms and 20 years there are 55 variances and covariances to estimate, and the formula does not know how badly.


7. Things to keep in mind

  • Many equations, few years. \(\Sigma\) has \(m(m+1)/2\) elements. If \(m\) comes close to \(T\), the reported standard errors become far too small, as in the third experiment; with \(m > T\) the estimate of \(\Sigma\) cannot even be inverted. Beck and Katz (1995) showed this for panels of countries, and proposed to keep OLS and correct its standard errors instead (panel-corrected standard errors).
  • Autocorrelation. SUR allows errors to correlate between equations in the same year, not between years. Our residuals fail here:
Code
dw <- rbind(
  GE = unlist(dwtest(ols_ge)[c("statistic", "p.value")]),
  Westinghouse = unlist(dwtest(ols_wh)[c("statistic", "p.value")])
)
round(dw, 3)
             statistic.DW p.value
GE                  1.072   0.004
Westinghouse        1.413   0.037
  • The Durbin–Watson statistics (1.07 and 1.41, far below 2) show positive autocorrelation, so all the standard errors of this page, OLS and SUR, are too small. A serious analysis would add autoregressive errors to each equation (Parks’ method), or dynamics.
  • One wrong equation spoils the others. If the equation of one firm lacks an important predictor, its error goes through \(\Sigma\) into the estimates of the other firms. OLS keeps such damage inside its own equation. SUR is more precise when everything is right, and less robust when something is wrong.
  • Endogeneity. SUR does not help if a predictor depends on the errors, for example if investment raises the value of the firm in the same year. (Here the value is that of the beginning of the year.) Three-stage least squares combines SUR with instrumental variables: method = "3SLS".
  • Pooling. If the coefficients are the same in all equations, a panel model is simpler and more precise. SUR is for few units, many times and different coefficients.
  • In psychology and sociology the same model appears as a path model with correlated residuals. lavaan fits it with y1 ~ x1; y2 ~ x2; y1 ~~ y2, and with maximum likelihood it gives the iterated estimates. For categorical outcomes, the bivariate probit model is the relative of SUR.

8. Reporting the results in APA style

A report (APA 7th edition) needs the equations, why they are estimated together, the residual correlation and its test, the method and its variant, and the estimates. The numbers come from the R objects:

Code
terms <- c("Intercept", "Value", "Capital")
fmt <- function(v) ifelse(rep(terms, 2) == "Intercept", f1(v), f3(v))
apa_table <- data.frame(
  Equation  = c("General Electric", "", "", "Westinghouse", "", ""),
  Predictor = rep(terms, 2),
  ols  = fmt(coef(ols)), ols_se = fmt(se_ols),
  sur  = fmt(b), sur_se = fmt(se),
  t    = f2(b / se))

Method (data analysis):

We modeled the annual gross investment of General Electric and Westinghouse from 1935 to 1954 (T = 20 years, million dollars; Grunfeld’s data as corrected by Kleiber & Zeileis, 2010) with one equation per firm, with the market value of the firm and its stock of capital as predictors. Because both firms were exposed to the same economic conditions, the equations were estimated jointly by seemingly unrelated regressions (Zellner, 1962), using the residual covariance matrix of the OLS equations with a correction for degrees of freedom. Independence of the equations was tested with the Breusch–Pagan (1980) test, and equality of the slopes with an F test on the joint estimates. Analyses were conducted in R (Version 4.6.2; R Core Team, 2026) with the package systemfit (Henningsen & Hamann, 2007).

Results:

The residuals of the two equations were correlated, r = .73, χ²(1) = 10.63, p = .001. In the joint estimates (Table 1), investment increased with the value of the firm both for General Electric, b = 0.038, SE = 0.014, t(17) = 2.66, and for Westinghouse, b = 0.058, SE = 0.015, t(17) = 3.96. The slopes of the two firms did not differ significantly, F(2, 34) = 2.00, p = .151. The residuals were autocorrelated (Durbin–Watson = 1.07 and 1.41), so the standard errors are probably too small.

Table 1

Investment of General Electric and Westinghouse: Separate and Joint Estimates

Equation Predictor OLS b OLS SE SUR b SUR SE SUR t
General Electric Intercept -10.0 31.4 -27.7 29.3 -0.95
Value 0.027 0.016 0.038 0.014 2.66
Capital 0.152 0.026 0.139 0.025 5.56
Westinghouse Intercept -0.5 8.0 -1.3 7.5 -0.17
Value 0.053 0.016 0.058 0.015 3.96
Capital 0.092 0.056 0.064 0.053 1.21

Note. T = 20 years. SUR = seemingly unrelated regressions. Residual correlation between the equations: .73 (OLS residuals).

Points to remember:

  • Report the residual correlations: they are the reason for the method.
  • Say how \(\hat\Sigma\) was computed (divisor, one step or iterated).
  • Show OLS next to SUR. If they differ by more than precision can explain, suspect a wrong equation.
  • Give the number of equations and of time points.

9. Summary

When Several regressions with different predictors whose errors are correlated, such as firms in the same years or outcomes of the same people
The model Stacked equations, errors with covariance \(\Sigma \otimes I\)
How (R) systemfit(list(eq1 = y1 ~ x1, eq2 = y2 ~ x2), method = "SUR", data = wide)
The estimator Feasible GLS: OLS, then \(\hat\Sigma\) from its residuals, then GLS; iterated = maximum likelihood
Gain Large with correlated errors and different predictors
No gain Uncorrelated errors, or the same predictors everywhere
Tests Breusch–Pagan for \(\Sigma\) diagonal; linearHypothesis() between equations
Dangers Many equations and few times; autocorrelation; one misspecified equation
Related pages Multivariate regression, generalized least squares

References

Beck, N., & Katz, J. N. (1995). What to do (and not to do) with time-series cross-section data. American Political Science Review, 89(3), 634–647. https://doi.org/10.2307/2082979

Breusch, T. S., & Pagan, A. R. (1980). The Lagrange multiplier test and its applications to model specification in econometrics. The Review of Economic Studies, 47(1), 239–253. https://doi.org/10.2307/2297111

Henningsen, A., & Hamann, J. D. (2007). systemfit: A package for estimating systems of simultaneous equations in R. Journal of Statistical Software, 23(4), 1–40. https://doi.org/10.18637/jss.v023.i04

Kleiber, C., & Zeileis, A. (2010). The Grunfeld data at 50. German Economic Review, 11(4), 404–417. https://doi.org/10.1111/j.1468-0475.2010.00513.x

Zellner, A. (1962). An efficient method of estimating seemingly unrelated regressions and tests for aggregation bias. Journal of the American Statistical Association, 57(298), 348–368. https://doi.org/10.1080/01621459.1962.10480664