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(108.2,108.5,108.8,112.3,110.2,116.6,109.5,115.5,109.5,120.1,116,132.9,111.2,128.1,112.1,129.3,114,132.5,119.1,131,114.1,124.9,115.1,120.8,115.4,122,110.8,122.1,116,127.4,119.2,135.2,126.5,137.3,127.8,135,131.3,136,140.3,138.4,137.3,134.7,143,138.4,134.5,133.9,139.9,133.6,159.3,141.2,170.4,151.8,175,155.4,175.8,156.6,180.9,161.6,180.3,160.7,169.6,156,172.3,159.5,184.8,168.7,177.7,169.9,184.6,169.9,211.4,185.9,215.3,190.8,215.9,195.8,244.7,211.9,259.3,227.1,289,251.3,310.9,256.7,321,251.9,315.1,251.2,333.2,270.3,314.1,267.2,284.7,243,273.9,229.9,216,187.2,196.4,178.2,190.9,175.2,206.4,192.4,196.3,187,199.5,184,198.9,194.1,214.4,212.7,214.2,217.5,187.6,200.5,180.6,205.9,172.2,196.5),dim=c(2,60),dimnames=list(c('Y','X'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Y','X'),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 Y X 1 108.2 108.5 2 108.8 112.3 3 110.2 116.6 4 109.5 115.5 5 109.5 120.1 6 116.0 132.9 7 111.2 128.1 8 112.1 129.3 9 114.0 132.5 10 119.1 131.0 11 114.1 124.9 12 115.1 120.8 13 115.4 122.0 14 110.8 122.1 15 116.0 127.4 16 119.2 135.2 17 126.5 137.3 18 127.8 135.0 19 131.3 136.0 20 140.3 138.4 21 137.3 134.7 22 143.0 138.4 23 134.5 133.9 24 139.9 133.6 25 159.3 141.2 26 170.4 151.8 27 175.0 155.4 28 175.8 156.6 29 180.9 161.6 30 180.3 160.7 31 169.6 156.0 32 172.3 159.5 33 184.8 168.7 34 177.7 169.9 35 184.6 169.9 36 211.4 185.9 37 215.3 190.8 38 215.9 195.8 39 244.7 211.9 40 259.3 227.1 41 289.0 251.3 42 310.9 256.7 43 321.0 251.9 44 315.1 251.2 45 333.2 270.3 46 314.1 267.2 47 284.7 243.0 48 273.9 229.9 49 216.0 187.2 50 196.4 178.2 51 190.9 175.2 52 206.4 192.4 53 196.3 187.0 54 199.5 184.0 55 198.9 194.1 56 214.4 212.7 57 214.2 217.5 58 187.6 200.5 59 180.6 205.9 60 172.2 196.5 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X -54.695 1.381 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -49.109 -4.816 3.671 8.942 27.753 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -54.69470 7.54758 -7.247 1.13e-09 *** X 1.38127 0.04303 32.097 < 2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 14.77 on 58 degrees of freedom Multiple R-squared: 0.9467, Adjusted R-squared: 0.9458 F-statistic: 1030 on 1 and 58 DF, p-value: < 2.2e-16 > 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,] 5.326334e-05 1.065267e-04 0.9999467 [2,] 3.675663e-05 7.351325e-05 0.9999632 [3,] 1.268192e-05 2.536384e-05 0.9999873 [4,] 1.295602e-06 2.591203e-06 0.9999987 [5,] 9.903335e-08 1.980667e-07 0.9999999 [6,] 1.371649e-06 2.743298e-06 0.9999986 [7,] 2.176832e-07 4.353663e-07 0.9999998 [8,] 1.063745e-07 2.127490e-07 0.9999999 [9,] 3.686449e-08 7.372898e-08 1.0000000 [10,] 6.227164e-09 1.245433e-08 1.0000000 [11,] 1.224419e-09 2.448837e-09 1.0000000 [12,] 3.013039e-10 6.026077e-10 1.0000000 [13,] 3.251359e-09 6.502718e-09 1.0000000 [14,] 1.644772e-08 3.289544e-08 1.0000000 [15,] 8.667463e-08 1.733493e-07 0.9999999 [16,] 2.380281e-06 4.760562e-06 0.9999976 [17,] 7.546370e-06 1.509274e-05 0.9999925 [18,] 2.079461e-05 4.158922e-05 0.9999792 [19,] 1.535640e-05 3.071280e-05 0.9999846 [20,] 2.647649e-05 5.295299e-05 0.9999735 [21,] 3.043150e-04 6.086299e-04 0.9996957 [22,] 6.170576e-04 1.234115e-03 0.9993829 [23,] 6.800998e-04 1.360200e-03 0.9993199 [24,] 5.582545e-04 1.116509e-03 0.9994417 [25,] 3.636423e-04 7.272846e-04 0.9996364 [26,] 2.517144e-04 5.034287e-04 0.9997483 [27,] 1.518207e-04 3.036414e-04 0.9998482 [28,] 8.994729e-05 1.798946e-04 0.9999101 [29,] 5.599214e-05 1.119843e-04 0.9999440 [30,] 4.561504e-05 9.123008e-05 0.9999544 [31,] 2.868144e-05 5.736287e-05 0.9999713 [32,] 2.003988e-05 4.007977e-05 0.9999800 [33,] 1.340935e-05 2.681871e-05 0.9999866 [34,] 9.678182e-06 1.935636e-05 0.9999903 [35,] 5.396368e-06 1.079274e-05 0.9999946 [36,] 3.262357e-06 6.524714e-06 0.9999967 [37,] 2.512783e-06 5.025567e-06 0.9999975 [38,] 1.065426e-06 2.130853e-06 0.9999989 [39,] 4.707469e-06 9.414937e-06 0.9999953 [40,] 8.705101e-06 1.741020e-05 0.9999913 [41,] 7.748239e-06 1.549648e-05 0.9999923 [42,] 8.718328e-06 1.743666e-05 0.9999913 [43,] 2.353130e-05 4.706261e-05 0.9999765 [44,] 1.591116e-02 3.182233e-02 0.9840888 [45,] 3.644762e-02 7.289524e-02 0.9635524 [46,] 2.302442e-02 4.604884e-02 0.9769756 [47,] 1.252011e-02 2.504022e-02 0.9874799 [48,] 1.470547e-02 2.941094e-02 0.9852945 [49,] 1.152537e-02 2.305073e-02 0.9884746 [50,] 4.351331e-02 8.702661e-02 0.9564867 [51,] 3.969943e-01 7.939886e-01 0.6030057 > postscript(file="/var/www/html/rcomp/tmp/18vyn1258725719.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/2trxe1258725719.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/3c5xy1258725719.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/4fuvw1258725719.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/5wb7s1258725719.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 13.0270040 8.3781813 3.8387240 4.6581201 -1.6957179 -12.8759627 7 8 9 10 11 12 -11.0458709 -11.8033939 -14.3234551 -7.1515514 -3.7258097 2.9373937 13 14 15 16 17 18 1.5798708 -3.1582562 -5.2789825 -12.8528817 -8.4535469 -3.9766279 19 20 21 22 23 24 -1.8578970 3.8270571 5.9377528 6.5270571 4.2427681 10.0571489 25 26 27 28 29 30 18.9595035 15.4180507 15.0454819 14.1879589 12.3816133 13.0247555 31 32 33 34 35 36 8.8167204 6.6822784 6.4746025 -2.2829205 4.6170795 9.3167735 37 38 39 40 41 42 6.4485547 0.1422091 6.7037761 0.3084854 -3.4182275 11.0229192 43 44 45 46 47 48 27.7530110 22.8198994 14.5376590 -0.2804067 3.7463062 11.0409318 49 50 51 52 53 54 12.1211236 4.9525457 3.5963531 -4.6614759 -7.3026226 0.0411848 55 56 57 58 59 60 -14.5096334 -24.7012392 -31.5313310 -34.6497558 -49.1086091 -44.5246793 > postscript(file="/var/www/html/rcomp/tmp/6daat1258725719.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 13.0270040 NA 1 8.3781813 13.0270040 2 3.8387240 8.3781813 3 4.6581201 3.8387240 4 -1.6957179 4.6581201 5 -12.8759627 -1.6957179 6 -11.0458709 -12.8759627 7 -11.8033939 -11.0458709 8 -14.3234551 -11.8033939 9 -7.1515514 -14.3234551 10 -3.7258097 -7.1515514 11 2.9373937 -3.7258097 12 1.5798708 2.9373937 13 -3.1582562 1.5798708 14 -5.2789825 -3.1582562 15 -12.8528817 -5.2789825 16 -8.4535469 -12.8528817 17 -3.9766279 -8.4535469 18 -1.8578970 -3.9766279 19 3.8270571 -1.8578970 20 5.9377528 3.8270571 21 6.5270571 5.9377528 22 4.2427681 6.5270571 23 10.0571489 4.2427681 24 18.9595035 10.0571489 25 15.4180507 18.9595035 26 15.0454819 15.4180507 27 14.1879589 15.0454819 28 12.3816133 14.1879589 29 13.0247555 12.3816133 30 8.8167204 13.0247555 31 6.6822784 8.8167204 32 6.4746025 6.6822784 33 -2.2829205 6.4746025 34 4.6170795 -2.2829205 35 9.3167735 4.6170795 36 6.4485547 9.3167735 37 0.1422091 6.4485547 38 6.7037761 0.1422091 39 0.3084854 6.7037761 40 -3.4182275 0.3084854 41 11.0229192 -3.4182275 42 27.7530110 11.0229192 43 22.8198994 27.7530110 44 14.5376590 22.8198994 45 -0.2804067 14.5376590 46 3.7463062 -0.2804067 47 11.0409318 3.7463062 48 12.1211236 11.0409318 49 4.9525457 12.1211236 50 3.5963531 4.9525457 51 -4.6614759 3.5963531 52 -7.3026226 -4.6614759 53 0.0411848 -7.3026226 54 -14.5096334 0.0411848 55 -24.7012392 -14.5096334 56 -31.5313310 -24.7012392 57 -34.6497558 -31.5313310 58 -49.1086091 -34.6497558 59 -44.5246793 -49.1086091 60 NA -44.5246793 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 8.3781813 13.0270040 [2,] 3.8387240 8.3781813 [3,] 4.6581201 3.8387240 [4,] -1.6957179 4.6581201 [5,] -12.8759627 -1.6957179 [6,] -11.0458709 -12.8759627 [7,] -11.8033939 -11.0458709 [8,] -14.3234551 -11.8033939 [9,] -7.1515514 -14.3234551 [10,] -3.7258097 -7.1515514 [11,] 2.9373937 -3.7258097 [12,] 1.5798708 2.9373937 [13,] -3.1582562 1.5798708 [14,] -5.2789825 -3.1582562 [15,] -12.8528817 -5.2789825 [16,] -8.4535469 -12.8528817 [17,] -3.9766279 -8.4535469 [18,] -1.8578970 -3.9766279 [19,] 3.8270571 -1.8578970 [20,] 5.9377528 3.8270571 [21,] 6.5270571 5.9377528 [22,] 4.2427681 6.5270571 [23,] 10.0571489 4.2427681 [24,] 18.9595035 10.0571489 [25,] 15.4180507 18.9595035 [26,] 15.0454819 15.4180507 [27,] 14.1879589 15.0454819 [28,] 12.3816133 14.1879589 [29,] 13.0247555 12.3816133 [30,] 8.8167204 13.0247555 [31,] 6.6822784 8.8167204 [32,] 6.4746025 6.6822784 [33,] -2.2829205 6.4746025 [34,] 4.6170795 -2.2829205 [35,] 9.3167735 4.6170795 [36,] 6.4485547 9.3167735 [37,] 0.1422091 6.4485547 [38,] 6.7037761 0.1422091 [39,] 0.3084854 6.7037761 [40,] -3.4182275 0.3084854 [41,] 11.0229192 -3.4182275 [42,] 27.7530110 11.0229192 [43,] 22.8198994 27.7530110 [44,] 14.5376590 22.8198994 [45,] -0.2804067 14.5376590 [46,] 3.7463062 -0.2804067 [47,] 11.0409318 3.7463062 [48,] 12.1211236 11.0409318 [49,] 4.9525457 12.1211236 [50,] 3.5963531 4.9525457 [51,] -4.6614759 3.5963531 [52,] -7.3026226 -4.6614759 [53,] 0.0411848 -7.3026226 [54,] -14.5096334 0.0411848 [55,] -24.7012392 -14.5096334 [56,] -31.5313310 -24.7012392 [57,] -34.6497558 -31.5313310 [58,] -49.1086091 -34.6497558 [59,] -44.5246793 -49.1086091 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 8.3781813 13.0270040 2 3.8387240 8.3781813 3 4.6581201 3.8387240 4 -1.6957179 4.6581201 5 -12.8759627 -1.6957179 6 -11.0458709 -12.8759627 7 -11.8033939 -11.0458709 8 -14.3234551 -11.8033939 9 -7.1515514 -14.3234551 10 -3.7258097 -7.1515514 11 2.9373937 -3.7258097 12 1.5798708 2.9373937 13 -3.1582562 1.5798708 14 -5.2789825 -3.1582562 15 -12.8528817 -5.2789825 16 -8.4535469 -12.8528817 17 -3.9766279 -8.4535469 18 -1.8578970 -3.9766279 19 3.8270571 -1.8578970 20 5.9377528 3.8270571 21 6.5270571 5.9377528 22 4.2427681 6.5270571 23 10.0571489 4.2427681 24 18.9595035 10.0571489 25 15.4180507 18.9595035 26 15.0454819 15.4180507 27 14.1879589 15.0454819 28 12.3816133 14.1879589 29 13.0247555 12.3816133 30 8.8167204 13.0247555 31 6.6822784 8.8167204 32 6.4746025 6.6822784 33 -2.2829205 6.4746025 34 4.6170795 -2.2829205 35 9.3167735 4.6170795 36 6.4485547 9.3167735 37 0.1422091 6.4485547 38 6.7037761 0.1422091 39 0.3084854 6.7037761 40 -3.4182275 0.3084854 41 11.0229192 -3.4182275 42 27.7530110 11.0229192 43 22.8198994 27.7530110 44 14.5376590 22.8198994 45 -0.2804067 14.5376590 46 3.7463062 -0.2804067 47 11.0409318 3.7463062 48 12.1211236 11.0409318 49 4.9525457 12.1211236 50 3.5963531 4.9525457 51 -4.6614759 3.5963531 52 -7.3026226 -4.6614759 53 0.0411848 -7.3026226 54 -14.5096334 0.0411848 55 -24.7012392 -14.5096334 56 -31.5313310 -24.7012392 57 -34.6497558 -31.5313310 58 -49.1086091 -34.6497558 59 -44.5246793 -49.1086091 > 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/7hchq1258725719.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/88p8m1258725719.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/9kvro1258725719.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/10bza01258725719.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/112t871258725719.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/12puf21258725720.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/138fhk1258725720.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/145ls01258725720.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/15v53s1258725720.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/16ejpw1258725720.tab") + } > > system("convert tmp/18vyn1258725719.ps tmp/18vyn1258725719.png") > system("convert tmp/2trxe1258725719.ps tmp/2trxe1258725719.png") > system("convert tmp/3c5xy1258725719.ps tmp/3c5xy1258725719.png") > system("convert tmp/4fuvw1258725719.ps tmp/4fuvw1258725719.png") > system("convert tmp/5wb7s1258725719.ps tmp/5wb7s1258725719.png") > system("convert tmp/6daat1258725719.ps tmp/6daat1258725719.png") > system("convert tmp/7hchq1258725719.ps tmp/7hchq1258725719.png") > system("convert tmp/88p8m1258725719.ps tmp/88p8m1258725719.png") > system("convert tmp/9kvro1258725719.ps tmp/9kvro1258725719.png") > system("convert tmp/10bza01258725719.ps tmp/10bza01258725719.png") > > > proc.time() user system elapsed 2.496 1.555 3.120