data(GrunfeldGreene, package="systemfit") library("plm") GGPanel <- plm.data(GrunfeldGreene, c("firm", "year")) form <- invest ~ value + capital ##Replicates the tables in Greene 2003 (5th Edition) Table 14.1 ##OLS Estimation greeneOLS <- systemfit(form, data=GGPanel) round(coef(summary(greeneOLS)), digits=4) round(sapply(greeneOLS$eq, function(x) { return(summary(x)$ssr/20) }), digits=3) ##Pooled OLS greeneOlsPooled <- systemfit(form, data = GGPanel, pooled = TRUE) round(coef(summary(greeneOlsPooled$eq[[1]])), digits = 4) sum(sapply(greeneOlsPooled$eq, function(x) { return(summary(x)$ssr) }))/100 ##SUR Estimation greeneSur <- systemfit(form, method = "SUR", data = GGPanel, methodResidCov = "noDfCor") round(coef(summary(greeneSur)), digits = 4) round(greeneSur$residCov, digits = 3) round(summary(greeneSur)$residCor, digits = 3) #Pooled SUR Estimation greeneSurPooled <- systemfit(form, method = "SUR", data = GGPanel, pooled = TRUE, methodResidCov = "noDfCor", residCovWeighted = TRUE) round(coef(summary(greeneSurPooled$eq[[1]])), digits = 4) round(greeneSurPooled$residCov, digits = 3) round(cov(residuals(greeneSurPooled)), digits = 3) round(summary(greeneSurPooled)$residCor, digits = 3)