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(97.4,116.7,97,109,105.4,119.5,102.7,115.1,98.1,107.1,104.5,109.7,87.4,110.4,89.9,105,109.8,115.8,111.7,116.4,98.6,111.1,96.9,119.5,95.1,110.9,97,115.1,112.7,125.2,102.9,116,97.4,112.9,111.4,121.7,87.4,123.2,96.8,116.6,114.1,136.2,110.3,120.9,103.9,119.6,101.6,125.9,94.6,116.1,95.9,107.5,104.7,116.7,102.8,112.5,98.1,113,113.9,126.4,80.9,114.1,95.7,112.5,113.2,112.4,105.9,113.1,108.8,116.3,102.3,111.7,99,118.8,100.7,116.5,115.5,125.1,100.7,113.1,109.9,119.6,114.6,114.4,85.4,114,100.5,117.8,114.8,117,116.5,120.9,112.9,115,102,117.3,106,119.4,105.3,114.9,118.8,125.8,106.1,117.6,109.3,117.6,117.2,114.9,92.5,121.9,104.2,117,112.5,106.4,122.4,110.5,113.3,113.6,100,114.2),dim=c(2,60),dimnames=list(c('Tip','ipchn'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Tip','ipchn'),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 = '2' > #'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 ipchn Tip 1 116.7 97.4 2 109.0 97.0 3 119.5 105.4 4 115.1 102.7 5 107.1 98.1 6 109.7 104.5 7 110.4 87.4 8 105.0 89.9 9 115.8 109.8 10 116.4 111.7 11 111.1 98.6 12 119.5 96.9 13 110.9 95.1 14 115.1 97.0 15 125.2 112.7 16 116.0 102.9 17 112.9 97.4 18 121.7 111.4 19 123.2 87.4 20 116.6 96.8 21 136.2 114.1 22 120.9 110.3 23 119.6 103.9 24 125.9 101.6 25 116.1 94.6 26 107.5 95.9 27 116.7 104.7 28 112.5 102.8 29 113.0 98.1 30 126.4 113.9 31 114.1 80.9 32 112.5 95.7 33 112.4 113.2 34 113.1 105.9 35 116.3 108.8 36 111.7 102.3 37 118.8 99.0 38 116.5 100.7 39 125.1 115.5 40 113.1 100.7 41 119.6 109.9 42 114.4 114.6 43 114.0 85.4 44 117.8 100.5 45 117.0 114.8 46 120.9 116.5 47 115.0 112.9 48 117.3 102.0 49 119.4 106.0 50 114.9 105.3 51 125.8 118.8 52 117.6 106.1 53 117.6 109.3 54 114.9 117.2 55 121.9 92.5 56 117.0 104.2 57 106.4 112.5 58 110.5 122.4 59 113.6 113.3 60 114.2 100.0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Tip 95.1965 0.2029 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -11.6204 -3.5597 0.0757 2.5425 17.8550 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 95.19648 8.03171 11.853 <2e-16 *** Tip 0.20288 0.07711 2.631 0.0109 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 5.273 on 58 degrees of freedom Multiple R-squared: 0.1066, Adjusted R-squared: 0.09122 F-statistic: 6.922 on 1 and 58 DF, p-value: 0.01089 > 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.43098194 0.8619639 0.56901806 [2,] 0.52347544 0.9530491 0.47652456 [3,] 0.41258815 0.8251763 0.58741185 [4,] 0.38860945 0.7772189 0.61139055 [5,] 0.27562567 0.5512513 0.72437433 [6,] 0.18516382 0.3703276 0.81483618 [7,] 0.12439491 0.2487898 0.87560509 [8,] 0.24633466 0.4926693 0.75366534 [9,] 0.18083235 0.3616647 0.81916765 [10,] 0.14221285 0.2844257 0.85778715 [11,] 0.20131897 0.4026379 0.79868103 [12,] 0.14377924 0.2875585 0.85622076 [13,] 0.10136613 0.2027323 0.89863387 [14,] 0.07728332 0.1545666 0.92271668 [15,] 0.41778899 0.8355780 0.58221101 [16,] 0.35453119 0.7090624 0.64546881 [17,] 0.91672298 0.1665540 0.08327702 [18,] 0.89262130 0.2147574 0.10737870 [19,] 0.86452941 0.2709412 0.13547059 [20,] 0.94431163 0.1113767 0.05568837 [21,] 0.92337807 0.1532439 0.07662193 [22,] 0.94715259 0.1056948 0.05284741 [23,] 0.92421971 0.1515606 0.07578029 [24,] 0.91352589 0.1729482 0.08647411 [25,] 0.88766629 0.2246674 0.11233371 [26,] 0.93602720 0.1279456 0.06397280 [27,] 0.93238719 0.1352256 0.06761281 [28,] 0.91512672 0.1697466 0.08487328 [29,] 0.93050571 0.1389886 0.06949429 [30,] 0.91994634 0.1601073 0.08005366 [31,] 0.88937654 0.2212469 0.11062346 [32,] 0.88750691 0.2249862 0.11249309 [33,] 0.85760331 0.2847934 0.14239669 [34,] 0.80709020 0.3858196 0.19290980 [35,] 0.87666472 0.2466706 0.12333528 [36,] 0.85331704 0.2933659 0.14668296 [37,] 0.81930203 0.3613959 0.18069797 [38,] 0.78909922 0.4218016 0.21090078 [39,] 0.76752226 0.4649555 0.23247774 [40,] 0.69607587 0.6078483 0.30392413 [41,] 0.62339982 0.7532004 0.37660018 [42,] 0.62516795 0.7496641 0.37483205 [43,] 0.54554744 0.9089051 0.45445256 [44,] 0.44696719 0.8939344 0.55303281 [45,] 0.37480032 0.7496006 0.62519968 [46,] 0.28868383 0.5773677 0.71131617 [47,] 0.82444177 0.3511165 0.17555823 [48,] 0.74773416 0.5045317 0.25226584 [49,] 0.69606670 0.6078666 0.30393330 [50,] 0.68281879 0.6343624 0.31718121 [51,] 0.61946776 0.7610645 0.38053224 > postscript(file="/var/www/html/rcomp/tmp/1h4xq1259061832.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/2ho5l1259061832.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/3uj9q1259061832.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/4mbcs1259061832.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/5oxhj1259061832.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 1.74304369 -5.87580445 2.92000642 -0.93221850 -7.99897207 -6.69740189 7 8 9 10 11 12 -2.52815973 -8.43535887 -1.67266408 -1.45813543 -4.10041190 4.64448352 13 14 15 16 17 18 -3.59033310 0.22419555 7.13898491 -0.07279443 -2.05695631 3.90272847 19 20 21 22 23 24 10.27184027 1.76477148 17.85495339 3.32589609 3.32432591 10.09094912 25 26 27 28 29 30 1.71110673 -7.15263682 0.26202218 -3.55250647 -2.09897207 8.09552932 31 32 33 34 35 36 2.49055805 -2.11206089 -5.76245492 -3.58143341 -0.96978442 -4.25106664 37 38 39 40 41 42 3.51843623 0.87354081 6.47092187 -2.52645919 2.10704796 -4.04648644 43 44 45 46 47 48 1.47759959 2.21411675 -1.48706237 2.06804221 -3.10159102 1.40979726 49 50 51 52 53 54 2.69827862 -1.65970561 6.50141899 0.87799066 0.22877575 -4.07397355 55 56 57 58 59 60 7.93715401 0.66346201 -11.62043916 -9.52894778 -4.58274288 -1.28444342 > postscript(file="/var/www/html/rcomp/tmp/6quu41259061832.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 1.74304369 NA 1 -5.87580445 1.74304369 2 2.92000642 -5.87580445 3 -0.93221850 2.92000642 4 -7.99897207 -0.93221850 5 -6.69740189 -7.99897207 6 -2.52815973 -6.69740189 7 -8.43535887 -2.52815973 8 -1.67266408 -8.43535887 9 -1.45813543 -1.67266408 10 -4.10041190 -1.45813543 11 4.64448352 -4.10041190 12 -3.59033310 4.64448352 13 0.22419555 -3.59033310 14 7.13898491 0.22419555 15 -0.07279443 7.13898491 16 -2.05695631 -0.07279443 17 3.90272847 -2.05695631 18 10.27184027 3.90272847 19 1.76477148 10.27184027 20 17.85495339 1.76477148 21 3.32589609 17.85495339 22 3.32432591 3.32589609 23 10.09094912 3.32432591 24 1.71110673 10.09094912 25 -7.15263682 1.71110673 26 0.26202218 -7.15263682 27 -3.55250647 0.26202218 28 -2.09897207 -3.55250647 29 8.09552932 -2.09897207 30 2.49055805 8.09552932 31 -2.11206089 2.49055805 32 -5.76245492 -2.11206089 33 -3.58143341 -5.76245492 34 -0.96978442 -3.58143341 35 -4.25106664 -0.96978442 36 3.51843623 -4.25106664 37 0.87354081 3.51843623 38 6.47092187 0.87354081 39 -2.52645919 6.47092187 40 2.10704796 -2.52645919 41 -4.04648644 2.10704796 42 1.47759959 -4.04648644 43 2.21411675 1.47759959 44 -1.48706237 2.21411675 45 2.06804221 -1.48706237 46 -3.10159102 2.06804221 47 1.40979726 -3.10159102 48 2.69827862 1.40979726 49 -1.65970561 2.69827862 50 6.50141899 -1.65970561 51 0.87799066 6.50141899 52 0.22877575 0.87799066 53 -4.07397355 0.22877575 54 7.93715401 -4.07397355 55 0.66346201 7.93715401 56 -11.62043916 0.66346201 57 -9.52894778 -11.62043916 58 -4.58274288 -9.52894778 59 -1.28444342 -4.58274288 60 NA -1.28444342 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -5.87580445 1.74304369 [2,] 2.92000642 -5.87580445 [3,] -0.93221850 2.92000642 [4,] -7.99897207 -0.93221850 [5,] -6.69740189 -7.99897207 [6,] -2.52815973 -6.69740189 [7,] -8.43535887 -2.52815973 [8,] -1.67266408 -8.43535887 [9,] -1.45813543 -1.67266408 [10,] -4.10041190 -1.45813543 [11,] 4.64448352 -4.10041190 [12,] -3.59033310 4.64448352 [13,] 0.22419555 -3.59033310 [14,] 7.13898491 0.22419555 [15,] -0.07279443 7.13898491 [16,] -2.05695631 -0.07279443 [17,] 3.90272847 -2.05695631 [18,] 10.27184027 3.90272847 [19,] 1.76477148 10.27184027 [20,] 17.85495339 1.76477148 [21,] 3.32589609 17.85495339 [22,] 3.32432591 3.32589609 [23,] 10.09094912 3.32432591 [24,] 1.71110673 10.09094912 [25,] -7.15263682 1.71110673 [26,] 0.26202218 -7.15263682 [27,] -3.55250647 0.26202218 [28,] -2.09897207 -3.55250647 [29,] 8.09552932 -2.09897207 [30,] 2.49055805 8.09552932 [31,] -2.11206089 2.49055805 [32,] -5.76245492 -2.11206089 [33,] -3.58143341 -5.76245492 [34,] -0.96978442 -3.58143341 [35,] -4.25106664 -0.96978442 [36,] 3.51843623 -4.25106664 [37,] 0.87354081 3.51843623 [38,] 6.47092187 0.87354081 [39,] -2.52645919 6.47092187 [40,] 2.10704796 -2.52645919 [41,] -4.04648644 2.10704796 [42,] 1.47759959 -4.04648644 [43,] 2.21411675 1.47759959 [44,] -1.48706237 2.21411675 [45,] 2.06804221 -1.48706237 [46,] -3.10159102 2.06804221 [47,] 1.40979726 -3.10159102 [48,] 2.69827862 1.40979726 [49,] -1.65970561 2.69827862 [50,] 6.50141899 -1.65970561 [51,] 0.87799066 6.50141899 [52,] 0.22877575 0.87799066 [53,] -4.07397355 0.22877575 [54,] 7.93715401 -4.07397355 [55,] 0.66346201 7.93715401 [56,] -11.62043916 0.66346201 [57,] -9.52894778 -11.62043916 [58,] -4.58274288 -9.52894778 [59,] -1.28444342 -4.58274288 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -5.87580445 1.74304369 2 2.92000642 -5.87580445 3 -0.93221850 2.92000642 4 -7.99897207 -0.93221850 5 -6.69740189 -7.99897207 6 -2.52815973 -6.69740189 7 -8.43535887 -2.52815973 8 -1.67266408 -8.43535887 9 -1.45813543 -1.67266408 10 -4.10041190 -1.45813543 11 4.64448352 -4.10041190 12 -3.59033310 4.64448352 13 0.22419555 -3.59033310 14 7.13898491 0.22419555 15 -0.07279443 7.13898491 16 -2.05695631 -0.07279443 17 3.90272847 -2.05695631 18 10.27184027 3.90272847 19 1.76477148 10.27184027 20 17.85495339 1.76477148 21 3.32589609 17.85495339 22 3.32432591 3.32589609 23 10.09094912 3.32432591 24 1.71110673 10.09094912 25 -7.15263682 1.71110673 26 0.26202218 -7.15263682 27 -3.55250647 0.26202218 28 -2.09897207 -3.55250647 29 8.09552932 -2.09897207 30 2.49055805 8.09552932 31 -2.11206089 2.49055805 32 -5.76245492 -2.11206089 33 -3.58143341 -5.76245492 34 -0.96978442 -3.58143341 35 -4.25106664 -0.96978442 36 3.51843623 -4.25106664 37 0.87354081 3.51843623 38 6.47092187 0.87354081 39 -2.52645919 6.47092187 40 2.10704796 -2.52645919 41 -4.04648644 2.10704796 42 1.47759959 -4.04648644 43 2.21411675 1.47759959 44 -1.48706237 2.21411675 45 2.06804221 -1.48706237 46 -3.10159102 2.06804221 47 1.40979726 -3.10159102 48 2.69827862 1.40979726 49 -1.65970561 2.69827862 50 6.50141899 -1.65970561 51 0.87799066 6.50141899 52 0.22877575 0.87799066 53 -4.07397355 0.22877575 54 7.93715401 -4.07397355 55 0.66346201 7.93715401 56 -11.62043916 0.66346201 57 -9.52894778 -11.62043916 58 -4.58274288 -9.52894778 59 -1.28444342 -4.58274288 > 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/79gzb1259061832.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/898071259061832.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/9ae831259061832.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/10bu8a1259061832.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/113ekt1259061832.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/12t9zq1259061832.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/13ajg61259061832.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/14mn4p1259061832.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/15yog31259061832.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/162yib1259061832.tab") + } > > system("convert tmp/1h4xq1259061832.ps tmp/1h4xq1259061832.png") > system("convert tmp/2ho5l1259061832.ps tmp/2ho5l1259061832.png") > system("convert tmp/3uj9q1259061832.ps tmp/3uj9q1259061832.png") > system("convert tmp/4mbcs1259061832.ps tmp/4mbcs1259061832.png") > system("convert tmp/5oxhj1259061832.ps tmp/5oxhj1259061832.png") > system("convert tmp/6quu41259061832.ps tmp/6quu41259061832.png") > system("convert tmp/79gzb1259061832.ps tmp/79gzb1259061832.png") > system("convert tmp/898071259061832.ps tmp/898071259061832.png") > system("convert tmp/9ae831259061832.ps tmp/9ae831259061832.png") > system("convert tmp/10bu8a1259061832.ps tmp/10bu8a1259061832.png") > > > proc.time() user system elapsed 2.457 1.572 3.880