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(267413,294912,267366,293488,264777,290555,258863,284736,254844,281818,254868,287854,277267,316263,285351,325412,286602,326011,283042,328282,276687,317480,277915,317539,277128,313737,277103,312276,275037,309391,270150,302950,267140,300316,264993,304035,287259,333476,291186,337698,292300,335932,288186,323931,281477,313927,282656,314485,280190,313218,280408,309664,276836,302963,275216,298989,274352,298423,271311,301631,289802,329765,290726,335083,292300,327616,278506,309119,269826,295916,265861,291413,269034,291542,264176,284678,255198,276475,253353,272566,246057,264981,235372,263290,258556,296806,260993,303598,254663,286994,250643,276427,243422,266424,247105,267153,248541,268381,245039,262522,237080,255542,237085,253158,225554,243803,226839,250741,247934,280445,248333,285257,246969,270976,245098,261076,246263,255603,255765,260376,264319,263903,268347,264291,273046,263276,273963,262572,267430,256167,271993,264221,292710,293860),dim=c(2,67),dimnames=list(c('Y','X'),1:67)) > y <- array(NA,dim=c(2,67),dimnames=list(c('Y','X'),1:67)) > 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 267413 294912 2 267366 293488 3 264777 290555 4 258863 284736 5 254844 281818 6 254868 287854 7 277267 316263 8 285351 325412 9 286602 326011 10 283042 328282 11 276687 317480 12 277915 317539 13 277128 313737 14 277103 312276 15 275037 309391 16 270150 302950 17 267140 300316 18 264993 304035 19 287259 333476 20 291186 337698 21 292300 335932 22 288186 323931 23 281477 313927 24 282656 314485 25 280190 313218 26 280408 309664 27 276836 302963 28 275216 298989 29 274352 298423 30 271311 301631 31 289802 329765 32 290726 335083 33 292300 327616 34 278506 309119 35 269826 295916 36 265861 291413 37 269034 291542 38 264176 284678 39 255198 276475 40 253353 272566 41 246057 264981 42 235372 263290 43 258556 296806 44 260993 303598 45 254663 286994 46 250643 276427 47 243422 266424 48 247105 267153 49 248541 268381 50 245039 262522 51 237080 255542 52 237085 253158 53 225554 243803 54 226839 250741 55 247934 280445 56 248333 285257 57 246969 270976 58 245098 261076 59 246263 255603 60 255765 260376 61 264319 263903 62 268347 264291 63 273046 263276 64 273963 262572 65 267430 256167 66 271993 264221 67 292710 293860 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 1.007e+05 5.664e-01 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -15840 -4779 -745 2886 25608 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1.007e+05 1.301e+04 7.735 8.65e-11 *** X 5.664e-01 4.444e-02 12.744 < 2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 9138 on 65 degrees of freedom Multiple R-squared: 0.7142, Adjusted R-squared: 0.7098 F-statistic: 162.4 on 1 and 65 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,] 1.040600e-03 2.081199e-03 0.99895940 [2,] 1.962890e-02 3.925780e-02 0.98037110 [3,] 1.524936e-02 3.049872e-02 0.98475064 [4,] 4.711795e-03 9.423590e-03 0.99528820 [5,] 1.389705e-03 2.779411e-03 0.99861029 [6,] 8.136701e-04 1.627340e-03 0.99918633 [7,] 3.148230e-04 6.296460e-04 0.99968518 [8,] 9.189306e-05 1.837861e-04 0.99990811 [9,] 2.471065e-05 4.942130e-05 0.99997529 [10,] 7.076561e-06 1.415312e-05 0.99999292 [11,] 1.854324e-06 3.708648e-06 0.99999815 [12,] 4.347606e-07 8.695213e-07 0.99999957 [13,] 1.104062e-07 2.208125e-07 0.99999989 [14,] 2.405855e-07 4.811710e-07 0.99999976 [15,] 6.839342e-08 1.367868e-07 0.99999993 [16,] 1.628462e-08 3.256924e-08 0.99999998 [17,] 5.030933e-09 1.006187e-08 0.99999999 [18,] 6.963242e-09 1.392648e-08 0.99999999 [19,] 5.890224e-09 1.178045e-08 0.99999999 [20,] 6.297469e-09 1.259494e-08 0.99999999 [21,] 2.845345e-09 5.690690e-09 1.00000000 [22,] 3.495676e-09 6.991351e-09 1.00000000 [23,] 4.906475e-09 9.812950e-09 1.00000000 [24,] 7.975854e-09 1.595171e-08 0.99999999 [25,] 7.809777e-09 1.561955e-08 0.99999999 [26,] 2.323161e-09 4.646322e-09 1.00000000 [27,] 7.388970e-10 1.477794e-09 1.00000000 [28,] 2.068825e-10 4.137649e-10 1.00000000 [29,] 1.751289e-10 3.502579e-10 1.00000000 [30,] 6.865047e-11 1.373009e-10 1.00000000 [31,] 2.350754e-11 4.701509e-11 1.00000000 [32,] 6.512153e-12 1.302431e-11 1.00000000 [33,] 3.332070e-12 6.664141e-12 1.00000000 [34,] 1.268174e-12 2.536348e-12 1.00000000 [35,] 3.210863e-13 6.421725e-13 1.00000000 [36,] 7.678337e-14 1.535667e-13 1.00000000 [37,] 2.559179e-14 5.118357e-14 1.00000000 [38,] 9.744846e-13 1.948969e-12 1.00000000 [39,] 2.947692e-12 5.895384e-12 1.00000000 [40,] 2.223227e-11 4.446455e-11 1.00000000 [41,] 2.491868e-11 4.983736e-11 1.00000000 [42,] 1.349630e-11 2.699259e-11 1.00000000 [43,] 7.876046e-12 1.575209e-11 1.00000000 [44,] 3.041710e-12 6.083419e-12 1.00000000 [45,] 1.182160e-12 2.364320e-12 1.00000000 [46,] 4.319347e-13 8.638694e-13 1.00000000 [47,] 2.221102e-13 4.442204e-13 1.00000000 [48,] 9.667429e-14 1.933486e-13 1.00000000 [49,] 3.067308e-13 6.134616e-13 1.00000000 [50,] 3.426399e-11 6.852798e-11 1.00000000 [51,] 3.643105e-10 7.286210e-10 1.00000000 [52,] 4.227032e-07 8.454065e-07 0.99999958 [53,] 1.000306e-04 2.000612e-04 0.99989997 [54,] 5.736431e-03 1.147286e-02 0.99426357 [55,] 1.172143e-01 2.344287e-01 0.88278567 [56,] 6.408759e-01 7.182482e-01 0.35912411 [57,] 9.252955e-01 1.494090e-01 0.07470449 [58,] 9.865461e-01 2.690774e-02 0.01345387 > postscript(file="/var/www/html/rcomp/tmp/1tmca1259050672.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/2wy1y1259050672.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/3hvlj1259050672.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/459h51259050672.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/5g2gk1259050672.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 = 67 Frequency = 1 1 2 3 4 5 6 -284.4132 475.1274 -452.6481 -3070.8195 -5437.0909 -8831.8263 7 8 9 10 11 12 -2523.4251 378.6647 1290.3965 -3555.8772 -3792.7228 -2598.1399 13 14 15 16 17 18 -1231.7217 -429.2246 -861.1869 -2100.0632 -3618.1896 -7871.5973 19 20 21 22 23 24 -2280.7115 -745.0138 1369.2325 4052.4896 3009.6640 3872.6179 25 26 27 28 29 30 2124.2352 4355.1884 4578.5737 5209.4111 4665.9884 -191.9936 31 32 33 34 35 36 2364.1651 276.0984 6079.3391 2761.8714 1559.9303 145.3885 37 38 39 40 41 42 3245.3241 2275.0311 -2056.8644 -1687.8424 -4687.7675 -14415.0005 43 44 45 46 47 48 -10214.1576 -11624.0845 -8549.7302 -6584.6776 -8140.0696 -4869.9685 49 50 51 52 53 54 -4129.4965 -4313.0123 -8318.6039 -6963.3280 -13195.7413 -15840.3613 55 56 57 58 59 60 -11569.4362 -13895.9092 -7171.2809 -3435.0111 829.8462 7628.4625 61 62 63 64 65 66 14184.8019 17993.0422 23266.9289 24582.6681 21677.4018 21678.6896 67 25608.4300 > postscript(file="/var/www/html/rcomp/tmp/6lbn51259050672.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 = 67 Frequency = 1 lag(myerror, k = 1) myerror 0 -284.4132 NA 1 475.1274 -284.4132 2 -452.6481 475.1274 3 -3070.8195 -452.6481 4 -5437.0909 -3070.8195 5 -8831.8263 -5437.0909 6 -2523.4251 -8831.8263 7 378.6647 -2523.4251 8 1290.3965 378.6647 9 -3555.8772 1290.3965 10 -3792.7228 -3555.8772 11 -2598.1399 -3792.7228 12 -1231.7217 -2598.1399 13 -429.2246 -1231.7217 14 -861.1869 -429.2246 15 -2100.0632 -861.1869 16 -3618.1896 -2100.0632 17 -7871.5973 -3618.1896 18 -2280.7115 -7871.5973 19 -745.0138 -2280.7115 20 1369.2325 -745.0138 21 4052.4896 1369.2325 22 3009.6640 4052.4896 23 3872.6179 3009.6640 24 2124.2352 3872.6179 25 4355.1884 2124.2352 26 4578.5737 4355.1884 27 5209.4111 4578.5737 28 4665.9884 5209.4111 29 -191.9936 4665.9884 30 2364.1651 -191.9936 31 276.0984 2364.1651 32 6079.3391 276.0984 33 2761.8714 6079.3391 34 1559.9303 2761.8714 35 145.3885 1559.9303 36 3245.3241 145.3885 37 2275.0311 3245.3241 38 -2056.8644 2275.0311 39 -1687.8424 -2056.8644 40 -4687.7675 -1687.8424 41 -14415.0005 -4687.7675 42 -10214.1576 -14415.0005 43 -11624.0845 -10214.1576 44 -8549.7302 -11624.0845 45 -6584.6776 -8549.7302 46 -8140.0696 -6584.6776 47 -4869.9685 -8140.0696 48 -4129.4965 -4869.9685 49 -4313.0123 -4129.4965 50 -8318.6039 -4313.0123 51 -6963.3280 -8318.6039 52 -13195.7413 -6963.3280 53 -15840.3613 -13195.7413 54 -11569.4362 -15840.3613 55 -13895.9092 -11569.4362 56 -7171.2809 -13895.9092 57 -3435.0111 -7171.2809 58 829.8462 -3435.0111 59 7628.4625 829.8462 60 14184.8019 7628.4625 61 17993.0422 14184.8019 62 23266.9289 17993.0422 63 24582.6681 23266.9289 64 21677.4018 24582.6681 65 21678.6896 21677.4018 66 25608.4300 21678.6896 67 NA 25608.4300 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 475.1274 -284.4132 [2,] -452.6481 475.1274 [3,] -3070.8195 -452.6481 [4,] -5437.0909 -3070.8195 [5,] -8831.8263 -5437.0909 [6,] -2523.4251 -8831.8263 [7,] 378.6647 -2523.4251 [8,] 1290.3965 378.6647 [9,] -3555.8772 1290.3965 [10,] -3792.7228 -3555.8772 [11,] -2598.1399 -3792.7228 [12,] -1231.7217 -2598.1399 [13,] -429.2246 -1231.7217 [14,] -861.1869 -429.2246 [15,] -2100.0632 -861.1869 [16,] -3618.1896 -2100.0632 [17,] -7871.5973 -3618.1896 [18,] -2280.7115 -7871.5973 [19,] -745.0138 -2280.7115 [20,] 1369.2325 -745.0138 [21,] 4052.4896 1369.2325 [22,] 3009.6640 4052.4896 [23,] 3872.6179 3009.6640 [24,] 2124.2352 3872.6179 [25,] 4355.1884 2124.2352 [26,] 4578.5737 4355.1884 [27,] 5209.4111 4578.5737 [28,] 4665.9884 5209.4111 [29,] -191.9936 4665.9884 [30,] 2364.1651 -191.9936 [31,] 276.0984 2364.1651 [32,] 6079.3391 276.0984 [33,] 2761.8714 6079.3391 [34,] 1559.9303 2761.8714 [35,] 145.3885 1559.9303 [36,] 3245.3241 145.3885 [37,] 2275.0311 3245.3241 [38,] -2056.8644 2275.0311 [39,] -1687.8424 -2056.8644 [40,] -4687.7675 -1687.8424 [41,] -14415.0005 -4687.7675 [42,] -10214.1576 -14415.0005 [43,] -11624.0845 -10214.1576 [44,] -8549.7302 -11624.0845 [45,] -6584.6776 -8549.7302 [46,] -8140.0696 -6584.6776 [47,] -4869.9685 -8140.0696 [48,] -4129.4965 -4869.9685 [49,] -4313.0123 -4129.4965 [50,] -8318.6039 -4313.0123 [51,] -6963.3280 -8318.6039 [52,] -13195.7413 -6963.3280 [53,] -15840.3613 -13195.7413 [54,] -11569.4362 -15840.3613 [55,] -13895.9092 -11569.4362 [56,] -7171.2809 -13895.9092 [57,] -3435.0111 -7171.2809 [58,] 829.8462 -3435.0111 [59,] 7628.4625 829.8462 [60,] 14184.8019 7628.4625 [61,] 17993.0422 14184.8019 [62,] 23266.9289 17993.0422 [63,] 24582.6681 23266.9289 [64,] 21677.4018 24582.6681 [65,] 21678.6896 21677.4018 [66,] 25608.4300 21678.6896 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 475.1274 -284.4132 2 -452.6481 475.1274 3 -3070.8195 -452.6481 4 -5437.0909 -3070.8195 5 -8831.8263 -5437.0909 6 -2523.4251 -8831.8263 7 378.6647 -2523.4251 8 1290.3965 378.6647 9 -3555.8772 1290.3965 10 -3792.7228 -3555.8772 11 -2598.1399 -3792.7228 12 -1231.7217 -2598.1399 13 -429.2246 -1231.7217 14 -861.1869 -429.2246 15 -2100.0632 -861.1869 16 -3618.1896 -2100.0632 17 -7871.5973 -3618.1896 18 -2280.7115 -7871.5973 19 -745.0138 -2280.7115 20 1369.2325 -745.0138 21 4052.4896 1369.2325 22 3009.6640 4052.4896 23 3872.6179 3009.6640 24 2124.2352 3872.6179 25 4355.1884 2124.2352 26 4578.5737 4355.1884 27 5209.4111 4578.5737 28 4665.9884 5209.4111 29 -191.9936 4665.9884 30 2364.1651 -191.9936 31 276.0984 2364.1651 32 6079.3391 276.0984 33 2761.8714 6079.3391 34 1559.9303 2761.8714 35 145.3885 1559.9303 36 3245.3241 145.3885 37 2275.0311 3245.3241 38 -2056.8644 2275.0311 39 -1687.8424 -2056.8644 40 -4687.7675 -1687.8424 41 -14415.0005 -4687.7675 42 -10214.1576 -14415.0005 43 -11624.0845 -10214.1576 44 -8549.7302 -11624.0845 45 -6584.6776 -8549.7302 46 -8140.0696 -6584.6776 47 -4869.9685 -8140.0696 48 -4129.4965 -4869.9685 49 -4313.0123 -4129.4965 50 -8318.6039 -4313.0123 51 -6963.3280 -8318.6039 52 -13195.7413 -6963.3280 53 -15840.3613 -13195.7413 54 -11569.4362 -15840.3613 55 -13895.9092 -11569.4362 56 -7171.2809 -13895.9092 57 -3435.0111 -7171.2809 58 829.8462 -3435.0111 59 7628.4625 829.8462 60 14184.8019 7628.4625 61 17993.0422 14184.8019 62 23266.9289 17993.0422 63 24582.6681 23266.9289 64 21677.4018 24582.6681 65 21678.6896 21677.4018 66 25608.4300 21678.6896 > 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/722pc1259050672.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/835zp1259050672.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/9l6gx1259050672.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/107aqm1259050672.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/11dxok1259050672.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/12rpbw1259050672.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/13adgq1259050672.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/148maf1259050673.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/158joo1259050673.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/1664qy1259050673.tab") + } > system("convert tmp/1tmca1259050672.ps tmp/1tmca1259050672.png") > system("convert tmp/2wy1y1259050672.ps tmp/2wy1y1259050672.png") > system("convert tmp/3hvlj1259050672.ps tmp/3hvlj1259050672.png") > system("convert tmp/459h51259050672.ps tmp/459h51259050672.png") > system("convert tmp/5g2gk1259050672.ps tmp/5g2gk1259050672.png") > system("convert tmp/6lbn51259050672.ps tmp/6lbn51259050672.png") > system("convert tmp/722pc1259050672.ps tmp/722pc1259050672.png") > system("convert tmp/835zp1259050672.ps tmp/835zp1259050672.png") > system("convert tmp/9l6gx1259050672.ps tmp/9l6gx1259050672.png") > system("convert tmp/107aqm1259050672.ps tmp/107aqm1259050672.png") > > > proc.time() user system elapsed 2.498 1.545 3.291