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(1280 + ,1024 + ,1024 + ,768 + ,1120 + ,700 + ,1024 + ,768 + ,1280 + ,800 + ,1280 + ,1024 + ,1280 + ,800 + ,1024 + ,768 + ,1280 + ,800 + ,1280 + ,1024 + ,1280 + ,800 + ,1280 + ,800 + ,1280 + ,1024 + ,1688 + ,949 + ,1440 + ,900 + ,1600 + ,1200 + ,1280 + ,800 + ,1280 + ,800 + ,1280 + ,768 + ,1176 + ,735 + ,1280 + ,800 + ,1503 + ,845 + ,1440 + ,900 + ,1366 + ,768 + ,1280 + ,768 + ,1024 + ,768 + ,1280 + ,800 + ,2560 + ,1440 + ,1280 + ,768 + ,1024 + ,768 + ,1280 + ,1024 + ,1280 + ,800 + ,1440 + ,900 + ,1280 + ,800 + ,1440 + ,900 + ,1024 + ,768 + ,1440 + ,900 + ,1143 + ,857 + ,1280 + ,800 + ,1440 + ,900 + ,1280 + ,800 + ,1366 + ,768 + ,1024 + ,768 + ,1408 + ,880 + ,1366 + ,768 + ,1176 + ,735 + ,1920 + ,1200 + ,1257 + ,785 + ,1280 + ,800 + ,1280 + ,800 + ,1440 + ,900 + ,1680 + ,1050 + ,1440 + ,900 + ,1024 + ,768 + ,1140 + ,641 + ,1280 + ,1024 + ,1280 + ,800 + ,1280 + ,800 + ,1280 + ,800 + ,1280 + ,800 + ,1440 + ,900 + ,1280 + ,800 + ,1152 + ,864 + ,1280 + ,1024 + ,1280 + ,800 + ,1440 + ,900 + ,1280 + ,800 + ,1280 + ,1024 + ,1440 + ,900 + ,1280 + ,800 + ,1280 + ,800 + ,1440 + ,900 + ,1280 + ,800 + ,1280 + ,1024 + ,1600 + ,900 + ,1024 + ,768 + ,1366 + ,768 + ,1280 + ,800 + ,1280 + ,800 + ,1440 + ,900 + ,1366 + ,768 + ,1280 + ,800 + ,1024 + ,768 + ,1280 + ,800 + ,1440 + ,900 + ,1280 + ,800 + ,1280 + ,800 + ,1408 + ,880 + ,1280 + ,800 + ,1600 + ,900 + ,1600 + ,900 + ,1680 + ,1050 + ,1440 + ,900 + ,1440 + ,900 + ,917 + ,550 + ,1280 + ,800 + ,1760 + ,990 + ,1280 + ,800 + ,1280 + ,800 + ,1280 + ,800 + ,1024 + ,768 + ,1366 + ,768 + ,1440 + ,900 + ,1280 + ,800 + ,1280 + ,1024 + ,1920 + ,1080 + ,1024 + ,768 + ,1024 + ,768 + ,1600 + ,900 + ,1117 + ,698 + ,1440 + ,900 + ,983 + ,737 + ,1024 + ,768 + ,1024 + ,640 + ,1280 + ,800 + ,1440 + ,900 + ,1280 + ,800 + ,1280 + ,800 + ,1280 + ,800 + ,1440 + ,900 + ,1280 + ,800 + ,1024 + ,768 + ,1024 + ,768 + ,1152 + ,864 + ,1280 + ,768 + ,1024 + ,768 + ,1366 + ,768 + ,1680 + ,1050 + ,1680 + ,1050 + ,1280 + ,800 + ,1366 + ,768 + ,1024 + ,768 + ,1440 + ,900 + ,1024 + ,768 + ,1280 + ,800 + ,1280 + ,800 + ,1280 + ,800 + ,1024 + ,768 + ,1280 + ,800) + ,dim=c(2 + ,139) + ,dimnames=list(c('br' + ,'gr') + ,1:139)) > y <- array(NA,dim=c(2,139),dimnames=list(c('br','gr'),1:139)) > 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 br gr 1 1280 1024 2 1024 768 3 1120 700 4 1024 768 5 1280 800 6 1280 1024 7 1280 800 8 1024 768 9 1280 800 10 1280 1024 11 1280 800 12 1280 800 13 1280 1024 14 1688 949 15 1440 900 16 1600 1200 17 1280 800 18 1280 800 19 1280 768 20 1176 735 21 1280 800 22 1503 845 23 1440 900 24 1366 768 25 1280 768 26 1024 768 27 1280 800 28 2560 1440 29 1280 768 30 1024 768 31 1280 1024 32 1280 800 33 1440 900 34 1280 800 35 1440 900 36 1024 768 37 1440 900 38 1143 857 39 1280 800 40 1440 900 41 1280 800 42 1366 768 43 1024 768 44 1408 880 45 1366 768 46 1176 735 47 1920 1200 48 1257 785 49 1280 800 50 1280 800 51 1440 900 52 1680 1050 53 1440 900 54 1024 768 55 1140 641 56 1280 1024 57 1280 800 58 1280 800 59 1280 800 60 1280 800 61 1440 900 62 1280 800 63 1152 864 64 1280 1024 65 1280 800 66 1440 900 67 1280 800 68 1280 1024 69 1440 900 70 1280 800 71 1280 800 72 1440 900 73 1280 800 74 1280 1024 75 1600 900 76 1024 768 77 1366 768 78 1280 800 79 1280 800 80 1440 900 81 1366 768 82 1280 800 83 1024 768 84 1280 800 85 1440 900 86 1280 800 87 1280 800 88 1408 880 89 1280 800 90 1600 900 91 1600 900 92 1680 1050 93 1440 900 94 1440 900 95 917 550 96 1280 800 97 1760 990 98 1280 800 99 1280 800 100 1280 800 101 1024 768 102 1366 768 103 1440 900 104 1280 800 105 1280 1024 106 1920 1080 107 1024 768 108 1024 768 109 1600 900 110 1117 698 111 1440 900 112 983 737 113 1024 768 114 1024 640 115 1280 800 116 1440 900 117 1280 800 118 1280 800 119 1280 800 120 1440 900 121 1280 800 122 1024 768 123 1024 768 124 1152 864 125 1280 768 126 1024 768 127 1366 768 128 1680 1050 129 1680 1050 130 1280 800 131 1366 768 132 1024 768 133 1440 900 134 1024 768 135 1280 800 136 1280 800 137 1280 800 138 1024 768 139 1280 800 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) gr 94.974 1.438 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -287.22 -81.36 34.83 51.06 394.68 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 94.9736 87.4092 1.087 0.279 gr 1.4377 0.1026 14.016 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 137.6 on 137 degrees of freedom Multiple R-squared: 0.5891, Adjusted R-squared: 0.5861 F-statistic: 196.5 on 1 and 137 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,] 0.4557547 9.115094e-01 5.442453e-01 [2,] 0.3029019 6.058038e-01 6.970981e-01 [3,] 0.3216282 6.432563e-01 6.783718e-01 [4,] 0.2964047 5.928095e-01 7.035953e-01 [5,] 0.3017735 6.035470e-01 6.982265e-01 [6,] 0.2291586 4.583172e-01 7.708414e-01 [7,] 0.2203740 4.407480e-01 7.796260e-01 [8,] 0.1991244 3.982488e-01 8.008756e-01 [9,] 0.1577499 3.154998e-01 8.422501e-01 [10,] 0.7983901 4.032197e-01 2.016099e-01 [11,] 0.8070886 3.858227e-01 1.929114e-01 [12,] 0.7906977 4.186046e-01 2.093023e-01 [13,] 0.7454619 5.090762e-01 2.545381e-01 [14,] 0.6947468 6.105064e-01 3.052532e-01 [15,] 0.6540091 6.919818e-01 3.459909e-01 [16,] 0.5852152 8.295695e-01 4.147848e-01 [17,] 0.5252869 9.494262e-01 4.747131e-01 [18,] 0.6542358 6.915284e-01 3.457642e-01 [19,] 0.6344298 7.311403e-01 3.655702e-01 [20,] 0.6470510 7.058980e-01 3.529490e-01 [21,] 0.5966867 8.066266e-01 4.033133e-01 [22,] 0.6634263 6.731473e-01 3.365737e-01 [23,] 0.6080693 7.838613e-01 3.919307e-01 [24,] 0.9863930 2.721404e-02 1.360702e-02 [25,] 0.9828154 3.436929e-02 1.718464e-02 [26,] 0.9842470 3.150598e-02 1.575299e-02 [27,] 0.9937375 1.252495e-02 6.262475e-03 [28,] 0.9911647 1.767067e-02 8.835337e-03 [29,] 0.9881320 2.373597e-02 1.186799e-02 [30,] 0.9837010 3.259803e-02 1.629901e-02 [31,] 0.9785974 4.280527e-02 2.140263e-02 [32,] 0.9805869 3.882616e-02 1.941308e-02 [33,] 0.9748409 5.031816e-02 2.515908e-02 [34,] 0.9781546 4.369077e-02 2.184538e-02 [35,] 0.9712113 5.757735e-02 2.878868e-02 [36,] 0.9634808 7.303831e-02 3.651915e-02 [37,] 0.9529693 9.406134e-02 4.703067e-02 [38,] 0.9589187 8.216252e-02 4.108126e-02 [39,] 0.9632260 7.354809e-02 3.677405e-02 [40,] 0.9536085 9.278303e-02 4.639152e-02 [41,] 0.9592348 8.153038e-02 4.076519e-02 [42,] 0.9472460 1.055080e-01 5.275398e-02 [43,] 0.9409790 1.180420e-01 5.902100e-02 [44,] 0.9257486 1.485029e-01 7.425145e-02 [45,] 0.9078170 1.843661e-01 9.218304e-02 [46,] 0.8868885 2.262230e-01 1.131115e-01 [47,] 0.8648432 2.703137e-01 1.351568e-01 [48,] 0.8447342 3.105315e-01 1.552658e-01 [49,] 0.8175778 3.648445e-01 1.824222e-01 [50,] 0.8341112 3.317777e-01 1.658888e-01 [51,] 0.8281619 3.436763e-01 1.718381e-01 [52,] 0.9112456 1.775088e-01 8.875440e-02 [53,] 0.8912879 2.174242e-01 1.087121e-01 [54,] 0.8683008 2.633984e-01 1.316992e-01 [55,] 0.8421739 3.156523e-01 1.578261e-01 [56,] 0.8128695 3.742609e-01 1.871305e-01 [57,] 0.7829360 4.341280e-01 2.170640e-01 [58,] 0.7477031 5.045938e-01 2.522969e-01 [59,] 0.7774954 4.450092e-01 2.225046e-01 [60,] 0.8863036 2.273928e-01 1.136964e-01 [61,] 0.8628055 2.743890e-01 1.371945e-01 [62,] 0.8380973 3.238054e-01 1.619027e-01 [63,] 0.8085009 3.829983e-01 1.914991e-01 [64,] 0.9164121 1.671758e-01 8.358789e-02 [65,] 0.8986737 2.026525e-01 1.013263e-01 [66,] 0.8768692 2.462617e-01 1.231308e-01 [67,] 0.8519474 2.961052e-01 1.480526e-01 [68,] 0.8255060 3.489880e-01 1.744940e-01 [69,] 0.7943368 4.113264e-01 2.056632e-01 [70,] 0.9253010 1.493979e-01 7.469896e-02 [71,] 0.9427944 1.144112e-01 5.720559e-02 [72,] 0.9516867 9.662665e-02 4.831333e-02 [73,] 0.9597911 8.041777e-02 4.020889e-02 [74,] 0.9486184 1.027632e-01 5.138160e-02 [75,] 0.9350854 1.298292e-01 6.491462e-02 [76,] 0.9194097 1.611806e-01 8.059031e-02 [77,] 0.9324723 1.350553e-01 6.752766e-02 [78,] 0.9158201 1.683598e-01 8.417989e-02 [79,] 0.9274635 1.450729e-01 7.253645e-02 [80,] 0.9096751 1.806498e-01 9.032491e-02 [81,] 0.8891414 2.217171e-01 1.108586e-01 [82,] 0.8649681 2.700638e-01 1.350319e-01 [83,] 0.8373541 3.252917e-01 1.626459e-01 [84,] 0.8062267 3.875467e-01 1.937733e-01 [85,] 0.7716026 4.567949e-01 2.283974e-01 [86,] 0.8103842 3.792316e-01 1.896158e-01 [87,] 0.8464621 3.070758e-01 1.535379e-01 [88,] 0.8193651 3.612698e-01 1.806349e-01 [89,] 0.7852102 4.295797e-01 2.147898e-01 [90,] 0.7473816 5.052368e-01 2.526184e-01 [91,] 0.7420761 5.158479e-01 2.579239e-01 [92,] 0.7020790 5.958419e-01 2.979210e-01 [93,] 0.7569671 4.860658e-01 2.430329e-01 [94,] 0.7181309 5.637382e-01 2.818691e-01 [95,] 0.6765437 6.469125e-01 3.234563e-01 [96,] 0.6326527 7.346945e-01 3.673473e-01 [97,] 0.6487613 7.024774e-01 3.512387e-01 [98,] 0.6993522 6.012955e-01 3.006478e-01 [99,] 0.6525449 6.949103e-01 3.474551e-01 [100,] 0.6072453 7.855095e-01 3.927547e-01 [101,] 0.8907818 2.184365e-01 1.092182e-01 [102,] 0.9103769 1.792462e-01 8.962310e-02 [103,] 0.9180747 1.638507e-01 8.192535e-02 [104,] 0.9269586 1.460827e-01 7.304137e-02 [105,] 0.9501573 9.968535e-02 4.984268e-02 [106,] 0.9386057 1.227886e-01 6.139431e-02 [107,] 0.9179885 1.640231e-01 8.201155e-02 [108,] 0.9210765 1.578471e-01 7.892355e-02 [109,] 0.9322063 1.355874e-01 6.779369e-02 [110,] 0.9172014 1.655972e-01 8.279859e-02 [111,] 0.8924507 2.150985e-01 1.075493e-01 [112,] 0.8584041 2.831917e-01 1.415959e-01 [113,] 0.8223557 3.552887e-01 1.776443e-01 [114,] 0.7810157 4.379686e-01 2.189843e-01 [115,] 0.7347335 5.305330e-01 2.652665e-01 [116,] 0.6749479 6.501042e-01 3.250521e-01 [117,] 0.6194089 7.611822e-01 3.805911e-01 [118,] 0.6231858 7.536285e-01 3.768142e-01 [119,] 0.6384881 7.230239e-01 3.615119e-01 [120,] 0.7297615 5.404770e-01 2.702385e-01 [121,] 0.6974422 6.051157e-01 3.025578e-01 [122,] 0.7360958 5.278084e-01 2.639042e-01 [123,] 0.8180103 3.639794e-01 1.819897e-01 [124,] 0.7459597 5.080805e-01 2.540403e-01 [125,] 0.6943094 6.113811e-01 3.056906e-01 [126,] 0.6011058 7.977883e-01 3.988942e-01 [127,] 0.8676800 2.646401e-01 1.323200e-01 [128,] 0.8366493 3.267014e-01 1.633507e-01 [129,] 1.0000000 2.026662e-59 1.013331e-59 [130,] 1.0000000 8.674904e-42 4.337452e-42 > postscript(file="/var/www/html/rcomp/tmp/1daka1292348177.ps",horizontal=F,onefile=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/2daka1292348177.ps",horizontal=F,onefile=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/36kjv1292348177.ps",horizontal=F,onefile=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/46kjv1292348177.ps",horizontal=F,onefile=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/56kjv1292348177.ps",horizontal=F,onefile=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 = 139 Frequency = 1 1 2 3 4 5 6 -287.220415 -175.158722 18.607665 -175.158722 34.833567 -287.220415 7 8 9 10 11 12 34.833567 -175.158722 34.833567 -287.220415 34.833567 34.833567 13 14 15 16 17 18 -287.220415 228.610159 51.059468 -220.262828 34.833567 34.833567 19 20 21 22 23 24 80.841278 24.286731 34.833567 193.135222 51.059468 166.841278 25 26 27 28 29 30 80.841278 -175.158722 34.833567 394.679335 80.841278 -175.158722 31 32 33 34 35 36 -287.220415 34.833567 51.059468 34.833567 51.059468 -175.158722 37 38 39 40 41 42 51.059468 -184.117670 34.833567 51.059468 34.833567 166.841278 43 44 45 46 47 48 -175.158722 47.814288 166.841278 24.286731 99.737172 33.399681 49 50 51 52 53 54 34.833567 34.833567 51.059468 75.398320 51.059468 -175.158722 55 56 57 58 59 60 123.434383 -287.220415 34.833567 34.833567 34.833567 34.833567 61 62 63 64 65 66 51.059468 34.833567 -185.181857 -287.220415 34.833567 51.059468 67 68 69 70 71 72 34.833567 -287.220415 51.059468 34.833567 34.833567 51.059468 73 74 75 76 77 78 34.833567 -287.220415 211.059468 -175.158722 166.841278 34.833567 79 80 81 82 83 84 34.833567 51.059468 166.841278 34.833567 -175.158722 34.833567 85 86 87 88 89 90 51.059468 34.833567 34.833567 47.814288 34.833567 211.059468 91 92 93 94 95 96 211.059468 75.398320 51.059468 51.059468 31.268813 34.833567 97 98 99 100 101 102 241.662779 34.833567 34.833567 34.833567 -175.158722 166.841278 103 104 105 106 107 108 51.059468 34.833567 -287.220415 272.266090 -175.158722 -175.158722 109 110 111 112 113 114 211.059468 18.483147 51.059468 -171.588751 -175.158722 8.872124 115 116 117 118 119 120 34.833567 51.059468 34.833567 34.833567 34.833567 51.059468 121 122 123 124 125 126 34.833567 -175.158722 -175.158722 -185.181857 80.841278 -175.158722 127 128 129 130 131 132 166.841278 75.398320 75.398320 34.833567 166.841278 -175.158722 133 134 135 136 137 138 51.059468 -175.158722 34.833567 34.833567 34.833567 -175.158722 139 34.833567 > postscript(file="/var/www/html/rcomp/tmp/6hbig1292348177.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 139 Frequency = 1 lag(myerror, k = 1) myerror 0 -287.220415 NA 1 -175.158722 -287.220415 2 18.607665 -175.158722 3 -175.158722 18.607665 4 34.833567 -175.158722 5 -287.220415 34.833567 6 34.833567 -287.220415 7 -175.158722 34.833567 8 34.833567 -175.158722 9 -287.220415 34.833567 10 34.833567 -287.220415 11 34.833567 34.833567 12 -287.220415 34.833567 13 228.610159 -287.220415 14 51.059468 228.610159 15 -220.262828 51.059468 16 34.833567 -220.262828 17 34.833567 34.833567 18 80.841278 34.833567 19 24.286731 80.841278 20 34.833567 24.286731 21 193.135222 34.833567 22 51.059468 193.135222 23 166.841278 51.059468 24 80.841278 166.841278 25 -175.158722 80.841278 26 34.833567 -175.158722 27 394.679335 34.833567 28 80.841278 394.679335 29 -175.158722 80.841278 30 -287.220415 -175.158722 31 34.833567 -287.220415 32 51.059468 34.833567 33 34.833567 51.059468 34 51.059468 34.833567 35 -175.158722 51.059468 36 51.059468 -175.158722 37 -184.117670 51.059468 38 34.833567 -184.117670 39 51.059468 34.833567 40 34.833567 51.059468 41 166.841278 34.833567 42 -175.158722 166.841278 43 47.814288 -175.158722 44 166.841278 47.814288 45 24.286731 166.841278 46 99.737172 24.286731 47 33.399681 99.737172 48 34.833567 33.399681 49 34.833567 34.833567 50 51.059468 34.833567 51 75.398320 51.059468 52 51.059468 75.398320 53 -175.158722 51.059468 54 123.434383 -175.158722 55 -287.220415 123.434383 56 34.833567 -287.220415 57 34.833567 34.833567 58 34.833567 34.833567 59 34.833567 34.833567 60 51.059468 34.833567 61 34.833567 51.059468 62 -185.181857 34.833567 63 -287.220415 -185.181857 64 34.833567 -287.220415 65 51.059468 34.833567 66 34.833567 51.059468 67 -287.220415 34.833567 68 51.059468 -287.220415 69 34.833567 51.059468 70 34.833567 34.833567 71 51.059468 34.833567 72 34.833567 51.059468 73 -287.220415 34.833567 74 211.059468 -287.220415 75 -175.158722 211.059468 76 166.841278 -175.158722 77 34.833567 166.841278 78 34.833567 34.833567 79 51.059468 34.833567 80 166.841278 51.059468 81 34.833567 166.841278 82 -175.158722 34.833567 83 34.833567 -175.158722 84 51.059468 34.833567 85 34.833567 51.059468 86 34.833567 34.833567 87 47.814288 34.833567 88 34.833567 47.814288 89 211.059468 34.833567 90 211.059468 211.059468 91 75.398320 211.059468 92 51.059468 75.398320 93 51.059468 51.059468 94 31.268813 51.059468 95 34.833567 31.268813 96 241.662779 34.833567 97 34.833567 241.662779 98 34.833567 34.833567 99 34.833567 34.833567 100 -175.158722 34.833567 101 166.841278 -175.158722 102 51.059468 166.841278 103 34.833567 51.059468 104 -287.220415 34.833567 105 272.266090 -287.220415 106 -175.158722 272.266090 107 -175.158722 -175.158722 108 211.059468 -175.158722 109 18.483147 211.059468 110 51.059468 18.483147 111 -171.588751 51.059468 112 -175.158722 -171.588751 113 8.872124 -175.158722 114 34.833567 8.872124 115 51.059468 34.833567 116 34.833567 51.059468 117 34.833567 34.833567 118 34.833567 34.833567 119 51.059468 34.833567 120 34.833567 51.059468 121 -175.158722 34.833567 122 -175.158722 -175.158722 123 -185.181857 -175.158722 124 80.841278 -185.181857 125 -175.158722 80.841278 126 166.841278 -175.158722 127 75.398320 166.841278 128 75.398320 75.398320 129 34.833567 75.398320 130 166.841278 34.833567 131 -175.158722 166.841278 132 51.059468 -175.158722 133 -175.158722 51.059468 134 34.833567 -175.158722 135 34.833567 34.833567 136 34.833567 34.833567 137 -175.158722 34.833567 138 34.833567 -175.158722 139 NA 34.833567 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -175.158722 -287.220415 [2,] 18.607665 -175.158722 [3,] -175.158722 18.607665 [4,] 34.833567 -175.158722 [5,] -287.220415 34.833567 [6,] 34.833567 -287.220415 [7,] -175.158722 34.833567 [8,] 34.833567 -175.158722 [9,] -287.220415 34.833567 [10,] 34.833567 -287.220415 [11,] 34.833567 34.833567 [12,] -287.220415 34.833567 [13,] 228.610159 -287.220415 [14,] 51.059468 228.610159 [15,] -220.262828 51.059468 [16,] 34.833567 -220.262828 [17,] 34.833567 34.833567 [18,] 80.841278 34.833567 [19,] 24.286731 80.841278 [20,] 34.833567 24.286731 [21,] 193.135222 34.833567 [22,] 51.059468 193.135222 [23,] 166.841278 51.059468 [24,] 80.841278 166.841278 [25,] -175.158722 80.841278 [26,] 34.833567 -175.158722 [27,] 394.679335 34.833567 [28,] 80.841278 394.679335 [29,] -175.158722 80.841278 [30,] -287.220415 -175.158722 [31,] 34.833567 -287.220415 [32,] 51.059468 34.833567 [33,] 34.833567 51.059468 [34,] 51.059468 34.833567 [35,] -175.158722 51.059468 [36,] 51.059468 -175.158722 [37,] -184.117670 51.059468 [38,] 34.833567 -184.117670 [39,] 51.059468 34.833567 [40,] 34.833567 51.059468 [41,] 166.841278 34.833567 [42,] -175.158722 166.841278 [43,] 47.814288 -175.158722 [44,] 166.841278 47.814288 [45,] 24.286731 166.841278 [46,] 99.737172 24.286731 [47,] 33.399681 99.737172 [48,] 34.833567 33.399681 [49,] 34.833567 34.833567 [50,] 51.059468 34.833567 [51,] 75.398320 51.059468 [52,] 51.059468 75.398320 [53,] -175.158722 51.059468 [54,] 123.434383 -175.158722 [55,] -287.220415 123.434383 [56,] 34.833567 -287.220415 [57,] 34.833567 34.833567 [58,] 34.833567 34.833567 [59,] 34.833567 34.833567 [60,] 51.059468 34.833567 [61,] 34.833567 51.059468 [62,] -185.181857 34.833567 [63,] -287.220415 -185.181857 [64,] 34.833567 -287.220415 [65,] 51.059468 34.833567 [66,] 34.833567 51.059468 [67,] -287.220415 34.833567 [68,] 51.059468 -287.220415 [69,] 34.833567 51.059468 [70,] 34.833567 34.833567 [71,] 51.059468 34.833567 [72,] 34.833567 51.059468 [73,] -287.220415 34.833567 [74,] 211.059468 -287.220415 [75,] -175.158722 211.059468 [76,] 166.841278 -175.158722 [77,] 34.833567 166.841278 [78,] 34.833567 34.833567 [79,] 51.059468 34.833567 [80,] 166.841278 51.059468 [81,] 34.833567 166.841278 [82,] -175.158722 34.833567 [83,] 34.833567 -175.158722 [84,] 51.059468 34.833567 [85,] 34.833567 51.059468 [86,] 34.833567 34.833567 [87,] 47.814288 34.833567 [88,] 34.833567 47.814288 [89,] 211.059468 34.833567 [90,] 211.059468 211.059468 [91,] 75.398320 211.059468 [92,] 51.059468 75.398320 [93,] 51.059468 51.059468 [94,] 31.268813 51.059468 [95,] 34.833567 31.268813 [96,] 241.662779 34.833567 [97,] 34.833567 241.662779 [98,] 34.833567 34.833567 [99,] 34.833567 34.833567 [100,] -175.158722 34.833567 [101,] 166.841278 -175.158722 [102,] 51.059468 166.841278 [103,] 34.833567 51.059468 [104,] -287.220415 34.833567 [105,] 272.266090 -287.220415 [106,] -175.158722 272.266090 [107,] -175.158722 -175.158722 [108,] 211.059468 -175.158722 [109,] 18.483147 211.059468 [110,] 51.059468 18.483147 [111,] -171.588751 51.059468 [112,] -175.158722 -171.588751 [113,] 8.872124 -175.158722 [114,] 34.833567 8.872124 [115,] 51.059468 34.833567 [116,] 34.833567 51.059468 [117,] 34.833567 34.833567 [118,] 34.833567 34.833567 [119,] 51.059468 34.833567 [120,] 34.833567 51.059468 [121,] -175.158722 34.833567 [122,] -175.158722 -175.158722 [123,] -185.181857 -175.158722 [124,] 80.841278 -185.181857 [125,] -175.158722 80.841278 [126,] 166.841278 -175.158722 [127,] 75.398320 166.841278 [128,] 75.398320 75.398320 [129,] 34.833567 75.398320 [130,] 166.841278 34.833567 [131,] -175.158722 166.841278 [132,] 51.059468 -175.158722 [133,] -175.158722 51.059468 [134,] 34.833567 -175.158722 [135,] 34.833567 34.833567 [136,] 34.833567 34.833567 [137,] -175.158722 34.833567 [138,] 34.833567 -175.158722 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -175.158722 -287.220415 2 18.607665 -175.158722 3 -175.158722 18.607665 4 34.833567 -175.158722 5 -287.220415 34.833567 6 34.833567 -287.220415 7 -175.158722 34.833567 8 34.833567 -175.158722 9 -287.220415 34.833567 10 34.833567 -287.220415 11 34.833567 34.833567 12 -287.220415 34.833567 13 228.610159 -287.220415 14 51.059468 228.610159 15 -220.262828 51.059468 16 34.833567 -220.262828 17 34.833567 34.833567 18 80.841278 34.833567 19 24.286731 80.841278 20 34.833567 24.286731 21 193.135222 34.833567 22 51.059468 193.135222 23 166.841278 51.059468 24 80.841278 166.841278 25 -175.158722 80.841278 26 34.833567 -175.158722 27 394.679335 34.833567 28 80.841278 394.679335 29 -175.158722 80.841278 30 -287.220415 -175.158722 31 34.833567 -287.220415 32 51.059468 34.833567 33 34.833567 51.059468 34 51.059468 34.833567 35 -175.158722 51.059468 36 51.059468 -175.158722 37 -184.117670 51.059468 38 34.833567 -184.117670 39 51.059468 34.833567 40 34.833567 51.059468 41 166.841278 34.833567 42 -175.158722 166.841278 43 47.814288 -175.158722 44 166.841278 47.814288 45 24.286731 166.841278 46 99.737172 24.286731 47 33.399681 99.737172 48 34.833567 33.399681 49 34.833567 34.833567 50 51.059468 34.833567 51 75.398320 51.059468 52 51.059468 75.398320 53 -175.158722 51.059468 54 123.434383 -175.158722 55 -287.220415 123.434383 56 34.833567 -287.220415 57 34.833567 34.833567 58 34.833567 34.833567 59 34.833567 34.833567 60 51.059468 34.833567 61 34.833567 51.059468 62 -185.181857 34.833567 63 -287.220415 -185.181857 64 34.833567 -287.220415 65 51.059468 34.833567 66 34.833567 51.059468 67 -287.220415 34.833567 68 51.059468 -287.220415 69 34.833567 51.059468 70 34.833567 34.833567 71 51.059468 34.833567 72 34.833567 51.059468 73 -287.220415 34.833567 74 211.059468 -287.220415 75 -175.158722 211.059468 76 166.841278 -175.158722 77 34.833567 166.841278 78 34.833567 34.833567 79 51.059468 34.833567 80 166.841278 51.059468 81 34.833567 166.841278 82 -175.158722 34.833567 83 34.833567 -175.158722 84 51.059468 34.833567 85 34.833567 51.059468 86 34.833567 34.833567 87 47.814288 34.833567 88 34.833567 47.814288 89 211.059468 34.833567 90 211.059468 211.059468 91 75.398320 211.059468 92 51.059468 75.398320 93 51.059468 51.059468 94 31.268813 51.059468 95 34.833567 31.268813 96 241.662779 34.833567 97 34.833567 241.662779 98 34.833567 34.833567 99 34.833567 34.833567 100 -175.158722 34.833567 101 166.841278 -175.158722 102 51.059468 166.841278 103 34.833567 51.059468 104 -287.220415 34.833567 105 272.266090 -287.220415 106 -175.158722 272.266090 107 -175.158722 -175.158722 108 211.059468 -175.158722 109 18.483147 211.059468 110 51.059468 18.483147 111 -171.588751 51.059468 112 -175.158722 -171.588751 113 8.872124 -175.158722 114 34.833567 8.872124 115 51.059468 34.833567 116 34.833567 51.059468 117 34.833567 34.833567 118 34.833567 34.833567 119 51.059468 34.833567 120 34.833567 51.059468 121 -175.158722 34.833567 122 -175.158722 -175.158722 123 -185.181857 -175.158722 124 80.841278 -185.181857 125 -175.158722 80.841278 126 166.841278 -175.158722 127 75.398320 166.841278 128 75.398320 75.398320 129 34.833567 75.398320 130 166.841278 34.833567 131 -175.158722 166.841278 132 51.059468 -175.158722 133 -175.158722 51.059468 134 34.833567 -175.158722 135 34.833567 34.833567 136 34.833567 34.833567 137 -175.158722 34.833567 138 34.833567 -175.158722 > 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/792hj1292348177.ps",horizontal=F,onefile=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/892hj1292348177.ps",horizontal=F,onefile=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/992hj1292348177.ps",horizontal=F,onefile=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/10kchm1292348177.ps",horizontal=F,onefile=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/115ufr1292348177.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/129uwx1292348177.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/1354t61292348177.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/14q5su1292348177.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/15un901292348177.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/16fo761292348177.tab") + } > > try(system("convert tmp/1daka1292348177.ps tmp/1daka1292348177.png",intern=TRUE)) character(0) > try(system("convert tmp/2daka1292348177.ps tmp/2daka1292348177.png",intern=TRUE)) character(0) > try(system("convert tmp/36kjv1292348177.ps tmp/36kjv1292348177.png",intern=TRUE)) character(0) > try(system("convert tmp/46kjv1292348177.ps tmp/46kjv1292348177.png",intern=TRUE)) character(0) > try(system("convert tmp/56kjv1292348177.ps tmp/56kjv1292348177.png",intern=TRUE)) character(0) > try(system("convert tmp/6hbig1292348177.ps tmp/6hbig1292348177.png",intern=TRUE)) character(0) > try(system("convert tmp/792hj1292348177.ps tmp/792hj1292348177.png",intern=TRUE)) character(0) > try(system("convert tmp/892hj1292348177.ps tmp/892hj1292348177.png",intern=TRUE)) character(0) > try(system("convert tmp/992hj1292348177.ps tmp/992hj1292348177.png",intern=TRUE)) character(0) > try(system("convert tmp/10kchm1292348177.ps tmp/10kchm1292348177.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.518 1.790 8.170