## ---------------------------------------------------------------------------- ## Greene (2008) ## ## data ## availability: electronic ## firms: General Motors, US Steel, General Electric, Chrysler ## errors: none ## ## analysis ## result: OLS point estimates reproducible (minor deviation for GM_value) ## Standard errors differ (Greene has ML standard errors, minor dev. for GE_const) ## SUR point estimates reproducible (minor deviation for GE_const) ## Standard errors fully reproducible ## ML point estimates reproducible (minor deviation for US_capital) ## Standard errors fully reproducible ## ---------------------------------------------------------------------------- ## preliminaries source("start.R") ## data pre-processing gr <- subset(Grunfeld, firm %in% c("General Motors", "US Steel", "General Electric", "Chrysler")) gr$firm <- factor(gr$firm) pgr <- plm.data(gr, c("firm", "year")) ## SUR estimation (Example 16.8, pp. 534-536) ## Table 16.4 (p. 536) ## OLS sf_OLS <- systemfit(invest ~ value + capital, data = pgr, method = "OLS") gsummary(sf_OLS, digits = 5) ## correlation matrix for the 4 OLS residual vectors is summary(sf_OLS)$residCor ## covariance matrix for OLS residual vectors is summary(sf_OLS)$residCov * (17/20) ## alternatively lm_GM <- lm(invest ~ value + capital, data = gr, subset = firm == "General Motors") lm_US <- lm(invest ~ value + capital, data = gr, subset = firm == "US Steel") lm_GE <- lm(invest ~ value + capital, data = gr, subset = firm == "General Electric") lm_CH <- lm(invest ~ value + capital, data = gr, subset = firm == "Chrysler") ## FGLS sf_FGLS <- systemfit(invest ~ value + capital, data = pgr, method = "SUR", control = systemfit.control(methodResidCov = "noDfCor")) gsummary(sf_FGLS, digits = 5) ## ML via iterated FGLS sf_ML <- systemfit(invest ~ value + capital, data = pgr, method = "SUR", control = systemfit.control(methodResidCov = "noDfCor", maxiter = 7, tol = 1e-10)) gsummary(sf_ML, digits = 5) ## ML estimate of Sigma is summary(sf_ML)$residCov