R Under development (unstable) (2025-10-03 r88899 ucrt) -- "Unsuffered Consequences" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 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. > library( micEcon ) If you have questions, suggestions, or comments regarding one of the 'micEcon' packages, please use a forum or 'tracker' at micEcon's R-Forge site: https://r-forge.r-project.org/projects/micecon/ > library( plm ) > options( digits = 3 ) > > ## preparing data > data( germanFarms ) > # output quantity: > germanFarms$qOutput <- germanFarms$vOutput / germanFarms$pOutput > # quantity of variable inputs > germanFarms$qVarInput <- germanFarms$vVarInput / germanFarms$pVarInput > # a time trend to account for technical progress: > germanFarms$time <- c(1:20) > # taking logarithms > germanFarms$qLogOutput <- log( germanFarms$qOutput ) > germanFarms$qLogLabor <- log( germanFarms$qLabor ) > germanFarms$qLogLand <- log( germanFarms$land ) > germanFarms$qLogVarInput <- log( germanFarms$qVarInput ) > germanFarms$logTime <- log( germanFarms$time ) > > ## testing translogEst > # estimate a translog production function > estResult <- translogEst( "qOutput", c( "qLabor", "land", "qVarInput", "time" ), + germanFarms ) > > print( estResult ) Estimated Translog function with 20 observations. a_0 a_1 a_2 a_3 a_4 b_1_1 b_1_2 b_1_3 -133.485 24.589 19.923 34.631 -12.467 -16.865 14.347 -8.591 b_1_4 b_2_2 b_2_3 b_2_4 b_3_3 b_3_4 b_4_4 -3.573 0.264 -3.468 -1.163 -3.910 2.793 -0.246 > > summary( estResult ) Estimated Translog function with 20 observations. Estimate Std. Error t value Pr(>|t|) a_0 -133.485 165.548 -0.81 0.457 a_1 24.589 66.497 0.37 0.727 a_2 19.923 16.500 1.21 0.281 a_3 34.631 55.323 0.63 0.559 a_4 -12.467 5.228 -2.38 0.063 . b_1_1 -16.865 19.101 -0.88 0.418 b_1_2 14.347 8.770 1.64 0.163 b_1_3 -8.591 10.551 -0.81 0.453 b_1_4 -3.573 1.900 -1.88 0.119 b_2_2 0.264 4.822 0.05 0.958 b_2_3 -3.468 3.490 -0.99 0.366 b_2_4 -1.163 1.542 -0.75 0.485 b_3_3 -3.910 9.323 -0.42 0.692 b_3_4 2.793 0.750 3.72 0.014 * b_4_4 -0.246 0.160 -1.54 0.185 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 R-squared: 0.998 Adjusted R-squared: 0.993 > > residuals( estResult ) 1 2 3 4 5 6 7 8 0.002292 -0.013674 0.008394 0.022739 -0.008485 -0.017108 0.002266 -0.003225 9 10 11 12 13 14 15 16 0.008918 -0.002060 -0.001227 -0.001239 -0.000391 -0.002186 0.007307 0.004534 17 18 19 20 -0.013997 0.007881 -0.000263 -0.000475 > > print.default( estResult ) $call translogEst(yName = "qOutput", xNames = c("qLabor", "land", "qVarInput", "time"), data = germanFarms) $nExog [1] 4 $nShifter [1] 0 $est Call: lm(formula = as.formula(estFormula), data = estData) Coefficients: (Intercept) a_1 a_2 a_3 a_4 b_1_1 -133.485 24.589 19.923 34.631 -12.467 -16.865 b_1_2 b_1_3 b_1_4 b_2_2 b_2_3 b_2_4 14.347 -8.591 -3.573 0.264 -3.468 -1.163 b_3_3 b_3_4 b_4_4 -3.910 2.793 -0.246 $residuals 1 2 3 4 5 6 7 8 0.002292 -0.013674 0.008394 0.022739 -0.008485 -0.017108 0.002266 -0.003225 9 10 11 12 13 14 15 16 0.008918 -0.002060 -0.001227 -0.001239 -0.000391 -0.002186 0.007307 0.004534 17 18 19 20 -0.013997 0.007881 -0.000263 -0.000475 $fitted 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 944 976 1061 1145 1188 1206 1237 1293 1197 1281 1362 1543 1576 1700 1633 1619 17 18 19 20 1678 1742 1888 1993 $coef a_0 a_1 a_2 a_3 a_4 b_1_1 b_1_2 b_1_3 -133.485 24.589 19.923 34.631 -12.467 -16.865 14.347 -8.591 b_1_4 b_2_2 b_2_3 b_2_4 b_3_3 b_3_4 b_4_4 -3.573 0.264 -3.468 -1.163 -3.910 2.793 -0.246 $coefCov a_0 a_1 a_2 a_3 a_4 b_1_1 b_1_2 b_1_3 a_0 27405.99 9712.33 17.69 -9083.87 143.477 1775.85 -623.173 -1333.833 a_1 9712.33 4421.91 -133.02 -3202.91 18.862 775.11 -174.763 -656.263 a_2 17.69 -133.02 272.23 -117.76 -53.119 -70.62 -45.788 46.233 a_3 -9083.87 -3202.91 -117.76 3060.62 -27.798 -553.94 222.167 430.516 a_4 143.48 18.86 -53.12 -27.80 27.334 -8.21 9.313 -7.382 b_1_1 1775.85 775.11 -70.62 -553.94 -8.208 364.84 -79.338 -101.467 b_1_2 -623.17 -174.76 -45.79 222.17 9.313 -79.34 76.906 -4.733 b_1_3 -1333.83 -656.26 46.23 430.52 -7.382 -101.47 -4.733 111.316 b_1_4 138.95 53.86 5.31 -49.19 0.917 -3.56 -6.106 -6.116 b_2_2 -77.18 2.72 2.44 18.50 9.162 -50.20 12.688 -5.016 b_2_3 44.60 22.99 -43.90 5.93 4.681 35.82 -1.026 -4.401 b_2_4 81.28 17.02 9.80 -29.22 -4.695 16.08 -9.146 0.943 b_3_3 1480.84 527.13 36.56 -507.78 3.046 75.19 -34.433 -71.365 b_3_4 -68.98 -13.76 3.43 20.98 -2.147 -6.28 3.316 0.968 b_4_4 -7.58 -3.43 -1.52 3.06 0.728 -0.88 0.602 0.293 b_1_4 b_2_2 b_2_3 b_2_4 b_3_3 b_3_4 b_4_4 a_0 138.9469 -77.18 44.605 81.2783 1480.837 -68.9803 -7.5838 a_1 53.8560 2.72 22.994 17.0231 527.126 -13.7558 -3.4281 a_2 5.3118 2.44 -43.897 9.8010 36.560 3.4335 -1.5210 a_3 -49.1889 18.50 5.926 -29.2154 -507.777 20.9840 3.0597 a_4 0.9168 9.16 4.681 -4.6948 3.046 -2.1473 0.7278 b_1_1 -3.5626 -50.20 35.823 16.0775 75.187 -6.2751 -0.8797 b_1_2 -6.1059 12.69 -1.026 -9.1463 -34.433 3.3158 0.6018 b_1_3 -6.1163 -5.02 -4.401 0.9429 -71.365 0.9681 0.2932 b_1_4 3.6094 4.74 -2.943 -0.0203 9.613 -0.3327 -0.0490 b_2_2 4.7394 23.25 -11.100 -5.6859 2.878 1.0467 0.3004 b_2_3 -2.9430 -11.10 12.177 1.0946 -6.539 -1.1226 0.1081 b_2_4 -0.0203 -5.69 1.095 2.3774 4.005 -0.4070 -0.1735 b_3_3 9.6127 2.88 -6.539 4.0047 86.920 -2.8993 -0.5340 b_3_4 -0.3327 1.05 -1.123 -0.4070 -2.899 0.5624 -0.0302 b_4_4 -0.0490 0.30 0.108 -0.1735 -0.534 -0.0302 0.0255 $r2 [1] 0.998 $r2bar [1] 0.993 $nObs [1] 20 $yName [1] "qOutput" $xNames [1] "qLabor" "land" "qVarInput" "time" $model.matrix (Intercept) a_1 a_2 a_3 a_4 b_1_1 b_1_2 b_1_3 b_1_4 b_2_2 b_2_3 b_2_4 1 1 0.365 3.15 6.32 0.000 0.0665 1.15 2.31 0.000 4.97 19.9 0.00 2 1 0.372 3.19 6.41 0.693 0.0690 1.18 2.38 0.258 5.08 20.4 2.21 3 1 0.365 3.21 6.41 1.099 0.0665 1.17 2.34 0.401 5.14 20.6 3.52 4 1 0.392 3.22 6.48 1.386 0.0768 1.26 2.54 0.543 5.17 20.8 4.46 5 1 0.392 3.22 6.47 1.609 0.0768 1.26 2.54 0.631 5.17 20.8 5.17 6 1 0.385 3.23 6.49 1.792 0.0742 1.24 2.50 0.690 5.21 20.9 5.78 7 1 0.372 3.25 6.51 1.946 0.0690 1.21 2.42 0.723 5.30 21.2 6.33 8 1 0.399 3.26 6.47 2.079 0.0795 1.30 2.58 0.829 5.30 21.1 6.77 9 1 0.392 3.23 6.46 2.197 0.0768 1.26 2.53 0.861 5.20 20.8 7.09 10 1 0.425 3.26 6.47 2.303 0.0904 1.39 2.75 0.979 5.32 21.1 7.51 11 1 0.425 3.29 6.53 2.398 0.0904 1.40 2.78 1.020 5.40 21.5 7.88 12 1 0.525 3.40 6.63 2.485 0.1377 1.78 3.48 1.304 5.77 22.5 8.44 13 1 0.531 3.44 6.69 2.565 0.1408 1.82 3.55 1.361 5.91 23.0 8.82 14 1 0.513 3.47 6.68 2.639 0.1315 1.78 3.43 1.353 6.03 23.2 9.16 15 1 0.501 3.45 6.60 2.708 0.1254 1.73 3.31 1.356 5.95 22.8 9.34 16 1 0.476 3.46 6.58 2.773 0.1134 1.65 3.13 1.320 5.99 22.8 9.60 17 1 0.482 3.51 6.55 2.833 0.1164 1.69 3.16 1.367 6.17 23.0 9.95 18 1 0.482 3.56 6.55 2.890 0.1164 1.72 3.16 1.394 6.33 23.3 10.28 19 1 0.482 3.62 6.59 2.944 0.1164 1.75 3.18 1.420 6.55 23.9 10.66 20 1 0.482 3.67 6.65 2.996 0.1164 1.77 3.21 1.445 6.75 24.4 11.00 b_3_3 b_3_4 b_4_4 1 20.0 0.00 0.000 2 20.5 4.44 0.240 3 20.5 7.04 0.603 4 21.0 8.99 0.961 5 21.0 10.42 1.295 6 21.0 11.62 1.605 7 21.2 12.67 1.893 8 21.0 13.46 2.162 9 20.9 14.20 2.414 10 21.0 14.91 2.651 11 21.3 15.65 2.875 12 22.0 16.49 3.087 13 22.4 17.15 3.289 14 22.3 17.63 3.482 15 21.8 17.88 3.667 16 21.6 18.24 3.844 17 21.5 18.56 4.014 18 21.5 18.94 4.177 19 21.7 19.42 4.335 20 22.1 19.91 4.487 attr(,"assign") [1] 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 $r2nonLog [,1] [1,] 0.999 $dataLogged [1] FALSE attr(,"class") [1] "translogEst" > > fitted( estResult ) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 944 976 1061 1145 1188 1206 1237 1293 1197 1281 1362 1543 1576 1700 1633 1619 17 18 19 20 1678 1742 1888 1993 > all.equal( fitted( estResult ), predict( estResult ) ) [1] TRUE > all.equal( log( fitted( estResult ) ), predict( estResult, dataLogged = TRUE ) ) [1] TRUE > all.equal( fitted( estResult ), predict( estResult, newdata = germanFarms ) ) [1] TRUE > > > # estimate the translog production function with a different order of inputs > estResultOrder <- translogEst( yName = "qOutput", + xNames = c( "qLabor", "qVarInput", "land", "time" ), + data = germanFarms ) > print( estResultOrder ) Estimated Translog function with 20 observations. a_0 a_1 a_2 a_3 a_4 b_1_1 b_1_2 b_1_3 -133.485 24.589 34.631 19.923 -12.467 -16.865 -8.591 14.347 b_1_4 b_2_2 b_2_3 b_2_4 b_3_3 b_3_4 b_4_4 -3.573 -3.910 -3.468 2.793 0.264 -1.163 -0.246 > summary( estResultOrder ) Estimated Translog function with 20 observations. Estimate Std. Error t value Pr(>|t|) a_0 -133.485 165.548 -0.81 0.457 a_1 24.589 66.497 0.37 0.727 a_2 34.631 55.323 0.63 0.559 a_3 19.923 16.500 1.21 0.281 a_4 -12.467 5.228 -2.38 0.063 . b_1_1 -16.865 19.101 -0.88 0.418 b_1_2 -8.591 10.551 -0.81 0.453 b_1_3 14.347 8.770 1.64 0.163 b_1_4 -3.573 1.900 -1.88 0.119 b_2_2 -3.910 9.323 -0.42 0.692 b_2_3 -3.468 3.490 -0.99 0.366 b_2_4 2.793 0.750 3.72 0.014 * b_3_3 0.264 4.822 0.05 0.958 b_3_4 -1.163 1.542 -0.75 0.485 b_4_4 -0.246 0.160 -1.54 0.185 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 R-squared: 0.998 Adjusted R-squared: 0.993 > all.equal( residuals( estResult ), residuals( estResultOrder ) ) [1] TRUE > > # estimate the translog production function with a different order of inputs > estResultOrder2 <- translogEst( yName = "qOutput", + xNames = c( "land", "qVarInput", "qLabor", "time" ), + data = germanFarms ) > print( estResultOrder2 ) Estimated Translog function with 20 observations. a_0 a_1 a_2 a_3 a_4 b_1_1 b_1_2 b_1_3 -133.485 19.923 34.631 24.589 -12.467 0.264 -3.468 14.347 b_1_4 b_2_2 b_2_3 b_2_4 b_3_3 b_3_4 b_4_4 -1.163 -3.910 -8.591 2.793 -16.865 -3.573 -0.246 > summary( estResultOrder2 ) Estimated Translog function with 20 observations. Estimate Std. Error t value Pr(>|t|) a_0 -133.485 165.548 -0.81 0.457 a_1 19.923 16.500 1.21 0.281 a_2 34.631 55.323 0.63 0.559 a_3 24.589 66.497 0.37 0.727 a_4 -12.467 5.228 -2.38 0.063 . b_1_1 0.264 4.822 0.05 0.958 b_1_2 -3.468 3.490 -0.99 0.366 b_1_3 14.347 8.770 1.64 0.163 b_1_4 -1.163 1.542 -0.75 0.485 b_2_2 -3.910 9.323 -0.42 0.692 b_2_3 -8.591 10.551 -0.81 0.453 b_2_4 2.793 0.750 3.72 0.014 * b_3_3 -16.865 19.101 -0.88 0.418 b_3_4 -3.573 1.900 -1.88 0.119 b_4_4 -0.246 0.160 -1.54 0.185 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 R-squared: 0.998 Adjusted R-squared: 0.993 > all.equal( residuals( estResult ), residuals( estResultOrder2 ) ) [1] TRUE > > # estimate the translog production function with a different order of inputs > estResultOrder3 <- translogEst( yName = "qOutput", + xNames = c( "land", "qVarInput", "time", "qLabor" ), + data = germanFarms ) > print( estResultOrder3 ) Estimated Translog function with 20 observations. a_0 a_1 a_2 a_3 a_4 b_1_1 b_1_2 b_1_3 -133.485 19.923 34.631 -12.467 24.589 0.264 -3.468 -1.163 b_1_4 b_2_2 b_2_3 b_2_4 b_3_3 b_3_4 b_4_4 14.347 -3.910 2.793 -8.591 -0.246 -3.573 -16.865 > summary( estResultOrder3 ) Estimated Translog function with 20 observations. Estimate Std. Error t value Pr(>|t|) a_0 -133.485 165.548 -0.81 0.457 a_1 19.923 16.500 1.21 0.281 a_2 34.631 55.323 0.63 0.559 a_3 -12.467 5.228 -2.38 0.063 . a_4 24.589 66.497 0.37 0.727 b_1_1 0.264 4.822 0.05 0.958 b_1_2 -3.468 3.490 -0.99 0.366 b_1_3 -1.163 1.542 -0.75 0.485 b_1_4 14.347 8.770 1.64 0.163 b_2_2 -3.910 9.323 -0.42 0.692 b_2_3 2.793 0.750 3.72 0.014 * b_2_4 -8.591 10.551 -0.81 0.453 b_3_3 -0.246 0.160 -1.54 0.185 b_3_4 -3.573 1.900 -1.88 0.119 b_4_4 -16.865 19.101 -0.88 0.418 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 R-squared: 0.998 Adjusted R-squared: 0.993 > all.equal( residuals( estResult ), residuals( estResultOrder3 ) ) [1] TRUE > > > ## testing translogEst with dataLogged = TRUE > estResultLog <- translogEst( "qLogOutput", + xNames = c( "qLogLabor", "qLogLand", "qLogVarInput", "logTime" ), + data = germanFarms, dataLogged = TRUE ) > all.equal( estResult[ -c(1,6,12,13,16) ], estResultLog[ -c(1,6,12,13,16) ] ) [1] TRUE > all.equal( estResult$fitted, exp( estResultLog$fitted ) ) [1] TRUE > fitted( estResultLog ) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 6.85 6.88 6.97 7.04 7.08 7.10 7.12 7.16 7.09 7.16 7.22 7.34 7.36 7.44 7.40 7.39 17 18 19 20 7.43 7.46 7.54 7.60 > all.equal( fitted( estResultLog ), predict( estResultLog ) ) [1] TRUE > all.equal( exp( fitted( estResultLog ) ), + predict( estResultLog, dataLogged = FALSE ) ) [1] TRUE > all.equal( fitted( estResultLog ), + predict( estResultLog, newdata = germanFarms ) ) [1] TRUE > > > ## testing translogCalc > fitted <- translogCalc( c( "qLabor", "land", "qVarInput", "time" ), + germanFarms, estResult$coef ) > > all.equal( fitted, estResult$fitted ) [1] TRUE > > ## testing translogDeriv > margProducts <- translogDeriv( c( "qLabor", "land", "qVarInput", "time" ), + germanFarms, estResult$coef, estResult$coefCov ) > print( margProducts ) $deriv qLabor land qVarInput time 1 6137.0 163.8 -7.044 208.3 2 4381.9 123.6 -4.392 110.9 3 4012.4 107.0 -2.818 47.7 4 2675.9 105.7 -2.388 45.8 5 2202.7 98.9 -1.288 18.5 6 1859.8 82.1 -0.431 16.6 7 1804.0 60.3 0.228 23.3 8 1340.3 81.3 0.812 -17.6 9 727.9 68.1 1.775 -14.9 10 291.6 86.0 1.552 -33.3 11 -44.5 74.8 1.519 -21.3 12 -1280.4 126.4 -1.332 -47.8 13 -1527.4 115.0 -1.626 -38.3 14 -1105.0 103.1 -1.211 -39.1 15 -741.7 102.0 0.246 -53.7 16 -189.4 82.9 1.262 -51.0 17 453.4 87.7 1.438 -66.3 18 920.2 84.0 1.489 -70.9 19 1400.5 76.0 0.967 -69.9 20 1662.3 64.6 0.328 -63.2 attr(,"class") [1] "translogDeriv" > > margProductsObs <- translogDeriv( c( "qLabor", "land", "qVarInput", "time" ), + germanFarms, estResult$coef, estResult$coefCov, yName = "qOutput" ) > print( margProductsObs ) $deriv qLabor land qVarInput time 1 6151.1 164.2 -7.060 208.8 2 4322.4 121.9 -4.332 109.4 3 4046.2 107.9 -2.842 48.1 4 2737.5 108.1 -2.443 46.9 5 2184.1 98.1 -1.277 18.4 6 1828.2 80.7 -0.424 16.3 7 1808.1 60.4 0.229 23.4 8 1336.0 81.0 0.809 -17.5 9 734.5 68.8 1.791 -15.0 10 291.0 85.9 1.549 -33.3 11 -44.4 74.7 1.517 -21.3 12 -1278.8 126.2 -1.330 -47.8 13 -1526.8 114.9 -1.625 -38.3 14 -1102.6 102.9 -1.208 -39.0 15 -747.1 102.7 0.248 -54.1 16 -190.3 83.2 1.268 -51.3 17 447.1 86.4 1.418 -65.4 18 927.5 84.7 1.501 -71.5 19 1400.1 76.0 0.967 -69.9 20 1661.5 64.6 0.328 -63.2 attr(,"class") [1] "translogDeriv" > > germanFarms$fitted <- fitted > margProductsFitted <- translogDeriv( c( "qLabor", "land", "qVarInput", "time" ), + germanFarms, estResult$coef, estResult$coefCov, yName = "fitted" ) > all.equal( margProducts, margProductsFitted ) [1] TRUE > > > ## testing calculation of elasticities with translogEla > estEla <- translogEla( c( "qLabor", "land", "qVarInput", "time" ), + data = germanFarms, coef = coef( estResult ), coefCov = vcov( estResult ) ) > print( estEla ) qLabor land qVarInput time 1 9.362 4.06 -4.153 0.2206 2 6.510 3.06 -2.730 0.2273 3 5.448 2.49 -1.615 0.1349 4 3.457 2.30 -1.363 0.1600 5 2.744 2.07 -0.702 0.0780 6 2.266 1.72 -0.235 0.0827 7 2.115 1.26 0.124 0.1320 8 1.545 1.63 0.407 -0.1088 9 0.900 1.43 0.949 -0.1121 10 0.348 1.75 0.786 -0.2603 11 -0.050 1.47 0.761 -0.1722 12 -1.403 2.45 -0.657 -0.3720 13 -1.648 2.27 -0.827 -0.3159 14 -1.086 1.95 -0.568 -0.3222 15 -0.750 1.97 0.111 -0.4932 16 -0.188 1.63 0.561 -0.5044 17 0.438 1.75 0.600 -0.6717 18 0.856 1.69 0.600 -0.7329 19 1.202 1.50 0.375 -0.7037 20 1.351 1.28 0.127 -0.6345 > print( attributes( estEla )$variance ) qLabor land qVarInput time 1 4428 296 3036 28.1 2 4441 288 3061 27.9 3 4428 282 3056 27.7 4 4439 283 3075 27.7 5 4420 280 3066 27.5 6 4427 278 3072 27.4 7 4451 276 3087 27.5 8 4397 275 3053 27.3 9 4383 273 3047 27.1 10 4366 274 3037 27.2 11 4399 275 3061 27.3 12 4408 284 3071 28.0 13 4440 286 3093 28.2 14 4453 283 3097 28.4 15 4403 278 3060 28.0 16 4404 275 3056 28.0 17 4390 274 3039 28.2 18 4396 273 3039 28.4 19 4432 274 3058 28.8 20 4475 276 3083 29.2 > print( attributes( estEla )$stdDev ) qLabor land qVarInput time 1 66.5 17.2 55.1 5.30 2 66.6 17.0 55.3 5.28 3 66.5 16.8 55.3 5.26 4 66.6 16.8 55.5 5.26 5 66.5 16.7 55.4 5.24 6 66.5 16.7 55.4 5.24 7 66.7 16.6 55.6 5.25 8 66.3 16.6 55.3 5.23 9 66.2 16.5 55.2 5.20 10 66.1 16.5 55.1 5.21 11 66.3 16.6 55.3 5.23 12 66.4 16.8 55.4 5.29 13 66.6 16.9 55.6 5.31 14 66.7 16.8 55.6 5.33 15 66.4 16.7 55.3 5.29 16 66.4 16.6 55.3 5.29 17 66.3 16.5 55.1 5.31 18 66.3 16.5 55.1 5.33 19 66.6 16.6 55.3 5.37 20 66.9 16.6 55.5 5.40 > estElaMet <- elas( estResult ) > all.equal( estEla, estElaMet ) [1] TRUE > estElaLogMet <- elas( estResultLog ) > all.equal( estElaMet, estElaLogMet, check.attributes = FALSE ) [1] TRUE > > ## testing translogHessian > # compute the Hessian matrices > hessians <- translogHessian( c( "qLabor", "land", "qVarInput", "time" ), + germanFarms, estResult$coef ) > print( hessians ) [[1]] [,1] [,2] [,3] [,4] [1,] 27959.4 1467.13 -55.9124 -988.37 [2,] 1467.1 21.89 -1.4740 -10.78 [3,] -55.9 -1.47 0.0533 3.18 [4,] -988.4 -10.78 3.1836 -394.22 [[2]] [,1] [,2] [,3] [,4] [1,] 8823.3 953.938 -29.2495 -704.67 [2,] 953.9 10.984 -0.7867 -9.41 [3,] -29.2 -0.787 0.0166 1.75 [4,] -704.7 -9.414 1.7480 -102.79 [[3]] [,1] [,2] [,3] [,4] [1,] 3766.3 832.90 -2.11e+01 -696.8 [2,] 832.9 6.93 -5.30e-01 -11.8 [3,] -21.1 -0.53 9.04e-04 1.5 [4,] -696.8 -11.84 1.50e+00 -42.7 [[4]] [,1] [,2] [,3] [,4] [1,] -4376.0 692.742 -15.74627 -584.38 [2,] 692.7 6.001 -0.46429 -9.14 [3,] -15.7 -0.464 -0.00184 1.13 [4,] -584.4 -9.145 1.12765 -27.21 [[5]] [,1] [,2] [,3] [,4] [1,] -6553 645.712 -13.03733 -539.39 [2,] 646 4.767 -0.36265 -9.56 [3,] -13 -0.363 -0.00769 1.00 [4,] -539 -9.555 1.00485 -15.09 [[6]] [,1] [,2] [,3] [,4] [1,] -7812.2 593.234 -11.3954 -463.092 [2,] 593.2 2.836 -0.2818 -8.138 [3,] -11.4 -0.282 -0.0101 0.849 [4,] -463.1 -8.138 0.8488 -10.772 [[7]] [,1] [,2] [,3] [,4] [1,] -8531.0 560.140 -10.546 -401.326 [2,] 560.1 1.098 -0.235 -6.795 [3,] -10.5 -0.235 -0.011 0.737 [4,] -401.3 -6.795 0.737 -9.090 [[8]] [,1] [,2] [,3] [,4] [1,] -9329.9 563.569 -10.6627 -405.766 [2,] 563.6 2.487 -0.2155 -8.344 [3,] -10.7 -0.215 -0.0128 0.686 [4,] -405.8 -8.344 0.6856 -2.525 [[9]] [,1] [,2] [,3] [,4] [1,] -9265.20 502.272 -9.7777 -330.189 [2,] 502.27 1.672 -0.1566 -6.994 [3,] -9.78 -0.157 -0.0116 0.558 [4,] -330.19 -6.994 0.5584 -1.787 [[10]] [,1] [,2] [,3] [,4] [1,] -9353.3 480.371 -10.7392 -306.784 [2,] 480.4 2.977 -0.1586 -7.956 [3,] -10.7 -0.159 -0.0124 0.511 [4,] -306.8 -7.956 0.5114 1.055 [[11]] [,1] [,2] [,3] [,4] [1,] -9783.7 474.746 -11.259 -288.544 [2,] 474.7 1.818 -0.175 -6.553 [3,] -11.3 -0.175 -0.012 0.483 [4,] -288.5 -6.553 0.483 -0.493 [[12]] [,1] [,2] [,3] [,4] [1,] -7289.0 333.560 -9.20058 -232.139 [2,] 333.6 6.580 -0.34449 -8.924 [3,] -9.2 -0.344 -0.00752 0.513 [4,] -232.1 -8.924 0.51318 2.835 [[13]] [,1] [,2] [,3] [,4] [1,] -6815.72 315.976 -8.36177 -217.657 [2,] 315.98 5.126 -0.33789 -7.326 [3,] -8.36 -0.338 -0.00589 0.462 [4,] -217.66 -7.326 0.46204 1.585 [[14]] [,1] [,2] [,3] [,4] [1,] -8898.0 386.591 -10.17274 -234.344 [2,] 386.6 3.486 -0.30299 -6.761 [3,] -10.2 -0.303 -0.00806 0.453 [4,] -234.3 -6.761 0.45294 1.565 [[15]] [,1] [,2] [,3] [,4] [1,] -9327.5 404.076 -11.647 -211.345 [2,] 404.1 3.571 -0.228 -7.371 [3,] -11.6 -0.228 -0.012 0.404 [4,] -211.3 -7.371 0.404 3.561 [[16]] [,1] [,2] [,3] [,4] [1,] -10391.6 442.77 -12.165 -218.569 [2,] 442.8 2.06 -0.180 -6.304 [3,] -12.2 -0.18 -0.013 0.353 [4,] -218.6 -6.30 0.353 3.245 [[17]] [,1] [,2] [,3] [,4] [1,] -10942.8 466.859 -12.3142 -235.686 [2,] 466.9 2.360 -0.1726 -6.888 [3,] -12.3 -0.173 -0.0142 0.337 [4,] -235.7 -6.888 0.3368 5.094 [[18]] [,1] [,2] [,3] [,4] [1,] -11275.0 484.392 -12.3755 -250.918 [2,] 484.4 2.033 -0.1737 -6.633 [3,] -12.4 -0.174 -0.0147 0.325 [4,] -250.9 -6.633 0.3245 5.507 [[19]] [,1] [,2] [,3] [,4] [1,] -11958 504.538 -12.9742 -271.043 [2,] 505 1.383 -0.2011 -5.914 [3,] -13 -0.201 -0.0146 0.344 [4,] -271 -5.914 0.3438 4.985 [[20]] [,1] [,2] [,3] [,4] [1,] -12445.8 501.973 -13.4481 -272.531 [2,] 502.0 0.795 -0.2172 -4.993 [3,] -13.4 -0.217 -0.0135 0.351 [4,] -272.5 -4.993 0.3510 3.943 > > hessiansObs <- translogHessian( c( "qLabor", "land", "qVarInput", "time" ), + germanFarms, estResult$coef, yName = "qOutput" ) > print( hessiansObs ) [[1]] [,1] [,2] [,3] [,4] [1,] 28024 1470.50 -56.0407 -990.63 [2,] 1470 21.94 -1.4774 -10.80 [3,] -56 -1.48 0.0534 3.19 [4,] -991 -10.80 3.1909 -395.12 [[2]] [,1] [,2] [,3] [,4] [1,] 8703.4 940.983 -28.8523 -695.10 [2,] 941.0 10.835 -0.7760 -9.29 [3,] -28.9 -0.776 0.0164 1.72 [4,] -695.1 -9.286 1.7242 -101.39 [[3]] [,1] [,2] [,3] [,4] [1,] 3798.1 839.925 -2.12e+01 -702.72 [2,] 839.9 6.984 -5.34e-01 -11.94 [3,] -21.2 -0.534 9.12e-04 1.51 [4,] -702.7 -11.943 1.51e+00 -43.07 [[4]] [,1] [,2] [,3] [,4] [1,] -4476.6 708.674 -16.10842 -597.82 [2,] 708.7 6.139 -0.47497 -9.36 [3,] -16.1 -0.475 -0.00188 1.15 [4,] -597.8 -9.355 1.15359 -27.83 [[5]] [,1] [,2] [,3] [,4] [1,] -6497.5 640.26 -12.92717 -534.835 [2,] 640.3 4.73 -0.35958 -9.474 [3,] -12.9 -0.36 -0.00763 0.996 [4,] -534.8 -9.47 0.99636 -14.965 [[6]] [,1] [,2] [,3] [,4] [1,] -7679.7 583.171 -11.20205 -455.237 [2,] 583.2 2.788 -0.27699 -8.000 [3,] -11.2 -0.277 -0.00994 0.834 [4,] -455.2 -8.000 0.83444 -10.590 [[7]] [,1] [,2] [,3] [,4] [1,] -8550.4 561.411 -10.570 -402.236 [2,] 561.4 1.101 -0.235 -6.810 [3,] -10.6 -0.235 -0.011 0.739 [4,] -402.2 -6.810 0.739 -9.111 [[8]] [,1] [,2] [,3] [,4] [1,] -9299.9 561.754 -10.6284 -404.459 [2,] 561.8 2.478 -0.2148 -8.317 [3,] -10.6 -0.215 -0.0127 0.683 [4,] -404.5 -8.317 0.6834 -2.517 [[9]] [,1] [,2] [,3] [,4] [1,] -9348.19 506.771 -9.8653 -333.146 [2,] 506.77 1.687 -0.1580 -7.056 [3,] -9.87 -0.158 -0.0117 0.563 [4,] -333.15 -7.056 0.5634 -1.803 [[10]] [,1] [,2] [,3] [,4] [1,] -9334.1 479.383 -10.7171 -306.15 [2,] 479.4 2.971 -0.1582 -7.94 [3,] -10.7 -0.158 -0.0124 0.51 [4,] -306.2 -7.940 0.5104 1.05 [[11]] [,1] [,2] [,3] [,4] [1,] -9771.7 474.163 -11.246 -288.190 [2,] 474.2 1.815 -0.175 -6.545 [3,] -11.2 -0.175 -0.012 0.483 [4,] -288.2 -6.545 0.483 -0.493 [[12]] [,1] [,2] [,3] [,4] [1,] -7279.96 333.147 -9.18919 -231.852 [2,] 333.15 6.572 -0.34407 -8.913 [3,] -9.19 -0.344 -0.00751 0.513 [4,] -231.85 -8.913 0.51255 2.832 [[13]] [,1] [,2] [,3] [,4] [1,] -6813.05 315.853 -8.35851 -217.572 [2,] 315.85 5.124 -0.33776 -7.324 [3,] -8.36 -0.338 -0.00589 0.462 [4,] -217.57 -7.324 0.46186 1.585 [[14]] [,1] [,2] [,3] [,4] [1,] -8878.6 385.747 -10.15053 -233.832 [2,] 385.7 3.478 -0.30233 -6.746 [3,] -10.2 -0.302 -0.00804 0.452 [4,] -233.8 -6.746 0.45195 1.561 [[15]] [,1] [,2] [,3] [,4] [1,] -9395.9 407.04 -11.7322 -212.895 [2,] 407.0 3.60 -0.2301 -7.425 [3,] -11.7 -0.23 -0.0121 0.407 [4,] -212.9 -7.42 0.4074 3.587 [[16]] [,1] [,2] [,3] [,4] [1,] -10438.8 444.781 -12.2199 -219.562 [2,] 444.8 2.072 -0.1812 -6.332 [3,] -12.2 -0.181 -0.0131 0.355 [4,] -219.6 -6.332 0.3550 3.260 [[17]] [,1] [,2] [,3] [,4] [1,] -10790.7 460.37 -12.143 -232.410 [2,] 460.4 2.33 -0.170 -6.792 [3,] -12.1 -0.17 -0.014 0.332 [4,] -232.4 -6.79 0.332 5.023 [[18]] [,1] [,2] [,3] [,4] [1,] -11364.2 488.225 -12.4734 -252.903 [2,] 488.2 2.049 -0.1751 -6.685 [3,] -12.5 -0.175 -0.0148 0.327 [4,] -252.9 -6.685 0.3271 5.551 [[19]] [,1] [,2] [,3] [,4] [1,] -11954 504.405 -12.9707 -270.972 [2,] 504 1.382 -0.2010 -5.912 [3,] -13 -0.201 -0.0146 0.344 [4,] -271 -5.912 0.3437 4.983 [[20]] [,1] [,2] [,3] [,4] [1,] -12439.8 501.734 -13.4417 -272.401 [2,] 501.7 0.794 -0.2171 -4.991 [3,] -13.4 -0.217 -0.0135 0.351 [4,] -272.4 -4.991 0.3508 3.941 > > germanFarms$fitted <- fitted > hessiansFitted <- translogHessian( c( "qLabor", "land", "qVarInput", "time" ), + germanFarms, estResult$coef, yName = "fitted" ) > all.equal( hessians, hessiansFitted ) [1] TRUE > > # compute the bordered Hessian matrices > borderedHessians <- translogHessian( c( "qLabor", "land", "qVarInput", "time" ), + germanFarms, estResult$coef, bordered = TRUE ) > print( borderedHessians ) [[1]] [,1] [,2] [,3] [,4] [,5] [1,] 0.00 6137.0 163.84 -7.0437 208.28 [2,] 6137.01 27959.4 1467.13 -55.9124 -988.37 [3,] 163.84 1467.1 21.89 -1.4740 -10.78 [4,] -7.04 -55.9 -1.47 0.0533 3.18 [5,] 208.28 -988.4 -10.78 3.1836 -394.22 [[2]] [,1] [,2] [,3] [,4] [,5] [1,] 0.00 4381.9 123.589 -4.3916 110.91 [2,] 4381.95 8823.3 953.938 -29.2495 -704.67 [3,] 123.59 953.9 10.984 -0.7867 -9.41 [4,] -4.39 -29.2 -0.787 0.0166 1.75 [5,] 110.91 -704.7 -9.414 1.7480 -102.79 [[3]] [,1] [,2] [,3] [,4] [,5] [1,] 0.00 4012.4 107.03 -2.82e+00 47.7 [2,] 4012.41 3766.3 832.90 -2.11e+01 -696.8 [3,] 107.03 832.9 6.93 -5.30e-01 -11.8 [4,] -2.82 -21.1 -0.53 9.04e-04 1.5 [5,] 47.71 -696.8 -11.84 1.50e+00 -42.7 [[4]] [,1] [,2] [,3] [,4] [,5] [1,] 0.00 2675.9 105.718 -2.38803 45.82 [2,] 2675.94 -4376.0 692.742 -15.74627 -584.38 [3,] 105.72 692.7 6.001 -0.46429 -9.14 [4,] -2.39 -15.7 -0.464 -0.00184 1.13 [5,] 45.82 -584.4 -9.145 1.12765 -27.21 [[5]] [,1] [,2] [,3] [,4] [,5] [1,] 0.00 2203 98.887 -1.28793 18.53 [2,] 2202.67 -6553 645.712 -13.03733 -539.39 [3,] 98.89 646 4.767 -0.36265 -9.56 [4,] -1.29 -13 -0.363 -0.00769 1.00 [5,] 18.53 -539 -9.555 1.00485 -15.09 [[6]] [,1] [,2] [,3] [,4] [,5] [1,] 0.000 1859.8 82.112 -0.4312 16.622 [2,] 1859.767 -7812.2 593.234 -11.3954 -463.092 [3,] 82.112 593.2 2.836 -0.2818 -8.138 [4,] -0.431 -11.4 -0.282 -0.0101 0.849 [5,] 16.622 -463.1 -8.138 0.8488 -10.772 [[7]] [,1] [,2] [,3] [,4] [,5] [1,] 0.000 1804.0 60.263 0.228 23.315 [2,] 1804.011 -8531.0 560.140 -10.546 -401.326 [3,] 60.263 560.1 1.098 -0.235 -6.795 [4,] 0.228 -10.5 -0.235 -0.011 0.737 [5,] 23.315 -401.3 -6.795 0.737 -9.090 [[8]] [,1] [,2] [,3] [,4] [,5] [1,] 0.000 1340.3 81.266 0.8117 -17.583 [2,] 1340.312 -9329.9 563.569 -10.6627 -405.766 [3,] 81.266 563.6 2.487 -0.2155 -8.344 [4,] 0.812 -10.7 -0.215 -0.0128 0.686 [5,] -17.583 -405.8 -8.344 0.6856 -2.525 [[9]] [,1] [,2] [,3] [,4] [,5] [1,] 0.00 727.95 68.144 1.7748 -14.913 [2,] 727.95 -9265.20 502.272 -9.7777 -330.189 [3,] 68.14 502.27 1.672 -0.1566 -6.994 [4,] 1.77 -9.78 -0.157 -0.0116 0.558 [5,] -14.91 -330.19 -6.994 0.5584 -1.787 [[10]] [,1] [,2] [,3] [,4] [,5] [1,] 0.00 291.6 86.043 1.5522 -33.344 [2,] 291.56 -9353.3 480.371 -10.7392 -306.784 [3,] 86.04 480.4 2.977 -0.1586 -7.956 [4,] 1.55 -10.7 -0.159 -0.0124 0.511 [5,] -33.34 -306.8 -7.956 0.5114 1.055 [[11]] [,1] [,2] [,3] [,4] [,5] [1,] 0.00 -44.5 74.827 1.519 -21.324 [2,] -44.49 -9783.7 474.746 -11.259 -288.544 [3,] 74.83 474.7 1.818 -0.175 -6.553 [4,] 1.52 -11.3 -0.175 -0.012 0.483 [5,] -21.32 -288.5 -6.553 0.483 -0.493 [[12]] [,1] [,2] [,3] [,4] [,5] [1,] 0.00 -1280.4 126.385 -1.33154 -47.819 [2,] -1280.40 -7289.0 333.560 -9.20058 -232.139 [3,] 126.39 333.6 6.580 -0.34449 -8.924 [4,] -1.33 -9.2 -0.344 -0.00752 0.513 [5,] -47.82 -232.1 -8.924 0.51318 2.835 [[13]] [,1] [,2] [,3] [,4] [,5] [1,] 0.00 -1527.39 114.991 -1.62573 -38.287 [2,] -1527.39 -6815.72 315.976 -8.36177 -217.657 [3,] 114.99 315.98 5.126 -0.33789 -7.326 [4,] -1.63 -8.36 -0.338 -0.00589 0.462 [5,] -38.29 -217.66 -7.326 0.46204 1.585 [[14]] [,1] [,2] [,3] [,4] [,5] [1,] 0.00 -1105.0 103.109 -1.21057 -39.122 [2,] -1105.00 -8898.0 386.591 -10.17274 -234.344 [3,] 103.11 386.6 3.486 -0.30299 -6.761 [4,] -1.21 -10.2 -0.303 -0.00806 0.453 [5,] -39.12 -234.3 -6.761 0.45294 1.565 [[15]] [,1] [,2] [,3] [,4] [,5] [1,] 0.000 -741.7 102.000 0.246 -53.682 [2,] -741.701 -9327.5 404.076 -11.647 -211.345 [3,] 102.000 404.1 3.571 -0.228 -7.371 [4,] 0.246 -11.6 -0.228 -0.012 0.404 [5,] -53.682 -211.3 -7.371 0.404 3.561 [[16]] [,1] [,2] [,3] [,4] [,5] [1,] 0.00 -189.4 82.85 1.262 -51.033 [2,] -189.44 -10391.6 442.77 -12.165 -218.569 [3,] 82.85 442.8 2.06 -0.180 -6.304 [4,] 1.26 -12.2 -0.18 -0.013 0.353 [5,] -51.03 -218.6 -6.30 0.353 3.245 [[17]] [,1] [,2] [,3] [,4] [,5] [1,] 0.00 453.4 87.663 1.4377 -66.311 [2,] 453.38 -10942.8 466.859 -12.3142 -235.686 [3,] 87.66 466.9 2.360 -0.1726 -6.888 [4,] 1.44 -12.3 -0.173 -0.0142 0.337 [5,] -66.31 -235.7 -6.888 0.3368 5.094 [[18]] [,1] [,2] [,3] [,4] [,5] [1,] 0.00 920.2 84.043 1.4892 -70.921 [2,] 920.19 -11275.0 484.392 -12.3755 -250.918 [3,] 84.04 484.4 2.033 -0.1737 -6.633 [4,] 1.49 -12.4 -0.174 -0.0147 0.325 [5,] -70.92 -250.9 -6.633 0.3245 5.507 [[19]] [,1] [,2] [,3] [,4] [,5] [1,] 0.000 1400 76.030 0.9669 -69.918 [2,] 1400.466 -11958 504.538 -12.9742 -271.043 [3,] 76.030 505 1.383 -0.2011 -5.914 [4,] 0.967 -13 -0.201 -0.0146 0.344 [5,] -69.918 -271 -5.914 0.3438 4.985 [[20]] [,1] [,2] [,3] [,4] [,5] [1,] 0.000 1662.3 64.626 0.3284 -63.226 [2,] 1662.322 -12445.8 501.973 -13.4481 -272.531 [3,] 64.626 502.0 0.795 -0.2172 -4.993 [4,] 0.328 -13.4 -0.217 -0.0135 0.351 [5,] -63.226 -272.5 -4.993 0.3510 3.943 > > borderedHessiansObs <- translogHessian( c( "qLabor", "land", "qVarInput", "time" ), + germanFarms, estResult$coef, yName = "qOutput", bordered = TRUE ) > print( borderedHessiansObs ) [[1]] [,1] [,2] [,3] [,4] [,5] [1,] 0.00 6151 164.22 -7.0599 208.76 [2,] 6151.09 28024 1470.50 -56.0407 -990.63 [3,] 164.22 1470 21.94 -1.4774 -10.80 [4,] -7.06 -56 -1.48 0.0534 3.19 [5,] 208.76 -991 -10.80 3.1909 -395.12 [[2]] [,1] [,2] [,3] [,4] [,5] [1,] 0.00 4322.4 121.911 -4.3320 109.40 [2,] 4322.44 8703.4 940.983 -28.8523 -695.10 [3,] 121.91 941.0 10.835 -0.7760 -9.29 [4,] -4.33 -28.9 -0.776 0.0164 1.72 [5,] 109.40 -695.1 -9.286 1.7242 -101.39 [[3]] [,1] [,2] [,3] [,4] [,5] [1,] 0.00 4046.2 107.932 -2.84e+00 48.11 [2,] 4046.23 3798.1 839.925 -2.12e+01 -702.72 [3,] 107.93 839.9 6.984 -5.34e-01 -11.94 [4,] -2.84 -21.2 -0.534 9.12e-04 1.51 [5,] 48.11 -702.7 -11.943 1.51e+00 -43.07 [[4]] [,1] [,2] [,3] [,4] [,5] [1,] 0.00 2737.5 108.149 -2.44296 46.87 [2,] 2737.48 -4476.6 708.674 -16.10842 -597.82 [3,] 108.15 708.7 6.139 -0.47497 -9.36 [4,] -2.44 -16.1 -0.475 -0.00188 1.15 [5,] 46.87 -597.8 -9.355 1.15359 -27.83 [[5]] [,1] [,2] [,3] [,4] [,5] [1,] 0.00 2184.1 98.05 -1.27705 18.377 [2,] 2184.06 -6497.5 640.26 -12.92717 -534.835 [3,] 98.05 640.3 4.73 -0.35958 -9.474 [4,] -1.28 -12.9 -0.36 -0.00763 0.996 [5,] 18.38 -534.8 -9.47 0.99636 -14.965 [[6]] [,1] [,2] [,3] [,4] [,5] [1,] 0.000 1828.2 80.719 -0.42392 16.340 [2,] 1828.220 -7679.7 583.171 -11.20205 -455.237 [3,] 80.719 583.2 2.788 -0.27699 -8.000 [4,] -0.424 -11.2 -0.277 -0.00994 0.834 [5,] 16.340 -455.2 -8.000 0.83444 -10.590 [[7]] [,1] [,2] [,3] [,4] [,5] [1,] 0.000 1808.1 60.400 0.229 23.368 [2,] 1808.103 -8550.4 561.411 -10.570 -402.236 [3,] 60.400 561.4 1.101 -0.235 -6.810 [4,] 0.229 -10.6 -0.235 -0.011 0.739 [5,] 23.368 -402.2 -6.810 0.739 -9.111 [[8]] [,1] [,2] [,3] [,4] [,5] [1,] 0.000 1336.0 81.005 0.8090 -17.526 [2,] 1335.996 -9299.9 561.754 -10.6284 -404.459 [3,] 81.005 561.8 2.478 -0.2148 -8.317 [4,] 0.809 -10.6 -0.215 -0.0127 0.683 [5,] -17.526 -404.5 -8.317 0.6834 -2.517 [[9]] [,1] [,2] [,3] [,4] [,5] [1,] 0.00 734.47 68.754 1.7907 -15.047 [2,] 734.47 -9348.19 506.771 -9.8653 -333.146 [3,] 68.75 506.77 1.687 -0.1580 -7.056 [4,] 1.79 -9.87 -0.158 -0.0117 0.563 [5,] -15.05 -333.15 -7.056 0.5634 -1.803 [[10]] [,1] [,2] [,3] [,4] [,5] [1,] 0.00 291.0 85.866 1.5490 -33.28 [2,] 290.96 -9334.1 479.383 -10.7171 -306.15 [3,] 85.87 479.4 2.971 -0.1582 -7.94 [4,] 1.55 -10.7 -0.158 -0.0124 0.51 [5,] -33.28 -306.2 -7.940 0.5104 1.05 [[11]] [,1] [,2] [,3] [,4] [,5] [1,] 0.00 -44.4 74.735 1.517 -21.298 [2,] -44.44 -9771.7 474.163 -11.246 -288.190 [3,] 74.73 474.2 1.815 -0.175 -6.545 [4,] 1.52 -11.2 -0.175 -0.012 0.483 [5,] -21.30 -288.2 -6.545 0.483 -0.493 [[12]] [,1] [,2] [,3] [,4] [,5] [1,] 0.00 -1278.82 126.229 -1.32989 -47.760 [2,] -1278.82 -7279.96 333.147 -9.18919 -231.852 [3,] 126.23 333.15 6.572 -0.34407 -8.913 [4,] -1.33 -9.19 -0.344 -0.00751 0.513 [5,] -47.76 -231.85 -8.913 0.51255 2.832 [[13]] [,1] [,2] [,3] [,4] [,5] [1,] 0.00 -1526.79 114.946 -1.62510 -38.272 [2,] -1526.79 -6813.05 315.853 -8.35851 -217.572 [3,] 114.95 315.85 5.124 -0.33776 -7.324 [4,] -1.63 -8.36 -0.338 -0.00589 0.462 [5,] -38.27 -217.57 -7.324 0.46186 1.585 [[14]] [,1] [,2] [,3] [,4] [,5] [1,] 0.00 -1102.6 102.884 -1.20792 -39.037 [2,] -1102.59 -8878.6 385.747 -10.15053 -233.832 [3,] 102.88 385.7 3.478 -0.30233 -6.746 [4,] -1.21 -10.2 -0.302 -0.00804 0.452 [5,] -39.04 -233.8 -6.746 0.45195 1.561 [[15]] [,1] [,2] [,3] [,4] [,5] [1,] 0.000 -747.1 102.75 0.2477 -54.076 [2,] -747.141 -9395.9 407.04 -11.7322 -212.895 [3,] 102.748 407.0 3.60 -0.2301 -7.425 [4,] 0.248 -11.7 -0.23 -0.0121 0.407 [5,] -54.076 -212.9 -7.42 0.4074 3.587 [[16]] [,1] [,2] [,3] [,4] [,5] [1,] 0.00 -190.3 83.227 1.2680 -51.265 [2,] -190.30 -10438.8 444.781 -12.2199 -219.562 [3,] 83.23 444.8 2.072 -0.1812 -6.332 [4,] 1.27 -12.2 -0.181 -0.0131 0.355 [5,] -51.26 -219.6 -6.332 0.3550 3.260 [[17]] [,1] [,2] [,3] [,4] [,5] [1,] 0.00 447.1 86.44 1.418 -65.390 [2,] 447.07 -10790.7 460.37 -12.143 -232.410 [3,] 86.44 460.4 2.33 -0.170 -6.792 [4,] 1.42 -12.1 -0.17 -0.014 0.332 [5,] -65.39 -232.4 -6.79 0.332 5.023 [[18]] [,1] [,2] [,3] [,4] [,5] [1,] 0.0 927.5 84.707 1.5010 -71.482 [2,] 927.5 -11364.2 488.225 -12.4734 -252.903 [3,] 84.7 488.2 2.049 -0.1751 -6.685 [4,] 1.5 -12.5 -0.175 -0.0148 0.327 [5,] -71.5 -252.9 -6.685 0.3271 5.551 [[19]] [,1] [,2] [,3] [,4] [,5] [1,] 0.000 1400 76.010 0.9667 -69.900 [2,] 1400.098 -11954 504.405 -12.9707 -270.972 [3,] 76.010 504 1.382 -0.2010 -5.912 [4,] 0.967 -13 -0.201 -0.0146 0.344 [5,] -69.900 -271 -5.912 0.3437 4.983 [[20]] [,1] [,2] [,3] [,4] [,5] [1,] 0.000 1661.5 64.595 0.3282 -63.196 [2,] 1661.533 -12439.8 501.734 -13.4417 -272.401 [3,] 64.595 501.7 0.794 -0.2171 -4.991 [4,] 0.328 -13.4 -0.217 -0.0135 0.351 [5,] -63.196 -272.4 -4.991 0.3508 3.941 > > germanFarms$fitted <- fitted > borderedHessiansFitted <- translogHessian( c( "qLabor", "land", "qVarInput", "time" ), + germanFarms, estResult$coef, yName = "fitted", bordered = TRUE ) > all.equal( borderedHessians, borderedHessiansFitted ) [1] TRUE > > ## testing translogCheckMono > test <- translogCheckMono( c( "qLabor", "land", "qVarInput", "time" ), + germanFarms, coef( estResult ) ) > summary( test ) This translog function is monotonically increasing in qLabor, land, qVarInput, time at 1 out of 20 observations (5%) The monotonicity condition for the exogenous variable - 'qLabor' is fulfilled at 14 out of 20 observations (70%) - 'land' is fulfilled at 20 out of 20 observations (100%) - 'qVarInput' is fulfilled at 11 out of 20 observations (55%) - 'time' is fulfilled at 7 out of 20 observations (35%) > class( test ) <- NULL > print( test ) $exog qLabor land qVarInput time [1,] TRUE TRUE FALSE TRUE [2,] TRUE TRUE FALSE TRUE [3,] TRUE TRUE FALSE TRUE [4,] TRUE TRUE FALSE TRUE [5,] TRUE TRUE FALSE TRUE [6,] TRUE TRUE FALSE TRUE [7,] TRUE TRUE TRUE TRUE [8,] TRUE TRUE TRUE FALSE [9,] TRUE TRUE TRUE FALSE [10,] TRUE TRUE TRUE FALSE [11,] FALSE TRUE TRUE FALSE [12,] FALSE TRUE FALSE FALSE [13,] FALSE TRUE FALSE FALSE [14,] FALSE TRUE FALSE FALSE [15,] FALSE TRUE TRUE FALSE [16,] FALSE TRUE TRUE FALSE [17,] TRUE TRUE TRUE FALSE [18,] TRUE TRUE TRUE FALSE [19,] TRUE TRUE TRUE FALSE [20,] TRUE TRUE TRUE FALSE $obs [1] FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE $increasing [1] TRUE TRUE TRUE TRUE $strict [1] FALSE > > test <- translogCheckMono( c( "qLabor", "land", "qVarInput", "time" ), + germanFarms, coef( estResult ), strict = TRUE ) > summary( test ) This translog function is strictly monotonically increasing in qLabor, land, qVarInput, time at 1 out of 20 observations (5%) The monotonicity condition for the exogenous variable - 'qLabor' is fulfilled at 14 out of 20 observations (70%) - 'land' is fulfilled at 20 out of 20 observations (100%) - 'qVarInput' is fulfilled at 11 out of 20 observations (55%) - 'time' is fulfilled at 7 out of 20 observations (35%) > class( test ) <- NULL > print( test ) $exog qLabor land qVarInput time [1,] TRUE TRUE FALSE TRUE [2,] TRUE TRUE FALSE TRUE [3,] TRUE TRUE FALSE TRUE [4,] TRUE TRUE FALSE TRUE [5,] TRUE TRUE FALSE TRUE [6,] TRUE TRUE FALSE TRUE [7,] TRUE TRUE TRUE TRUE [8,] TRUE TRUE TRUE FALSE [9,] TRUE TRUE TRUE FALSE [10,] TRUE TRUE TRUE FALSE [11,] FALSE TRUE TRUE FALSE [12,] FALSE TRUE FALSE FALSE [13,] FALSE TRUE FALSE FALSE [14,] FALSE TRUE FALSE FALSE [15,] FALSE TRUE TRUE FALSE [16,] FALSE TRUE TRUE FALSE [17,] TRUE TRUE TRUE FALSE [18,] TRUE TRUE TRUE FALSE [19,] TRUE TRUE TRUE FALSE [20,] TRUE TRUE TRUE FALSE $obs [1] FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE $increasing [1] TRUE TRUE TRUE TRUE $strict [1] TRUE > > test <- translogCheckMono( c( "qLabor", "land", "qVarInput", "time" ), + germanFarms, coef( estResult ), increasing = FALSE ) > summary( test ) This translog function is monotonically decreasing in qLabor, land, qVarInput, time at 0 out of 20 observations (0%) The monotonicity condition for the exogenous variable - 'qLabor' is fulfilled at 6 out of 20 observations (30%) - 'land' is fulfilled at 0 out of 20 observations (0%) - 'qVarInput' is fulfilled at 9 out of 20 observations (45%) - 'time' is fulfilled at 13 out of 20 observations (65%) > class( test ) <- NULL > print( test ) $exog qLabor land qVarInput time [1,] FALSE FALSE TRUE FALSE [2,] FALSE FALSE TRUE FALSE [3,] FALSE FALSE TRUE FALSE [4,] FALSE FALSE TRUE FALSE [5,] FALSE FALSE TRUE FALSE [6,] FALSE FALSE TRUE FALSE [7,] FALSE FALSE FALSE FALSE [8,] FALSE FALSE FALSE TRUE [9,] FALSE FALSE FALSE TRUE [10,] FALSE FALSE FALSE TRUE [11,] TRUE FALSE FALSE TRUE [12,] TRUE FALSE TRUE TRUE [13,] TRUE FALSE TRUE TRUE [14,] TRUE FALSE TRUE TRUE [15,] TRUE FALSE FALSE TRUE [16,] TRUE FALSE FALSE TRUE [17,] FALSE FALSE FALSE TRUE [18,] FALSE FALSE FALSE TRUE [19,] FALSE FALSE FALSE TRUE [20,] FALSE FALSE FALSE TRUE $obs [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE $increasing [1] FALSE FALSE FALSE FALSE $strict [1] FALSE > > test <- translogCheckMono( c( "qLabor", "land", "qVarInput", "time" ), + germanFarms, coef( estResult ), increasing = FALSE, strict = TRUE ) > summary( test ) This translog function is strictly monotonically decreasing in qLabor, land, qVarInput, time at 0 out of 20 observations (0%) The monotonicity condition for the exogenous variable - 'qLabor' is fulfilled at 6 out of 20 observations (30%) - 'land' is fulfilled at 0 out of 20 observations (0%) - 'qVarInput' is fulfilled at 9 out of 20 observations (45%) - 'time' is fulfilled at 13 out of 20 observations (65%) > class( test ) <- NULL > print( test ) $exog qLabor land qVarInput time [1,] FALSE FALSE TRUE FALSE [2,] FALSE FALSE TRUE FALSE [3,] FALSE FALSE TRUE FALSE [4,] FALSE FALSE TRUE FALSE [5,] FALSE FALSE TRUE FALSE [6,] FALSE FALSE TRUE FALSE [7,] FALSE FALSE FALSE FALSE [8,] FALSE FALSE FALSE TRUE [9,] FALSE FALSE FALSE TRUE [10,] FALSE FALSE FALSE TRUE [11,] TRUE FALSE FALSE TRUE [12,] TRUE FALSE TRUE TRUE [13,] TRUE FALSE TRUE TRUE [14,] TRUE FALSE TRUE TRUE [15,] TRUE FALSE FALSE TRUE [16,] TRUE FALSE FALSE TRUE [17,] FALSE FALSE FALSE TRUE [18,] FALSE FALSE FALSE TRUE [19,] FALSE FALSE FALSE TRUE [20,] FALSE FALSE FALSE TRUE $obs [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE $increasing [1] FALSE FALSE FALSE FALSE $strict [1] TRUE > > test <- translogCheckMono( c( "qLabor", "land", "qVarInput", "time" ), + germanFarms, coef( estResult ), increasing = c( FALSE, TRUE, FALSE, FALSE ) ) > summary( test ) This translog function is monotonically increasing in land and monotonically decreasing in qLabor, qVarInput, time at 3 out of 20 observations (15%) The monotonicity condition for the exogenous variable - 'qLabor' is fulfilled at 6 out of 20 observations (30%) - 'land' is fulfilled at 20 out of 20 observations (100%) - 'qVarInput' is fulfilled at 9 out of 20 observations (45%) - 'time' is fulfilled at 13 out of 20 observations (65%) > print.default( test ) $exog qLabor land qVarInput time [1,] FALSE TRUE TRUE FALSE [2,] FALSE TRUE TRUE FALSE [3,] FALSE TRUE TRUE FALSE [4,] FALSE TRUE TRUE FALSE [5,] FALSE TRUE TRUE FALSE [6,] FALSE TRUE TRUE FALSE [7,] FALSE TRUE FALSE FALSE [8,] FALSE TRUE FALSE TRUE [9,] FALSE TRUE FALSE TRUE [10,] FALSE TRUE FALSE TRUE [11,] TRUE TRUE FALSE TRUE [12,] TRUE TRUE TRUE TRUE [13,] TRUE TRUE TRUE TRUE [14,] TRUE TRUE TRUE TRUE [15,] TRUE TRUE FALSE TRUE [16,] TRUE TRUE FALSE TRUE [17,] FALSE TRUE FALSE TRUE [18,] FALSE TRUE FALSE TRUE [19,] FALSE TRUE FALSE TRUE [20,] FALSE TRUE FALSE TRUE $obs [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE [13] TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE $increasing [1] FALSE TRUE FALSE FALSE $strict [1] FALSE attr(,"class") [1] "translogCheckMono" > > test <- translogCheckMono( c( "qLabor", "land", "qVarInput", "time" ), + germanFarms, coef( estResult ), increasing = c( FALSE, TRUE, TRUE, FALSE ), + strict = TRUE ) > summary( test ) This translog function is strictly monotonically increasing in land, qVarInput and strictly monotonically decreasing in qLabor, time at 3 out of 20 observations (15%) The monotonicity condition for the exogenous variable - 'qLabor' is fulfilled at 6 out of 20 observations (30%) - 'land' is fulfilled at 20 out of 20 observations (100%) - 'qVarInput' is fulfilled at 11 out of 20 observations (55%) - 'time' is fulfilled at 13 out of 20 observations (65%) > print.default( test ) $exog qLabor land qVarInput time [1,] FALSE TRUE FALSE FALSE [2,] FALSE TRUE FALSE FALSE [3,] FALSE TRUE FALSE FALSE [4,] FALSE TRUE FALSE FALSE [5,] FALSE TRUE FALSE FALSE [6,] FALSE TRUE FALSE FALSE [7,] FALSE TRUE TRUE FALSE [8,] FALSE TRUE TRUE TRUE [9,] FALSE TRUE TRUE TRUE [10,] FALSE TRUE TRUE TRUE [11,] TRUE TRUE TRUE TRUE [12,] TRUE TRUE FALSE TRUE [13,] TRUE TRUE FALSE TRUE [14,] TRUE TRUE FALSE TRUE [15,] TRUE TRUE TRUE TRUE [16,] TRUE TRUE TRUE TRUE [17,] FALSE TRUE TRUE TRUE [18,] FALSE TRUE TRUE TRUE [19,] FALSE TRUE TRUE TRUE [20,] FALSE TRUE TRUE TRUE $obs [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE [13] FALSE FALSE TRUE TRUE FALSE FALSE FALSE FALSE $increasing [1] FALSE TRUE TRUE FALSE $strict [1] TRUE attr(,"class") [1] "translogCheckMono" > > test <- translogCheckMono( c( "qLabor", "land", "qVarInput", "time" ), + germanFarms, coef( estResult ), increasing = c( TRUE, TRUE, FALSE, TRUE ) ) > summary( test ) This translog function is monotonically increasing in qLabor, land, time and monotonically decreasing in qVarInput at 6 out of 20 observations (30%) The monotonicity condition for the exogenous variable - 'qLabor' is fulfilled at 14 out of 20 observations (70%) - 'land' is fulfilled at 20 out of 20 observations (100%) - 'qVarInput' is fulfilled at 9 out of 20 observations (45%) - 'time' is fulfilled at 7 out of 20 observations (35%) > print.default( test ) $exog qLabor land qVarInput time [1,] TRUE TRUE TRUE TRUE [2,] TRUE TRUE TRUE TRUE [3,] TRUE TRUE TRUE TRUE [4,] TRUE TRUE TRUE TRUE [5,] TRUE TRUE TRUE TRUE [6,] TRUE TRUE TRUE TRUE [7,] TRUE TRUE FALSE TRUE [8,] TRUE TRUE FALSE FALSE [9,] TRUE TRUE FALSE FALSE [10,] TRUE TRUE FALSE FALSE [11,] FALSE TRUE FALSE FALSE [12,] FALSE TRUE TRUE FALSE [13,] FALSE TRUE TRUE FALSE [14,] FALSE TRUE TRUE FALSE [15,] FALSE TRUE FALSE FALSE [16,] FALSE TRUE FALSE FALSE [17,] TRUE TRUE FALSE FALSE [18,] TRUE TRUE FALSE FALSE [19,] TRUE TRUE FALSE FALSE [20,] TRUE TRUE FALSE FALSE $obs [1] TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE $increasing [1] TRUE TRUE FALSE TRUE $strict [1] FALSE attr(,"class") [1] "translogCheckMono" > > > ## testing translogCheckCurvature > test <- translogCheckCurvature( c( "qLabor", "land", "qVarInput", "time" ), + germanFarms, coef( estResult ) ) > summary( test ) Length Class Mode obs 20 -none- logical convexity 1 -none- logical quasi 1 -none- logical > class( test ) <- NULL > print( test ) $obs [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE $convexity [1] TRUE $quasi [1] FALSE > > test <- translogCheckCurvature( c( "qLabor", "land", "qVarInput", "time" ), + germanFarms, coef( estResult ), quasi = TRUE ) > summary( test ) Length Class Mode obs 20 -none- logical convexity 1 -none- logical quasi 1 -none- logical > class( test ) <- NULL > print( test ) $obs [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE $convexity [1] TRUE $quasi [1] TRUE > > test <- translogCheckCurvature( c( "qLabor", "land", "qVarInput", "time" ), + germanFarms, coef( estResult ), convexity = FALSE ) > summary( test ) Length Class Mode obs 20 -none- logical convexity 1 -none- logical quasi 1 -none- logical > class( test ) <- NULL > print( test ) $obs [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE $convexity [1] FALSE $quasi [1] FALSE > > test <- translogCheckCurvature( c( "qLabor", "land", "qVarInput", "time" ), + germanFarms, coef( estResult ), convexity = FALSE, quasi = TRUE ) > summary( test ) Length Class Mode obs 20 -none- logical convexity 1 -none- logical quasi 1 -none- logical > class( test ) <- NULL > print( test ) $obs [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE $convexity [1] FALSE $quasi [1] TRUE > > > ## testing translogProdFuncMargCost > # generate (artificial) prices > germanFarms$pLand <- 200 + 15 * germanFarms$time > germanFarms$pTime <- 1 > > # compute the marginal costs of producing the output > margCost <- translogProdFuncMargCost( yName = "qOutput", + xNames = c( "qLabor", "land", "qVarInput", "time" ), + wNames = c( "pLabor", "pLand", "pVarInput", "pTime" ), + data = germanFarms, coef = coef( estResult ) ) > print( margCost ) 1 2 3 4 5 6 7 8 9 10 11 72.1 46.5 29.5 27.9 27.0 27.7 28.9 29.5 27.9 28.8 29.0 12 13 14 15 16 17 18 19 20 18.2 13.0 26.2 34.3 39.9 57.6 79.6 604.2 -100.1 > > # compute the marginal costs again with different order of inputs > margCostOrder <- translogProdFuncMargCost( yName = "qOutput", + xNames = c( "qLabor", "qVarInput", "land", "time" ), + wNames = c( "pLabor", "pVarInput", "pLand", "pTime" ), + data = germanFarms, coef = coef( estResultOrder ) ) > all.equal( margCost, margCostOrder ) [1] TRUE > > # compute the marginal costs again with different order of inputs > margCostOrder2 <- translogProdFuncMargCost( yName = "qOutput", + xNames = c( "land", "qVarInput", "qLabor", "time" ), + wNames = c( "pLand", "pVarInput", "pLabor", "pTime" ), + data = germanFarms, coef = coef( estResultOrder2 ) ) > all.equal( margCost, margCostOrder2 ) [1] TRUE > > # compute the marginal costs again with different order of inputs > margCostOrder3 <- translogProdFuncMargCost( yName = "qOutput", + xNames = c( "land", "qVarInput", "time", "qLabor" ), + wNames = c( "pLand", "pVarInput", "pTime", "pLabor" ), + data = germanFarms, coef = coef( estResultOrder3 ) ) > all.equal( margCost, margCostOrder3 ) [1] TRUE > > > ## testing translogEst with one shifter > germanFarms$tech <- exp( germanFarms$time ) > estResultShifter <- translogEst( "qOutput", + c( "qLabor", "land", "qVarInput" ), + shifterNames = "tech", data = germanFarms ) > print( estResultShifter ) Estimated Translog function with 20 observations. a_0 a_1 a_2 a_3 b_1_1 b_1_2 b_1_3 b_2_2 73.52668 52.66212 9.24343 -29.64508 -3.65917 -5.35158 -5.09844 0.48539 b_2_3 b_3_3 d_1 -1.18143 5.58758 0.00798 > summary( estResultShifter ) Estimated Translog function with 20 observations. Estimate Std. Error t value Pr(>|t|) a_0 73.52668 122.80077 0.60 0.56 a_1 52.66212 75.15469 0.70 0.50 a_2 9.24343 20.77301 0.44 0.67 a_3 -29.64508 44.63654 -0.66 0.52 b_1_1 -3.65917 23.51973 -0.16 0.88 b_1_2 -5.35158 8.77016 -0.61 0.56 b_1_3 -5.09844 12.95490 -0.39 0.70 b_2_2 0.48539 2.89804 0.17 0.87 b_2_3 -1.18143 4.13951 -0.29 0.78 b_3_3 5.58758 8.34380 0.67 0.52 d_1 0.00798 0.00912 0.87 0.40 R-squared: 0.991 Adjusted R-squared: 0.981 > residuals( estResultShifter ) 1 2 3 4 5 6 7 8 0.01190 -0.06095 0.02074 0.01242 0.01717 -0.00263 -0.00786 0.03279 9 10 11 12 13 14 15 16 0.00673 -0.01403 -0.01549 0.00943 -0.01965 0.01033 0.02339 -0.01678 17 18 19 20 -0.01868 0.00363 0.01243 -0.00488 > print.default( estResultShifter ) $call translogEst(yName = "qOutput", xNames = c("qLabor", "land", "qVarInput"), data = germanFarms, shifterNames = "tech") $nExog [1] 3 $nShifter [1] 1 $est Call: lm(formula = as.formula(estFormula), data = estData) Coefficients: (Intercept) a_1 a_2 a_3 b_1_1 b_1_2 73.52668 52.66212 9.24343 -29.64508 -3.65917 -5.35158 b_1_3 b_2_2 b_2_3 b_3_3 d_1 -5.09844 0.48539 -1.18143 5.58758 0.00798 $residuals 1 2 3 4 5 6 7 8 0.01190 -0.06095 0.02074 0.01242 0.01717 -0.00263 -0.00786 0.03279 9 10 11 12 13 14 15 16 0.00673 -0.01403 -0.01549 0.00943 -0.01965 0.01033 0.02339 -0.01678 17 18 19 20 -0.01868 0.00363 0.01243 -0.00488 $fitted 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 935 1023 1048 1157 1158 1189 1249 1247 1200 1296 1382 1526 1606 1679 1607 1654 17 18 19 20 1686 1749 1864 2002 $coef a_0 a_1 a_2 a_3 b_1_1 b_1_2 b_1_3 b_2_2 73.52668 52.66212 9.24343 -29.64508 -3.65917 -5.35158 -5.09844 0.48539 b_2_3 b_3_3 d_1 -1.18143 5.58758 0.00798 $coefCov a_0 a_1 a_2 a_3 b_1_1 b_1_2 b_1_3 a_0 15080.030 7638.897 475.4563 -5.38e+03 1241.2236 -45.6529 -1.23e+03 a_1 7638.897 5648.228 -442.6042 -2.49e+03 1272.0678 -56.7700 -9.18e+02 a_2 475.456 -442.604 431.5181 -3.39e+02 -218.7282 -27.1063 9.54e+01 a_3 -5381.913 -2492.627 -338.8292 1.99e+03 -351.4677 32.0213 3.89e+02 b_1_1 1241.224 1272.068 -218.7282 -3.51e+02 553.1776 -44.9757 -2.08e+02 b_1_2 -45.653 -56.770 -27.1063 3.20e+01 -44.9757 76.9158 -2.72e+01 b_1_3 -1228.123 -918.315 95.3760 3.89e+02 -208.3786 -27.2045 1.68e+02 b_2_2 59.668 -19.572 34.3177 -3.45e+01 -1.6673 -5.7103 6.04e+00 b_2_3 -100.302 81.866 -81.4941 6.72e+01 37.2293 1.4329 -1.57e+01 b_3_3 959.065 401.296 87.4299 -3.66e+02 48.4467 -3.6809 -6.28e+01 d_1 -0.191 -0.188 -0.0299 8.77e-02 0.0208 0.0369 8.57e-03 b_2_2 b_2_3 b_3_3 d_1 a_0 59.66752 -1.00e+02 959.0647 -1.91e-01 a_1 -19.57188 8.19e+01 401.2962 -1.88e-01 a_2 34.31773 -8.15e+01 87.4299 -2.99e-02 a_3 -34.45950 6.72e+01 -366.0503 8.77e-02 b_1_1 -1.66734 3.72e+01 48.4467 2.08e-02 b_1_2 -5.71028 1.43e+00 -3.6809 3.69e-02 b_1_3 6.04264 -1.57e+01 -62.7992 8.57e-03 b_2_2 8.39863 -9.24e+00 9.6225 3.55e-03 b_2_3 -9.23966 1.71e+01 -18.0641 -2.96e-04 b_3_3 9.62251 -1.81e+01 69.6190 -1.38e-02 d_1 0.00355 -2.96e-04 -0.0138 8.31e-05 $r2 [1] 0.991 $r2bar [1] 0.981 $nObs [1] 20 $yName [1] "qOutput" $xNames [1] "qLabor" "land" "qVarInput" $shifterNames [1] "tech" $model.matrix (Intercept) a_1 a_2 a_3 b_1_1 b_1_2 b_1_3 b_2_2 b_2_3 b_3_3 d_1 1 1 0.365 3.15 6.32 0.0665 1.15 2.31 4.97 19.9 20.0 1 2 1 0.372 3.19 6.41 0.0690 1.18 2.38 5.08 20.4 20.5 2 3 1 0.365 3.21 6.41 0.0665 1.17 2.34 5.14 20.6 20.5 3 4 1 0.392 3.22 6.48 0.0768 1.26 2.54 5.17 20.8 21.0 4 5 1 0.392 3.22 6.47 0.0768 1.26 2.54 5.17 20.8 21.0 5 6 1 0.385 3.23 6.49 0.0742 1.24 2.50 5.21 20.9 21.0 6 7 1 0.372 3.25 6.51 0.0690 1.21 2.42 5.30 21.2 21.2 7 8 1 0.399 3.26 6.47 0.0795 1.30 2.58 5.30 21.1 21.0 8 9 1 0.392 3.23 6.46 0.0768 1.26 2.53 5.20 20.8 20.9 9 10 1 0.425 3.26 6.47 0.0904 1.39 2.75 5.32 21.1 21.0 10 11 1 0.425 3.29 6.53 0.0904 1.40 2.78 5.40 21.5 21.3 11 12 1 0.525 3.40 6.63 0.1377 1.78 3.48 5.77 22.5 22.0 12 13 1 0.531 3.44 6.69 0.1408 1.82 3.55 5.91 23.0 22.4 13 14 1 0.513 3.47 6.68 0.1315 1.78 3.43 6.03 23.2 22.3 14 15 1 0.501 3.45 6.60 0.1254 1.73 3.31 5.95 22.8 21.8 15 16 1 0.476 3.46 6.58 0.1134 1.65 3.13 5.99 22.8 21.6 16 17 1 0.482 3.51 6.55 0.1164 1.69 3.16 6.17 23.0 21.5 17 18 1 0.482 3.56 6.55 0.1164 1.72 3.16 6.33 23.3 21.5 18 19 1 0.482 3.62 6.59 0.1164 1.75 3.18 6.55 23.9 21.7 19 20 1 0.482 3.67 6.65 0.1164 1.77 3.21 6.75 24.4 22.1 20 attr(,"assign") [1] 0 1 2 3 4 5 6 7 8 9 10 $r2nonLog [,1] [1,] 0.993 $dataLogged [1] FALSE attr(,"class") [1] "translogEst" > # with dataLogged = TRUE > estResultShifterLog <- translogEst( "qLogOutput", + xNames = c( "qLogLabor", "qLogLand", "qLogVarInput" ), + data = germanFarms, shifterNames = "time", dataLogged = TRUE ) > all.equal( estResultShifter[ -c(1,6,12,13,14,17) ], + estResultShifterLog[ -c(1,6,12,13,14,17) ] ) [1] TRUE > all.equal( estResultShifter$fitted, exp( estResultShifterLog$fitted ) ) [1] TRUE > # testing translogCalc > fitted <- translogCalc( c( "qLabor", "land", "qVarInput" ), + shifterNames = "tech", data = germanFarms, coef = estResultShifter$coef ) > all.equal( fitted, estResultShifter$fitted ) [1] TRUE > # testing calculation of elasticities with translogEla > estElaShifter <- translogEla( c( "qLabor", "land", "qVarInput" ), + data = germanFarms, coef = coef( estResultShifter ), + coefCov = vcov( estResultShifter ) ) > print( estElaShifter ) qLabor land qVarInput 1 2.225 1.354 0.0944 2 1.580 1.231 0.5009 3 1.487 1.275 0.5243 4 0.967 1.047 0.7821 5 1.017 1.058 0.7277 6 0.900 1.084 0.8274 7 0.682 1.141 1.0041 8 0.767 1.042 0.6465 9 1.020 1.078 0.6486 10 0.645 0.901 0.5118 11 0.244 0.854 0.7653 12 -1.263 0.246 0.7378 13 -1.765 0.173 0.9480 14 -1.860 0.290 0.9743 15 -1.299 0.438 0.6175 16 -1.143 0.604 0.5894 17 -1.307 0.626 0.3555 18 -1.552 0.646 0.3119 19 -2.095 0.627 0.4682 20 -2.650 0.592 0.6938 > print( attributes( estElaShifter )$variance ) qLabor land qVarInput 1 5525 418 1961 2 5594 424 1987 3 5606 423 1989 4 5638 429 2005 5 5629 429 2001 6 5652 429 2008 7 5694 430 2021 8 5623 427 1996 9 5619 427 1996 10 5591 428 1986 11 5639 431 2003 12 5620 439 1997 13 5662 442 2011 14 5683 440 2014 15 5624 433 1991 16 5633 430 1990 17 5606 427 1975 18 5612 425 1973 19 5654 426 1984 20 5706 429 1999 > print( attributes( estElaShifter )$stdDev ) qLabor land qVarInput 1 74.3 20.5 44.3 2 74.8 20.6 44.6 3 74.9 20.6 44.6 4 75.1 20.7 44.8 5 75.0 20.7 44.7 6 75.2 20.7 44.8 7 75.5 20.7 45.0 8 75.0 20.7 44.7 9 75.0 20.7 44.7 10 74.8 20.7 44.6 11 75.1 20.8 44.8 12 75.0 20.9 44.7 13 75.2 21.0 44.8 14 75.4 21.0 44.9 15 75.0 20.8 44.6 16 75.1 20.7 44.6 17 74.9 20.7 44.4 18 74.9 20.6 44.4 19 75.2 20.7 44.5 20 75.5 20.7 44.7 > estElaShifterMet <- elas( estResultShifter ) > all.equal( estElaShifter, estElaShifterMet ) [1] TRUE > estElaShifterLogMet <- elas( estResultShifterLog ) > all.equal( estElaShifterMet, estElaShifterLogMet, check.attributes = FALSE ) [1] TRUE > > ## testing translogEst with two shifters > germanFarms$techSq <- exp( germanFarms$time^2 ) > estResultShifter2 <- translogEst( "qOutput", + c( "qLabor", "land", "qVarInput" ), + shifterNames = c( "tech", "techSq" ), data = germanFarms ) > print( estResultShifter2 ) Estimated Translog function with 20 observations. a_0 a_1 a_2 a_3 b_1_1 b_1_2 b_1_3 b_2_2 95.58953 67.47142 -6.60142 -29.17953 -9.63718 -0.05109 -9.60205 0.12943 b_2_3 b_3_3 d_1 d_2 1.22012 4.49207 0.03707 -0.00243 > summary( estResultShifter2 ) Estimated Translog function with 20 observations. Estimate Std. Error t value Pr(>|t|) a_0 95.58953 105.63575 0.90 0.392 a_1 67.47142 64.71631 1.04 0.328 a_2 -6.60142 19.35514 -0.34 0.742 a_3 -29.17953 38.20210 -0.76 0.467 b_1_1 -9.63718 20.33495 -0.47 0.648 b_1_2 -0.05109 7.93031 -0.01 0.995 b_1_3 -9.60205 11.29856 -0.85 0.420 b_2_2 0.12943 2.48619 0.05 0.960 b_2_3 1.22012 3.72775 0.33 0.752 b_3_3 4.49207 7.16048 0.63 0.548 d_1 0.03707 0.01607 2.31 0.050 * d_2 -0.00243 0.00117 -2.07 0.072 . --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 R-squared: 0.994 Adjusted R-squared: 0.986 > residuals( estResultShifter2 ) 1 2 3 4 5 6 7 8 0.01441 -0.04657 0.01685 0.02045 0.01142 -0.00695 -0.00561 0.00496 9 10 11 12 13 14 15 16 0.00637 -0.02698 0.00697 0.00616 -0.00863 -0.00731 0.02059 0.00813 17 18 19 20 -0.02289 0.00326 0.00885 -0.00348 > print.default( estResultShifter2 ) $call translogEst(yName = "qOutput", xNames = c("qLabor", "land", "qVarInput"), data = germanFarms, shifterNames = c("tech", "techSq")) $nExog [1] 3 $nShifter [1] 2 $est Call: lm(formula = as.formula(estFormula), data = estData) Coefficients: (Intercept) a_1 a_2 a_3 b_1_1 b_1_2 95.58953 67.47142 -6.60142 -29.17953 -9.63718 -0.05109 b_1_3 b_2_2 b_2_3 b_3_3 d_1 d_2 -9.60205 0.12943 1.22012 4.49207 0.03707 -0.00243 $residuals 1 2 3 4 5 6 7 8 0.01441 -0.04657 0.01685 0.02045 0.01142 -0.00695 -0.00561 0.00496 9 10 11 12 13 14 15 16 0.00637 -0.02698 0.00697 0.00616 -0.00863 -0.00731 0.02059 0.00813 17 18 19 20 -0.02289 0.00326 0.00885 -0.00348 $fitted 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 933 1009 1052 1148 1165 1194 1246 1282 1200 1313 1351 1531 1589 1708 1611 1613 17 18 19 20 1693 1750 1871 1999 $coef a_0 a_1 a_2 a_3 b_1_1 b_1_2 b_1_3 b_2_2 95.58953 67.47142 -6.60142 -29.17953 -9.63718 -0.05109 -9.60205 0.12943 b_2_3 b_3_3 d_1 d_2 1.22012 4.49207 0.03707 -0.00243 $coefCov a_0 a_1 a_2 a_3 b_1_1 b_1_2 b_1_3 a_0 1.12e+04 5.67e+03 2.67e+02 -3.94e+03 8.78e+02 -6.16300 -9.23e+02 a_1 5.67e+03 4.19e+03 -3.79e+02 -1.82e+03 9.11e+02 -23.27303 -6.88e+02 a_2 2.67e+02 -3.79e+02 3.75e+02 -2.50e+02 -1.38e+02 -39.44243 8.65e+01 a_3 -3.94e+03 -1.82e+03 -2.50e+02 1.46e+03 -2.58e+02 24.02958 2.84e+02 b_1_1 8.78e+02 9.11e+02 -1.38e+02 -2.58e+02 4.14e+02 -40.33289 -1.46e+02 b_1_2 -6.16e+00 -2.33e+01 -3.94e+01 2.40e+01 -4.03e+01 62.88984 -2.55e+01 b_1_3 -9.23e+02 -6.88e+02 8.65e+01 2.84e+02 -1.46e+02 -25.49360 1.28e+02 b_2_2 4.19e+01 -1.56e+01 2.65e+01 -2.53e+01 -7.25e-01 -4.62257 4.80e+00 b_2_3 -6.11e+01 6.83e+01 -6.86e+01 4.95e+01 2.39e+01 4.01848 -1.40e+01 b_3_3 6.97e+02 2.90e+02 6.81e+01 -2.68e+02 3.70e+01 -4.05044 -4.48e+01 d_1 9.70e-03 -3.72e-02 -1.29e-01 6.74e-02 -2.53e-02 0.06298 -2.43e-02 d_2 -1.25e-02 -8.40e-03 8.99e-03 -2.64e-04 3.39e-03 -0.00301 2.55e-03 b_2_2 b_2_3 b_3_3 d_1 d_2 a_0 4.19e+01 -61.10850 6.97e+02 9.70e-03 -1.25e-02 a_1 -1.56e+01 68.25813 2.90e+02 -3.72e-02 -8.40e-03 a_2 2.65e+01 -68.56555 6.81e+01 -1.29e-01 8.99e-03 a_3 -2.53e+01 49.46897 -2.68e+02 6.74e-02 -2.64e-04 b_1_1 -7.25e-01 23.92018 3.70e+01 -2.53e-02 3.39e-03 b_1_2 -4.62e+00 4.01848 -4.05e+00 6.30e-02 -3.01e-03 b_1_3 4.80e+00 -13.99477 -4.48e+01 -2.43e-02 2.55e-03 b_2_2 6.18e+00 -6.96699 7.14e+00 1.85e-04 2.02e-04 b_2_3 -6.97e+00 13.89612 -1.38e+01 1.61e-02 -1.36e-03 b_3_3 7.14e+00 -13.84468 5.13e+01 -1.75e-02 6.21e-04 d_1 1.85e-04 0.01608 -1.75e-02 2.58e-04 -1.65e-05 d_2 2.02e-04 -0.00136 6.21e-04 -1.65e-05 1.38e-06 $r2 [1] 0.994 $r2bar [1] 0.986 $nObs [1] 20 $yName [1] "qOutput" $xNames [1] "qLabor" "land" "qVarInput" $shifterNames [1] "tech" "techSq" $model.matrix (Intercept) a_1 a_2 a_3 b_1_1 b_1_2 b_1_3 b_2_2 b_2_3 b_3_3 d_1 d_2 1 1 0.365 3.15 6.32 0.0665 1.15 2.31 4.97 19.9 20.0 1 1 2 1 0.372 3.19 6.41 0.0690 1.18 2.38 5.08 20.4 20.5 2 4 3 1 0.365 3.21 6.41 0.0665 1.17 2.34 5.14 20.6 20.5 3 9 4 1 0.392 3.22 6.48 0.0768 1.26 2.54 5.17 20.8 21.0 4 16 5 1 0.392 3.22 6.47 0.0768 1.26 2.54 5.17 20.8 21.0 5 25 6 1 0.385 3.23 6.49 0.0742 1.24 2.50 5.21 20.9 21.0 6 36 7 1 0.372 3.25 6.51 0.0690 1.21 2.42 5.30 21.2 21.2 7 49 8 1 0.399 3.26 6.47 0.0795 1.30 2.58 5.30 21.1 21.0 8 64 9 1 0.392 3.23 6.46 0.0768 1.26 2.53 5.20 20.8 20.9 9 81 10 1 0.425 3.26 6.47 0.0904 1.39 2.75 5.32 21.1 21.0 10 100 11 1 0.425 3.29 6.53 0.0904 1.40 2.78 5.40 21.5 21.3 11 121 12 1 0.525 3.40 6.63 0.1377 1.78 3.48 5.77 22.5 22.0 12 144 13 1 0.531 3.44 6.69 0.1408 1.82 3.55 5.91 23.0 22.4 13 169 14 1 0.513 3.47 6.68 0.1315 1.78 3.43 6.03 23.2 22.3 14 196 15 1 0.501 3.45 6.60 0.1254 1.73 3.31 5.95 22.8 21.8 15 225 16 1 0.476 3.46 6.58 0.1134 1.65 3.13 5.99 22.8 21.6 16 256 17 1 0.482 3.51 6.55 0.1164 1.69 3.16 6.17 23.0 21.5 17 289 18 1 0.482 3.56 6.55 0.1164 1.72 3.16 6.33 23.3 21.5 18 324 19 1 0.482 3.62 6.59 0.1164 1.75 3.18 6.55 23.9 21.7 19 361 20 1 0.482 3.67 6.65 0.1164 1.77 3.21 6.75 24.4 22.1 20 400 attr(,"assign") [1] 0 1 2 3 4 5 6 7 8 9 10 11 $r2nonLog [,1] [1,] 0.995 $dataLogged [1] FALSE attr(,"class") [1] "translogEst" > # testing translogCalc > fitted <- translogCalc( c( "qLabor", "land", "qVarInput" ), + shifterNames = c( "tech", "techSq" ), data = germanFarms, + coef = estResultShifter2$coef ) > all.equal( fitted, estResultShifter2$fitted ) [1] TRUE > > ## testing translogEst with a logical variable as shifter > germanFarms$reUnif <- germanFarms$time >= 16 > estResultShifterLogi <- translogEst( "qOutput", + c( "qLabor", "land", "qVarInput" ), + shifterNames = "reUnif", data = germanFarms ) > print( estResultShifterLogi ) Estimated Translog function with 20 observations. a_0 a_1 a_2 a_3 b_1_1 b_1_2 b_1_3 b_2_2 85.3320 64.4796 19.4934 -39.3481 -8.9462 -9.1529 -4.6445 0.2614 b_2_3 b_3_3 d_1_TRUE -2.2745 7.5639 -0.0674 > summary( estResultShifterLogi ) Estimated Translog function with 20 observations. Estimate Std. Error t value Pr(>|t|) a_0 85.3320 112.1714 0.76 0.47 a_1 64.4796 67.0737 0.96 0.36 a_2 19.4934 19.5958 0.99 0.35 a_3 -39.3481 40.3884 -0.97 0.36 b_1_1 -8.9462 21.7900 -0.41 0.69 b_1_2 -9.1529 7.2109 -1.27 0.24 b_1_3 -4.6445 11.9982 -0.39 0.71 b_2_2 0.2614 2.6614 0.10 0.92 b_2_3 -2.2745 3.9030 -0.58 0.57 b_3_3 7.5639 7.6132 0.99 0.35 d_1_TRUE -0.0674 0.0437 -1.54 0.16 R-squared: 0.992 Adjusted R-squared: 0.983 > residuals( estResultShifterLogi ) 1 2 3 4 5 6 7 8 0.013460 -0.059786 0.012364 0.009952 0.020372 0.002762 -0.008802 0.018159 9 10 11 12 13 14 15 16 0.028258 -0.020858 -0.023040 0.010465 -0.011312 0.001630 0.006374 0.008557 17 18 19 20 -0.011357 -0.000908 0.006360 -0.002652 > print.default( estResultShifterLogi ) $call translogEst(yName = "qOutput", xNames = c("qLabor", "land", "qVarInput"), data = germanFarms, shifterNames = "reUnif") $nExog [1] 3 $nShifter [1] 1 $est Call: lm(formula = as.formula(estFormula), data = estData) Coefficients: (Intercept) a_1 a_2 a_3 b_1_1 b_1_2 85.3320 64.4796 19.4934 -39.3481 -8.9462 -9.1529 b_1_3 b_2_2 b_2_3 b_3_3 d_1_TRUE -4.6445 0.2614 -2.2745 7.5639 -0.0674 $residuals 1 2 3 4 5 6 7 8 0.013460 -0.059786 0.012364 0.009952 0.020372 0.002762 -0.008802 0.018159 9 10 11 12 13 14 15 16 0.028258 -0.020858 -0.023040 0.010465 -0.011312 0.001630 0.006374 0.008557 17 18 19 20 -0.011357 -0.000908 0.006360 -0.002652 $fitted 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 933 1022 1056 1160 1154 1183 1250 1265 1174 1305 1392 1525 1593 1693 1634 1612 17 18 19 20 1674 1757 1875 1997 $coef a_0 a_1 a_2 a_3 b_1_1 b_1_2 b_1_3 b_2_2 85.3320 64.4796 19.4934 -39.3481 -8.9462 -9.1529 -4.6445 0.2614 b_2_3 b_3_3 d_1_TRUE -2.2745 7.5639 -0.0674 $coefCov a_0 a_1 a_2 a_3 b_1_1 b_1_2 b_1_3 a_0 12582.431 6201.896 328.752 -4.44e+03 1115.3452 34.31397 -1.04e+03 a_1 6201.896 4498.877 -457.149 -1.97e+03 1140.6875 23.52100 -7.75e+02 a_2 328.752 -457.149 383.996 -2.68e+02 -191.4866 -12.69303 8.85e+01 a_3 -4442.188 -1965.674 -267.717 1.63e+03 -318.6963 -5.75821 3.25e+02 b_1_1 1115.345 1140.687 -191.487 -3.19e+02 474.8052 -46.16357 -1.82e+02 b_1_2 34.314 23.521 -12.693 -5.76e+00 -46.1636 51.99768 -2.68e+01 b_1_3 -1040.562 -774.797 88.459 3.25e+02 -182.4383 -26.75194 1.44e+02 b_2_2 57.893 -10.212 30.910 -3.29e+01 -2.3556 -6.26528 4.93e+00 b_2_3 -83.584 72.612 -73.509 5.85e+01 33.5644 1.46660 -1.40e+01 b_3_3 794.050 315.917 72.797 -3.02e+02 43.6411 2.02171 -5.23e+01 d_1_TRUE 0.185 0.176 -0.209 3.66e-02 0.0932 0.00746 -3.62e-02 b_2_2 b_2_3 b_3_3 d_1_TRUE a_0 57.8927 -83.5839 794.0501 0.18501 a_1 -10.2120 72.6123 315.9170 0.17598 a_2 30.9096 -73.5094 72.7972 -0.20906 a_3 -32.8504 58.5331 -302.0089 0.03658 b_1_1 -2.3556 33.5644 43.6411 0.09316 b_1_2 -6.2653 1.4666 2.0217 0.00746 b_1_3 4.9341 -14.0173 -52.3229 -0.03615 b_2_2 7.0833 -7.9736 8.7958 -0.00330 b_2_3 -7.9736 15.2335 -15.8524 0.03177 b_3_3 8.7958 -15.8524 57.9607 -0.01849 d_1_TRUE -0.0033 0.0318 -0.0185 0.00191 $r2 [1] 0.992 $r2bar [1] 0.983 $nObs [1] 20 $yName [1] "qOutput" $xNames [1] "qLabor" "land" "qVarInput" $shifterNames [1] "reUnif" $model.matrix (Intercept) a_1 a_2 a_3 b_1_1 b_1_2 b_1_3 b_2_2 b_2_3 b_3_3 d_1_TRUE 1 1 0.365 3.15 6.32 0.0665 1.15 2.31 4.97 19.9 20.0 0 2 1 0.372 3.19 6.41 0.0690 1.18 2.38 5.08 20.4 20.5 0 3 1 0.365 3.21 6.41 0.0665 1.17 2.34 5.14 20.6 20.5 0 4 1 0.392 3.22 6.48 0.0768 1.26 2.54 5.17 20.8 21.0 0 5 1 0.392 3.22 6.47 0.0768 1.26 2.54 5.17 20.8 21.0 0 6 1 0.385 3.23 6.49 0.0742 1.24 2.50 5.21 20.9 21.0 0 7 1 0.372 3.25 6.51 0.0690 1.21 2.42 5.30 21.2 21.2 0 8 1 0.399 3.26 6.47 0.0795 1.30 2.58 5.30 21.1 21.0 0 9 1 0.392 3.23 6.46 0.0768 1.26 2.53 5.20 20.8 20.9 0 10 1 0.425 3.26 6.47 0.0904 1.39 2.75 5.32 21.1 21.0 0 11 1 0.425 3.29 6.53 0.0904 1.40 2.78 5.40 21.5 21.3 0 12 1 0.525 3.40 6.63 0.1377 1.78 3.48 5.77 22.5 22.0 0 13 1 0.531 3.44 6.69 0.1408 1.82 3.55 5.91 23.0 22.4 0 14 1 0.513 3.47 6.68 0.1315 1.78 3.43 6.03 23.2 22.3 0 15 1 0.501 3.45 6.60 0.1254 1.73 3.31 5.95 22.8 21.8 0 16 1 0.476 3.46 6.58 0.1134 1.65 3.13 5.99 22.8 21.6 1 17 1 0.482 3.51 6.55 0.1164 1.69 3.16 6.17 23.0 21.5 1 18 1 0.482 3.56 6.55 0.1164 1.72 3.16 6.33 23.3 21.5 1 19 1 0.482 3.62 6.59 0.1164 1.75 3.18 6.55 23.9 21.7 1 20 1 0.482 3.67 6.65 0.1164 1.77 3.21 6.75 24.4 22.1 1 attr(,"assign") [1] 0 1 2 3 4 5 6 7 8 9 10 attr(,"contrasts") attr(,"contrasts")$d_1_ [1] "contr.treatment" $r2nonLog [,1] [1,] 0.995 $dataLogged [1] FALSE attr(,"class") [1] "translogEst" > # with dataLogged = TRUE > estResultShifterLogiLog <- translogEst( "qLogOutput", + xNames = c( "qLogLabor", "qLogLand", "qLogVarInput" ), + data = germanFarms, shifterNames = "reUnif", dataLogged = TRUE ) > all.equal( estResultShifterLogi[ -c(1,6,12,13,17) ], + estResultShifterLogiLog[ -c(1,6,12,13,17) ] ) [1] TRUE > all.equal( estResultShifterLogi$fitted, exp( estResultShifterLogiLog$fitted ) ) [1] TRUE > # testing translogCalc > fitted <- translogCalc( c( "qLabor", "land", "qVarInput" ), + shifterNames = c( "reUnif" ), data = germanFarms, + coef = estResultShifterLogi$coef ) > all.equal( fitted, estResultShifterLogi$fitted ) [1] TRUE > > ## testing translogEst with a factor as shifter > germanFarms$decade <- as.factor( c( rep( "70s", 5 ), rep( "80s", 10 ), + rep( "90s", 5 ) ) ) > estResultShifterFac <- translogEst( "qOutput", + c( "qLabor", "land", "qVarInput" ), + shifterNames = "decade", data = germanFarms ) > print( estResultShifterFac ) Estimated Translog function with 20 observations. a_0 a_1 a_2 a_3 b_1_1 b_1_2 b_1_3 b_2_2 79.19925 60.84800 18.74509 -36.83269 -9.81003 -8.53369 -4.34084 0.26040 b_2_3 b_3_3 d_1_80s d_1_90s -2.20612 7.12358 0.00441 -0.06082 > summary( estResultShifterFac ) Estimated Translog function with 20 observations. Estimate Std. Error t value Pr(>|t|) a_0 79.19925 127.31064 0.62 0.55 a_1 60.84800 76.03184 0.80 0.45 a_2 18.74509 21.49562 0.87 0.41 a_3 -36.83269 46.70874 -0.79 0.45 b_1_1 -9.81003 23.96482 -0.41 0.69 b_1_2 -8.53369 8.92287 -0.96 0.37 b_1_3 -4.34084 12.91117 -0.34 0.75 b_2_2 0.26040 2.81971 0.09 0.93 b_2_3 -2.20612 4.16633 -0.53 0.61 b_3_3 7.12358 8.70653 0.82 0.44 d_1_80s 0.00441 0.03285 0.13 0.90 d_1_90s -0.06082 0.06727 -0.90 0.39 R-squared: 0.992 Adjusted R-squared: 0.981 > residuals( estResultShifterFac ) 1 2 3 4 5 6 7 8 0.013405 -0.060079 0.013564 0.011335 0.021775 0.000580 -0.008497 0.017839 9 10 11 12 13 14 15 16 0.026051 -0.020887 -0.022241 0.010516 -0.011606 0.001766 0.006479 0.008618 17 18 19 20 -0.011422 -0.000781 0.006188 -0.002602 > print.default( estResultShifterFac ) $call translogEst(yName = "qOutput", xNames = c("qLabor", "land", "qVarInput"), data = germanFarms, shifterNames = "decade") $nExog [1] 3 $nShifter [1] 1 $est Call: lm(formula = as.formula(estFormula), data = estData) Coefficients: (Intercept) a_1 a_2 a_3 b_1_1 b_1_2 79.19925 60.84800 18.74509 -36.83269 -9.81003 -8.53369 b_1_3 b_2_2 b_2_3 b_3_3 d_1_80s d_1_90s -4.34084 0.26040 -2.20612 7.12358 0.00441 -0.06082 $residuals 1 2 3 4 5 6 7 8 0.013405 -0.060079 0.013564 0.011335 0.021775 0.000580 -0.008497 0.017839 9 10 11 12 13 14 15 16 0.026051 -0.020887 -0.022241 0.010516 -0.011606 0.001766 0.006479 0.008618 17 18 19 20 -0.011422 -0.000781 0.006188 -0.002602 $fitted 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 934 1022 1055 1159 1153 1185 1250 1266 1177 1305 1391 1525 1593 1693 1634 1612 17 18 19 20 1674 1757 1876 1997 $coef a_0 a_1 a_2 a_3 b_1_1 b_1_2 b_1_3 b_2_2 79.19925 60.84800 18.74509 -36.83269 -9.81003 -8.53369 -4.34084 0.26040 b_2_3 b_3_3 d_1_80s d_1_90s -2.20612 7.12358 0.00441 -0.06082 $coefCov a_0 a_1 a_2 a_3 b_1_1 b_1_2 b_1_3 a_0 16208.00 8195.872 623.384 -5841.253 1545.568 -171.964 -1.27e+03 a_1 8195.87 5780.841 -362.506 -2712.732 1454.262 -98.238 -9.31e+02 a_2 623.38 -362.506 462.062 -404.838 -179.109 -39.931 8.67e+01 a_3 -5841.25 -2712.732 -404.838 2181.706 -478.163 79.868 4.07e+02 b_1_1 1545.57 1454.262 -179.109 -478.163 574.313 -81.464 -2.19e+02 b_1_2 -171.96 -98.238 -39.931 79.868 -81.464 79.618 -1.96e+01 b_1_3 -1271.22 -930.809 86.697 407.307 -219.320 -19.606 1.67e+02 b_2_2 65.31 -11.267 34.735 -37.009 -2.598 -7.066 5.52e+00 b_2_3 -117.06 67.742 -85.348 75.234 34.401 3.993 -1.46e+01 b_3_3 1040.96 443.231 99.975 -400.381 70.066 -12.842 -6.61e+01 d_1_80s -1.50 -0.888 -0.183 0.615 -0.211 0.151 7.43e-02 d_1_90s -2.02 -1.122 -0.507 0.955 -0.209 0.233 6.98e-02 b_2_2 b_2_3 b_3_3 d_1_80s d_1_90s a_0 6.53e+01 -117.0614 1040.957 -1.499828 -2.02143 a_1 -1.13e+01 67.7424 443.231 -0.888147 -1.12247 a_2 3.47e+01 -85.3479 99.975 -0.183012 -0.50667 a_3 -3.70e+01 75.2343 -400.381 0.615178 0.95536 b_1_1 -2.60e+00 34.4014 70.066 -0.211258 -0.20941 b_1_2 -7.07e+00 3.9928 -12.842 0.151435 0.23344 b_1_3 5.52e+00 -14.5832 -66.141 0.074264 0.06979 b_2_2 7.95e+00 -8.9538 9.897 -0.000238 -0.00406 b_2_3 -8.95e+00 17.3583 -19.462 0.016721 0.06051 b_3_3 9.90e+00 -19.4624 75.804 -0.107677 -0.18078 d_1_80s -2.38e-04 0.0167 -0.108 0.001079 0.00160 d_1_90s -4.06e-03 0.0605 -0.181 0.001604 0.00453 $r2 [1] 0.992 $r2bar [1] 0.981 $nObs [1] 20 $yName [1] "qOutput" $xNames [1] "qLabor" "land" "qVarInput" $shifterNames [1] "decade" $model.matrix (Intercept) a_1 a_2 a_3 b_1_1 b_1_2 b_1_3 b_2_2 b_2_3 b_3_3 d_1_80s 1 1 0.365 3.15 6.32 0.0665 1.15 2.31 4.97 19.9 20.0 0 2 1 0.372 3.19 6.41 0.0690 1.18 2.38 5.08 20.4 20.5 0 3 1 0.365 3.21 6.41 0.0665 1.17 2.34 5.14 20.6 20.5 0 4 1 0.392 3.22 6.48 0.0768 1.26 2.54 5.17 20.8 21.0 0 5 1 0.392 3.22 6.47 0.0768 1.26 2.54 5.17 20.8 21.0 0 6 1 0.385 3.23 6.49 0.0742 1.24 2.50 5.21 20.9 21.0 1 7 1 0.372 3.25 6.51 0.0690 1.21 2.42 5.30 21.2 21.2 1 8 1 0.399 3.26 6.47 0.0795 1.30 2.58 5.30 21.1 21.0 1 9 1 0.392 3.23 6.46 0.0768 1.26 2.53 5.20 20.8 20.9 1 10 1 0.425 3.26 6.47 0.0904 1.39 2.75 5.32 21.1 21.0 1 11 1 0.425 3.29 6.53 0.0904 1.40 2.78 5.40 21.5 21.3 1 12 1 0.525 3.40 6.63 0.1377 1.78 3.48 5.77 22.5 22.0 1 13 1 0.531 3.44 6.69 0.1408 1.82 3.55 5.91 23.0 22.4 1 14 1 0.513 3.47 6.68 0.1315 1.78 3.43 6.03 23.2 22.3 1 15 1 0.501 3.45 6.60 0.1254 1.73 3.31 5.95 22.8 21.8 1 16 1 0.476 3.46 6.58 0.1134 1.65 3.13 5.99 22.8 21.6 0 17 1 0.482 3.51 6.55 0.1164 1.69 3.16 6.17 23.0 21.5 0 18 1 0.482 3.56 6.55 0.1164 1.72 3.16 6.33 23.3 21.5 0 19 1 0.482 3.62 6.59 0.1164 1.75 3.18 6.55 23.9 21.7 0 20 1 0.482 3.67 6.65 0.1164 1.77 3.21 6.75 24.4 22.1 0 d_1_90s 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 1 17 1 18 1 19 1 20 1 attr(,"assign") [1] 0 1 2 3 4 5 6 7 8 9 10 10 attr(,"contrasts") attr(,"contrasts")$d_1_ [1] "contr.treatment" $r2nonLog [,1] [1,] 0.995 $dataLogged [1] FALSE attr(,"class") [1] "translogEst" > # with dataLogged = TRUE > estResultShifterFacLog <- translogEst( "qLogOutput", + xNames = c( "qLogLabor", "qLogLand", "qLogVarInput" ), + data = germanFarms, shifterNames = "decade", dataLogged = TRUE ) > all.equal( estResultShifterFac[ -c(1,6,12,13,17) ], + estResultShifterFacLog[ -c(1,6,12,13,17) ] ) [1] TRUE > all.equal( estResultShifterFac$fitted, exp( estResultShifterFacLog$fitted ) ) [1] TRUE > # testing translogCalc > fitted <- translogCalc( c( "qLabor", "land", "qVarInput" ), + shifterNames = c( "decade" ), data = germanFarms, + coef = estResultShifterFac$coef ) > all.equal( fitted, estResultShifterFac$fitted ) [1] TRUE > > ## testing translogEst with some shifters and one is logical > estResultShifterLogi2 <- translogEst( "qOutput", + c( "qLabor", "land", "qVarInput" ), + shifterNames = c( "tech", "reUnif" ), data = germanFarms ) > print( estResultShifterLogi2 ) Estimated Translog function with 20 observations. a_0 a_1 a_2 a_3 b_1_1 b_1_2 b_1_3 b_2_2 73.44737 52.77497 16.88108 -33.51222 -7.29280 -6.72337 -4.19956 0.48257 b_2_3 b_3_3 d_1 d_2_TRUE -2.19335 6.60528 0.00542 -0.06134 > summary( estResultShifterLogi2 ) Estimated Translog function with 20 observations. Estimate Std. Error t value Pr(>|t|) a_0 73.44737 117.99704 0.62 0.55 a_1 52.77497 72.21483 0.73 0.49 a_2 16.88108 20.77968 0.81 0.44 a_3 -33.51222 42.99007 -0.78 0.46 b_1_1 -7.29280 22.76620 -0.32 0.76 b_1_2 -6.72337 8.49074 -0.79 0.45 b_1_3 -4.19956 12.46668 -0.34 0.74 b_2_2 0.48257 2.78467 0.17 0.87 b_2_3 -2.19335 4.05056 -0.54 0.60 b_3_3 6.60528 8.05428 0.82 0.44 d_1 0.00542 0.00897 0.60 0.56 d_2_TRUE -0.06134 0.04640 -1.32 0.22 R-squared: 0.992 Adjusted R-squared: 0.982 > residuals( estResultShifterLogi2 ) 1 2 3 4 5 6 7 8 0.013203 -0.058151 0.014861 0.016117 0.021710 0.000943 -0.009290 0.022381 9 10 11 12 13 14 15 16 0.013313 -0.020181 -0.022158 0.012285 -0.014199 0.003718 0.005448 0.008631 17 18 19 20 -0.011395 -0.000845 0.006402 -0.002794 > print.default( estResultShifterLogi2 ) $call translogEst(yName = "qOutput", xNames = c("qLabor", "land", "qVarInput"), data = germanFarms, shifterNames = c("tech", "reUnif")) $nExog [1] 3 $nShifter [1] 2 $est Call: lm(formula = as.formula(estFormula), data = estData) Coefficients: (Intercept) a_1 a_2 a_3 b_1_1 b_1_2 73.44737 52.77497 16.88108 -33.51222 -7.29280 -6.72337 b_1_3 b_2_2 b_2_3 b_3_3 d_1 d_2_TRUE -4.19956 0.48257 -2.19335 6.60528 0.00542 -0.06134 $residuals 1 2 3 4 5 6 7 8 0.013203 -0.058151 0.014861 0.016117 0.021710 0.000943 -0.009290 0.022381 9 10 11 12 13 14 15 16 0.013313 -0.020181 -0.022158 0.012285 -0.014199 0.003718 0.005448 0.008631 17 18 19 20 -0.011395 -0.000845 0.006402 -0.002794 $fitted 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 934 1020 1054 1153 1153 1185 1251 1260 1192 1304 1391 1522 1598 1690 1636 1612 17 18 19 20 1674 1757 1875 1997 $coef a_0 a_1 a_2 a_3 b_1_1 b_1_2 b_1_3 b_2_2 73.44737 52.77497 16.88108 -33.51222 -7.29280 -6.72337 -4.19956 0.48257 b_2_3 b_3_3 d_1 d_2_TRUE -2.19335 6.60528 0.00542 -0.06134 $coefCov a_0 a_1 a_2 a_3 b_1_1 b_1_2 b_1_3 a_0 1.39e+04 7.05e+03 438.6393 -4.97e+03 1146.1789 -42.0888 -1.13e+03 a_1 7.05e+03 5.21e+03 -408.1605 -2.30e+03 1174.2577 -52.5039 -8.48e+02 a_2 4.39e+02 -4.08e+02 431.7952 -3.30e+02 -217.8297 -31.0219 9.20e+01 a_3 -4.97e+03 -2.30e+03 -329.7387 1.85e+03 -316.4678 32.6004 3.57e+02 b_1_1 1.15e+03 1.17e+03 -217.8297 -3.16e+02 518.3001 -38.6738 -1.94e+02 b_1_2 -4.21e+01 -5.25e+01 -31.0219 3.26e+01 -38.6738 72.0926 -2.58e+01 b_1_3 -1.13e+03 -8.48e+02 91.9882 3.57e+02 -194.2635 -25.8233 1.55e+02 b_2_2 5.51e+01 -1.81e+01 31.6730 -3.18e+01 -1.5336 -5.2700 5.58e+00 b_2_3 -9.26e+01 7.55e+01 -79.6652 6.43e+01 36.4774 2.1173 -1.50e+01 b_3_3 8.85e+02 3.71e+02 85.1710 -3.40e+02 42.6146 -4.1974 -5.75e+01 d_1 -1.76e-01 -1.74e-01 -0.0388 8.66e-02 0.0245 0.0361 6.60e-03 d_2_TRUE 2.78e-03 -3.96e-03 -0.2681 1.36e-01 0.1275 0.0481 -3.15e-02 b_2_2 b_2_3 b_3_3 d_1 d_2_TRUE a_0 5.51e+01 -92.5626 885.4523 -1.76e-01 2.78e-03 a_1 -1.81e+01 75.5213 370.5800 -1.74e-01 -3.96e-03 a_2 3.17e+01 -79.6652 85.1710 -3.88e-02 -2.68e-01 a_3 -3.18e+01 64.2687 -340.2238 8.66e-02 1.36e-01 b_1_1 -1.53e+00 36.4774 42.6146 2.45e-02 1.28e-01 b_1_2 -5.27e+00 2.1173 -4.1974 3.61e-02 4.81e-02 b_1_3 5.58e+00 -14.9818 -57.4587 6.60e-03 -3.15e-02 b_2_2 7.75e+00 -8.5293 8.8828 3.28e-03 9.91e-05 b_2_3 -8.53e+00 16.4071 -17.2677 1.20e-03 3.55e-02 b_3_3 8.88e+00 -17.2677 64.8714 -1.42e-02 -3.57e-02 d_1 3.28e-03 0.0012 -0.0142 8.05e-05 8.96e-05 d_2_TRUE 9.91e-05 0.0355 -0.0357 8.96e-05 2.15e-03 $r2 [1] 0.992 $r2bar [1] 0.982 $nObs [1] 20 $yName [1] "qOutput" $xNames [1] "qLabor" "land" "qVarInput" $shifterNames [1] "tech" "reUnif" $model.matrix (Intercept) a_1 a_2 a_3 b_1_1 b_1_2 b_1_3 b_2_2 b_2_3 b_3_3 d_1 1 1 0.365 3.15 6.32 0.0665 1.15 2.31 4.97 19.9 20.0 1 2 1 0.372 3.19 6.41 0.0690 1.18 2.38 5.08 20.4 20.5 2 3 1 0.365 3.21 6.41 0.0665 1.17 2.34 5.14 20.6 20.5 3 4 1 0.392 3.22 6.48 0.0768 1.26 2.54 5.17 20.8 21.0 4 5 1 0.392 3.22 6.47 0.0768 1.26 2.54 5.17 20.8 21.0 5 6 1 0.385 3.23 6.49 0.0742 1.24 2.50 5.21 20.9 21.0 6 7 1 0.372 3.25 6.51 0.0690 1.21 2.42 5.30 21.2 21.2 7 8 1 0.399 3.26 6.47 0.0795 1.30 2.58 5.30 21.1 21.0 8 9 1 0.392 3.23 6.46 0.0768 1.26 2.53 5.20 20.8 20.9 9 10 1 0.425 3.26 6.47 0.0904 1.39 2.75 5.32 21.1 21.0 10 11 1 0.425 3.29 6.53 0.0904 1.40 2.78 5.40 21.5 21.3 11 12 1 0.525 3.40 6.63 0.1377 1.78 3.48 5.77 22.5 22.0 12 13 1 0.531 3.44 6.69 0.1408 1.82 3.55 5.91 23.0 22.4 13 14 1 0.513 3.47 6.68 0.1315 1.78 3.43 6.03 23.2 22.3 14 15 1 0.501 3.45 6.60 0.1254 1.73 3.31 5.95 22.8 21.8 15 16 1 0.476 3.46 6.58 0.1134 1.65 3.13 5.99 22.8 21.6 16 17 1 0.482 3.51 6.55 0.1164 1.69 3.16 6.17 23.0 21.5 17 18 1 0.482 3.56 6.55 0.1164 1.72 3.16 6.33 23.3 21.5 18 19 1 0.482 3.62 6.59 0.1164 1.75 3.18 6.55 23.9 21.7 19 20 1 0.482 3.67 6.65 0.1164 1.77 3.21 6.75 24.4 22.1 20 d_2_TRUE 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 1 17 1 18 1 19 1 20 1 attr(,"assign") [1] 0 1 2 3 4 5 6 7 8 9 10 11 attr(,"contrasts") attr(,"contrasts")$d_2_ [1] "contr.treatment" $r2nonLog [,1] [1,] 0.995 $dataLogged [1] FALSE attr(,"class") [1] "translogEst" > # testing translogCalc > fitted <- translogCalc( c( "qLabor", "land", "qVarInput" ), + shifterNames = c( "tech", "reUnif" ), data = germanFarms, + coef = estResultShifterLogi2$coef ) > all.equal( fitted, estResultShifterLogi2$fitted ) [1] TRUE > > ## testing translogEst with some shifters and one is a factor > estResultShifterFac2 <- translogEst( "qOutput", + c( "qLabor", "land", "qVarInput" ), + shifterNames = c( "tech", "decade" ), data = germanFarms ) > print( estResultShifterFac2 ) Estimated Translog function with 20 observations. a_0 a_1 a_2 a_3 b_1_1 b_1_2 b_1_3 b_2_2 91.53512 60.26224 18.28544 -40.26722 -2.44666 -7.70035 -5.19432 0.63953 b_2_3 b_3_3 d_1 d_2_80s d_2_90s -2.43048 7.83108 0.00917 -0.01892 -0.08529 > summary( estResultShifterFac2 ) Estimated Translog function with 20 observations. Estimate Std. Error t value Pr(>|t|) a_0 91.53512 133.04629 0.69 0.51 a_1 60.26224 78.72169 0.77 0.47 a_2 18.28544 22.26500 0.82 0.44 a_3 -40.26722 48.62072 -0.83 0.43 b_1_1 -2.44666 27.06594 -0.09 0.93 b_1_2 -7.70035 9.31872 -0.83 0.44 b_1_3 -5.19432 13.42579 -0.39 0.71 b_2_2 0.63953 2.97193 0.22 0.84 b_2_3 -2.43048 4.32604 -0.56 0.59 b_3_3 7.83108 9.07372 0.86 0.42 d_1 0.00917 0.01347 0.68 0.52 d_2_80s -0.01892 0.04828 -0.39 0.71 d_2_90s -0.08529 0.07838 -1.09 0.31 R-squared: 0.993 Adjusted R-squared: 0.98 > residuals( estResultShifterFac2 ) 1 2 3 4 5 6 7 8 0.01326 -0.05577 0.01144 0.01444 0.01662 0.00904 -0.01093 0.02667 9 10 11 12 13 14 15 16 0.01245 -0.01959 -0.02497 0.01332 -0.01493 0.00458 0.00436 0.00842 17 18 19 20 -0.01114 -0.00135 0.00717 -0.00310 > print.default( estResultShifterFac2 ) $call translogEst(yName = "qOutput", xNames = c("qLabor", "land", "qVarInput"), data = germanFarms, shifterNames = c("tech", "decade")) $nExog [1] 3 $nShifter [1] 2 $est Call: lm(formula = as.formula(estFormula), data = estData) Coefficients: (Intercept) a_1 a_2 a_3 b_1_1 b_1_2 91.53512 60.26224 18.28544 -40.26722 -2.44666 -7.70035 b_1_3 b_2_2 b_2_3 b_3_3 d_1 d_2_80s -5.19432 0.63953 -2.43048 7.83108 0.00917 -0.01892 d_2_90s -0.08529 $residuals 1 2 3 4 5 6 7 8 0.01326 -0.05577 0.01144 0.01444 0.01662 0.00904 -0.01093 0.02667 9 10 11 12 13 14 15 16 0.01245 -0.01959 -0.02497 0.01332 -0.01493 0.00458 0.00436 0.00842 17 18 19 20 -0.01114 -0.00135 0.00717 -0.00310 $fitted 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 934 1018 1057 1155 1159 1175 1253 1255 1193 1304 1395 1520 1599 1688 1638 1612 17 18 19 20 1674 1758 1874 1998 $coef a_0 a_1 a_2 a_3 b_1_1 b_1_2 b_1_3 b_2_2 91.53512 60.26224 18.28544 -40.26722 -2.44666 -7.70035 -5.19432 0.63953 b_2_3 b_3_3 d_1 d_2_80s d_2_90s -2.43048 7.83108 0.00917 -0.01892 -0.08529 $coefCov a_0 a_1 a_2 a_3 b_1_1 b_1_2 b_1_3 a_0 17701.316 8.77e+03 6.56e+02 -6.35e+03 1852.625 -162.1467 -1.39e+03 a_1 8769.398 6.20e+03 -3.88e+02 -2.90e+03 1549.489 -106.3519 -9.97e+02 a_2 655.959 -3.88e+02 4.96e+02 -4.31e+02 -199.285 -43.6274 9.38e+01 a_3 -6352.523 -2.90e+03 -4.31e+02 2.36e+03 -567.092 79.4344 4.43e+02 b_1_1 1852.625 1.55e+03 -1.99e+02 -5.67e+02 732.565 -74.0819 -2.49e+02 b_1_2 -162.147 -1.06e+02 -4.36e+01 7.94e+01 -74.082 86.8386 -2.25e+01 b_1_3 -1385.306 -9.97e+02 9.38e+01 4.43e+02 -248.643 -22.5500 1.80e+02 b_2_2 80.098 -1.26e+01 3.69e+01 -4.25e+01 3.239 -6.8923 5.22e+00 b_2_3 -131.447 7.29e+01 -9.13e+01 8.23e+01 33.310 3.8765 -1.52e+01 b_3_3 1134.610 4.74e+02 1.06e+02 -4.34e+02 86.342 -12.4928 -7.22e+01 d_1 0.244 -1.16e-02 -9.09e-03 -6.79e-02 0.146 0.0165 -1.69e-02 d_2_80s -2.229 -9.23e-01 -1.73e-01 8.32e-01 -0.597 0.1204 1.23e-01 d_2_90s -2.818 -1.17e+00 -5.19e-01 1.21e+00 -0.613 0.2062 1.20e-01 b_2_2 b_2_3 b_3_3 d_1 d_2_80s d_2_90s a_0 80.0981 -1.31e+02 1134.610 0.244054 -2.228581 -2.818044 a_1 -12.5557 7.29e+01 474.196 -0.011589 -0.922502 -1.172223 a_2 36.8562 -9.13e+01 106.459 -0.009094 -0.173030 -0.518819 a_3 -42.4786 8.23e+01 -434.403 -0.067949 0.832279 1.205367 b_1_1 3.2385 3.33e+01 86.342 0.145677 -0.597090 -0.613234 b_1_2 -6.8923 3.88e+00 -12.493 0.016487 0.120373 0.206223 b_1_3 5.2209 -1.52e+01 -72.198 -0.016885 0.122563 0.119871 b_2_2 8.8324 -9.78e+00 11.187 0.007501 -0.019339 -0.024371 b_2_3 -9.7809 1.87e+01 -21.204 -0.004439 0.029217 0.076704 b_3_3 11.1868 -2.12e+01 82.332 0.013997 -0.151030 -0.231134 d_1 0.0075 -4.44e-03 0.014 0.000181 -0.000462 -0.000484 d_2_80s -0.0193 2.92e-02 -0.151 -0.000462 0.002331 0.002951 d_2_90s -0.0244 7.67e-02 -0.231 -0.000484 0.002951 0.006143 $r2 [1] 0.993 $r2bar [1] 0.98 $nObs [1] 20 $yName [1] "qOutput" $xNames [1] "qLabor" "land" "qVarInput" $shifterNames [1] "tech" "decade" $model.matrix (Intercept) a_1 a_2 a_3 b_1_1 b_1_2 b_1_3 b_2_2 b_2_3 b_3_3 d_1 d_2_80s 1 1 0.365 3.15 6.32 0.0665 1.15 2.31 4.97 19.9 20.0 1 0 2 1 0.372 3.19 6.41 0.0690 1.18 2.38 5.08 20.4 20.5 2 0 3 1 0.365 3.21 6.41 0.0665 1.17 2.34 5.14 20.6 20.5 3 0 4 1 0.392 3.22 6.48 0.0768 1.26 2.54 5.17 20.8 21.0 4 0 5 1 0.392 3.22 6.47 0.0768 1.26 2.54 5.17 20.8 21.0 5 0 6 1 0.385 3.23 6.49 0.0742 1.24 2.50 5.21 20.9 21.0 6 1 7 1 0.372 3.25 6.51 0.0690 1.21 2.42 5.30 21.2 21.2 7 1 8 1 0.399 3.26 6.47 0.0795 1.30 2.58 5.30 21.1 21.0 8 1 9 1 0.392 3.23 6.46 0.0768 1.26 2.53 5.20 20.8 20.9 9 1 10 1 0.425 3.26 6.47 0.0904 1.39 2.75 5.32 21.1 21.0 10 1 11 1 0.425 3.29 6.53 0.0904 1.40 2.78 5.40 21.5 21.3 11 1 12 1 0.525 3.40 6.63 0.1377 1.78 3.48 5.77 22.5 22.0 12 1 13 1 0.531 3.44 6.69 0.1408 1.82 3.55 5.91 23.0 22.4 13 1 14 1 0.513 3.47 6.68 0.1315 1.78 3.43 6.03 23.2 22.3 14 1 15 1 0.501 3.45 6.60 0.1254 1.73 3.31 5.95 22.8 21.8 15 1 16 1 0.476 3.46 6.58 0.1134 1.65 3.13 5.99 22.8 21.6 16 0 17 1 0.482 3.51 6.55 0.1164 1.69 3.16 6.17 23.0 21.5 17 0 18 1 0.482 3.56 6.55 0.1164 1.72 3.16 6.33 23.3 21.5 18 0 19 1 0.482 3.62 6.59 0.1164 1.75 3.18 6.55 23.9 21.7 19 0 20 1 0.482 3.67 6.65 0.1164 1.77 3.21 6.75 24.4 22.1 20 0 d_2_90s 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 1 17 1 18 1 19 1 20 1 attr(,"assign") [1] 0 1 2 3 4 5 6 7 8 9 10 11 11 attr(,"contrasts") attr(,"contrasts")$d_2_ [1] "contr.treatment" $r2nonLog [,1] [1,] 0.995 $dataLogged [1] FALSE attr(,"class") [1] "translogEst" > # testing translogCalc > fitted <- translogCalc( c( "qLabor", "land", "qVarInput" ), + shifterNames = c( "tech", "decade" ), data = germanFarms, + coef = estResultShifterFac2$coef ) > all.equal( fitted, estResultShifterFac2$fitted ) [1] TRUE > > > ## checking monotonicity of models with shifter variables > test <- translogCheckMono( c( "qLabor", "land", "qVarInput" ), + germanFarms, coef( estResultShifter ) ) > summary( test ) This translog function is monotonically increasing in qLabor, land, qVarInput at 11 out of 20 observations (55%) The monotonicity condition for the exogenous variable - 'qLabor' is fulfilled at 11 out of 20 observations (55%) - 'land' is fulfilled at 20 out of 20 observations (100%) - 'qVarInput' is fulfilled at 20 out of 20 observations (100%) > print.default( test ) $exog qLabor land qVarInput [1,] TRUE TRUE TRUE [2,] TRUE TRUE TRUE [3,] TRUE TRUE TRUE [4,] TRUE TRUE TRUE [5,] TRUE TRUE TRUE [6,] TRUE TRUE TRUE [7,] TRUE TRUE TRUE [8,] TRUE TRUE TRUE [9,] TRUE TRUE TRUE [10,] TRUE TRUE TRUE [11,] TRUE TRUE TRUE [12,] FALSE TRUE TRUE [13,] FALSE TRUE TRUE [14,] FALSE TRUE TRUE [15,] FALSE TRUE TRUE [16,] FALSE TRUE TRUE [17,] FALSE TRUE TRUE [18,] FALSE TRUE TRUE [19,] FALSE TRUE TRUE [20,] FALSE TRUE TRUE $obs [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE $increasing [1] TRUE TRUE TRUE $strict [1] FALSE attr(,"class") [1] "translogCheckMono" > > # with logarithmized data > test2 <- translogCheckMono( c( "qLogLabor", "qLogLand", "qLogVarInput" ), + germanFarms, coef( estResultShifterLog ), dataLogged = TRUE ) > all.equal( test, test2, check.attributes = FALSE ) [1] TRUE > > # with two shifter variables > test <- translogCheckMono( c( "qLabor", "land", "qVarInput" ), + germanFarms, coef( estResultShifter2 ) ) > summary( test ) This translog function is monotonically increasing in qLabor, land, qVarInput at 8 out of 20 observations (40%) The monotonicity condition for the exogenous variable - 'qLabor' is fulfilled at 11 out of 20 observations (55%) - 'land' is fulfilled at 20 out of 20 observations (100%) - 'qVarInput' is fulfilled at 12 out of 20 observations (60%) > print.default( test ) $exog qLabor land qVarInput [1,] TRUE TRUE FALSE [2,] TRUE TRUE FALSE [3,] TRUE TRUE TRUE [4,] TRUE TRUE TRUE [5,] TRUE TRUE TRUE [6,] TRUE TRUE TRUE [7,] TRUE TRUE TRUE [8,] TRUE TRUE TRUE [9,] TRUE TRUE TRUE [10,] TRUE TRUE FALSE [11,] TRUE TRUE TRUE [12,] FALSE TRUE FALSE [13,] FALSE TRUE FALSE [14,] FALSE TRUE TRUE [15,] FALSE TRUE FALSE [16,] FALSE TRUE TRUE [17,] FALSE TRUE FALSE [18,] FALSE TRUE FALSE [19,] FALSE TRUE TRUE [20,] FALSE TRUE TRUE $obs [1] FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE FALSE [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE $increasing [1] TRUE TRUE TRUE $strict [1] FALSE attr(,"class") [1] "translogCheckMono" > > # with a logical variable as shifter > test <- translogCheckMono( c( "qLabor", "land", "qVarInput" ), + germanFarms, coef( estResultShifterLogi ) ) > summary( test ) This translog function is monotonically increasing in qLabor, land, qVarInput at 10 out of 20 observations (50%) The monotonicity condition for the exogenous variable - 'qLabor' is fulfilled at 11 out of 20 observations (55%) - 'land' is fulfilled at 20 out of 20 observations (100%) - 'qVarInput' is fulfilled at 17 out of 20 observations (85%) > print.default( test ) $exog qLabor land qVarInput [1,] TRUE TRUE FALSE [2,] TRUE TRUE TRUE [3,] TRUE TRUE TRUE [4,] TRUE TRUE TRUE [5,] TRUE TRUE TRUE [6,] TRUE TRUE TRUE [7,] TRUE TRUE TRUE [8,] TRUE TRUE TRUE [9,] TRUE TRUE TRUE [10,] TRUE TRUE TRUE [11,] TRUE TRUE TRUE [12,] FALSE TRUE TRUE [13,] FALSE TRUE TRUE [14,] FALSE TRUE TRUE [15,] FALSE TRUE TRUE [16,] FALSE TRUE TRUE [17,] FALSE TRUE FALSE [18,] FALSE TRUE FALSE [19,] FALSE TRUE TRUE [20,] FALSE TRUE TRUE $obs [1] FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE $increasing [1] TRUE TRUE TRUE $strict [1] FALSE attr(,"class") [1] "translogCheckMono" > > # with a factor as shifter > test <- translogCheckMono( c( "qLabor", "land", "qVarInput" ), + germanFarms, coef( estResultShifterFac ) ) > summary( test ) This translog function is monotonically increasing in qLabor, land, qVarInput at 10 out of 20 observations (50%) The monotonicity condition for the exogenous variable - 'qLabor' is fulfilled at 11 out of 20 observations (55%) - 'land' is fulfilled at 20 out of 20 observations (100%) - 'qVarInput' is fulfilled at 17 out of 20 observations (85%) > print.default( test ) $exog qLabor land qVarInput [1,] TRUE TRUE FALSE [2,] TRUE TRUE TRUE [3,] TRUE TRUE TRUE [4,] TRUE TRUE TRUE [5,] TRUE TRUE TRUE [6,] TRUE TRUE TRUE [7,] TRUE TRUE TRUE [8,] TRUE TRUE TRUE [9,] TRUE TRUE TRUE [10,] TRUE TRUE TRUE [11,] TRUE TRUE TRUE [12,] FALSE TRUE TRUE [13,] FALSE TRUE TRUE [14,] FALSE TRUE TRUE [15,] FALSE TRUE TRUE [16,] FALSE TRUE TRUE [17,] FALSE TRUE FALSE [18,] FALSE TRUE FALSE [19,] FALSE TRUE TRUE [20,] FALSE TRUE TRUE $obs [1] FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE $increasing [1] TRUE TRUE TRUE $strict [1] FALSE attr(,"class") [1] "translogCheckMono" > > # with two shifters and one is logical > test <- translogCheckMono( c( "qLabor", "land", "qVarInput" ), + germanFarms, coef( estResultShifterLogi2 ) ) > summary( test ) This translog function is monotonically increasing in qLabor, land, qVarInput at 10 out of 20 observations (50%) The monotonicity condition for the exogenous variable - 'qLabor' is fulfilled at 11 out of 20 observations (55%) - 'land' is fulfilled at 20 out of 20 observations (100%) - 'qVarInput' is fulfilled at 18 out of 20 observations (90%) > print.default( test ) $exog qLabor land qVarInput [1,] TRUE TRUE FALSE [2,] TRUE TRUE TRUE [3,] TRUE TRUE TRUE [4,] TRUE TRUE TRUE [5,] TRUE TRUE TRUE [6,] TRUE TRUE TRUE [7,] TRUE TRUE TRUE [8,] TRUE TRUE TRUE [9,] TRUE TRUE TRUE [10,] TRUE TRUE TRUE [11,] TRUE TRUE TRUE [12,] FALSE TRUE TRUE [13,] FALSE TRUE TRUE [14,] FALSE TRUE TRUE [15,] FALSE TRUE TRUE [16,] FALSE TRUE TRUE [17,] FALSE TRUE TRUE [18,] FALSE TRUE FALSE [19,] FALSE TRUE TRUE [20,] FALSE TRUE TRUE $obs [1] FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE $increasing [1] TRUE TRUE TRUE $strict [1] FALSE attr(,"class") [1] "translogCheckMono" > > # with two shifters and one is a factor > test <- translogCheckMono( c( "qLabor", "land", "qVarInput" ), + germanFarms, coef( estResultShifterFac2 ) ) > summary( test ) This translog function is monotonically increasing in qLabor, land, qVarInput at 10 out of 20 observations (50%) The monotonicity condition for the exogenous variable - 'qLabor' is fulfilled at 11 out of 20 observations (55%) - 'land' is fulfilled at 20 out of 20 observations (100%) - 'qVarInput' is fulfilled at 17 out of 20 observations (85%) > print.default( test ) $exog qLabor land qVarInput [1,] TRUE TRUE FALSE [2,] TRUE TRUE TRUE [3,] TRUE TRUE TRUE [4,] TRUE TRUE TRUE [5,] TRUE TRUE TRUE [6,] TRUE TRUE TRUE [7,] TRUE TRUE TRUE [8,] TRUE TRUE TRUE [9,] TRUE TRUE TRUE [10,] TRUE TRUE TRUE [11,] TRUE TRUE TRUE [12,] FALSE TRUE TRUE [13,] FALSE TRUE TRUE [14,] FALSE TRUE TRUE [15,] FALSE TRUE TRUE [16,] FALSE TRUE TRUE [17,] FALSE TRUE FALSE [18,] FALSE TRUE FALSE [19,] FALSE TRUE TRUE [20,] FALSE TRUE TRUE $obs [1] FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE $increasing [1] TRUE TRUE TRUE $strict [1] FALSE attr(,"class") [1] "translogCheckMono" > > > ## estimate with further argument passed to lm() > estResult2 <- translogEst( yName = "qOutput", + xNames = c( "qLabor", "land", "qVarInput", "time" ), + germanFarms, x = TRUE, y = TRUE ) > print( estResult2 ) Estimated Translog function with 20 observations. a_0 a_1 a_2 a_3 a_4 b_1_1 b_1_2 b_1_3 -133.485 24.589 19.923 34.631 -12.467 -16.865 14.347 -8.591 b_1_4 b_2_2 b_2_3 b_2_4 b_3_3 b_3_4 b_4_4 -3.573 0.264 -3.468 -1.163 -3.910 2.793 -0.246 > summary( estResult2 ) Estimated Translog function with 20 observations. Estimate Std. Error t value Pr(>|t|) a_0 -133.485 165.548 -0.81 0.457 a_1 24.589 66.497 0.37 0.727 a_2 19.923 16.500 1.21 0.281 a_3 34.631 55.323 0.63 0.559 a_4 -12.467 5.228 -2.38 0.063 . b_1_1 -16.865 19.101 -0.88 0.418 b_1_2 14.347 8.770 1.64 0.163 b_1_3 -8.591 10.551 -0.81 0.453 b_1_4 -3.573 1.900 -1.88 0.119 b_2_2 0.264 4.822 0.05 0.958 b_2_3 -3.468 3.490 -0.99 0.366 b_2_4 -1.163 1.542 -0.75 0.485 b_3_3 -3.910 9.323 -0.42 0.692 b_3_4 2.793 0.750 3.72 0.014 * b_4_4 -0.246 0.160 -1.54 0.185 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 R-squared: 0.998 Adjusted R-squared: 0.993 > print.default( estResult2 ) $call translogEst(yName = "qOutput", xNames = c("qLabor", "land", "qVarInput", "time"), data = germanFarms, x = TRUE, y = TRUE) $nExog [1] 4 $nShifter [1] 0 $est Call: lm(formula = as.formula(estFormula), data = estData, x = TRUE, y = TRUE) Coefficients: (Intercept) a_1 a_2 a_3 a_4 b_1_1 -133.485 24.589 19.923 34.631 -12.467 -16.865 b_1_2 b_1_3 b_1_4 b_2_2 b_2_3 b_2_4 14.347 -8.591 -3.573 0.264 -3.468 -1.163 b_3_3 b_3_4 b_4_4 -3.910 2.793 -0.246 $residuals 1 2 3 4 5 6 7 8 0.002292 -0.013674 0.008394 0.022739 -0.008485 -0.017108 0.002266 -0.003225 9 10 11 12 13 14 15 16 0.008918 -0.002060 -0.001227 -0.001239 -0.000391 -0.002186 0.007307 0.004534 17 18 19 20 -0.013997 0.007881 -0.000263 -0.000475 $fitted 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 944 976 1061 1145 1188 1206 1237 1293 1197 1281 1362 1543 1576 1700 1633 1619 17 18 19 20 1678 1742 1888 1993 $coef a_0 a_1 a_2 a_3 a_4 b_1_1 b_1_2 b_1_3 -133.485 24.589 19.923 34.631 -12.467 -16.865 14.347 -8.591 b_1_4 b_2_2 b_2_3 b_2_4 b_3_3 b_3_4 b_4_4 -3.573 0.264 -3.468 -1.163 -3.910 2.793 -0.246 $coefCov a_0 a_1 a_2 a_3 a_4 b_1_1 b_1_2 b_1_3 a_0 27405.99 9712.33 17.69 -9083.87 143.477 1775.85 -623.173 -1333.833 a_1 9712.33 4421.91 -133.02 -3202.91 18.862 775.11 -174.763 -656.263 a_2 17.69 -133.02 272.23 -117.76 -53.119 -70.62 -45.788 46.233 a_3 -9083.87 -3202.91 -117.76 3060.62 -27.798 -553.94 222.167 430.516 a_4 143.48 18.86 -53.12 -27.80 27.334 -8.21 9.313 -7.382 b_1_1 1775.85 775.11 -70.62 -553.94 -8.208 364.84 -79.338 -101.467 b_1_2 -623.17 -174.76 -45.79 222.17 9.313 -79.34 76.906 -4.733 b_1_3 -1333.83 -656.26 46.23 430.52 -7.382 -101.47 -4.733 111.316 b_1_4 138.95 53.86 5.31 -49.19 0.917 -3.56 -6.106 -6.116 b_2_2 -77.18 2.72 2.44 18.50 9.162 -50.20 12.688 -5.016 b_2_3 44.60 22.99 -43.90 5.93 4.681 35.82 -1.026 -4.401 b_2_4 81.28 17.02 9.80 -29.22 -4.695 16.08 -9.146 0.943 b_3_3 1480.84 527.13 36.56 -507.78 3.046 75.19 -34.433 -71.365 b_3_4 -68.98 -13.76 3.43 20.98 -2.147 -6.28 3.316 0.968 b_4_4 -7.58 -3.43 -1.52 3.06 0.728 -0.88 0.602 0.293 b_1_4 b_2_2 b_2_3 b_2_4 b_3_3 b_3_4 b_4_4 a_0 138.9469 -77.18 44.605 81.2783 1480.837 -68.9803 -7.5838 a_1 53.8560 2.72 22.994 17.0231 527.126 -13.7558 -3.4281 a_2 5.3118 2.44 -43.897 9.8010 36.560 3.4335 -1.5210 a_3 -49.1889 18.50 5.926 -29.2154 -507.777 20.9840 3.0597 a_4 0.9168 9.16 4.681 -4.6948 3.046 -2.1473 0.7278 b_1_1 -3.5626 -50.20 35.823 16.0775 75.187 -6.2751 -0.8797 b_1_2 -6.1059 12.69 -1.026 -9.1463 -34.433 3.3158 0.6018 b_1_3 -6.1163 -5.02 -4.401 0.9429 -71.365 0.9681 0.2932 b_1_4 3.6094 4.74 -2.943 -0.0203 9.613 -0.3327 -0.0490 b_2_2 4.7394 23.25 -11.100 -5.6859 2.878 1.0467 0.3004 b_2_3 -2.9430 -11.10 12.177 1.0946 -6.539 -1.1226 0.1081 b_2_4 -0.0203 -5.69 1.095 2.3774 4.005 -0.4070 -0.1735 b_3_3 9.6127 2.88 -6.539 4.0047 86.920 -2.8993 -0.5340 b_3_4 -0.3327 1.05 -1.123 -0.4070 -2.899 0.5624 -0.0302 b_4_4 -0.0490 0.30 0.108 -0.1735 -0.534 -0.0302 0.0255 $r2 [1] 0.998 $r2bar [1] 0.993 $nObs [1] 20 $yName [1] "qOutput" $xNames [1] "qLabor" "land" "qVarInput" "time" $model.matrix (Intercept) a_1 a_2 a_3 a_4 b_1_1 b_1_2 b_1_3 b_1_4 b_2_2 b_2_3 b_2_4 1 1 0.365 3.15 6.32 0.000 0.0665 1.15 2.31 0.000 4.97 19.9 0.00 2 1 0.372 3.19 6.41 0.693 0.0690 1.18 2.38 0.258 5.08 20.4 2.21 3 1 0.365 3.21 6.41 1.099 0.0665 1.17 2.34 0.401 5.14 20.6 3.52 4 1 0.392 3.22 6.48 1.386 0.0768 1.26 2.54 0.543 5.17 20.8 4.46 5 1 0.392 3.22 6.47 1.609 0.0768 1.26 2.54 0.631 5.17 20.8 5.17 6 1 0.385 3.23 6.49 1.792 0.0742 1.24 2.50 0.690 5.21 20.9 5.78 7 1 0.372 3.25 6.51 1.946 0.0690 1.21 2.42 0.723 5.30 21.2 6.33 8 1 0.399 3.26 6.47 2.079 0.0795 1.30 2.58 0.829 5.30 21.1 6.77 9 1 0.392 3.23 6.46 2.197 0.0768 1.26 2.53 0.861 5.20 20.8 7.09 10 1 0.425 3.26 6.47 2.303 0.0904 1.39 2.75 0.979 5.32 21.1 7.51 11 1 0.425 3.29 6.53 2.398 0.0904 1.40 2.78 1.020 5.40 21.5 7.88 12 1 0.525 3.40 6.63 2.485 0.1377 1.78 3.48 1.304 5.77 22.5 8.44 13 1 0.531 3.44 6.69 2.565 0.1408 1.82 3.55 1.361 5.91 23.0 8.82 14 1 0.513 3.47 6.68 2.639 0.1315 1.78 3.43 1.353 6.03 23.2 9.16 15 1 0.501 3.45 6.60 2.708 0.1254 1.73 3.31 1.356 5.95 22.8 9.34 16 1 0.476 3.46 6.58 2.773 0.1134 1.65 3.13 1.320 5.99 22.8 9.60 17 1 0.482 3.51 6.55 2.833 0.1164 1.69 3.16 1.367 6.17 23.0 9.95 18 1 0.482 3.56 6.55 2.890 0.1164 1.72 3.16 1.394 6.33 23.3 10.28 19 1 0.482 3.62 6.59 2.944 0.1164 1.75 3.18 1.420 6.55 23.9 10.66 20 1 0.482 3.67 6.65 2.996 0.1164 1.77 3.21 1.445 6.75 24.4 11.00 b_3_3 b_3_4 b_4_4 1 20.0 0.00 0.000 2 20.5 4.44 0.240 3 20.5 7.04 0.603 4 21.0 8.99 0.961 5 21.0 10.42 1.295 6 21.0 11.62 1.605 7 21.2 12.67 1.893 8 21.0 13.46 2.162 9 20.9 14.20 2.414 10 21.0 14.91 2.651 11 21.3 15.65 2.875 12 22.0 16.49 3.087 13 22.4 17.15 3.289 14 22.3 17.63 3.482 15 21.8 17.88 3.667 16 21.6 18.24 3.844 17 21.5 18.56 4.014 18 21.5 18.94 4.177 19 21.7 19.42 4.335 20 22.1 19.91 4.487 attr(,"assign") [1] 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 $r2nonLog [,1] [1,] 0.999 $dataLogged [1] FALSE attr(,"class") [1] "translogEst" > > ## panel data > data( "GrunfeldGreene", package = "systemfit" ) > ggData <- pdata.frame( GrunfeldGreene, c( "firm", "year" ), + row.names = FALSE ) > ggData$logInvest <- log( ggData$invest ) > ggData$logValue <- log( ggData$value ) > ggData$logCapital <- log( ggData$capital ) > # fixed effects > ggResult <- translogEst( "invest", c( "value", "capital" ), ggData ) > print( ggResult ) Estimated Translog function with 100 observations. a_0 a_1 a_2 b_1_1 b_1_2 b_2_2 2.947 -0.764 0.458 0.285 -0.118 0.148 > print.default( ggResult ) $call translogEst(yName = "invest", xNames = c("value", "capital"), data = ggData) $nExog [1] 2 $nShifter [1] 0 $est Model Formula: y ~ 1 + a_1 + a_2 + b_1_1 + b_1_2 + b_2_2 Coefficients: a_1 a_2 b_1_1 b_1_2 b_2_2 -0.764 0.458 0.285 -0.118 0.148 $residuals 1 2 3 4 5 6 7 8 -0.04158 0.06478 -0.18099 -0.07600 -0.22324 0.03022 0.09949 0.22419 9 10 11 12 13 14 15 16 0.17666 0.26769 0.11955 0.18176 0.01626 -0.08983 -0.18958 -0.09250 17 18 19 20 21 22 23 24 -0.17729 -0.11540 -0.04459 0.05039 0.15143 0.20039 -0.05075 0.03938 25 26 27 28 29 30 31 32 -0.25628 -0.03001 -0.00847 -0.14045 -0.28638 -0.12673 0.17478 -0.16632 33 34 35 36 37 38 39 40 -0.12827 0.08078 -0.08004 0.03990 0.33048 0.10648 0.05079 0.09928 41 42 43 44 45 46 47 48 -0.19431 -0.33064 -0.11543 -0.46035 -0.49815 -0.04050 0.43523 0.22520 49 50 51 52 53 54 55 56 -0.29032 -0.34388 0.03644 0.46948 0.45844 0.38419 -0.01722 -0.15862 57 58 59 60 61 62 63 64 0.11844 0.14496 0.14021 0.03682 0.11964 -0.19187 0.15657 -0.11212 65 66 67 68 69 70 71 72 -0.29861 -0.03069 0.53365 0.24949 -0.07066 -0.08568 -0.14368 0.17075 73 74 75 76 77 78 79 80 0.26232 0.01664 -0.39270 -0.41131 0.06557 0.19873 0.15692 -0.19296 81 82 83 84 85 86 87 88 0.15278 0.44502 0.20191 -0.30392 -0.56712 -0.44775 0.07296 0.03549 89 90 91 92 93 94 95 96 -0.11209 -0.24251 -0.26273 0.10775 0.16315 0.33314 0.05793 0.07860 97 98 99 100 0.21800 0.24088 0.11240 -0.28387 $fitted 1 2 3 4 5 6 7 8 9 10 11 331.1 367.2 492.1 278.0 413.5 447.5 463.5 358.0 418.7 418.9 498.0 12 13 14 15 16 17 18 19 20 21 22 573.7 559.7 578.9 671.0 705.2 902.5 1000.2 1363.9 1413.6 34.6 59.5 23 24 25 26 27 28 29 30 31 32 33 69.7 49.6 67.7 71.5 68.9 53.9 63.1 67.6 74.5 87.5 71.3 34 35 36 37 38 39 40 41 42 43 44 82.4 85.6 96.7 115.4 130.4 166.3 156.2 40.2 62.6 86.6 70.7 45 46 47 48 49 50 51 52 53 54 55 79.2 77.5 73.1 73.4 81.9 80.1 90.3 100.0 93.1 99.6 100.0 56 57 58 59 60 61 62 63 64 65 66 109.6 120.1 136.1 156.0 182.7 11.5 31.4 30.0 25.6 25.4 29.5 67 68 69 70 71 72 73 74 75 76 77 28.4 33.8 39.7 41.2 45.3 45.1 42.7 48.7 47.5 48.6 50.9 78 79 80 81 82 83 84 85 86 87 88 58.8 77.0 83.2 180.2 227.7 384.0 355.5 406.2 409.3 439.5 430.1 89 90 91 92 93 94 95 96 97 98 99 404.5 367.3 336.4 377.4 357.2 354.4 382.3 387.1 473.0 507.1 572.9 100 610.1 $coef a_0 a_1 a_2 b_1_1 b_1_2 b_2_2 2.947 -0.764 0.458 0.285 -0.118 0.148 $coefCov a_0 a_1 a_2 b_1_1 b_1_2 b_2_2 a_0 NA NA NA NA NA NA a_1 NA 1.14147 -0.15784 -0.17563 0.024000 -0.004967 a_2 NA -0.15784 0.05060 0.02673 -0.007971 0.001988 b_1_1 NA -0.17563 0.02673 0.02756 -0.004213 0.001049 b_1_2 NA 0.02400 -0.00797 -0.00421 0.001404 -0.000553 b_2_2 NA -0.00497 0.00199 0.00105 -0.000553 0.000495 $r2 [1] 0.73 $r2bar [1] 0.703 $nObs [1] 100 $yName [1] "invest" $xNames [1] "value" "capital" $r2nonLog [,1] [1,] 0.953 $dataLogged [1] FALSE attr(,"class") [1] "translogEst" > # with dataLogged = TRUE > ggResultLog <- translogEst( "logInvest", + xNames = c( "logValue", "logCapital" ), + data = ggData, dataLogged = TRUE ) > all.equal( ggResult[ -c(1,6,12,13,15) ], ggResultLog[ -c(1,6,12,13,15) ] ) [1] TRUE > all.equal( ggResult$fitted, exp( ggResultLog$fitted ) ) [1] TRUE > # random effects > ggResultRan <- translogEst( "invest", c( "value", "capital" ), ggData, + model = "random", random.method = "amemiya" ) > print( ggResultRan ) Estimated Translog function with 100 observations. a_0 a_1 a_2 b_1_1 b_1_2 b_2_2 3.091 -0.822 0.462 0.296 -0.119 0.148 > print.default( ggResultRan ) $call translogEst(yName = "invest", xNames = c("value", "capital"), data = ggData, model = "random", random.method = "amemiya") $nExog [1] 2 $nShifter [1] 0 $est Model Formula: y ~ 1 + a_1 + a_2 + b_1_1 + b_1_2 + b_2_2 Coefficients: (Intercept) a_1 a_2 b_1_1 b_1_2 b_2_2 3.091 -0.822 0.462 0.296 -0.119 0.148 $residuals 1 2 3 4 5 6 7 8 -0.01983 0.07942 -0.16888 -0.04690 -0.20463 0.04688 0.11698 0.25032 9 10 11 12 13 14 15 16 0.19721 0.28588 0.13542 0.19786 0.04145 -0.06261 -0.16520 -0.06839 17 18 19 20 21 22 23 24 -0.15937 -0.09776 -0.03318 0.06519 0.17585 0.21953 -0.03180 0.06334 25 26 27 28 29 30 31 32 -0.23475 -0.00903 0.01347 -0.11638 -0.26385 -0.10543 0.19431 -0.14723 33 34 35 36 37 38 39 40 -0.10565 0.10218 -0.05756 0.06134 0.35069 0.12759 0.06903 0.12063 41 42 43 44 45 46 47 48 -0.26557 -0.41055 -0.20199 -0.54015 -0.57981 -0.12099 0.35760 0.15010 49 50 51 52 53 54 55 56 -0.36690 -0.41987 -0.04252 0.38882 0.38296 0.30930 -0.09038 -0.23347 57 58 59 60 61 62 63 64 0.04169 0.06597 0.05887 -0.04744 0.08933 -0.22442 0.12140 -0.14498 65 66 67 68 69 70 71 72 -0.33101 -0.06434 0.50104 0.21662 -0.10413 -0.11925 -0.17846 0.13569 73 74 75 76 77 78 79 80 0.22921 -0.01730 -0.42585 -0.44497 0.03096 0.16259 0.11718 -0.23257 81 82 83 84 85 86 87 88 0.22935 0.51684 0.26666 -0.23085 -0.49536 -0.37832 0.14089 0.10535 89 90 91 92 93 94 95 96 -0.04060 -0.16951 -0.19025 0.17830 0.23629 0.40800 0.13248 0.15306 97 98 99 100 0.28693 0.31112 0.18401 -0.21294 $fitted 1 2 3 4 5 6 7 8 9 10 11 324.0 361.9 486.1 270.1 405.9 440.1 455.5 348.8 410.2 411.4 490.1 12 13 14 15 16 17 18 19 20 21 22 564.6 545.8 563.4 654.8 688.4 886.5 982.7 1348.4 1392.9 33.8 58.4 23 24 25 26 27 28 29 30 31 32 33 68.4 48.4 66.3 70.0 67.4 52.6 61.7 66.2 73.1 85.9 69.7 34 35 36 37 38 39 40 41 42 43 44 80.7 83.7 94.7 113.1 127.6 163.3 152.9 43.2 67.8 94.5 76.5 45 46 47 48 49 50 51 52 53 54 55 85.9 84.0 79.0 79.1 88.5 86.4 97.7 108.4 100.4 107.4 107.6 56 57 58 59 60 61 62 63 64 65 66 118.1 129.7 147.3 169.2 198.8 11.8 32.4 31.0 26.5 26.2 30.5 67 68 69 70 71 72 73 74 75 76 77 29.4 34.9 41.1 42.6 46.9 46.7 44.2 50.4 49.0 50.3 52.7 78 79 80 81 82 83 84 85 86 87 88 61.0 80.1 86.6 166.9 211.9 359.9 330.4 378.1 381.9 410.7 401.0 89 90 91 92 93 94 95 96 97 98 99 376.6 341.4 312.9 351.7 332.0 328.8 354.8 359.4 441.5 472.7 533.3 100 568.3 $coef a_0 a_1 a_2 b_1_1 b_1_2 b_2_2 3.091 -0.822 0.462 0.296 -0.119 0.148 $coefCov a_0 a_1 a_2 b_1_1 b_1_2 b_2_2 a_0 11.8320 -3.60649 0.44707 0.54276 -0.066132 0.011610 a_1 -3.6065 1.12890 -0.15744 -0.17331 0.023856 -0.004846 a_2 0.4471 -0.15744 0.05083 0.02667 -0.008004 0.001995 b_1_1 0.5428 -0.17331 0.02667 0.02713 -0.004190 0.001028 b_1_2 -0.0661 0.02386 -0.00800 -0.00419 0.001409 -0.000555 b_2_2 0.0116 -0.00485 0.00199 0.00103 -0.000555 0.000497 $r2 [1] 0.73 $r2bar [1] 0.716 $nObs [1] 100 $yName [1] "invest" $xNames [1] "value" "capital" $r2nonLog [,1] [1,] 0.951 $dataLogged [1] FALSE attr(,"class") [1] "translogEst" > # with dataLogged = TRUE > ggResultRanLog <- translogEst( "logInvest", + xNames = c( "logValue", "logCapital" ), + data = ggData, dataLogged = TRUE, + model = "random", random.method = "amemiya" ) > all.equal( ggResultRan[ -c(1,6,12,13,15) ], ggResultRanLog[ -c(1,6,12,13,15) ] ) [1] TRUE > all.equal( ggResultRan$fitted, exp( ggResultRanLog$fitted ) ) [1] TRUE > > ## testing translogEla with panel data > # fixed effects > ggEla <- translogEla( c( "value", "capital" ), + data = ggData, coef = coef( ggResult ), + coefCov = vcov( ggResult ) ) > print( ggEla ) value capital 1 1.406 -0.34014 2 1.177 0.04541 3 1.089 0.19026 4 0.867 0.31064 5 0.995 0.25502 6 1.014 0.24903 7 0.983 0.28229 8 0.866 0.34813 9 0.946 0.30107 10 1.000 0.25191 11 0.996 0.28057 12 0.951 0.34094 13 0.781 0.47448 14 0.736 0.51237 15 0.760 0.51211 16 0.756 0.52139 17 0.817 0.50553 18 0.802 0.52839 19 0.844 0.53252 20 0.786 0.57887 21 0.679 0.09211 22 0.881 0.00541 23 0.752 0.18051 24 0.504 0.32298 25 0.604 0.30299 26 0.618 0.30122 27 0.570 0.33265 28 0.448 0.37806 29 0.558 0.32637 30 0.619 0.29075 31 0.686 0.25281 32 0.649 0.31160 33 0.510 0.38259 34 0.546 0.38026 35 0.466 0.44261 36 0.499 0.43864 37 0.517 0.45312 38 0.445 0.51856 39 0.515 0.50656 40 0.393 0.57526 41 0.709 0.30082 42 0.857 0.24619 43 0.936 0.22532 44 0.812 0.30450 45 0.829 0.30736 46 0.804 0.32561 47 0.741 0.36843 48 0.669 0.42468 49 0.684 0.42890 50 0.673 0.43383 51 0.723 0.41247 52 0.741 0.41296 53 0.626 0.48800 54 0.596 0.51765 55 0.549 0.55025 56 0.577 0.54315 57 0.607 0.53409 58 0.636 0.52990 59 0.662 0.52878 60 0.693 0.52640 61 0.666 -0.07702 62 1.044 -0.31446 63 0.880 -0.02569 64 0.699 0.13798 65 0.647 0.18554 66 0.686 0.18090 67 0.605 0.24572 68 0.556 0.31736 69 0.544 0.35471 70 0.539 0.36439 71 0.584 0.34711 72 0.602 0.33279 73 0.495 0.40251 74 0.513 0.41106 75 0.467 0.43818 76 0.495 0.42277 77 0.539 0.39953 78 0.576 0.39560 79 0.646 0.38458 80 0.621 0.41467 81 0.823 0.19430 82 0.911 0.15150 83 0.923 0.23093 84 0.717 0.39479 85 0.719 0.41224 86 0.777 0.36756 87 0.796 0.36253 88 0.753 0.39332 89 0.727 0.40531 90 0.710 0.40440 91 0.747 0.36256 92 0.769 0.36189 93 0.714 0.39773 94 0.668 0.43142 95 0.659 0.44840 96 0.659 0.45046 97 0.753 0.40701 98 0.705 0.45263 99 0.647 0.51014 100 0.651 0.51590 > print( attributes( ggEla )$variance ) value capital 1 1.466 0.0706 2 1.460 0.0621 3 1.458 0.0604 4 1.294 0.0536 5 1.395 0.0576 6 1.412 0.0583 7 1.401 0.0577 8 1.317 0.0543 9 1.372 0.0565 10 1.399 0.0577 11 1.414 0.0582 12 1.404 0.0576 13 1.310 0.0542 14 1.288 0.0535 15 1.313 0.0545 16 1.315 0.0546 17 1.369 0.0565 18 1.369 0.0566 19 1.419 0.0584 20 1.386 0.0575 21 1.030 0.0453 22 1.140 0.0506 23 1.119 0.0478 24 1.007 0.0431 25 1.064 0.0452 26 1.073 0.0455 27 1.053 0.0447 28 0.994 0.0426 29 1.042 0.0443 30 1.069 0.0454 31 1.101 0.0467 32 1.101 0.0465 33 1.034 0.0440 34 1.057 0.0448 35 1.029 0.0439 36 1.050 0.0447 37 1.069 0.0454 38 1.047 0.0449 39 1.092 0.0464 40 1.037 0.0449 41 1.143 0.0481 42 1.245 0.0521 43 1.312 0.0547 44 1.236 0.0515 45 1.254 0.0521 46 1.241 0.0516 47 1.207 0.0503 48 1.174 0.0491 49 1.189 0.0497 50 1.182 0.0494 51 1.215 0.0506 52 1.232 0.0512 53 1.171 0.0492 54 1.162 0.0490 55 1.139 0.0484 56 1.159 0.0490 57 1.180 0.0497 58 1.203 0.0506 59 1.227 0.0514 60 1.255 0.0524 61 0.968 0.0454 62 1.126 0.0567 63 1.124 0.0504 64 1.061 0.0460 65 1.044 0.0450 66 1.070 0.0460 67 1.041 0.0445 68 1.037 0.0442 69 1.045 0.0444 70 1.046 0.0444 71 1.069 0.0453 72 1.075 0.0455 73 1.032 0.0439 74 1.047 0.0445 75 1.029 0.0439 76 1.041 0.0443 77 1.060 0.0449 78 1.085 0.0458 79 1.134 0.0476 80 1.129 0.0474 81 1.185 0.0502 82 1.242 0.0527 83 1.301 0.0542 84 1.199 0.0500 85 1.211 0.0504 86 1.240 0.0515 87 1.255 0.0520 88 1.232 0.0512 89 1.215 0.0506 90 1.199 0.0500 91 1.209 0.0504 92 1.229 0.0511 93 1.199 0.0500 94 1.176 0.0492 95 1.178 0.0493 96 1.179 0.0493 97 1.240 0.0515 98 1.222 0.0509 99 1.202 0.0504 100 1.209 0.0507 > print( attributes( ggEla )$stdDev ) value capital 1 1.211 0.266 2 1.208 0.249 3 1.208 0.246 4 1.138 0.232 5 1.181 0.240 6 1.188 0.241 7 1.183 0.240 8 1.148 0.233 9 1.171 0.238 10 1.183 0.240 11 1.189 0.241 12 1.185 0.240 13 1.145 0.233 14 1.135 0.231 15 1.146 0.233 16 1.147 0.234 17 1.170 0.238 18 1.170 0.238 19 1.191 0.242 20 1.177 0.240 21 1.015 0.213 22 1.068 0.225 23 1.058 0.219 24 1.004 0.208 25 1.031 0.213 26 1.036 0.213 27 1.026 0.211 28 0.997 0.206 29 1.021 0.211 30 1.034 0.213 31 1.049 0.216 32 1.049 0.216 33 1.017 0.210 34 1.028 0.212 35 1.015 0.210 36 1.025 0.211 37 1.034 0.213 38 1.023 0.212 39 1.045 0.215 40 1.019 0.212 41 1.069 0.219 42 1.116 0.228 43 1.145 0.234 44 1.112 0.227 45 1.120 0.228 46 1.114 0.227 47 1.099 0.224 48 1.083 0.222 49 1.090 0.223 50 1.087 0.222 51 1.102 0.225 52 1.110 0.226 53 1.082 0.222 54 1.078 0.221 55 1.067 0.220 56 1.077 0.221 57 1.086 0.223 58 1.097 0.225 59 1.108 0.227 60 1.120 0.229 61 0.984 0.213 62 1.061 0.238 63 1.060 0.225 64 1.030 0.215 65 1.022 0.212 66 1.034 0.214 67 1.020 0.211 68 1.019 0.210 69 1.022 0.211 70 1.023 0.211 71 1.034 0.213 72 1.037 0.213 73 1.016 0.210 74 1.023 0.211 75 1.014 0.209 76 1.020 0.210 77 1.030 0.212 78 1.041 0.214 79 1.065 0.218 80 1.063 0.218 81 1.089 0.224 82 1.115 0.229 83 1.141 0.233 84 1.095 0.224 85 1.100 0.225 86 1.113 0.227 87 1.120 0.228 88 1.110 0.226 89 1.102 0.225 90 1.095 0.224 91 1.100 0.224 92 1.109 0.226 93 1.095 0.224 94 1.085 0.222 95 1.085 0.222 96 1.086 0.222 97 1.113 0.227 98 1.105 0.226 99 1.097 0.225 100 1.099 0.225 > ggElaMet <- elas( ggResult ) > all.equal( ggEla, ggElaMet ) [1] TRUE > ggElaLogMet <- elas( ggResultLog ) > all.equal( ggElaMet, ggElaLogMet, check.attributes = FALSE ) [1] TRUE > # random effects > ggElaRan <- translogEla( c( "value", "capital" ), + data = ggData, coef = coef( ggResultRan ), + coefCov = vcov( ggResultRan ) ) > print( ggElaRan ) value capital 1 1.431 -0.34147 2 1.205 0.04397 3 1.118 0.18878 4 0.889 0.30964 5 1.021 0.25372 6 1.041 0.24767 7 1.010 0.28096 8 0.889 0.34705 9 0.972 0.29982 10 1.027 0.25059 11 1.024 0.27920 12 0.978 0.33959 13 0.805 0.47339 14 0.758 0.51135 15 0.784 0.51101 16 0.779 0.52029 17 0.843 0.50425 18 0.828 0.52711 19 0.873 0.53109 20 0.813 0.57753 21 0.683 0.09226 22 0.893 0.00507 23 0.763 0.18020 24 0.507 0.32319 25 0.612 0.30291 26 0.627 0.30109 27 0.577 0.33262 28 0.450 0.37833 29 0.564 0.32639 30 0.627 0.29065 31 0.696 0.25256 32 0.660 0.31134 33 0.516 0.38264 34 0.554 0.38019 35 0.471 0.44268 36 0.507 0.43860 37 0.526 0.45298 38 0.452 0.51852 39 0.526 0.50630 40 0.400 0.57527 41 0.723 0.30038 42 0.876 0.24537 43 0.959 0.22428 44 0.831 0.30370 45 0.849 0.30650 46 0.823 0.32479 47 0.758 0.36773 48 0.684 0.42409 49 0.700 0.42825 50 0.689 0.43321 51 0.741 0.41172 52 0.760 0.41215 53 0.642 0.48741 54 0.612 0.51709 55 0.563 0.54978 56 0.592 0.54260 57 0.624 0.53346 58 0.654 0.52918 59 0.681 0.52797 60 0.714 0.52549 61 0.663 -0.07643 62 1.052 -0.31462 63 0.890 -0.02595 64 0.705 0.13795 65 0.652 0.18558 66 0.694 0.18082 67 0.610 0.24576 68 0.562 0.31741 69 0.551 0.35471 70 0.546 0.36438 71 0.593 0.34699 72 0.610 0.33265 73 0.500 0.40257 74 0.520 0.41104 75 0.473 0.43825 76 0.502 0.42278 77 0.547 0.39945 78 0.585 0.39540 79 0.659 0.38416 80 0.634 0.41427 81 0.839 0.19372 82 0.930 0.15072 83 0.945 0.22992 84 0.734 0.39411 85 0.736 0.41151 86 0.796 0.36674 87 0.816 0.36165 88 0.772 0.39252 89 0.745 0.40457 90 0.727 0.40371 91 0.765 0.36184 92 0.788 0.36111 93 0.731 0.39705 94 0.684 0.43082 95 0.675 0.44779 96 0.675 0.44985 97 0.772 0.40617 98 0.724 0.45186 99 0.665 0.50942 100 0.669 0.51516 > print( attributes( ggElaRan )$variance ) value capital 1 1.444 0.0709 2 1.437 0.0623 3 1.435 0.0607 4 1.274 0.0538 5 1.373 0.0578 6 1.390 0.0585 7 1.379 0.0579 8 1.296 0.0546 9 1.350 0.0568 10 1.377 0.0580 11 1.392 0.0584 12 1.382 0.0579 13 1.290 0.0544 14 1.268 0.0538 15 1.293 0.0547 16 1.294 0.0548 17 1.347 0.0567 18 1.347 0.0568 19 1.396 0.0587 20 1.364 0.0578 21 1.016 0.0455 22 1.124 0.0508 23 1.103 0.0480 24 0.993 0.0433 25 1.049 0.0454 26 1.058 0.0457 27 1.038 0.0449 28 0.981 0.0428 29 1.028 0.0445 30 1.054 0.0456 31 1.086 0.0469 32 1.085 0.0467 33 1.019 0.0442 34 1.042 0.0450 35 1.015 0.0441 36 1.035 0.0449 37 1.053 0.0456 38 1.032 0.0451 39 1.076 0.0466 40 1.023 0.0451 41 1.126 0.0483 42 1.226 0.0523 43 1.292 0.0549 44 1.218 0.0517 45 1.235 0.0524 46 1.222 0.0518 47 1.189 0.0505 48 1.156 0.0493 49 1.171 0.0499 50 1.165 0.0496 51 1.197 0.0508 52 1.214 0.0514 53 1.154 0.0494 54 1.144 0.0492 55 1.122 0.0486 56 1.142 0.0493 57 1.162 0.0500 58 1.185 0.0508 59 1.208 0.0516 60 1.235 0.0526 61 0.956 0.0456 62 1.111 0.0569 63 1.108 0.0506 64 1.046 0.0462 65 1.030 0.0452 66 1.055 0.0462 67 1.026 0.0447 68 1.023 0.0444 69 1.030 0.0446 70 1.031 0.0446 71 1.054 0.0455 72 1.060 0.0457 73 1.018 0.0441 74 1.032 0.0447 75 1.014 0.0441 76 1.026 0.0445 77 1.045 0.0451 78 1.069 0.0460 79 1.117 0.0478 80 1.112 0.0477 81 1.168 0.0504 82 1.224 0.0529 83 1.282 0.0545 84 1.181 0.0502 85 1.193 0.0507 86 1.221 0.0517 87 1.235 0.0523 88 1.214 0.0514 89 1.196 0.0508 90 1.181 0.0502 91 1.191 0.0506 92 1.210 0.0513 93 1.181 0.0502 94 1.159 0.0494 95 1.160 0.0495 96 1.161 0.0496 97 1.221 0.0517 98 1.203 0.0511 99 1.184 0.0506 100 1.190 0.0509 > print( attributes( ggElaRan )$stdDev ) value capital 1 1.202 0.266 2 1.199 0.250 3 1.198 0.246 4 1.129 0.232 5 1.172 0.240 6 1.179 0.242 7 1.174 0.241 8 1.139 0.234 9 1.162 0.238 10 1.173 0.241 11 1.180 0.242 12 1.176 0.241 13 1.136 0.233 14 1.126 0.232 15 1.137 0.234 16 1.137 0.234 17 1.161 0.238 18 1.161 0.238 19 1.182 0.242 20 1.168 0.240 21 1.008 0.213 22 1.060 0.225 23 1.050 0.219 24 0.997 0.208 25 1.024 0.213 26 1.029 0.214 27 1.019 0.212 28 0.990 0.207 29 1.014 0.211 30 1.027 0.214 31 1.042 0.217 32 1.042 0.216 33 1.010 0.210 34 1.021 0.212 35 1.007 0.210 36 1.017 0.212 37 1.026 0.213 38 1.016 0.212 39 1.037 0.216 40 1.011 0.212 41 1.061 0.220 42 1.107 0.229 43 1.136 0.234 44 1.104 0.227 45 1.111 0.229 46 1.105 0.228 47 1.090 0.225 48 1.075 0.222 49 1.082 0.223 50 1.079 0.223 51 1.094 0.225 52 1.102 0.227 53 1.074 0.222 54 1.070 0.222 55 1.059 0.220 56 1.068 0.222 57 1.078 0.224 58 1.089 0.225 59 1.099 0.227 60 1.111 0.229 61 0.978 0.214 62 1.054 0.239 63 1.053 0.225 64 1.023 0.215 65 1.015 0.213 66 1.027 0.215 67 1.013 0.211 68 1.011 0.211 69 1.015 0.211 70 1.015 0.211 71 1.027 0.213 72 1.030 0.214 73 1.009 0.210 74 1.016 0.211 75 1.007 0.210 76 1.013 0.211 77 1.022 0.212 78 1.034 0.215 79 1.057 0.219 80 1.055 0.218 81 1.081 0.224 82 1.106 0.230 83 1.132 0.233 84 1.087 0.224 85 1.092 0.225 86 1.105 0.227 87 1.112 0.229 88 1.102 0.227 89 1.094 0.225 90 1.087 0.224 91 1.091 0.225 92 1.100 0.227 93 1.087 0.224 94 1.076 0.222 95 1.077 0.223 96 1.078 0.223 97 1.105 0.227 98 1.097 0.226 99 1.088 0.225 100 1.091 0.226 > ggElaRanMet <- elas( ggResultRan ) > all.equal( ggElaRan, ggElaRanMet ) [1] TRUE > ggElaRanLogMet <- elas( ggResultRanLog ) > all.equal( ggElaRanMet, ggElaRanLogMet, check.attributes = FALSE ) [1] TRUE > > ## panel data with a shifter > ggData$yearInt <- as.numeric( as.character( ggData$year ) ) > ggData$tech <- exp( ggData$yearInt - min( ggData$yearInt ) ) > # fixed effects > ggResShifter <- translogEst( "invest", c( "value", "capital" ), ggData, + shifterNames = "tech" ) > print( ggResShifter ) Estimated Translog function with 100 observations. a_0 a_1 a_2 b_1_1 b_1_2 b_2_2 d_1 2.6708 -0.3347 0.1178 0.1730 -0.0468 0.0620 0.0408 > print.default( ggResShifter ) $call translogEst(yName = "invest", xNames = c("value", "capital"), data = ggData, shifterNames = "tech") $nExog [1] 2 $nShifter [1] 1 $est Model Formula: y ~ 1 + a_1 + a_2 + b_1_1 + b_1_2 + b_2_2 + d_1 Coefficients: a_1 a_2 b_1_1 b_1_2 b_2_2 d_1 -0.3347 0.1178 0.1730 -0.0468 0.0620 0.0408 $residuals 1 2 3 4 5 6 7 8 -0.05880 0.03800 -0.08855 -0.05073 -0.19930 0.02692 0.09565 0.18837 9 10 11 12 13 14 15 16 0.08584 0.08797 -0.03178 0.08765 0.04761 -0.03444 -0.14052 -0.05805 17 18 19 20 21 22 23 24 -0.14942 -0.06858 0.04203 0.18013 0.11081 0.20014 0.04876 0.16189 25 26 27 28 29 30 31 32 -0.12816 0.06771 0.07603 -0.09441 -0.31052 -0.21622 0.02774 -0.25588 33 34 35 36 37 38 39 40 -0.21878 -0.02111 -0.12849 -0.02792 0.28243 0.14642 0.08501 0.19456 41 42 43 44 45 46 47 48 -0.15422 -0.28250 -0.04967 -0.40686 -0.45562 -0.02382 0.44775 0.27063 49 50 51 52 53 54 55 56 -0.25423 -0.34704 -0.00873 0.40818 0.44632 0.39310 0.00506 -0.16802 57 58 59 60 61 62 63 64 0.07452 0.08238 0.06687 -0.04413 -0.02222 -0.12794 0.16370 -0.09799 65 66 67 68 69 70 71 72 -0.29041 -0.03355 0.54011 0.32966 0.04959 0.01395 -0.08470 0.17051 73 74 75 76 77 78 79 80 0.29781 0.05221 -0.36555 -0.44146 -0.02706 0.09261 0.05696 -0.27623 81 82 83 84 85 86 87 88 0.15634 0.43022 0.33445 -0.05224 -0.30221 -0.27868 0.21191 0.16675 89 90 91 92 93 94 95 96 -0.02044 -0.21537 -0.34967 0.00616 0.05276 0.22526 -0.04936 -0.06361 97 98 99 100 0.02229 0.08299 0.02792 -0.38547 $fitted 1 2 3 4 5 6 7 8 9 10 11 336.8 377.2 448.6 271.1 403.8 449.0 465.3 371.1 458.5 501.4 579.3 12 13 14 15 16 17 18 19 20 21 22 630.4 542.5 547.7 638.9 681.3 877.7 954.5 1250.7 1241.6 36.1 59.6 23 24 25 26 27 28 29 30 31 32 33 63.1 43.9 59.6 64.9 63.3 51.4 64.7 73.9 86.4 95.7 78.0 34 35 36 37 38 39 40 41 42 43 44 91.3 89.8 103.5 121.1 125.3 160.7 142.0 38.6 59.7 81.1 67.0 45 46 47 48 49 50 51 52 53 54 55 75.9 76.2 72.2 70.1 79.0 80.4 94.4 106.3 94.2 98.7 97.8 56 57 58 59 60 61 62 63 64 65 66 110.6 125.5 144.9 167.9 198.2 13.2 29.4 29.8 25.2 25.2 29.5 67 68 69 70 71 72 73 74 75 76 77 28.3 31.2 35.2 37.3 42.7 45.1 41.3 47.0 46.2 50.1 55.9 78 79 80 81 82 83 84 85 86 87 88 65.4 85.1 90.4 179.5 231.1 336.3 276.4 311.7 345.7 382.5 377.2 89 90 91 92 93 94 95 96 97 98 99 369.1 357.5 367.0 417.7 398.9 394.8 425.6 446.3 575.2 593.8 623.4 100 675.3 $coef a_0 a_1 a_2 b_1_1 b_1_2 b_2_2 d_1 2.6708 -0.3347 0.1178 0.1730 -0.0468 0.0620 0.0408 $coefCov a_0 a_1 a_2 b_1_1 b_1_2 b_2_2 d_1 a_0 NA NA NA NA NA NA NA a_1 NA 0.98834 -0.144114 -0.153299 0.022441 -0.006542 0.001084 a_2 NA -0.14411 0.050453 0.025236 -0.008326 0.003515 -0.000858 b_1_1 NA -0.15330 0.025236 0.024370 -0.004102 0.001497 -0.000283 b_1_2 NA 0.02244 -0.008326 -0.004102 0.001518 -0.000855 0.000180 b_2_2 NA -0.00654 0.003515 0.001497 -0.000855 0.000883 -0.000218 d_1 NA 0.00108 -0.000858 -0.000283 0.000180 -0.000218 0.000103 $r2 [1] 0.772 $r2bar [1] 0.746 $nObs [1] 100 $yName [1] "invest" $xNames [1] "value" "capital" $shifterNames [1] "tech" $r2nonLog [,1] [1,] 0.961 $dataLogged [1] FALSE attr(,"class") [1] "translogEst" > # random effects > ggResShifterRan <- translogEst( "invest", c( "value", "capital" ), ggData, + shifterNames = "tech", model = "random", random.method = "amemiya" ) > print( ggResShifterRan ) Estimated Translog function with 100 observations. a_0 a_1 a_2 b_1_1 b_1_2 b_2_2 d_1 2.8597 -0.4349 0.1363 0.1938 -0.0509 0.0664 0.0390 > print.default( ggResShifterRan ) $call translogEst(yName = "invest", xNames = c("value", "capital"), data = ggData, shifterNames = "tech", model = "random", random.method = "amemiya") $nExog [1] 2 $nShifter [1] 1 $est Model Formula: y ~ 1 + a_1 + a_2 + b_1_1 + b_1_2 + b_2_2 + d_1 Coefficients: (Intercept) a_1 a_2 b_1_1 b_1_2 b_2_2 2.8597 -0.4349 0.1363 0.1938 -0.0509 0.0664 d_1 0.0390 $residuals 1 2 3 4 5 6 7 8 -0.018218 0.068174 -0.068583 0.001995 -0.165243 0.058691 0.128661 0.237923 9 10 11 12 13 14 15 16 0.127984 0.130081 0.004692 0.121509 0.091168 0.011393 -0.099727 -0.017254 17 18 19 20 21 22 23 24 -0.119558 -0.040388 0.057069 0.198708 0.122125 0.197269 0.041798 0.166113 25 26 27 28 29 30 31 32 -0.130676 0.065235 0.076369 -0.086316 -0.304021 -0.209857 0.032655 -0.254492 33 34 35 36 37 38 39 40 -0.209242 -0.014128 -0.121248 -0.022518 0.284006 0.145967 0.078223 0.191947 41 42 43 44 45 46 47 48 -0.194217 -0.339492 -0.119697 -0.464179 -0.515987 -0.080997 0.395952 0.221983 49 50 51 52 53 54 55 56 -0.305463 -0.395447 -0.060965 0.353369 0.398803 0.345573 -0.039841 -0.214955 57 58 59 60 61 62 63 64 0.025340 0.029629 0.010016 -0.106246 -0.055574 -0.181627 0.110484 -0.145449 65 66 67 68 69 70 71 72 -0.336275 -0.081976 0.494003 0.279773 -0.003558 -0.038575 -0.138365 0.118794 73 74 75 76 77 78 79 80 0.249173 0.001416 -0.414013 -0.488749 -0.073903 0.042811 -0.000744 -0.334569 81 82 83 84 85 86 87 88 0.231587 0.497223 0.381706 0.004579 -0.248653 -0.225123 0.263982 0.222546 89 90 91 92 93 94 95 96 0.040104 -0.149075 -0.279169 0.073567 0.125285 0.300819 0.025397 0.012455 97 98 99 100 0.090298 0.151459 0.095254 -0.318783 $fitted 1 2 3 4 5 6 7 8 9 10 11 323.4 366.0 439.7 257.2 390.2 434.9 450.2 353.1 439.6 480.7 558.6 12 13 14 15 16 17 18 19 20 21 22 609.4 519.3 523.2 613.3 654.1 851.9 927.9 1232.0 1218.8 35.7 59.7 23 24 25 26 27 28 29 30 31 32 33 63.5 43.7 59.7 65.0 63.3 51.0 64.2 73.5 85.9 95.6 77.3 34 35 36 37 38 39 40 41 42 43 44 90.6 89.2 103.0 120.9 125.3 161.8 142.4 40.2 63.2 87.0 70.9 45 46 47 48 49 50 51 52 53 54 55 80.6 80.7 76.1 73.6 83.2 84.4 99.5 112.3 98.8 103.6 102.3 56 57 58 59 60 61 62 63 64 65 66 115.9 131.8 152.7 177.7 210.9 13.7 31.1 31.4 26.5 26.4 31.0 67 68 69 70 71 72 73 74 75 76 77 29.6 32.8 37.2 39.3 45.1 47.5 43.3 49.5 48.5 52.6 58.6 78 79 80 81 82 83 84 85 86 87 88 68.8 90.1 95.9 166.5 216.1 320.8 261.1 295.4 327.6 363.1 356.7 89 90 91 92 93 94 95 96 97 98 99 347.4 334.5 342.0 390.5 371.0 366.0 394.9 413.6 537.4 554.5 582.8 100 631.7 $coef a_0 a_1 a_2 b_1_1 b_1_2 b_2_2 d_1 2.8597 -0.4349 0.1363 0.1938 -0.0509 0.0664 0.0390 $coefCov a_0 a_1 a_2 b_1_1 b_1_2 b_2_2 d_1 a_0 10.182172 -3.101937 0.38730 0.467615 -0.057590 0.011026 -4.79e-04 a_1 -3.101937 0.979227 -0.14282 -0.151452 0.022117 -0.006167 9.46e-04 a_2 0.387301 -0.142820 0.05037 0.024962 -0.008291 0.003449 -8.30e-04 b_1_1 0.467615 -0.151452 0.02496 0.023994 -0.004035 0.001417 -2.53e-04 b_1_2 -0.057590 0.022117 -0.00829 -0.004035 0.001508 -0.000839 1.74e-04 b_2_2 0.011026 -0.006167 0.00345 0.001417 -0.000839 0.000865 -2.10e-04 d_1 -0.000479 0.000946 -0.00083 -0.000253 0.000174 -0.000210 9.99e-05 $r2 [1] 0.768 $r2bar [1] 0.753 $nObs [1] 100 $yName [1] "invest" $xNames [1] "value" "capital" $shifterNames [1] "tech" $r2nonLog [,1] [1,] 0.959 $dataLogged [1] FALSE attr(,"class") [1] "translogEst" > > ## panel data with a logical variable as shifter > ggData$war <- ggData$yearInt >= 1939 & ggData$yearInt <= 1945 > # fixed effects > ggResShifterLogi <- translogEst( "invest", c( "value", "capital" ), ggData, + shifterNames = "war" ) > print( ggResShifterLogi ) Estimated Translog function with 100 observations. a_0 a_1 a_2 b_1_1 b_1_2 b_2_2 d_1_TRUE 2.930 -0.718 0.438 0.270 -0.106 0.131 -0.098 > print.default( ggResShifterLogi ) $call translogEst(yName = "invest", xNames = c("value", "capital"), data = ggData, shifterNames = "war") $nExog [1] 2 $nShifter [1] 1 $est Model Formula: y ~ 1 + a_1 + a_2 + b_1_1 + b_1_2 + b_2_2 + d_1_ Coefficients: a_1 a_2 b_1_1 b_1_2 b_2_2 d_1_TRUE -0.718 0.438 0.270 -0.106 0.131 -0.098 $residuals 1 2 3 4 5 6 7 8 -0.01189 0.00802 -0.23897 -0.13994 -0.18498 0.06974 0.14136 0.26637 9 10 11 12 13 14 15 16 0.21781 0.30606 0.16272 0.13449 -0.01293 -0.11108 -0.20776 -0.10771 17 18 19 20 21 22 23 24 -0.19042 -0.12154 -0.04293 0.06358 0.10072 0.16423 -0.09882 -0.00853 25 26 27 28 29 30 31 32 -0.20378 0.02311 0.04647 -0.08407 -0.23310 -0.07499 0.22615 -0.20773 33 34 35 36 37 38 39 40 -0.16589 0.04491 -0.10689 0.01426 0.30988 0.09987 0.04591 0.10830 41 42 43 44 45 46 47 48 -0.25868 -0.39048 -0.17025 -0.51515 -0.45271 0.00599 0.48484 0.28206 49 50 51 52 53 54 55 56 -0.23081 -0.28406 0.09538 0.43237 0.43215 0.36496 -0.02942 -0.17061 57 58 59 60 61 62 63 64 0.10629 0.13440 0.13218 0.03154 0.09206 -0.14568 0.12288 -0.16482 65 66 67 68 69 70 71 72 -0.25493 0.01464 0.57878 0.30020 -0.01462 -0.02817 -0.08656 0.12846 73 74 75 76 77 78 79 80 0.22678 -0.01590 -0.42170 -0.44224 0.03215 0.16701 0.12817 -0.21653 81 82 83 84 85 86 87 88 0.09204 0.38859 0.15377 -0.34104 -0.50143 -0.38748 0.13399 0.09974 89 90 91 92 93 94 95 96 -0.04742 -0.17974 -0.20656 0.06788 0.12650 0.30104 0.02986 0.05109 97 98 99 100 0.18779 0.21884 0.10320 -0.29066 $fitted 1 2 3 4 5 6 7 8 9 10 11 321.4 388.7 521.4 296.4 398.0 430.1 444.5 343.2 401.8 403.1 476.9 12 13 14 15 16 17 18 19 20 21 22 601.5 576.3 591.4 683.3 716.0 914.5 1006.4 1361.6 1395.1 36.4 61.7 23 24 25 26 27 28 29 30 31 32 33 73.1 52.0 64.3 67.8 65.2 50.9 59.8 64.2 70.8 91.2 74.0 34 35 36 37 38 39 40 41 42 43 44 85.4 87.9 99.2 117.8 131.2 167.1 154.8 42.9 66.5 91.5 74.7 45 46 47 48 49 50 51 52 53 54 55 75.6 74.0 69.6 69.3 77.2 75.5 85.1 103.8 95.5 101.6 101.2 56 57 58 59 60 61 62 63 64 65 66 110.9 121.6 137.5 157.3 183.7 11.8 30.0 31.0 27.0 24.3 28.2 67 68 69 70 71 72 73 74 75 76 77 27.2 32.1 37.6 38.9 42.8 47.0 44.3 50.4 48.8 50.2 52.7 78 79 80 81 82 83 84 85 86 87 88 60.7 79.2 85.2 191.4 240.9 402.9 368.9 380.4 385.4 413.5 403.3 89 90 91 92 93 94 95 96 97 98 99 379.2 344.9 318.1 392.7 370.5 366.0 393.2 397.9 487.5 518.4 578.1 100 614.2 $coef a_0 a_1 a_2 b_1_1 b_1_2 b_2_2 d_1_TRUE 2.930 -0.718 0.438 0.270 -0.106 0.131 -0.098 $coefCov a_0 a_1 a_2 b_1_1 b_1_2 b_2_2 d_1_TRUE a_0 NA NA NA NA NA NA NA a_1 NA 1.11425 -0.154268 -0.171555 0.023585 -0.005092 -0.001396 a_2 NA -0.15427 0.049490 0.026166 -0.007850 0.002046 0.000604 b_1_1 NA -0.17155 0.026166 0.026958 -0.004165 0.001102 0.000447 b_1_2 NA 0.02359 -0.007850 -0.004165 0.001414 -0.000603 -0.000363 b_2_2 NA -0.00509 0.002046 0.001102 -0.000603 0.000574 0.000521 d_1_TRUE NA -0.00140 0.000604 0.000447 -0.000363 0.000521 0.002955 $r2 [1] 0.74 $r2bar [1] 0.711 $nObs [1] 100 $yName [1] "invest" $xNames [1] "value" "capital" $shifterNames [1] "war" $r2nonLog [,1] [1,] 0.954 $dataLogged [1] FALSE attr(,"class") [1] "translogEst" > # random effects > ggResShifterLogiRan <- translogEst( "invest", c( "value", "capital" ), ggData, + shifterNames = "war", model = "random", random.method = "amemiya" ) > print( ggResShifterLogiRan ) Estimated Translog function with 100 observations. a_0 a_1 a_2 b_1_1 b_1_2 b_2_2 d_1_TRUE 3.0808 -0.7793 0.4419 0.2817 -0.1071 0.1311 -0.0979 > print.default( ggResShifterLogiRan ) $call translogEst(yName = "invest", xNames = c("value", "capital"), data = ggData, shifterNames = "war", model = "random", random.method = "amemiya") $nExog [1] 2 $nShifter [1] 1 $est Model Formula: y ~ 1 + a_1 + a_2 + b_1_1 + b_1_2 + b_2_2 + d_1_ Coefficients: (Intercept) a_1 a_2 b_1_1 b_1_2 b_2_2 3.0808 -0.7793 0.4419 0.2817 -0.1071 0.1311 d_1_TRUE -0.0979 $residuals 1 2 3 4 5 6 7 8 9 10 0.0117 0.0243 -0.2255 -0.1080 -0.1646 0.0880 0.1605 0.2948 0.2402 0.3260 11 12 13 14 15 16 17 18 19 20 0.1800 0.1522 0.0145 -0.0815 -0.1813 -0.0815 -0.1710 -0.1025 -0.0307 0.0794 21 22 23 24 25 26 27 28 29 30 0.1237 0.1812 -0.0820 0.0140 -0.1843 0.0420 0.0664 -0.0616 -0.2125 -0.0557 31 32 33 34 35 36 37 38 39 40 0.2434 -0.1908 -0.1450 0.0644 -0.0862 0.0338 0.3280 0.1189 0.0617 0.1276 41 42 43 44 45 46 47 48 49 50 -0.3267 -0.4680 -0.2551 -0.5926 -0.5324 -0.0725 0.4095 0.2095 -0.3051 -0.3576 51 52 53 54 55 56 57 58 59 60 0.0185 0.3538 0.3592 0.2927 -0.0999 -0.2429 0.0319 0.0575 0.0527 -0.0512 61 62 63 64 65 66 67 68 69 70 0.0615 -0.1794 0.0868 -0.1982 -0.2879 -0.0198 0.5456 0.2667 -0.0489 -0.0625 71 72 73 74 75 76 77 78 79 80 -0.1223 0.0926 0.1931 -0.0505 -0.4554 -0.4765 -0.0032 0.1299 0.0871 -0.2575 81 82 83 84 85 86 87 88 89 90 0.1680 0.4594 0.2167 -0.2691 -0.4311 -0.3197 0.2002 0.1680 0.0226 -0.1080 91 92 93 94 95 96 97 98 99 100 -0.1354 0.1371 0.1986 0.3750 0.1034 0.1245 0.2552 0.2876 0.1734 -0.2212 $fitted 1 2 3 4 5 6 7 8 9 10 11 313.9 382.4 514.4 287.1 390.0 422.4 436.1 333.6 392.9 395.2 468.7 12 13 14 15 16 17 18 19 20 21 22 591.0 560.7 574.1 665.4 697.5 896.9 987.4 1345.1 1373.2 35.6 60.7 23 24 25 26 27 28 29 30 31 32 33 71.9 50.9 63.0 66.6 64.0 49.8 58.6 63.0 69.6 89.7 72.5 34 35 36 37 38 39 40 41 42 43 44 83.8 86.1 97.3 115.7 128.7 164.5 151.8 45.9 71.9 99.6 80.7 45 46 47 48 49 50 51 52 53 54 55 81.9 80.0 75.0 74.5 83.2 81.2 91.9 112.2 102.8 109.2 108.6 56 57 58 59 60 61 62 63 64 65 66 119.2 131.0 148.5 170.3 199.6 12.2 31.0 32.1 27.9 25.1 29.1 67 68 69 70 71 72 73 74 75 76 77 28.1 33.2 38.9 40.2 44.4 48.7 45.8 52.1 50.5 51.9 54.6 78 79 80 81 82 83 84 85 86 87 88 63.0 82.6 88.7 177.4 224.4 378.3 343.3 354.6 360.1 387.0 376.7 89 90 91 92 93 94 95 96 97 98 99 353.5 321.1 296.2 366.4 344.8 339.9 365.3 369.8 455.7 483.9 539.0 100 573.0 $coef a_0 a_1 a_2 b_1_1 b_1_2 b_2_2 d_1_TRUE 3.0808 -0.7793 0.4419 0.2817 -0.1071 0.1311 -0.0979 $coefCov a_0 a_1 a_2 b_1_1 b_1_2 b_2_2 d_1_TRUE a_0 11.545235 -3.51868 0.436122 0.529587 -0.064533 0.011358 0.000142 a_1 -3.518682 1.10200 -0.153817 -0.169288 0.023422 -0.004947 -0.001230 a_2 0.436122 -0.15382 0.049687 0.026100 -0.007879 0.002051 0.000601 b_1_1 0.529587 -0.16929 0.026100 0.026537 -0.004138 0.001076 0.000416 b_1_2 -0.064533 0.02342 -0.007879 -0.004138 0.001418 -0.000605 -0.000362 b_2_2 0.011358 -0.00495 0.002051 0.001076 -0.000605 0.000576 0.000522 d_1_TRUE 0.000142 -0.00123 0.000601 0.000416 -0.000362 0.000522 0.002973 $r2 [1] 0.739 $r2bar [1] 0.722 $nObs [1] 100 $yName [1] "invest" $xNames [1] "value" "capital" $shifterNames [1] "war" $r2nonLog [,1] [1,] 0.951 $dataLogged [1] FALSE attr(,"class") [1] "translogEst" > > ## panel data with a factor as shifter > ggData$decade <- as.factor( ifelse( ggData$yearInt <= 1939, "30s", + ifelse( ggData$yearInt <= 1949, "40s", "50s" ) ) ) > # fixed effects > ggResShifterFac <- translogEst( "invest", c( "value", "capital" ), ggData, + shifterNames = "decade" ) > print( ggResShifterFac ) Estimated Translog function with 100 observations. a_0 a_1 a_2 b_1_1 b_1_2 b_2_2 d_1_40s d_1_50s 2.5597 -0.4612 0.2427 0.2169 -0.0804 0.1070 0.2850 0.4308 > print.default( ggResShifterFac ) $call translogEst(yName = "invest", xNames = c("value", "capital"), data = ggData, shifterNames = "decade") $nExog [1] 2 $nShifter [1] 1 $est Model Formula: y ~ 1 + a_1 + a_2 + b_1_1 + b_1_2 + b_2_2 + d_1_ Coefficients: a_1 a_2 b_1_1 b_1_2 b_2_2 d_1_40s d_1_50s -0.4612 0.2427 0.2169 -0.0804 0.1070 0.2850 0.4308 $residuals 1 2 3 4 5 6 7 8 -0.09336 0.09759 -0.04748 0.04821 -0.07978 -0.10400 -0.01123 0.12055 9 10 11 12 13 14 15 16 0.06355 0.12616 0.01746 0.13529 0.06253 -0.00805 -0.08955 -0.12415 17 18 19 20 21 22 23 24 -0.19085 -0.09686 0.01727 0.15671 0.14566 0.22388 0.07284 0.21684 25 26 27 28 29 30 31 32 -0.05921 -0.11293 -0.07285 -0.19543 -0.36525 -0.22339 0.06436 -0.21851 33 34 35 36 37 38 39 40 -0.15002 0.07312 -0.03103 -0.04719 0.27544 0.12507 0.08455 0.19405 41 42 43 44 45 46 47 48 -0.13601 -0.25115 -0.00545 -0.32964 -0.35119 -0.16932 0.32889 0.16191 49 50 51 52 53 54 55 56 -0.33690 -0.38928 -0.01118 0.43490 0.47616 0.43620 0.06549 -0.21783 57 58 59 60 61 62 63 64 0.06161 0.09918 0.10990 0.02368 0.04070 -0.19169 0.21027 -0.00709 65 66 67 68 69 70 71 72 -0.16811 -0.17061 0.42930 0.21406 -0.05989 -0.06337 -0.12396 0.17912 73 74 75 76 77 78 79 80 0.31966 0.09540 -0.29343 -0.46861 -0.00620 0.14001 0.12078 -0.19636 81 82 83 84 85 86 87 88 0.18296 0.48314 0.34991 -0.05915 -0.29270 -0.49038 0.03573 0.01770 89 90 91 92 93 94 95 96 -0.12848 -0.27145 -0.33339 0.05091 0.12574 0.32101 0.06867 -0.05324 97 98 99 100 0.07649 0.14354 0.07832 -0.30531 $fitted 1 2 3 4 5 6 7 8 9 10 11 348.7 355.4 430.6 245.6 358.3 511.8 517.8 397.1 468.8 482.6 551.5 12 13 14 15 16 17 18 19 20 21 22 601.0 534.4 533.5 607.1 727.9 914.8 981.8 1282.1 1271.1 34.8 58.2 23 24 25 26 27 28 29 30 31 32 33 61.6 41.5 55.6 77.7 73.5 56.9 68.3 74.5 83.2 92.2 72.8 34 35 36 37 38 39 40 41 42 43 44 83.1 81.5 105.5 121.9 128.0 160.7 142.1 37.9 57.8 77.6 62.0 45 46 47 48 49 50 51 52 53 54 55 68.3 88.1 81.3 78.2 85.9 83.8 94.7 103.5 91.4 94.6 92.1 56 57 58 59 60 61 62 63 64 65 66 116.3 127.1 142.4 160.8 185.2 12.4 31.4 28.4 23.1 22.3 33.9 67 68 69 70 71 72 73 74 75 76 77 31.6 35.0 39.3 40.3 44.5 44.7 40.4 45.1 43.0 51.5 54.7 78 79 80 81 82 83 84 85 86 87 88 62.4 79.8 83.5 174.8 219.2 331.2 278.3 308.7 427.2 456.2 437.8 89 90 91 92 93 94 95 96 97 98 99 411.2 378.1 361.1 399.4 370.8 358.7 378.2 441.7 544.9 558.9 592.7 100 623.3 $coef a_0 a_1 a_2 b_1_1 b_1_2 b_2_2 d_1_40s d_1_50s 2.5597 -0.4612 0.2427 0.2169 -0.0804 0.1070 0.2850 0.4308 $coefCov a_0 a_1 a_2 b_1_1 b_1_2 b_2_2 d_1_40s d_1_50s a_0 NA NA NA NA NA NA NA NA a_1 NA 1.01064 -0.14283 -0.156907 0.022491 -0.006560 0.002687 0.01450 a_2 NA -0.14283 0.04697 0.024509 -0.007537 0.002463 -0.003494 -0.00660 b_1_1 NA -0.15691 0.02451 0.024914 -0.004022 0.001400 -0.000641 -0.00319 b_1_2 NA 0.02249 -0.00754 -0.004022 0.001365 -0.000664 0.000515 0.00140 b_2_2 NA -0.00656 0.00246 0.001400 -0.000664 0.000665 -0.000496 -0.00167 d_1_40s NA 0.00269 -0.00349 -0.000641 0.000515 -0.000496 0.005530 0.00666 d_1_50s NA 0.01450 -0.00660 -0.003193 0.001399 -0.001671 0.006663 0.01401 $r2 [1] 0.772 $r2bar [1] 0.743 $nObs [1] 100 $yName [1] "invest" $xNames [1] "value" "capital" $shifterNames [1] "decade" $r2nonLog [,1] [1,] 0.959 $dataLogged [1] FALSE attr(,"class") [1] "translogEst" > # random effects > ggResShifterFacRan <- translogEst( "invest", c( "value", "capital" ), ggData, + shifterNames = "decade", model = "random", random.method = "amemiya" ) > print( ggResShifterFacRan ) Estimated Translog function with 100 observations. a_0 a_1 a_2 b_1_1 b_1_2 b_2_2 d_1_40s d_1_50s 2.7460 -0.5481 0.2516 0.2341 -0.0826 0.1092 0.2822 0.4188 > print.default( ggResShifterFacRan ) $call translogEst(yName = "invest", xNames = c("value", "capital"), data = ggData, shifterNames = "decade", model = "random", random.method = "amemiya") $nExog [1] 2 $nShifter [1] 1 $est Model Formula: y ~ 1 + a_1 + a_2 + b_1_1 + b_1_2 + b_2_2 + d_1_ Coefficients: (Intercept) a_1 a_2 b_1_1 b_1_2 b_2_2 2.7460 -0.5481 0.2516 0.2341 -0.0826 0.1092 d_1_40s d_1_50s 0.2822 0.4188 $residuals 1 2 3 4 5 6 7 8 -0.06149 0.12099 -0.03099 0.09237 -0.05327 -0.07810 0.01515 0.16058 9 10 11 12 13 14 15 16 0.09492 0.15477 0.04095 0.15707 0.09528 0.02660 -0.06027 -0.08671 17 18 19 20 21 22 23 24 -0.16415 -0.07195 0.03041 0.17334 0.16420 0.23046 0.07786 0.23116 25 26 27 28 29 30 31 32 -0.05096 -0.10316 -0.06162 -0.17931 -0.35235 -0.21259 0.07205 -0.21326 33 34 35 36 37 38 39 40 -0.13854 0.08159 -0.02198 -0.03155 0.28756 0.13653 0.08980 0.20337 41 42 43 44 45 46 47 48 -0.18348 -0.31424 -0.08054 -0.39417 -0.41936 -0.23310 0.26918 0.10506 49 50 51 52 53 54 55 56 -0.39693 -0.44832 -0.07522 0.36752 0.41568 0.37547 0.00667 -0.27062 57 58 59 60 61 62 63 64 0.00540 0.03870 0.04483 -0.04695 0.00850 -0.23782 0.16460 -0.04787 65 66 67 68 69 70 71 72 -0.20824 -0.21096 0.39050 0.17298 -0.10354 -0.10756 -0.17059 0.13227 73 74 75 76 77 78 79 80 0.27544 0.04872 -0.33901 -0.50581 -0.04493 0.09783 0.07118 -0.24681 81 82 83 84 85 86 87 88 0.26070 0.55243 0.40426 0.00587 -0.23096 -0.42867 0.09476 0.07925 89 90 91 92 93 94 95 96 -0.06424 -0.20417 -0.26555 0.11500 0.19354 0.39088 0.13717 0.02416 97 98 99 100 0.14485 0.21248 0.14716 -0.23810 $fitted 1 2 3 4 5 6 7 8 9 10 11 337.7 347.2 423.5 235.0 348.9 498.7 504.3 381.5 454.4 469.0 538.7 12 13 14 15 16 17 18 19 20 21 22 588.1 517.2 515.3 589.6 701.1 890.7 957.7 1265.3 1250.1 34.2 57.8 23 24 25 26 27 28 29 30 31 32 33 61.3 41.0 55.2 77.0 72.7 56.0 67.4 73.7 82.6 91.7 72.0 34 35 36 37 38 39 40 41 42 43 44 82.4 80.7 103.9 120.5 126.5 159.9 140.7 39.8 61.6 83.7 66.1 45 46 47 48 49 50 51 52 53 54 55 73.2 93.9 86.3 82.7 91.2 88.9 100.9 110.7 97.1 100.5 97.6 56 57 58 59 60 61 62 63 64 65 66 122.6 134.5 151.3 171.6 198.7 12.8 32.9 29.7 24.0 23.2 35.3 67 68 69 70 71 72 73 74 75 76 77 32.8 36.5 41.1 42.1 46.6 46.8 42.2 47.2 45.0 53.5 56.9 78 79 80 81 82 83 84 85 86 87 88 65.1 83.9 87.8 161.7 204.5 313.6 260.8 290.3 401.6 430.1 411.7 89 90 91 92 93 94 95 96 97 98 99 385.6 353.5 337.4 374.6 346.5 334.5 353.2 408.8 508.9 521.7 553.3 100 582.8 $coef a_0 a_1 a_2 b_1_1 b_1_2 b_2_2 d_1_40s d_1_50s 2.7460 -0.5481 0.2516 0.2341 -0.0826 0.1092 0.2822 0.4188 $coefCov a_0 a_1 a_2 b_1_1 b_1_2 b_2_2 d_1_40s a_0 10.33197 -3.16036 0.39529 0.477929 -0.059788 0.013462 -0.001141 a_1 -3.16036 0.99801 -0.14184 -0.154465 0.022184 -0.006208 0.002383 a_2 0.39529 -0.14184 0.04705 0.024319 -0.007536 0.002437 -0.003476 b_1_1 0.47793 -0.15446 0.02432 0.024440 -0.003962 0.001330 -0.000572 b_1_2 -0.05979 0.02218 -0.00754 -0.003962 0.001361 -0.000657 0.000506 b_2_2 0.01346 -0.00621 0.00244 0.001330 -0.000657 0.000656 -0.000482 d_1_40s -0.00114 0.00238 -0.00348 -0.000572 0.000506 -0.000482 0.005538 d_1_50s -0.01973 0.01290 -0.00646 -0.002862 0.001354 -0.001616 0.006615 d_1_50s a_0 -0.01973 a_1 0.01290 a_2 -0.00646 b_1_1 -0.00286 b_1_2 0.00135 b_2_2 -0.00162 d_1_40s 0.00662 d_1_50s 0.01377 $r2 [1] 0.769 $r2bar [1] 0.752 $nObs [1] 100 $yName [1] "invest" $xNames [1] "value" "capital" $shifterNames [1] "decade" $r2nonLog [,1] [1,] 0.957 $dataLogged [1] FALSE attr(,"class") [1] "translogEst" > > proc.time() user system elapsed 1.96 0.28 2.25