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(3956.2,3977.7,3142.7,3983.4,3884.3,4152.9,3892.2,4286.1,3613,4348.1,3730.5,3949.3,3481.3,4166.7,3649.5,4217.9,4215.2,4528.2,4066.6,4232.2,4196.8,4470.9,4536.6,5121.2,4441.6,4170.8,3548.3,4398.6,4735.9,4491.4,4130.6,4251.8,4356.2,4901.9,4159.6,4745.2,3988,4666.9,4167.8,4210.4,4902.2,5273.6,3909.4,4095.3,4697.6,4610.1,4308.9,4718.1,4420.4,4185.5,3544.2,4314.7,4433,4422.6,4479.7,5059.2,4533.2,5043.6,4237.5,4436.6,4207.4,4922.6,4394,4454.8,5148.4,5058.7,4202.2,4768.9,4682.5,5171.8,4884.3,4989.3,5288.9,5202.1,4505.2,4838.4,4611.5,4876.5,5104,5875.5,4586.6,5717.9,4529.3,4778.8,4504.1,6195.9,4604.9,4625.4,4795.4,5549.8,5391.1,6397.6,5213.9,5856.7,5415,6343.8,5990.3,6615.5,4241.8,5904.6,5677.6,6861,5164.2,6553.5,3962.3,5481,4011,5435.3,3310.3,5278,3837.3,4671.8,4145.3,4891.5,3796.7,4241.6,3849.6,4152.1,4285,4484.4,4189.6,4124.7),dim=c(2,61),dimnames=list(c('Y','X'),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('Y','X'),1:61)) > 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 Y X 1 3956.2 3977.7 2 3142.7 3983.4 3 3884.3 4152.9 4 3892.2 4286.1 5 3613.0 4348.1 6 3730.5 3949.3 7 3481.3 4166.7 8 3649.5 4217.9 9 4215.2 4528.2 10 4066.6 4232.2 11 4196.8 4470.9 12 4536.6 5121.2 13 4441.6 4170.8 14 3548.3 4398.6 15 4735.9 4491.4 16 4130.6 4251.8 17 4356.2 4901.9 18 4159.6 4745.2 19 3988.0 4666.9 20 4167.8 4210.4 21 4902.2 5273.6 22 3909.4 4095.3 23 4697.6 4610.1 24 4308.9 4718.1 25 4420.4 4185.5 26 3544.2 4314.7 27 4433.0 4422.6 28 4479.7 5059.2 29 4533.2 5043.6 30 4237.5 4436.6 31 4207.4 4922.6 32 4394.0 4454.8 33 5148.4 5058.7 34 4202.2 4768.9 35 4682.5 5171.8 36 4884.3 4989.3 37 5288.9 5202.1 38 4505.2 4838.4 39 4611.5 4876.5 40 5104.0 5875.5 41 4586.6 5717.9 42 4529.3 4778.8 43 4504.1 6195.9 44 4604.9 4625.4 45 4795.4 5549.8 46 5391.1 6397.6 47 5213.9 5856.7 48 5415.0 6343.8 49 5990.3 6615.5 50 4241.8 5904.6 51 5677.6 6861.0 52 5164.2 6553.5 53 3962.3 5481.0 54 4011.0 5435.3 55 3310.3 5278.0 56 3837.3 4671.8 57 4145.3 4891.5 58 3796.7 4241.6 59 3849.6 4152.1 60 4285.0 4484.4 61 4189.6 4124.7 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 1538.6271 0.5778 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1277.8 -192.6 60.3 229.6 744.6 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1.539e+03 3.437e+02 4.477 3.52e-05 *** X 5.778e-01 6.964e-02 8.297 1.73e-11 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 396.4 on 59 degrees of freedom Multiple R-squared: 0.5385, Adjusted R-squared: 0.5306 F-statistic: 68.83 on 1 and 59 DF, p-value: 1.727e-11 > 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.55289063 0.89421874 0.4471094 [2,] 0.39283594 0.78567189 0.6071641 [3,] 0.31156704 0.62313408 0.6884330 [4,] 0.20619439 0.41238877 0.7938056 [5,] 0.18244329 0.36488659 0.8175567 [6,] 0.15153712 0.30307423 0.8484629 [7,] 0.10347479 0.20694959 0.8965252 [8,] 0.06279222 0.12558444 0.9372078 [9,] 0.17395928 0.34791856 0.8260407 [10,] 0.21321681 0.42643362 0.7867832 [11,] 0.36100512 0.72201024 0.6389949 [12,] 0.30047424 0.60094849 0.6995258 [13,] 0.23066820 0.46133640 0.7693318 [14,] 0.17722496 0.35444993 0.8227750 [15,] 0.14633258 0.29266516 0.8536674 [16,] 0.12263190 0.24526380 0.8773681 [17,] 0.09799449 0.19598898 0.9020055 [18,] 0.06895856 0.13791711 0.9310414 [19,] 0.08598882 0.17197764 0.9140112 [20,] 0.05841466 0.11682933 0.9415853 [21,] 0.07689814 0.15379629 0.9231019 [22,] 0.09411852 0.18823704 0.9058815 [23,] 0.08543358 0.17086717 0.9145664 [24,] 0.06025043 0.12050085 0.9397496 [25,] 0.04064863 0.08129727 0.9593514 [26,] 0.02773899 0.05547798 0.9722610 [27,] 0.02094779 0.04189558 0.9790522 [28,] 0.01652714 0.03305428 0.9834729 [29,] 0.03171139 0.06342278 0.9682886 [30,] 0.02176125 0.04352250 0.9782387 [31,] 0.01414920 0.02829840 0.9858508 [32,] 0.01446963 0.02893926 0.9855304 [33,] 0.03310287 0.06620574 0.9668971 [34,] 0.02350475 0.04700949 0.9764953 [35,] 0.01829775 0.03659550 0.9817022 [36,] 0.01453482 0.02906965 0.9854652 [37,] 0.01571137 0.03142274 0.9842886 [38,] 0.01235064 0.02470129 0.9876494 [39,] 0.03209750 0.06419500 0.9679025 [40,] 0.04011038 0.08022077 0.9598896 [41,] 0.02684278 0.05368556 0.9731572 [42,] 0.01776377 0.03552755 0.9822362 [43,] 0.01562663 0.03125325 0.9843734 [44,] 0.01195627 0.02391255 0.9880437 [45,] 0.05361936 0.10723873 0.9463806 [46,] 0.07726255 0.15452509 0.9227375 [47,] 0.16006484 0.32012968 0.8399352 [48,] 0.65228542 0.69542916 0.3477146 [49,] 0.61998726 0.76002547 0.3800127 [50,] 0.64137047 0.71725905 0.3586295 [51,] 0.86071333 0.27857333 0.1392867 [52,] 0.82175220 0.35649560 0.1782478 > postscript(file="/var/www/html/rcomp/tmp/19wze1258736035.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/2kwsz1258736035.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/39xtx1258736035.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/4idl41258736035.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/5axo01258736035.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 = 61 Frequency = 1 1 2 3 4 5 6 119.361161 -697.432151 -53.764848 -122.824347 -437.846337 -89.930057 7 8 9 10 11 12 -464.738129 -326.120159 60.296562 82.717672 75.003013 39.076566 13 14 15 16 17 18 493.192997 -531.723925 602.258646 135.393302 -14.617591 -120.680401 19 20 21 22 23 24 -247.040695 196.513146 316.623805 4.614936 495.376869 44.277275 25 26 27 28 29 30 463.499719 -487.348684 339.109498 17.998556 80.511830 135.520662 31 32 33 34 35 36 -175.377513 281.505175 686.987443 -91.773646 155.741201 462.984960 37 38 39 40 41 42 744.634648 171.071060 255.357870 170.661621 -255.681193 229.606392 43 44 45 46 47 48 -614.357176 393.836927 50.242620 156.105804 291.423773 211.090046 49 50 51 52 53 54 629.408844 -708.351603 174.865322 -160.869166 -743.106527 -668.002254 55 56 57 58 59 60 -1277.818400 -400.571788 -219.508741 -192.613403 -88.002628 155.403064 61 267.828380 > postscript(file="/var/www/html/rcomp/tmp/6wi061258736035.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 = 61 Frequency = 1 lag(myerror, k = 1) myerror 0 119.361161 NA 1 -697.432151 119.361161 2 -53.764848 -697.432151 3 -122.824347 -53.764848 4 -437.846337 -122.824347 5 -89.930057 -437.846337 6 -464.738129 -89.930057 7 -326.120159 -464.738129 8 60.296562 -326.120159 9 82.717672 60.296562 10 75.003013 82.717672 11 39.076566 75.003013 12 493.192997 39.076566 13 -531.723925 493.192997 14 602.258646 -531.723925 15 135.393302 602.258646 16 -14.617591 135.393302 17 -120.680401 -14.617591 18 -247.040695 -120.680401 19 196.513146 -247.040695 20 316.623805 196.513146 21 4.614936 316.623805 22 495.376869 4.614936 23 44.277275 495.376869 24 463.499719 44.277275 25 -487.348684 463.499719 26 339.109498 -487.348684 27 17.998556 339.109498 28 80.511830 17.998556 29 135.520662 80.511830 30 -175.377513 135.520662 31 281.505175 -175.377513 32 686.987443 281.505175 33 -91.773646 686.987443 34 155.741201 -91.773646 35 462.984960 155.741201 36 744.634648 462.984960 37 171.071060 744.634648 38 255.357870 171.071060 39 170.661621 255.357870 40 -255.681193 170.661621 41 229.606392 -255.681193 42 -614.357176 229.606392 43 393.836927 -614.357176 44 50.242620 393.836927 45 156.105804 50.242620 46 291.423773 156.105804 47 211.090046 291.423773 48 629.408844 211.090046 49 -708.351603 629.408844 50 174.865322 -708.351603 51 -160.869166 174.865322 52 -743.106527 -160.869166 53 -668.002254 -743.106527 54 -1277.818400 -668.002254 55 -400.571788 -1277.818400 56 -219.508741 -400.571788 57 -192.613403 -219.508741 58 -88.002628 -192.613403 59 155.403064 -88.002628 60 267.828380 155.403064 61 NA 267.828380 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -697.432151 119.361161 [2,] -53.764848 -697.432151 [3,] -122.824347 -53.764848 [4,] -437.846337 -122.824347 [5,] -89.930057 -437.846337 [6,] -464.738129 -89.930057 [7,] -326.120159 -464.738129 [8,] 60.296562 -326.120159 [9,] 82.717672 60.296562 [10,] 75.003013 82.717672 [11,] 39.076566 75.003013 [12,] 493.192997 39.076566 [13,] -531.723925 493.192997 [14,] 602.258646 -531.723925 [15,] 135.393302 602.258646 [16,] -14.617591 135.393302 [17,] -120.680401 -14.617591 [18,] -247.040695 -120.680401 [19,] 196.513146 -247.040695 [20,] 316.623805 196.513146 [21,] 4.614936 316.623805 [22,] 495.376869 4.614936 [23,] 44.277275 495.376869 [24,] 463.499719 44.277275 [25,] -487.348684 463.499719 [26,] 339.109498 -487.348684 [27,] 17.998556 339.109498 [28,] 80.511830 17.998556 [29,] 135.520662 80.511830 [30,] -175.377513 135.520662 [31,] 281.505175 -175.377513 [32,] 686.987443 281.505175 [33,] -91.773646 686.987443 [34,] 155.741201 -91.773646 [35,] 462.984960 155.741201 [36,] 744.634648 462.984960 [37,] 171.071060 744.634648 [38,] 255.357870 171.071060 [39,] 170.661621 255.357870 [40,] -255.681193 170.661621 [41,] 229.606392 -255.681193 [42,] -614.357176 229.606392 [43,] 393.836927 -614.357176 [44,] 50.242620 393.836927 [45,] 156.105804 50.242620 [46,] 291.423773 156.105804 [47,] 211.090046 291.423773 [48,] 629.408844 211.090046 [49,] -708.351603 629.408844 [50,] 174.865322 -708.351603 [51,] -160.869166 174.865322 [52,] -743.106527 -160.869166 [53,] -668.002254 -743.106527 [54,] -1277.818400 -668.002254 [55,] -400.571788 -1277.818400 [56,] -219.508741 -400.571788 [57,] -192.613403 -219.508741 [58,] -88.002628 -192.613403 [59,] 155.403064 -88.002628 [60,] 267.828380 155.403064 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -697.432151 119.361161 2 -53.764848 -697.432151 3 -122.824347 -53.764848 4 -437.846337 -122.824347 5 -89.930057 -437.846337 6 -464.738129 -89.930057 7 -326.120159 -464.738129 8 60.296562 -326.120159 9 82.717672 60.296562 10 75.003013 82.717672 11 39.076566 75.003013 12 493.192997 39.076566 13 -531.723925 493.192997 14 602.258646 -531.723925 15 135.393302 602.258646 16 -14.617591 135.393302 17 -120.680401 -14.617591 18 -247.040695 -120.680401 19 196.513146 -247.040695 20 316.623805 196.513146 21 4.614936 316.623805 22 495.376869 4.614936 23 44.277275 495.376869 24 463.499719 44.277275 25 -487.348684 463.499719 26 339.109498 -487.348684 27 17.998556 339.109498 28 80.511830 17.998556 29 135.520662 80.511830 30 -175.377513 135.520662 31 281.505175 -175.377513 32 686.987443 281.505175 33 -91.773646 686.987443 34 155.741201 -91.773646 35 462.984960 155.741201 36 744.634648 462.984960 37 171.071060 744.634648 38 255.357870 171.071060 39 170.661621 255.357870 40 -255.681193 170.661621 41 229.606392 -255.681193 42 -614.357176 229.606392 43 393.836927 -614.357176 44 50.242620 393.836927 45 156.105804 50.242620 46 291.423773 156.105804 47 211.090046 291.423773 48 629.408844 211.090046 49 -708.351603 629.408844 50 174.865322 -708.351603 51 -160.869166 174.865322 52 -743.106527 -160.869166 53 -668.002254 -743.106527 54 -1277.818400 -668.002254 55 -400.571788 -1277.818400 56 -219.508741 -400.571788 57 -192.613403 -219.508741 58 -88.002628 -192.613403 59 155.403064 -88.002628 60 267.828380 155.403064 > 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/77lkn1258736035.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/80iyj1258736035.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/9a52h1258736035.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/10km191258736035.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/11uome1258736035.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/122qro1258736035.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/13mh441258736035.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/14ysqw1258736035.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/15hcy11258736035.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/16duo41258736035.tab") + } > > system("convert tmp/19wze1258736035.ps tmp/19wze1258736035.png") > system("convert tmp/2kwsz1258736035.ps tmp/2kwsz1258736035.png") > system("convert tmp/39xtx1258736035.ps tmp/39xtx1258736035.png") > system("convert tmp/4idl41258736035.ps tmp/4idl41258736035.png") > system("convert tmp/5axo01258736035.ps tmp/5axo01258736035.png") > system("convert tmp/6wi061258736035.ps tmp/6wi061258736035.png") > system("convert tmp/77lkn1258736035.ps tmp/77lkn1258736035.png") > system("convert tmp/80iyj1258736035.ps tmp/80iyj1258736035.png") > system("convert tmp/9a52h1258736035.ps tmp/9a52h1258736035.png") > system("convert tmp/10km191258736035.ps tmp/10km191258736035.png") > > > proc.time() user system elapsed 2.532 1.585 4.619