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. > ## ---------------------------------------------------------------------------- > ## Kmenta+Gilbert (1968) -> Zellner (1962) > ## > ## data > ## availability: none > ## firms: General Electric, Westinghouse > ## errors: none > ## > ## analysis > ## result: exact at precision given > ## note: for all estimates pertaining to WH, value and capital are interchanged > ## ---------------------------------------------------------------------------- > > ## 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("General Electric", "Westinghouse")) > gr$firm <- factor(gr$firm) > pgr <- plm.data(gr, c("firm", "year")) > > ## OLS, SUR and iterated SUR (ML) (pp. 1199-1200) > fmGE <- lm(invest ~ value + capital, data = gr, subset = firm == "General Electric") > fmWH <- lm(invest ~ value + capital, data = gr, subset = firm == "Westinghouse") > gsummary(fmGE, digits = 4) (Intercept) value capital R^2 sigma^2 -9.9563 0.0266 0.1517 0.7053 777.4463 31.3742 0.0156 0.0257 > gsummary(fmWH, digits = 4) (Intercept) value capital R^2 sigma^2 -0.5094 0.0529 0.0924 0.7444 104.3079 8.0153 0.0157 0.0561 > ## alternatively: > ## systemfit(invest ~ value + capital, method = "OLS", data = pgr) > > fmSUR <- systemfit(invest ~ value + capital, method = "SUR", data = pgr) > gsummary(fmSUR, digits = 4) Method: SUR (Intercept) value capital R^2 sigma^2 General.Electric -27.7193 0.0383 0.139 0.6926 811.0809 29.3212 0.0144 0.025 Westinghouse -1.2520 0.0576 0.064 0.7404 105.9589 7.5452 0.0145 0.053 > > fmML <- systemfit(invest ~ value + capital, method = "SUR", data = pgr, maxit = 100) > gsummary(fmML, digits = 4) Method: SUR (Intercept) value capital R^2 sigma^2 General.Electric -30.7484 0.0405 0.1359 0.6868 826.1573 29.6608 0.0145 0.0255 Westinghouse -1.7016 0.0594 0.0557 0.7378 107.0036 7.5149 0.0144 0.0529 >