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. > ## ---------------------------------------------------------------------------- > ## Griliches and Wallace (1965) -> Grunfeld (1958) > ## > ## data > ## availability: none > ## firms: Chrysler, Goodyear, Atlantic Refining, Westinghouse, Union Oil, General Motors > ## note: "Only six of the original eleven firms are used in this study, because we did not > ## succeed in reproducing and extending the original set of data for the others." (p. 313, fn. 8) > ## > ## analysis > ## result: GM cannot be reproduced. (see also Grunfeld, 1958) > ## Small deviations for aggregate, possibly due to problems with GM. > ## G&W construct alternative model based on further variables and > ## evaluate models in 1955-1960 post-sample period > ## ---------------------------------------------------------------------------- > > ## 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 > > ## data pre-processing > gr <- subset(Grunfeld, firm %in% c("Chrysler", "Goodyear", "Atlantic Refining", + "Westinghouse", "Union Oil", "General Motors")) > gr$firm <- factor(gr$firm) > pgr <- plm.data(gr, c("firm", "year")) > > ## Grunfeld model (Table 1, p. 314) > ## p. 313: "Table 1 reproduces Grunfeld's original estimates" > sf <- systemfit(invest ~ value + capital, method = "OLS", data = pgr) > gsummary(sf, sigma2 = FALSE) Method: OLS (Intercept) value capital R^2 Atlantic.Refining 22.707 0.162 0.003 0.680 6.872 0.057 0.022 Chrysler -6.190 0.078 0.316 0.914 13.506 0.020 0.029 General.Motors -149.782 0.119 0.371 0.921 105.842 0.026 0.037 Goodyear -7.723 0.075 0.082 0.666 9.359 0.034 0.028 Union.Oil -4.500 0.088 0.124 0.764 11.289 0.066 0.017 Westinghouse -0.509 0.053 0.092 0.744 8.015 0.016 0.056 > > ## alternatively: > lm_CH <- lm(invest ~ capital + value, data = gr, subset = firm == "Chrysler") > lm_GY <- lm(invest ~ capital + value, data = gr, subset = firm == "Goodyear") > lm_AR <- lm(invest ~ capital + value, data = gr, subset = firm == "Atlantic Refining") > lm_WH <- lm(invest ~ capital + value, data = gr, subset = firm == "Westinghouse") > lm_UO <- lm(invest ~ capital + value, data = gr, subset = firm == "Union Oil") > lm_GM <- lm(invest ~ capital + value, data = gr, subset = firm == "General Motors") > > ## aggregate regression > gr_macro <- aggregate(gr[,-4], list(gr$year), sum)[,-1] > lm_macro <- lm(invest ~ capital + value, data = gr_macro) > gsummary(lm_macro, sigma2 = FALSE) (Intercept) value capital R^2 -312.405 0.242 0.113 0.946 113.128 0.023 0.020 >