R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(147768,0,137507,0,136919,0,136151,0,133001,0,125554,0,119647,0,114158,0,116193,0,152803,0,161761,0,160942,0,149470,0,139208,0,134588,0,130322,0,126611,0,122401,0,117352,0,112135,0,112879,0,148729,0,157230,0,157221,0,146681,0,136524,0,132111,1,125326,1,122716,1,116615,1,113719,1,110737,1,112093,1,143565,1,149946,1,149147,1,134339,1,122683,1,115614,1,116566,1,111272,1,104609,1,101802,1,94542,1,93051,1,124129,1,130374,1,123946,1,114971,1,105531,1,104919,0,104782,0,101281,0,94545,0,93248,0,84031,0,87486,0,115867,0,120327,0,117008,0,108811,0),dim=c(2,61),dimnames=list(c('jonger_dan_25','plan'),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('jonger_dan_25','plan'),1:61)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'No Linear Trend' > par2 = 'Include Monthly 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 jonger_dan_25 plan M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 1 147768 0 1 0 0 0 0 0 0 0 0 0 0 2 137507 0 0 1 0 0 0 0 0 0 0 0 0 3 136919 0 0 0 1 0 0 0 0 0 0 0 0 4 136151 0 0 0 0 1 0 0 0 0 0 0 0 5 133001 0 0 0 0 0 1 0 0 0 0 0 0 6 125554 0 0 0 0 0 0 1 0 0 0 0 0 7 119647 0 0 0 0 0 0 0 1 0 0 0 0 8 114158 0 0 0 0 0 0 0 0 1 0 0 0 9 116193 0 0 0 0 0 0 0 0 0 1 0 0 10 152803 0 0 0 0 0 0 0 0 0 0 1 0 11 161761 0 0 0 0 0 0 0 0 0 0 0 1 12 160942 0 0 0 0 0 0 0 0 0 0 0 0 13 149470 0 1 0 0 0 0 0 0 0 0 0 0 14 139208 0 0 1 0 0 0 0 0 0 0 0 0 15 134588 0 0 0 1 0 0 0 0 0 0 0 0 16 130322 0 0 0 0 1 0 0 0 0 0 0 0 17 126611 0 0 0 0 0 1 0 0 0 0 0 0 18 122401 0 0 0 0 0 0 1 0 0 0 0 0 19 117352 0 0 0 0 0 0 0 1 0 0 0 0 20 112135 0 0 0 0 0 0 0 0 1 0 0 0 21 112879 0 0 0 0 0 0 0 0 0 1 0 0 22 148729 0 0 0 0 0 0 0 0 0 0 1 0 23 157230 0 0 0 0 0 0 0 0 0 0 0 1 24 157221 0 0 0 0 0 0 0 0 0 0 0 0 25 146681 0 1 0 0 0 0 0 0 0 0 0 0 26 136524 0 0 1 0 0 0 0 0 0 0 0 0 27 132111 1 0 0 1 0 0 0 0 0 0 0 0 28 125326 1 0 0 0 1 0 0 0 0 0 0 0 29 122716 1 0 0 0 0 1 0 0 0 0 0 0 30 116615 1 0 0 0 0 0 1 0 0 0 0 0 31 113719 1 0 0 0 0 0 0 1 0 0 0 0 32 110737 1 0 0 0 0 0 0 0 1 0 0 0 33 112093 1 0 0 0 0 0 0 0 0 1 0 0 34 143565 1 0 0 0 0 0 0 0 0 0 1 0 35 149946 1 0 0 0 0 0 0 0 0 0 0 1 36 149147 1 0 0 0 0 0 0 0 0 0 0 0 37 134339 1 1 0 0 0 0 0 0 0 0 0 0 38 122683 1 0 1 0 0 0 0 0 0 0 0 0 39 115614 1 0 0 1 0 0 0 0 0 0 0 0 40 116566 1 0 0 0 1 0 0 0 0 0 0 0 41 111272 1 0 0 0 0 1 0 0 0 0 0 0 42 104609 1 0 0 0 0 0 1 0 0 0 0 0 43 101802 1 0 0 0 0 0 0 1 0 0 0 0 44 94542 1 0 0 0 0 0 0 0 1 0 0 0 45 93051 1 0 0 0 0 0 0 0 0 1 0 0 46 124129 1 0 0 0 0 0 0 0 0 0 1 0 47 130374 1 0 0 0 0 0 0 0 0 0 0 1 48 123946 1 0 0 0 0 0 0 0 0 0 0 0 49 114971 1 1 0 0 0 0 0 0 0 0 0 0 50 105531 1 0 1 0 0 0 0 0 0 0 0 0 51 104919 0 0 0 1 0 0 0 0 0 0 0 0 52 104782 0 0 0 0 1 0 0 0 0 0 0 0 53 101281 0 0 0 0 0 1 0 0 0 0 0 0 54 94545 0 0 0 0 0 0 1 0 0 0 0 0 55 93248 0 0 0 0 0 0 0 1 0 0 0 0 56 84031 0 0 0 0 0 0 0 0 1 0 0 0 57 87486 0 0 0 0 0 0 0 0 0 1 0 0 58 115867 0 0 0 0 0 0 0 0 0 0 1 0 59 120327 0 0 0 0 0 0 0 0 0 0 0 1 60 117008 0 0 0 0 0 0 0 0 0 0 0 0 61 108811 0 1 0 0 0 0 0 0 0 0 0 0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) plan M1 M2 M3 M4 144166 -6283 -8398 -13362 -16823 -19023 M5 M6 M7 M8 M9 M10 -22677 -28908 -32499 -38532 -37312 -4634 M11 2275 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -27158 -9120 6466 10296 16776 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 144166 6736 21.404 < 2e-16 *** plan -6283 3846 -1.634 0.108905 M1 -8398 8883 -0.945 0.349151 M2 -13362 9274 -1.441 0.156115 M3 -16823 9274 -1.814 0.075931 . M4 -19023 9274 -2.051 0.045715 * M5 -22677 9274 -2.445 0.018195 * M6 -28908 9274 -3.117 0.003082 ** M7 -32499 9274 -3.504 0.001002 ** M8 -38532 9274 -4.155 0.000133 *** M9 -37312 9274 -4.023 0.000202 *** M10 -4634 9274 -0.500 0.619561 M11 2275 9274 0.245 0.807274 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 14660 on 48 degrees of freedom Multiple R-squared: 0.529, Adjusted R-squared: 0.4113 F-statistic: 4.493 on 12 and 48 DF, p-value: 8.418e-05 > 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,] 8.820808e-03 1.764162e-02 0.991179192 [2,] 4.821471e-03 9.642942e-03 0.995178529 [3,] 1.276160e-03 2.552319e-03 0.998723840 [4,] 2.953851e-04 5.907703e-04 0.999704615 [5,] 6.735152e-05 1.347030e-04 0.999932648 [6,] 1.965268e-05 3.930536e-05 0.999980347 [7,] 8.576960e-06 1.715392e-05 0.999991423 [8,] 5.584605e-06 1.116921e-05 0.999994415 [9,] 4.976549e-06 9.953097e-06 0.999995023 [10,] 6.496484e-06 1.299297e-05 0.999993504 [11,] 2.220079e-05 4.440157e-05 0.999977799 [12,] 9.176985e-06 1.835397e-05 0.999990823 [13,] 4.160611e-06 8.321222e-06 0.999995839 [14,] 1.393503e-06 2.787006e-06 0.999998606 [15,] 4.792448e-07 9.584896e-07 0.999999521 [16,] 1.701474e-07 3.402947e-07 0.999999830 [17,] 1.695714e-07 3.391428e-07 0.999999830 [18,] 1.778958e-07 3.557916e-07 0.999999822 [19,] 2.759796e-07 5.519592e-07 0.999999724 [20,] 1.817431e-06 3.634861e-06 0.999998183 [21,] 2.739476e-04 5.478953e-04 0.999726052 [22,] 5.777240e-02 1.155448e-01 0.942227597 [23,] 9.890178e-01 2.196430e-02 0.010982150 [24,] 9.969167e-01 6.166686e-03 0.003083343 [25,] 9.981754e-01 3.649102e-03 0.001824551 [26,] 9.975661e-01 4.867786e-03 0.002433893 [27,] 9.966269e-01 6.746150e-03 0.003373075 [28,] 9.906744e-01 1.865124e-02 0.009325618 [29,] 9.900799e-01 1.984020e-02 0.009920101 [30,] 9.820555e-01 3.588905e-02 0.017944525 > postscript(file="/var/www/html/rcomp/tmp/1y0bx1229444277.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/21ml41229444277.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/3knm81229444277.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/43igy1229444277.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/56hc91229444277.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > qqline(mysum$resid) > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 61 Frequency = 1 1 2 3 4 5 6 7 12000.349 6703.218 9575.618 11008.418 11511.618 10296.018 7980.218 8 9 10 11 12 13 14 8524.218 9339.418 13271.218 15320.218 16776.018 13702.349 8404.218 15 16 17 18 19 20 21 7244.618 5179.418 5121.618 7143.018 5685.218 6501.218 6025.418 22 23 24 25 26 27 28 9197.218 10789.218 13055.018 10913.349 5720.218 11050.572 6466.372 29 30 31 32 33 34 35 7509.572 7639.972 8335.172 11386.172 11522.372 10316.172 9788.172 36 37 38 39 40 41 42 11263.972 4854.303 -1837.828 -5446.428 -2293.628 -3934.428 -4366.028 43 44 45 46 47 48 49 -3581.828 -4808.828 -7519.628 -9119.828 -9783.828 -13937.028 -14513.697 50 51 52 53 54 55 56 -18989.828 -22424.382 -20360.582 -20208.382 -20712.982 -18418.782 -21602.782 57 58 59 60 61 -19367.582 -23664.782 -26113.782 -27157.982 -26956.651 > postscript(file="/var/www/html/rcomp/tmp/63eki1229444277.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 61 Frequency = 1 lag(myerror, k = 1) myerror 0 12000.349 NA 1 6703.218 12000.349 2 9575.618 6703.218 3 11008.418 9575.618 4 11511.618 11008.418 5 10296.018 11511.618 6 7980.218 10296.018 7 8524.218 7980.218 8 9339.418 8524.218 9 13271.218 9339.418 10 15320.218 13271.218 11 16776.018 15320.218 12 13702.349 16776.018 13 8404.218 13702.349 14 7244.618 8404.218 15 5179.418 7244.618 16 5121.618 5179.418 17 7143.018 5121.618 18 5685.218 7143.018 19 6501.218 5685.218 20 6025.418 6501.218 21 9197.218 6025.418 22 10789.218 9197.218 23 13055.018 10789.218 24 10913.349 13055.018 25 5720.218 10913.349 26 11050.572 5720.218 27 6466.372 11050.572 28 7509.572 6466.372 29 7639.972 7509.572 30 8335.172 7639.972 31 11386.172 8335.172 32 11522.372 11386.172 33 10316.172 11522.372 34 9788.172 10316.172 35 11263.972 9788.172 36 4854.303 11263.972 37 -1837.828 4854.303 38 -5446.428 -1837.828 39 -2293.628 -5446.428 40 -3934.428 -2293.628 41 -4366.028 -3934.428 42 -3581.828 -4366.028 43 -4808.828 -3581.828 44 -7519.628 -4808.828 45 -9119.828 -7519.628 46 -9783.828 -9119.828 47 -13937.028 -9783.828 48 -14513.697 -13937.028 49 -18989.828 -14513.697 50 -22424.382 -18989.828 51 -20360.582 -22424.382 52 -20208.382 -20360.582 53 -20712.982 -20208.382 54 -18418.782 -20712.982 55 -21602.782 -18418.782 56 -19367.582 -21602.782 57 -23664.782 -19367.582 58 -26113.782 -23664.782 59 -27157.982 -26113.782 60 -26956.651 -27157.982 61 NA -26956.651 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 6703.218 12000.349 [2,] 9575.618 6703.218 [3,] 11008.418 9575.618 [4,] 11511.618 11008.418 [5,] 10296.018 11511.618 [6,] 7980.218 10296.018 [7,] 8524.218 7980.218 [8,] 9339.418 8524.218 [9,] 13271.218 9339.418 [10,] 15320.218 13271.218 [11,] 16776.018 15320.218 [12,] 13702.349 16776.018 [13,] 8404.218 13702.349 [14,] 7244.618 8404.218 [15,] 5179.418 7244.618 [16,] 5121.618 5179.418 [17,] 7143.018 5121.618 [18,] 5685.218 7143.018 [19,] 6501.218 5685.218 [20,] 6025.418 6501.218 [21,] 9197.218 6025.418 [22,] 10789.218 9197.218 [23,] 13055.018 10789.218 [24,] 10913.349 13055.018 [25,] 5720.218 10913.349 [26,] 11050.572 5720.218 [27,] 6466.372 11050.572 [28,] 7509.572 6466.372 [29,] 7639.972 7509.572 [30,] 8335.172 7639.972 [31,] 11386.172 8335.172 [32,] 11522.372 11386.172 [33,] 10316.172 11522.372 [34,] 9788.172 10316.172 [35,] 11263.972 9788.172 [36,] 4854.303 11263.972 [37,] -1837.828 4854.303 [38,] -5446.428 -1837.828 [39,] -2293.628 -5446.428 [40,] -3934.428 -2293.628 [41,] -4366.028 -3934.428 [42,] -3581.828 -4366.028 [43,] -4808.828 -3581.828 [44,] -7519.628 -4808.828 [45,] -9119.828 -7519.628 [46,] -9783.828 -9119.828 [47,] -13937.028 -9783.828 [48,] -14513.697 -13937.028 [49,] -18989.828 -14513.697 [50,] -22424.382 -18989.828 [51,] -20360.582 -22424.382 [52,] -20208.382 -20360.582 [53,] -20712.982 -20208.382 [54,] -18418.782 -20712.982 [55,] -21602.782 -18418.782 [56,] -19367.582 -21602.782 [57,] -23664.782 -19367.582 [58,] -26113.782 -23664.782 [59,] -27157.982 -26113.782 [60,] -26956.651 -27157.982 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 6703.218 12000.349 2 9575.618 6703.218 3 11008.418 9575.618 4 11511.618 11008.418 5 10296.018 11511.618 6 7980.218 10296.018 7 8524.218 7980.218 8 9339.418 8524.218 9 13271.218 9339.418 10 15320.218 13271.218 11 16776.018 15320.218 12 13702.349 16776.018 13 8404.218 13702.349 14 7244.618 8404.218 15 5179.418 7244.618 16 5121.618 5179.418 17 7143.018 5121.618 18 5685.218 7143.018 19 6501.218 5685.218 20 6025.418 6501.218 21 9197.218 6025.418 22 10789.218 9197.218 23 13055.018 10789.218 24 10913.349 13055.018 25 5720.218 10913.349 26 11050.572 5720.218 27 6466.372 11050.572 28 7509.572 6466.372 29 7639.972 7509.572 30 8335.172 7639.972 31 11386.172 8335.172 32 11522.372 11386.172 33 10316.172 11522.372 34 9788.172 10316.172 35 11263.972 9788.172 36 4854.303 11263.972 37 -1837.828 4854.303 38 -5446.428 -1837.828 39 -2293.628 -5446.428 40 -3934.428 -2293.628 41 -4366.028 -3934.428 42 -3581.828 -4366.028 43 -4808.828 -3581.828 44 -7519.628 -4808.828 45 -9119.828 -7519.628 46 -9783.828 -9119.828 47 -13937.028 -9783.828 48 -14513.697 -13937.028 49 -18989.828 -14513.697 50 -22424.382 -18989.828 51 -20360.582 -22424.382 52 -20208.382 -20360.582 53 -20712.982 -20208.382 54 -18418.782 -20712.982 55 -21602.782 -18418.782 56 -19367.582 -21602.782 57 -23664.782 -19367.582 58 -26113.782 -23664.782 59 -27157.982 -26113.782 60 -26956.651 -27157.982 > 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/75nsz1229444277.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/8b7qb1229444277.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/92s8a1229444277.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/103q7x1229444277.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/1148fe1229444277.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/12va1v1229444277.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/13zanv1229444277.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/14kwn11229444277.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/15rize1229444277.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/16bn9k1229444277.tab") + } > system("convert tmp/1y0bx1229444277.ps tmp/1y0bx1229444277.png") > system("convert tmp/21ml41229444277.ps tmp/21ml41229444277.png") > system("convert tmp/3knm81229444277.ps tmp/3knm81229444277.png") > system("convert tmp/43igy1229444277.ps tmp/43igy1229444277.png") > system("convert tmp/56hc91229444277.ps tmp/56hc91229444277.png") > system("convert tmp/63eki1229444277.ps tmp/63eki1229444277.png") > system("convert tmp/75nsz1229444277.ps tmp/75nsz1229444277.png") > system("convert tmp/8b7qb1229444277.ps tmp/8b7qb1229444277.png") > system("convert tmp/92s8a1229444277.ps tmp/92s8a1229444277.png") > system("convert tmp/103q7x1229444277.ps tmp/103q7x1229444277.png") > > > proc.time() user system elapsed 2.385 1.544 2.856