R version 2.10.1 (2009-12-14) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > ## ---------------------------------------------------------------------------- > ## Griffiths, Hill, Judge (1993) -> Vinod and Ullah (1981) -> (Maddala (1977)) / Boot and De Wit (1960) > ## > ## data > ## availability: printed > ## firms: General Motors, US Steel, General Electric, Chrysler, Atlantic Refining, > ## IBM, Union Oil, Westinghouse, Goodyear, Diamond Match > ## errors: invest_AR,1953 = 81.90 (Atlantic Refining) > ## capital_US,1946 = 232.6 (US Steel) > ## invest_US,1952 = 645.2 (US Steel) > ## call Atlantic Refining Atlantic Richfield > ## > ## analysis > ## result: exact at precision given > ## ---------------------------------------------------------------------------- > > ## preliminaries > source("start.R") Loading required package: kinship Loading required package: survival Loading required package: splines Loading required package: nlme Loading required package: lattice [1] "kinship is loaded" Loading required package: Formula Loading required package: MASS Loading required package: sandwich Loading required package: zoo Loading required package: Matrix Loading required package: car Loading required package: lmtest > > > ## Table 17.2 (firms unlabeled) > > ## data pre-processing > gr <- subset(Grunfeld, firm %in% c("General Electric", "Westinghouse")) > gr$firm <- factor(gr$firm) > pgr <- plm.data(gr, c("firm", "year")) > > ## model fitting > sf_ols <- systemfit(invest ~ value + capital, data = pgr, method = "OLS") > sf_sur <- systemfit(invest ~ value + capital, data = pgr, method = "SUR", + control = systemfit.control(methodResidCov = "noDfCor")) > summary(sf_ols) systemfit results method: OLS N DF SSR detRCov OLS-R2 McElroy-R2 system 40 34 14989.8 38001.4 0.710551 0.617634 N DF SSR MSE RMSE R2 Adj R2 General.Electric 20 17 13216.59 777.446 27.8827 0.705307 0.670637 Westinghouse 20 17 1773.23 104.308 10.2131 0.744446 0.714381 The covariance matrix of the residuals General.Electric Westinghouse General.Electric 777.446 207.587 Westinghouse 207.587 104.308 The correlations of the residuals General.Electric Westinghouse General.Electric 1.000000 0.728965 Westinghouse 0.728965 1.000000 OLS estimates for 'General.Electric' (equation 1) Model Formula: General.Electric_invest ~ General.Electric_value + General.Electric_capital Estimate Std. Error t value Pr(>|t|) (Intercept) -9.9563065 31.3742491 -0.31734 0.75485 value 0.0265512 0.0155661 1.70571 0.10627 capital 0.1516939 0.0257041 5.90155 1.7421e-05 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 27.882725 on 17 degrees of freedom Number of observations: 20 Degrees of Freedom: 17 SSR: 13216.58777 MSE: 777.446339 Root MSE: 27.882725 Multiple R-Squared: 0.705307 Adjusted R-Squared: 0.670637 OLS estimates for 'Westinghouse' (equation 2) Model Formula: Westinghouse_invest ~ Westinghouse_value + Westinghouse_capital Estimate Std. Error t value Pr(>|t|) (Intercept) -0.5093902 8.0152889 -0.06355 0.9500680 value 0.0528941 0.0157065 3.36766 0.0036548 ** capital 0.0924065 0.0560990 1.64720 0.1178743 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 10.213123 on 17 degrees of freedom Number of observations: 20 Degrees of Freedom: 17 SSR: 1773.23393 MSE: 104.307878 Root MSE: 10.213123 Multiple R-Squared: 0.744446 Adjusted R-Squared: 0.714381 > summary(sf_sur) systemfit results method: SUR N DF SSR detRCov OLS-R2 McElroy-R2 system 40 34 15589.7 25750.4 0.698968 0.615103 N DF SSR MSE RMSE R2 Adj R2 General.Electric 20 17 13788.4 811.081 28.4795 0.692557 0.656388 Westinghouse 20 17 1801.3 105.959 10.2936 0.740401 0.709860 The covariance matrix of the residuals used for estimation General.Electric Westinghouse General.Electric 660.829 176.4491 Westinghouse 176.449 88.6617 The covariance matrix of the residuals General.Electric Westinghouse General.Electric 689.419 190.636 Westinghouse 190.636 90.065 The correlations of the residuals General.Electric Westinghouse General.Electric 1.000000 0.765043 Westinghouse 0.765043 1.000000 SUR estimates for 'General.Electric' (equation 1) Model Formula: General.Electric_invest ~ General.Electric_value + General.Electric_capital Estimate Std. Error t value Pr(>|t|) (Intercept) -27.7193171 27.0328280 -1.02539 0.319547 value 0.0383102 0.0132901 2.88261 0.010336 * capital 0.1390363 0.0230356 6.03572 1.3366e-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 'Westinghouse' (equation 2) Model Formula: Westinghouse_invest ~ Westinghouse_value + Westinghouse_capital Estimate Std. Error t value Pr(>|t|) (Intercept) -1.2519882 6.9563467 -0.17998 0.85929789 value 0.0576298 0.0134110 4.29720 0.00048791 *** capital 0.0639781 0.0489010 1.30832 0.20817926 --- 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 > > > ## Table 17B.2 (firms unlabeled) > > ## data pre-processing > gr <- subset(Grunfeld, firm %in% c("General Motors", "US Steel", "General Electric", "Chrysler", + "Atlantic Refining", "IBM", "Union Oil", "Westinghouse", "Goodyear", "Diamond Match")) > gr$firm <- factor(gr$firm) > gr$invest[c(19, 158)] <- c(81.90, 645.2) > gr$capital[152] <- 232.6 > pgr <- plm.data(gr, c("firm", "year")) > > ## model fitting > lm_within <- lm(invest ~ 0 + firm + value + capital, data = gr) > summary(lm_within) Call: lm(formula = invest ~ 0 + firm + value + capital, data = gr) Residuals: Min 1Q Median 3Q Max -182.4558 -17.3769 0.6314 19.1888 250.2408 Coefficients: Estimate Std. Error t value Pr(>|t|) firmAtlantic Refining -115.31690 14.16199 -8.143 5.22e-14 *** firmChrysler -27.63498 14.06983 -1.964 0.051 . firmDiamond Match -6.54627 11.81987 -0.554 0.580 firmGeneral Electric -235.11874 24.41825 -9.629 < 2e-16 *** firmGeneral Motors -69.14348 49.68547 -1.392 0.166 firmGoodyear -87.27701 12.88512 -6.773 1.57e-10 *** firmIBM -23.07357 12.66121 -1.822 0.070 . firmUS Steel 100.86240 24.91366 4.048 7.53e-05 *** firmUnion Oil -66.68293 12.83763 -5.194 5.31e-07 *** firmWestinghouse -57.35860 13.98559 -4.101 6.11e-05 *** value 0.10977 0.01185 9.260 < 2e-16 *** capital 0.31064 0.01737 17.884 < 2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 52.74 on 188 degrees of freedom Multiple R-squared: 0.9616, Adjusted R-squared: 0.9592 F-statistic: 392.4 on 12 and 188 DF, p-value: < 2.2e-16 > >