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(115.6,37.2,111.9,37.2,107,34.7,107.1,32.5,100.6,33.5,99.2,31.5,108.4,31.2,103,27,99.8,26.7,115,26.5,90.8,26,95.9,27.2,114.4,30.5,108.2,33.7,112.6,34.2,109.1,36.7,105,36.2,105,38.5,118.5,40,103.7,42.5,112.5,43.5,116.6,43.3,96.6,45.5,101.9,44.3,116.5,43,119.3,43.5,115.4,41.5,108.5,42.5,111.5,41.3,108.8,39.5,121.8,38.5,109.6,41,112.2,44.5,119.6,46,104.1,44,105.3,41.5,115,41.3,124.1,38,116.8,38,107.5,36.2,115.6,38.7,116.2,38.7,116.3,39.2,119,35.7,111.9,36.5,118.6,36.7,106.9,34.7,103.2,35,118.6,28.2,118.7,23.7,102.8,15,100.6,8.7,94.9,11,94.5,7.5,102.9,5.7,95.3,9.3,92.5,10.2,102.7,15.7,91.5,18.1,89.5,20.8),dim=c(2,60),dimnames=list(c('Ipzb','Cvn'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Ipzb','Cvn'),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 Ipzb Cvn 1 115.6 37.2 2 111.9 37.2 3 107.0 34.7 4 107.1 32.5 5 100.6 33.5 6 99.2 31.5 7 108.4 31.2 8 103.0 27.0 9 99.8 26.7 10 115.0 26.5 11 90.8 26.0 12 95.9 27.2 13 114.4 30.5 14 108.2 33.7 15 112.6 34.2 16 109.1 36.7 17 105.0 36.2 18 105.0 38.5 19 118.5 40.0 20 103.7 42.5 21 112.5 43.5 22 116.6 43.3 23 96.6 45.5 24 101.9 44.3 25 116.5 43.0 26 119.3 43.5 27 115.4 41.5 28 108.5 42.5 29 111.5 41.3 30 108.8 39.5 31 121.8 38.5 32 109.6 41.0 33 112.2 44.5 34 119.6 46.0 35 104.1 44.0 36 105.3 41.5 37 115.0 41.3 38 124.1 38.0 39 116.8 38.0 40 107.5 36.2 41 115.6 38.7 42 116.2 38.7 43 116.3 39.2 44 119.0 35.7 45 111.9 36.5 46 118.6 36.7 47 106.9 34.7 48 103.2 35.0 49 118.6 28.2 50 118.7 23.7 51 102.8 15.0 52 100.6 8.7 53 94.9 11.0 54 94.5 7.5 55 102.9 5.7 56 95.3 9.3 57 92.5 10.2 58 102.7 15.7 59 91.5 18.1 60 89.5 20.8 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Cvn 92.7883 0.4668 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -17.4263 -4.7763 -0.5793 5.2458 14.8493 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 92.78831 2.96556 31.289 < 2e-16 *** Cvn 0.46677 0.08585 5.437 1.13e-06 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 7.155 on 58 degrees of freedom Multiple R-squared: 0.3376, Adjusted R-squared: 0.3262 F-statistic: 29.56 on 1 and 58 DF, p-value: 1.131e-06 > 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.16140286 0.3228057 0.83859714 [2,] 0.07380666 0.1476133 0.92619334 [3,] 0.12901040 0.2580208 0.87098960 [4,] 0.10202281 0.2040456 0.89797719 [5,] 0.05390310 0.1078062 0.94609690 [6,] 0.27541138 0.5508228 0.72458862 [7,] 0.45904743 0.9180949 0.54095257 [8,] 0.43648856 0.8729771 0.56351144 [9,] 0.51037564 0.9792487 0.48962436 [10,] 0.41471591 0.8294318 0.58528409 [11,] 0.34962070 0.6992414 0.65037930 [12,] 0.27562783 0.5512557 0.72437217 [13,] 0.24499213 0.4899843 0.75500787 [14,] 0.23401702 0.4680340 0.76598298 [15,] 0.21861670 0.4372334 0.78138330 [16,] 0.29019921 0.5803984 0.70980079 [17,] 0.22436182 0.4487236 0.77563818 [18,] 0.17876929 0.3575386 0.82123071 [19,] 0.52845317 0.9430937 0.47154683 [20,] 0.62807625 0.7438475 0.37192375 [21,] 0.59570746 0.8085851 0.40429254 [22,] 0.59360168 0.8127966 0.40639832 [23,] 0.53955066 0.9208987 0.46044934 [24,] 0.49475343 0.9895069 0.50524657 [25,] 0.42571403 0.8514281 0.57428597 [26,] 0.36842335 0.7368467 0.63157665 [27,] 0.46808294 0.9361659 0.53191706 [28,] 0.40971464 0.8194293 0.59028536 [29,] 0.35025452 0.7005090 0.64974548 [30,] 0.30877339 0.6175468 0.69122661 [31,] 0.40637032 0.8127406 0.59362968 [32,] 0.46737109 0.9347422 0.53262891 [33,] 0.40714033 0.8142807 0.59285967 [34,] 0.54407862 0.9118428 0.45592138 [35,] 0.49863201 0.9972640 0.50136799 [36,] 0.45380002 0.9076000 0.54619998 [37,] 0.38891239 0.7778248 0.61108761 [38,] 0.32919333 0.6583867 0.67080667 [39,] 0.27068942 0.5413788 0.72931058 [40,] 0.27788471 0.5557694 0.72211529 [41,] 0.21085361 0.4217072 0.78914639 [42,] 0.21330158 0.4266032 0.78669842 [43,] 0.15770594 0.3154119 0.84229406 [44,] 0.17204554 0.3440911 0.82795446 [45,] 0.23739912 0.4747982 0.76260088 [46,] 0.86608324 0.2678335 0.13391676 [47,] 0.90155676 0.1968865 0.09844324 [48,] 0.85318143 0.2936371 0.14681857 [49,] 0.76265467 0.4746907 0.23734533 [50,] 0.67754789 0.6449042 0.32245211 [51,] 0.57935963 0.8412807 0.42064037 > postscript(file="/var/www/html/rcomp/tmp/1i7o81258727714.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/2m4x41258727714.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/3babs1258727714.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/46zk81258727714.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/5xk7y1258727714.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 5.4478862 1.7478862 -1.9851916 -0.8583001 -7.8250690 -8.2915312 7 8 9 10 11 12 1.0484994 -2.3910713 -5.4510407 9.8423131 -14.1243025 -9.5844251 13 14 15 16 17 18 7.3752376 -0.3184228 3.8481928 -0.8187294 -4.6853449 -5.7589133 19 20 21 22 23 24 7.0409334 -8.9259888 -0.5927577 3.6005961 -17.4262954 -11.5661728 25 26 27 28 29 30 3.6406268 6.2072423 3.2407801 -4.1259888 -0.5658662 -2.4256822 31 32 33 34 35 36 11.0410867 -2.3258355 -1.3595266 5.3403201 -9.2261421 -6.8592199 37 38 39 40 41 42 2.9341338 13.5744711 6.2744711 -2.1853449 4.7477329 5.3477329 43 44 45 46 47 48 5.2143485 9.5480395 2.0746244 8.6812706 -2.0851916 -5.9252223 49 50 51 52 53 54 12.6488060 14.8492659 3.0101551 3.7507990 -3.0227694 -1.7890784 55 56 57 58 59 60 7.4511056 -1.8292623 -5.0493543 2.5834169 -9.7368284 -12.9971043 > postscript(file="/var/www/html/rcomp/tmp/6jr0u1258727714.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 5.4478862 NA 1 1.7478862 5.4478862 2 -1.9851916 1.7478862 3 -0.8583001 -1.9851916 4 -7.8250690 -0.8583001 5 -8.2915312 -7.8250690 6 1.0484994 -8.2915312 7 -2.3910713 1.0484994 8 -5.4510407 -2.3910713 9 9.8423131 -5.4510407 10 -14.1243025 9.8423131 11 -9.5844251 -14.1243025 12 7.3752376 -9.5844251 13 -0.3184228 7.3752376 14 3.8481928 -0.3184228 15 -0.8187294 3.8481928 16 -4.6853449 -0.8187294 17 -5.7589133 -4.6853449 18 7.0409334 -5.7589133 19 -8.9259888 7.0409334 20 -0.5927577 -8.9259888 21 3.6005961 -0.5927577 22 -17.4262954 3.6005961 23 -11.5661728 -17.4262954 24 3.6406268 -11.5661728 25 6.2072423 3.6406268 26 3.2407801 6.2072423 27 -4.1259888 3.2407801 28 -0.5658662 -4.1259888 29 -2.4256822 -0.5658662 30 11.0410867 -2.4256822 31 -2.3258355 11.0410867 32 -1.3595266 -2.3258355 33 5.3403201 -1.3595266 34 -9.2261421 5.3403201 35 -6.8592199 -9.2261421 36 2.9341338 -6.8592199 37 13.5744711 2.9341338 38 6.2744711 13.5744711 39 -2.1853449 6.2744711 40 4.7477329 -2.1853449 41 5.3477329 4.7477329 42 5.2143485 5.3477329 43 9.5480395 5.2143485 44 2.0746244 9.5480395 45 8.6812706 2.0746244 46 -2.0851916 8.6812706 47 -5.9252223 -2.0851916 48 12.6488060 -5.9252223 49 14.8492659 12.6488060 50 3.0101551 14.8492659 51 3.7507990 3.0101551 52 -3.0227694 3.7507990 53 -1.7890784 -3.0227694 54 7.4511056 -1.7890784 55 -1.8292623 7.4511056 56 -5.0493543 -1.8292623 57 2.5834169 -5.0493543 58 -9.7368284 2.5834169 59 -12.9971043 -9.7368284 60 NA -12.9971043 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 1.7478862 5.4478862 [2,] -1.9851916 1.7478862 [3,] -0.8583001 -1.9851916 [4,] -7.8250690 -0.8583001 [5,] -8.2915312 -7.8250690 [6,] 1.0484994 -8.2915312 [7,] -2.3910713 1.0484994 [8,] -5.4510407 -2.3910713 [9,] 9.8423131 -5.4510407 [10,] -14.1243025 9.8423131 [11,] -9.5844251 -14.1243025 [12,] 7.3752376 -9.5844251 [13,] -0.3184228 7.3752376 [14,] 3.8481928 -0.3184228 [15,] -0.8187294 3.8481928 [16,] -4.6853449 -0.8187294 [17,] -5.7589133 -4.6853449 [18,] 7.0409334 -5.7589133 [19,] -8.9259888 7.0409334 [20,] -0.5927577 -8.9259888 [21,] 3.6005961 -0.5927577 [22,] -17.4262954 3.6005961 [23,] -11.5661728 -17.4262954 [24,] 3.6406268 -11.5661728 [25,] 6.2072423 3.6406268 [26,] 3.2407801 6.2072423 [27,] -4.1259888 3.2407801 [28,] -0.5658662 -4.1259888 [29,] -2.4256822 -0.5658662 [30,] 11.0410867 -2.4256822 [31,] -2.3258355 11.0410867 [32,] -1.3595266 -2.3258355 [33,] 5.3403201 -1.3595266 [34,] -9.2261421 5.3403201 [35,] -6.8592199 -9.2261421 [36,] 2.9341338 -6.8592199 [37,] 13.5744711 2.9341338 [38,] 6.2744711 13.5744711 [39,] -2.1853449 6.2744711 [40,] 4.7477329 -2.1853449 [41,] 5.3477329 4.7477329 [42,] 5.2143485 5.3477329 [43,] 9.5480395 5.2143485 [44,] 2.0746244 9.5480395 [45,] 8.6812706 2.0746244 [46,] -2.0851916 8.6812706 [47,] -5.9252223 -2.0851916 [48,] 12.6488060 -5.9252223 [49,] 14.8492659 12.6488060 [50,] 3.0101551 14.8492659 [51,] 3.7507990 3.0101551 [52,] -3.0227694 3.7507990 [53,] -1.7890784 -3.0227694 [54,] 7.4511056 -1.7890784 [55,] -1.8292623 7.4511056 [56,] -5.0493543 -1.8292623 [57,] 2.5834169 -5.0493543 [58,] -9.7368284 2.5834169 [59,] -12.9971043 -9.7368284 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 1.7478862 5.4478862 2 -1.9851916 1.7478862 3 -0.8583001 -1.9851916 4 -7.8250690 -0.8583001 5 -8.2915312 -7.8250690 6 1.0484994 -8.2915312 7 -2.3910713 1.0484994 8 -5.4510407 -2.3910713 9 9.8423131 -5.4510407 10 -14.1243025 9.8423131 11 -9.5844251 -14.1243025 12 7.3752376 -9.5844251 13 -0.3184228 7.3752376 14 3.8481928 -0.3184228 15 -0.8187294 3.8481928 16 -4.6853449 -0.8187294 17 -5.7589133 -4.6853449 18 7.0409334 -5.7589133 19 -8.9259888 7.0409334 20 -0.5927577 -8.9259888 21 3.6005961 -0.5927577 22 -17.4262954 3.6005961 23 -11.5661728 -17.4262954 24 3.6406268 -11.5661728 25 6.2072423 3.6406268 26 3.2407801 6.2072423 27 -4.1259888 3.2407801 28 -0.5658662 -4.1259888 29 -2.4256822 -0.5658662 30 11.0410867 -2.4256822 31 -2.3258355 11.0410867 32 -1.3595266 -2.3258355 33 5.3403201 -1.3595266 34 -9.2261421 5.3403201 35 -6.8592199 -9.2261421 36 2.9341338 -6.8592199 37 13.5744711 2.9341338 38 6.2744711 13.5744711 39 -2.1853449 6.2744711 40 4.7477329 -2.1853449 41 5.3477329 4.7477329 42 5.2143485 5.3477329 43 9.5480395 5.2143485 44 2.0746244 9.5480395 45 8.6812706 2.0746244 46 -2.0851916 8.6812706 47 -5.9252223 -2.0851916 48 12.6488060 -5.9252223 49 14.8492659 12.6488060 50 3.0101551 14.8492659 51 3.7507990 3.0101551 52 -3.0227694 3.7507990 53 -1.7890784 -3.0227694 54 7.4511056 -1.7890784 55 -1.8292623 7.4511056 56 -5.0493543 -1.8292623 57 2.5834169 -5.0493543 58 -9.7368284 2.5834169 59 -12.9971043 -9.7368284 > 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/7zwzk1258727714.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/83nfr1258727714.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/916ny1258727714.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/10u2ly1258727714.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/110cml1258727714.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/12kyn91258727714.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/139fp91258727714.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/14i4gr1258727714.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/156zmf1258727714.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/16mt471258727714.tab") + } > > system("convert tmp/1i7o81258727714.ps tmp/1i7o81258727714.png") > system("convert tmp/2m4x41258727714.ps tmp/2m4x41258727714.png") > system("convert tmp/3babs1258727714.ps tmp/3babs1258727714.png") > system("convert tmp/46zk81258727714.ps tmp/46zk81258727714.png") > system("convert tmp/5xk7y1258727714.ps tmp/5xk7y1258727714.png") > system("convert tmp/6jr0u1258727714.ps tmp/6jr0u1258727714.png") > system("convert tmp/7zwzk1258727714.ps tmp/7zwzk1258727714.png") > system("convert tmp/83nfr1258727714.ps tmp/83nfr1258727714.png") > system("convert tmp/916ny1258727714.ps tmp/916ny1258727714.png") > system("convert tmp/10u2ly1258727714.ps tmp/10u2ly1258727714.png") > > > proc.time() user system elapsed 2.518 1.590 2.942