R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(110.5,55,110.8,48.7,104.2,70.3,88.9,94.8,89.8,58.5,90,62.4,93.9,56.7,91.3,65.1,87.8,114.4,99.7,50.7,73.5,44.5,79.2,72,96.9,61.2,95.2,68.4,95.6,78.7,89.7,64.1,92.8,64.6,88,71.9,101.1,71,92.7,76.4,95.8,117.3,103.8,66.1,81.8,57.3,87.1,75,105.9,63.8,108.1,62.2,102.6,75.4,93.7,58,103.5,62.1,100.6,99.2,113.3,70.7,102.4,73.3,102.1,111.2,106.9,68.9,87.3,57.6,93.1,72.9,109.1,75.9,120.3,79.4,104.9,96.9,92.6,75.2,109.8,60.3,111.4,88.9,117.9,90.5,121.6,79.9,117.8,116.3,124.2,95.2,106.8,81.5,102.7,89.1,116.8,76,113.6,100.5,96.1,83.9,85,75.1,83.2,69.5,84.9,95.1,83,90.1,79.6,78.4,83.2,113.8,83.8,73.6,82.8,56.5,71.4,97.7),dim=c(2,60),dimnames=list(c('prod','inv '),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('prod','inv '),1:60)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.numeric > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x prod inv\r 1 110.5 55.0 2 110.8 48.7 3 104.2 70.3 4 88.9 94.8 5 89.8 58.5 6 90.0 62.4 7 93.9 56.7 8 91.3 65.1 9 87.8 114.4 10 99.7 50.7 11 73.5 44.5 12 79.2 72.0 13 96.9 61.2 14 95.2 68.4 15 95.6 78.7 16 89.7 64.1 17 92.8 64.6 18 88.0 71.9 19 101.1 71.0 20 92.7 76.4 21 95.8 117.3 22 103.8 66.1 23 81.8 57.3 24 87.1 75.0 25 105.9 63.8 26 108.1 62.2 27 102.6 75.4 28 93.7 58.0 29 103.5 62.1 30 100.6 99.2 31 113.3 70.7 32 102.4 73.3 33 102.1 111.2 34 106.9 68.9 35 87.3 57.6 36 93.1 72.9 37 109.1 75.9 38 120.3 79.4 39 104.9 96.9 40 92.6 75.2 41 109.8 60.3 42 111.4 88.9 43 117.9 90.5 44 121.6 79.9 45 117.8 116.3 46 124.2 95.2 47 106.8 81.5 48 102.7 89.1 49 116.8 76.0 50 113.6 100.5 51 96.1 83.9 52 85.0 75.1 53 83.2 69.5 54 84.9 95.1 55 83.0 90.1 56 79.6 78.4 57 83.2 113.8 58 83.8 73.6 59 82.8 56.5 60 71.4 97.7 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) `inv\r` 91.16251 0.08567 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -28.133 -9.588 -1.971 9.412 24.882 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 91.16251 7.27638 12.529 <2e-16 *** `inv\r` 0.08567 0.09292 0.922 0.360 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 12.58 on 58 degrees of freedom Multiple R-squared: 0.01444, Adjusted R-squared: -0.002549 F-statistic: 0.85 on 1 and 58 DF, p-value: 0.3604 > if (n > n25) { + kp3 <- k + 3 + nmkm3 <- n - k - 3 + gqarr <- array(NA, dim=c(nmkm3-kp3+1,3)) + numgqtests <- 0 + numsignificant1 <- 0 + numsignificant5 <- 0 + numsignificant10 <- 0 + for (mypoint in kp3:nmkm3) { + j <- 0 + numgqtests <- numgqtests + 1 + for (myalt in c('greater', 'two.sided', 'less')) { + j <- j + 1 + gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value + } + if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1 + } + gqarr + } [,1] [,2] [,3] [1,] 0.343950064 0.687900129 0.656049936 [2,] 0.325143402 0.650286804 0.674856598 [3,] 0.244557097 0.489114194 0.755442903 [4,] 0.171337981 0.342675963 0.828662019 [5,] 0.115145102 0.230290205 0.884854898 [6,] 0.065310848 0.130621696 0.934689152 [7,] 0.366411723 0.732823446 0.633588277 [8,] 0.409031415 0.818062830 0.590968585 [9,] 0.317980564 0.635961129 0.682019436 [10,] 0.237307447 0.474614894 0.762692553 [11,] 0.174070878 0.348141756 0.825929122 [12,] 0.128783509 0.257567018 0.871216491 [13,] 0.087504643 0.175009286 0.912495357 [14,] 0.064488641 0.128977282 0.935511359 [15,] 0.050171007 0.100342013 0.949828993 [16,] 0.032150683 0.064301365 0.967849317 [17,] 0.023223600 0.046447199 0.976776400 [18,] 0.019508863 0.039017725 0.980491137 [19,] 0.023965966 0.047931932 0.976034034 [20,] 0.018740854 0.037481708 0.981259146 [21,] 0.018338130 0.036676261 0.981661870 [22,] 0.020507280 0.041014559 0.979492720 [23,] 0.015408241 0.030816482 0.984591759 [24,] 0.009405848 0.018811697 0.990594152 [25,] 0.006938975 0.013877950 0.993061025 [26,] 0.004651254 0.009302508 0.995348746 [27,] 0.008491102 0.016982204 0.991508898 [28,] 0.005678869 0.011357738 0.994321131 [29,] 0.003689846 0.007379691 0.996310154 [30,] 0.003170735 0.006341469 0.996829265 [31,] 0.002352879 0.004705757 0.997647121 [32,] 0.001345371 0.002690743 0.998654629 [33,] 0.001315647 0.002631295 0.998684353 [34,] 0.005235150 0.010470300 0.994764850 [35,] 0.003315802 0.006631605 0.996684198 [36,] 0.001945389 0.003890779 0.998054611 [37,] 0.002355980 0.004711960 0.997644020 [38,] 0.002346212 0.004692424 0.997653788 [39,] 0.004679101 0.009358202 0.995320899 [40,] 0.020410345 0.040820690 0.979589655 [41,] 0.024601621 0.049203242 0.975398379 [42,] 0.118197811 0.236395621 0.881802189 [43,] 0.129573723 0.259147446 0.870426277 [44,] 0.119676131 0.239352263 0.880323869 [45,] 0.458143278 0.916286556 0.541856722 [46,] 0.954321334 0.091357333 0.045678666 [47,] 0.992128539 0.015742922 0.007871461 [48,] 0.983747628 0.032504743 0.016252372 [49,] 0.961958915 0.076082169 0.038041085 [50,] 0.936155728 0.127688544 0.063844272 [51,] 0.868478211 0.263043578 0.131521789 > postscript(file="/var/www/html/rcomp/tmp/1bkey1258626008.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') > points(x[,1]-mysum$resid) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/293j41258626008.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/3nj4q1258626008.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/4ldfw1258626008.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5fh4a1258626008.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > qqline(mysum$resid) > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 60 Frequency = 1 1 2 3 4 5 6 14.6255623 15.4652924 7.0147893 -10.3841609 -6.3742877 -6.5084063 7 8 9 10 11 12 -2.1200791 -5.4397192 -13.1633211 4.1939495 -21.4748876 -18.1308521 13 14 15 16 17 18 0.4943994 -1.8224349 -2.3048508 -6.9540478 -3.8968835 -9.3222850 19 20 21 22 23 24 3.8548193 -5.0078065 -5.4117683 6.9746094 -14.2714820 -10.4878664 25 26 27 28 29 30 9.2716537 11.6087280 4.9778650 -2.4314520 7.0172951 0.9388847 31 32 33 34 35 36 16.0805207 4.9577750 1.4108275 9.8347293 -8.7971834 -4.3079564 37 38 39 40 41 42 11.4350293 22.3351792 5.4359291 -5.0050007 13.4715037 12.6213006 43 44 45 46 47 48 18.9842263 23.5923435 16.6739031 24.8815705 8.6552692 3.9041663 49 50 51 52 53 54 19.1264621 13.8275119 -2.2503422 -12.5964336 -13.9166735 -14.4098624 55 56 57 58 59 60 -15.8815052 -18.2791493 -17.7119183 -13.6679264 -13.2029448 -28.1326081 > postscript(file="/var/www/html/rcomp/tmp/6cgj41258626008.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 60 Frequency = 1 lag(myerror, k = 1) myerror 0 14.6255623 NA 1 15.4652924 14.6255623 2 7.0147893 15.4652924 3 -10.3841609 7.0147893 4 -6.3742877 -10.3841609 5 -6.5084063 -6.3742877 6 -2.1200791 -6.5084063 7 -5.4397192 -2.1200791 8 -13.1633211 -5.4397192 9 4.1939495 -13.1633211 10 -21.4748876 4.1939495 11 -18.1308521 -21.4748876 12 0.4943994 -18.1308521 13 -1.8224349 0.4943994 14 -2.3048508 -1.8224349 15 -6.9540478 -2.3048508 16 -3.8968835 -6.9540478 17 -9.3222850 -3.8968835 18 3.8548193 -9.3222850 19 -5.0078065 3.8548193 20 -5.4117683 -5.0078065 21 6.9746094 -5.4117683 22 -14.2714820 6.9746094 23 -10.4878664 -14.2714820 24 9.2716537 -10.4878664 25 11.6087280 9.2716537 26 4.9778650 11.6087280 27 -2.4314520 4.9778650 28 7.0172951 -2.4314520 29 0.9388847 7.0172951 30 16.0805207 0.9388847 31 4.9577750 16.0805207 32 1.4108275 4.9577750 33 9.8347293 1.4108275 34 -8.7971834 9.8347293 35 -4.3079564 -8.7971834 36 11.4350293 -4.3079564 37 22.3351792 11.4350293 38 5.4359291 22.3351792 39 -5.0050007 5.4359291 40 13.4715037 -5.0050007 41 12.6213006 13.4715037 42 18.9842263 12.6213006 43 23.5923435 18.9842263 44 16.6739031 23.5923435 45 24.8815705 16.6739031 46 8.6552692 24.8815705 47 3.9041663 8.6552692 48 19.1264621 3.9041663 49 13.8275119 19.1264621 50 -2.2503422 13.8275119 51 -12.5964336 -2.2503422 52 -13.9166735 -12.5964336 53 -14.4098624 -13.9166735 54 -15.8815052 -14.4098624 55 -18.2791493 -15.8815052 56 -17.7119183 -18.2791493 57 -13.6679264 -17.7119183 58 -13.2029448 -13.6679264 59 -28.1326081 -13.2029448 60 NA -28.1326081 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 15.4652924 14.6255623 [2,] 7.0147893 15.4652924 [3,] -10.3841609 7.0147893 [4,] -6.3742877 -10.3841609 [5,] -6.5084063 -6.3742877 [6,] -2.1200791 -6.5084063 [7,] -5.4397192 -2.1200791 [8,] -13.1633211 -5.4397192 [9,] 4.1939495 -13.1633211 [10,] -21.4748876 4.1939495 [11,] -18.1308521 -21.4748876 [12,] 0.4943994 -18.1308521 [13,] -1.8224349 0.4943994 [14,] -2.3048508 -1.8224349 [15,] -6.9540478 -2.3048508 [16,] -3.8968835 -6.9540478 [17,] -9.3222850 -3.8968835 [18,] 3.8548193 -9.3222850 [19,] -5.0078065 3.8548193 [20,] -5.4117683 -5.0078065 [21,] 6.9746094 -5.4117683 [22,] -14.2714820 6.9746094 [23,] -10.4878664 -14.2714820 [24,] 9.2716537 -10.4878664 [25,] 11.6087280 9.2716537 [26,] 4.9778650 11.6087280 [27,] -2.4314520 4.9778650 [28,] 7.0172951 -2.4314520 [29,] 0.9388847 7.0172951 [30,] 16.0805207 0.9388847 [31,] 4.9577750 16.0805207 [32,] 1.4108275 4.9577750 [33,] 9.8347293 1.4108275 [34,] -8.7971834 9.8347293 [35,] -4.3079564 -8.7971834 [36,] 11.4350293 -4.3079564 [37,] 22.3351792 11.4350293 [38,] 5.4359291 22.3351792 [39,] -5.0050007 5.4359291 [40,] 13.4715037 -5.0050007 [41,] 12.6213006 13.4715037 [42,] 18.9842263 12.6213006 [43,] 23.5923435 18.9842263 [44,] 16.6739031 23.5923435 [45,] 24.8815705 16.6739031 [46,] 8.6552692 24.8815705 [47,] 3.9041663 8.6552692 [48,] 19.1264621 3.9041663 [49,] 13.8275119 19.1264621 [50,] -2.2503422 13.8275119 [51,] -12.5964336 -2.2503422 [52,] -13.9166735 -12.5964336 [53,] -14.4098624 -13.9166735 [54,] -15.8815052 -14.4098624 [55,] -18.2791493 -15.8815052 [56,] -17.7119183 -18.2791493 [57,] -13.6679264 -17.7119183 [58,] -13.2029448 -13.6679264 [59,] -28.1326081 -13.2029448 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 15.4652924 14.6255623 2 7.0147893 15.4652924 3 -10.3841609 7.0147893 4 -6.3742877 -10.3841609 5 -6.5084063 -6.3742877 6 -2.1200791 -6.5084063 7 -5.4397192 -2.1200791 8 -13.1633211 -5.4397192 9 4.1939495 -13.1633211 10 -21.4748876 4.1939495 11 -18.1308521 -21.4748876 12 0.4943994 -18.1308521 13 -1.8224349 0.4943994 14 -2.3048508 -1.8224349 15 -6.9540478 -2.3048508 16 -3.8968835 -6.9540478 17 -9.3222850 -3.8968835 18 3.8548193 -9.3222850 19 -5.0078065 3.8548193 20 -5.4117683 -5.0078065 21 6.9746094 -5.4117683 22 -14.2714820 6.9746094 23 -10.4878664 -14.2714820 24 9.2716537 -10.4878664 25 11.6087280 9.2716537 26 4.9778650 11.6087280 27 -2.4314520 4.9778650 28 7.0172951 -2.4314520 29 0.9388847 7.0172951 30 16.0805207 0.9388847 31 4.9577750 16.0805207 32 1.4108275 4.9577750 33 9.8347293 1.4108275 34 -8.7971834 9.8347293 35 -4.3079564 -8.7971834 36 11.4350293 -4.3079564 37 22.3351792 11.4350293 38 5.4359291 22.3351792 39 -5.0050007 5.4359291 40 13.4715037 -5.0050007 41 12.6213006 13.4715037 42 18.9842263 12.6213006 43 23.5923435 18.9842263 44 16.6739031 23.5923435 45 24.8815705 16.6739031 46 8.6552692 24.8815705 47 3.9041663 8.6552692 48 19.1264621 3.9041663 49 13.8275119 19.1264621 50 -2.2503422 13.8275119 51 -12.5964336 -2.2503422 52 -13.9166735 -12.5964336 53 -14.4098624 -13.9166735 54 -15.8815052 -14.4098624 55 -18.2791493 -15.8815052 56 -17.7119183 -18.2791493 57 -13.6679264 -17.7119183 58 -13.2029448 -13.6679264 59 -28.1326081 -13.2029448 > plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals') > lines(lowess(z)) > abline(lm(z)) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/7qm4y1258626008.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/8p8b51258626008.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/9rro71258626008.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/html/rcomp/tmp/10txoz1258626008.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) > a<-table.row.end(a) > myeq <- colnames(x)[1] > myeq <- paste(myeq, '[t] = ', sep='') > for (i in 1:k){ + if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') + myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ') + if (rownames(mysum$coefficients)[i] != '(Intercept)') { + myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') + if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') + } + } > myeq <- paste(myeq, ' + e[t]') > a<-table.row.start(a) > a<-table.element(a, myeq) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/11z5lw1258626008.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Variable',header=TRUE) > a<-table.element(a,'Parameter',header=TRUE) > a<-table.element(a,'S.D.',header=TRUE) > a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE) > a<-table.element(a,'2-tail p-value',header=TRUE) > a<-table.element(a,'1-tail p-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:k){ + a<-table.row.start(a) + a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE) + a<-table.element(a,mysum$coefficients[i,1]) + a<-table.element(a, round(mysum$coefficients[i,2],6)) + a<-table.element(a, round(mysum$coefficients[i,3],4)) + a<-table.element(a, round(mysum$coefficients[i,4],6)) + a<-table.element(a, round(mysum$coefficients[i,4]/2,6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/12oy0f1258626008.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple R',1,TRUE) > a<-table.element(a, sqrt(mysum$r.squared)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'R-squared',1,TRUE) > a<-table.element(a, mysum$r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Adjusted R-squared',1,TRUE) > a<-table.element(a, mysum$adj.r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (value)',1,TRUE) > a<-table.element(a, mysum$fstatistic[1]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'p-value',1,TRUE) > a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3])) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Residual Standard Deviation',1,TRUE) > a<-table.element(a, mysum$sigma) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Sum Squared Residuals',1,TRUE) > a<-table.element(a, sum(myerror*myerror)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/130fmb1258626008.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Time or Index', 1, TRUE) > a<-table.element(a, 'Actuals', 1, TRUE) > a<-table.element(a, 'Interpolation
Forecast', 1, TRUE) > a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE) > a<-table.row.end(a) > for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,i, 1, TRUE) + a<-table.element(a,x[i]) + a<-table.element(a,x[i]-mysum$resid[i]) + a<-table.element(a,mysum$resid[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/14z4j71258626008.tab") > if (n > n25) { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'p-values',header=TRUE) + a<-table.element(a,'Alternative Hypothesis',3,header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'breakpoint index',header=TRUE) + a<-table.element(a,'greater',header=TRUE) + a<-table.element(a,'2-sided',header=TRUE) + a<-table.element(a,'less',header=TRUE) + a<-table.row.end(a) + for (mypoint in kp3:nmkm3) { + a<-table.row.start(a) + a<-table.element(a,mypoint,header=TRUE) + a<-table.element(a,gqarr[mypoint-kp3+1,1]) + a<-table.element(a,gqarr[mypoint-kp3+1,2]) + a<-table.element(a,gqarr[mypoint-kp3+1,3]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/www/html/rcomp/tmp/15v6et1258626008.tab") + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Description',header=TRUE) + a<-table.element(a,'# significant tests',header=TRUE) + a<-table.element(a,'% significant tests',header=TRUE) + a<-table.element(a,'OK/NOK',header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'1% type I error level',header=TRUE) + a<-table.element(a,numsignificant1) + a<-table.element(a,numsignificant1/numgqtests) + if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'5% type I error level',header=TRUE) + a<-table.element(a,numsignificant5) + a<-table.element(a,numsignificant5/numgqtests) + if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'10% type I error level',header=TRUE) + a<-table.element(a,numsignificant10) + a<-table.element(a,numsignificant10/numgqtests) + if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/www/html/rcomp/tmp/163qtq1258626008.tab") + } > > system("convert tmp/1bkey1258626008.ps tmp/1bkey1258626008.png") > system("convert tmp/293j41258626008.ps tmp/293j41258626008.png") > system("convert tmp/3nj4q1258626008.ps tmp/3nj4q1258626008.png") > system("convert tmp/4ldfw1258626008.ps tmp/4ldfw1258626008.png") > system("convert tmp/5fh4a1258626008.ps tmp/5fh4a1258626008.png") > system("convert tmp/6cgj41258626008.ps tmp/6cgj41258626008.png") > system("convert tmp/7qm4y1258626008.ps tmp/7qm4y1258626008.png") > system("convert tmp/8p8b51258626008.ps tmp/8p8b51258626008.png") > system("convert tmp/9rro71258626008.ps tmp/9rro71258626008.png") > system("convert tmp/10txoz1258626008.ps tmp/10txoz1258626008.png") > > > proc.time() user system elapsed 2.470 1.566 3.936