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(10.81 + ,24563400 + ,-0.2643 + ,24.45 + ,2772.73 + ,0.0373 + ,115.7 + ,9.12 + ,14163200 + ,-0.2643 + ,23.62 + ,2151.83 + ,0.0353 + ,109.2 + ,11.03 + ,18184800 + ,-0.2643 + ,21.90 + ,1840.26 + ,0.0292 + ,116.9 + ,12.74 + ,20810300 + ,-0.1918 + ,27.12 + ,2116.24 + ,0.0327 + ,109.9 + ,9.98 + ,12843000 + ,-0.1918 + ,27.70 + ,2110.49 + ,0.0362 + ,116.1 + ,11.62 + ,13866700 + ,-0.1918 + ,29.23 + ,2160.54 + ,0.0325 + ,118.9 + ,9.40 + ,15119200 + ,-0.2246 + ,26.50 + ,2027.13 + ,0.0272 + ,116.3 + ,9.27 + ,8301600 + ,-0.2246 + ,22.84 + ,1805.43 + ,0.0272 + ,114.0 + ,7.76 + ,14039600 + ,-0.2246 + ,20.49 + ,1498.80 + ,0.0265 + ,97.0 + ,8.78 + ,12139700 + ,0.3654 + ,23.28 + ,1690.20 + ,0.0213 + ,85.3 + ,10.65 + ,9649000 + ,0.3654 + ,25.71 + ,1930.58 + ,0.019 + ,84.9 + ,10.95 + ,8513600 + ,0.3654 + ,26.52 + ,1950.40 + ,0.0155 + ,94.6 + ,12.36 + ,15278600 + ,0.0447 + ,25.51 + ,1934.03 + ,0.0114 + ,97.8 + ,10.85 + ,15590900 + ,0.0447 + ,23.36 + ,1731.49 + ,0.0114 + ,95.0 + ,11.84 + ,9691100 + ,0.0447 + ,24.15 + ,1845.35 + ,0.0148 + ,110.7 + ,12.14 + ,10882700 + ,-0.0312 + ,20.92 + ,1688.23 + ,0.0164 + ,108.5 + ,11.65 + ,10294800 + ,-0.0312 + ,20.38 + ,1615.73 + ,0.0118 + ,110.3 + ,8.86 + ,16031900 + ,-0.0312 + ,21.90 + ,1463.21 + ,0.0107 + ,106.3 + ,7.63 + ,13683600 + ,-0.0048 + ,19.21 + ,1328.26 + ,0.0146 + ,97.4 + ,7.38 + ,8677200 + ,-0.0048 + ,19.65 + ,1314.85 + ,0.018 + ,94.5 + ,7.25 + ,9874100 + ,-0.0048 + ,17.51 + ,1172.06 + ,0.0151 + ,93.7 + ,8.03 + ,10725500 + ,0.0705 + ,21.41 + ,1329.75 + ,0.0203 + ,79.6 + ,7.75 + ,8348400 + ,0.0705 + ,23.09 + ,1478.78 + ,0.022 + ,84.9 + ,7.16 + ,8046200 + ,0.0705 + ,20.70 + ,1335.51 + ,0.0238 + ,80.7 + ,7.18 + ,10862300 + ,-0.0134 + ,19.00 + ,1320.91 + ,0.026 + ,78.8 + ,7.51 + ,8100300 + ,-0.0134 + ,19.04 + ,1337.52 + ,0.0298 + ,64.8 + ,7.07 + ,7287500 + ,-0.0134 + ,19.45 + ,1341.17 + ,0.0302 + ,61.4 + ,7.11 + ,14002500 + ,0.0812 + ,20.54 + ,1464.31 + ,0.0222 + ,81.0 + ,8.98 + ,19037900 + ,0.0812 + ,19.77 + ,1595.91 + ,0.0206 + ,83.6 + ,9.53 + ,10774600 + ,0.0812 + ,20.60 + ,1622.80 + ,0.0211 + ,83.5 + ,10.54 + ,8960600 + ,0.1885 + ,21.21 + ,1735.02 + ,0.0211 + ,77.0 + ,11.31 + ,7773300 + ,0.1885 + ,21.30 + ,1810.45 + ,0.0216 + ,81.7 + ,10.36 + ,9579700 + ,0.1885 + ,22.33 + ,1786.94 + ,0.0232 + ,77.0 + ,11.44 + ,11270700 + ,0.3628 + ,21.12 + ,1932.21 + ,0.0204 + ,81.7 + ,10.45 + ,9492800 + ,0.3628 + ,20.77 + ,1960.26 + ,0.0177 + ,92.5 + ,10.69 + ,9136800 + ,0.3628 + ,22.11 + ,2003.37 + ,0.0188 + ,91.7 + ,11.28 + ,14487600 + ,0.2942 + ,22.34 + ,2066.15 + ,0.0193 + ,96.4 + ,11.96 + ,10133200 + ,0.2942 + ,21.43 + ,2029.82 + ,0.0169 + ,88.5 + ,13.52 + ,18659700 + ,0.2942 + ,20.14 + ,1994.22 + ,0.0174 + ,88.5 + ,12.89 + ,15980700 + ,0.3036 + ,21.11 + ,1920.15 + ,0.0229 + ,93.0 + ,14.03 + ,9732100 + ,0.3036 + ,21.19 + ,1986.74 + ,0.0305 + ,93.1 + ,16.27 + ,14626300 + ,0.3036 + ,23.07 + ,2047.79 + ,0.0327 + ,102.8 + ,16.17 + ,16904000 + ,0.3703 + ,23.01 + ,1887.36 + ,0.0299 + ,105.7 + ,17.25 + ,13616700 + ,0.3703 + ,22.12 + ,1838.10 + ,0.0265 + ,98.7 + ,19.38 + ,13772900 + ,0.3703 + ,22.40 + ,1896.84 + ,0.0254 + ,96.7 + ,26.20 + ,28749200 + ,0.7398 + ,22.66 + ,1974.99 + ,0.0319 + ,92.9 + ,33.53 + ,31408300 + ,0.7398 + ,24.21 + ,2096.81 + ,0.0352 + ,92.6 + ,32.20 + ,26342800 + ,0.7398 + ,24.13 + ,2175.44 + ,0.0326 + ,102.7 + ,38.45 + ,48909500 + ,0.6988 + ,23.73 + ,2062.41 + ,0.0297 + ,105.1 + ,44.86 + ,41542400 + ,0.6988 + ,22.79 + ,2051.72 + ,0.0301 + ,104.4 + ,41.67 + ,24857200 + ,0.6988 + ,21.89 + ,1999.23 + ,0.0315 + ,103.0 + ,36.06 + ,34093700 + ,0.7478 + ,22.92 + ,1921.65 + ,0.0351 + ,97.5 + ,39.76 + ,22555200 + ,0.7478 + ,23.44 + ,2068.22 + ,0.028 + ,103.1 + ,36.81 + ,19067500 + ,0.7478 + ,22.57 + ,2056.96 + ,0.0253 + ,106.2 + ,42.65 + ,19029100 + ,0.5651 + ,23.27 + ,2184.83 + ,0.0317 + ,103.6 + ,46.89 + ,15223200 + ,0.5651 + ,24.95 + ,2152.09 + ,0.0364 + ,105.5 + ,53.61 + ,21903700 + ,0.5651 + ,23.45 + ,2151.69 + ,0.0469 + ,87.5 + ,57.59 + ,33306600 + ,0.6473 + ,23.42 + ,2120.30 + ,0.0435 + ,85.2 + ,67.82 + ,23898100 + ,0.6473 + ,25.30 + ,2232.82 + ,0.0346 + ,98.3 + ,71.89 + ,23279600 + ,0.6473 + ,23.90 + ,2205.32 + ,0.0342 + ,103.8 + ,75.51 + ,40699800 + ,0.3441 + ,25.73 + ,2305.82 + ,0.0399 + ,106.8 + ,68.49 + ,37646000 + ,0.3441 + ,24.64 + ,2281.39 + ,0.036 + ,102.7 + ,62.72 + ,37277000 + ,0.3441 + ,24.95 + ,2339.79 + ,0.0336 + ,107.5 + ,70.39 + ,39246800 + ,0.2415 + ,22.15 + ,2322.57 + ,0.0355 + ,109.8 + ,59.77 + ,27418400 + ,0.2415 + ,20.85 + ,2178.88 + ,0.0417 + ,104.7 + ,57.27 + ,30318700 + ,0.2415 + ,21.45 + ,2172.09 + ,0.0432 + ,105.7 + ,67.96 + ,32808100 + ,0.3151 + ,22.15 + ,2091.47 + ,0.0415 + ,107.0 + ,67.85 + ,28668200 + ,0.3151 + ,23.75 + ,2183.75 + ,0.0382 + ,100.2 + ,76.98 + ,32370300 + ,0.3151 + ,25.27 + ,2258.43 + ,0.0206 + ,105.9 + ,81.08 + ,24171100 + ,0.239 + ,26.53 + ,2366.71 + ,0.0131 + ,105.1 + ,91.66 + ,25009100 + ,0.239 + ,27.22 + ,2431.77 + ,0.0197 + ,105.3 + ,84.84 + ,32084300 + ,0.239 + ,27.69 + ,2415.29 + ,0.0254 + ,110.0 + ,85.73 + ,50117500 + ,0.2127 + ,28.61 + ,2463.93 + ,0.0208 + ,110.2 + ,84.61 + ,27522200 + ,0.2127 + ,26.21 + ,2416.15 + ,0.0242 + ,111.2 + ,92.91 + ,26816800 + ,0.2127 + ,25.93 + ,2421.64 + ,0.0278 + ,108.2 + ,99.80 + ,25136100 + ,0.273 + ,27.86 + ,2525.09 + ,0.0257 + ,106.3 + ,121.19 + ,30295600 + ,0.273 + ,28.65 + ,2604.52 + ,0.0269 + ,108.5 + ,122.04 + ,41526100 + ,0.273 + ,27.51 + ,2603.23 + ,0.0269 + ,105.3 + ,131.76 + ,43845100 + ,0.3657 + ,27.06 + ,2546.27 + ,0.0236 + ,111.9 + ,138.48 + ,39188900 + ,0.3657 + ,26.91 + ,2596.36 + ,0.0197 + ,105.6 + ,153.47 + ,40496400 + ,0.3657 + ,27.60 + ,2701.50 + ,0.0276 + ,99.5 + ,189.95 + ,37438400 + ,0.4643 + ,34.48 + ,2859.12 + ,0.0354 + ,95.2 + ,182.22 + ,46553700 + ,0.4643 + ,31.58 + ,2660.96 + ,0.0431 + ,87.8 + ,198.08 + ,31771400 + ,0.4643 + ,33.46 + ,2652.28 + ,0.0408 + ,90.6 + ,135.36 + ,62108100 + ,0.5096 + ,30.64 + ,2389.86 + ,0.0428 + ,87.9 + ,125.02 + ,46645400 + ,0.5096 + ,25.66 + ,2271.48 + ,0.0403 + ,76.4 + ,143.50 + ,42313100 + ,0.5096 + ,26.78 + ,2279.10 + ,0.0398 + ,65.9 + ,173.95 + ,38841700 + ,0.3592 + ,26.91 + ,2412.80 + ,0.0394 + ,62.3 + ,188.75 + ,32650300 + ,0.3592 + ,26.82 + ,2522.66 + ,0.0418 + ,57.2 + ,167.44 + ,34281100 + ,0.3592 + ,26.05 + ,2292.98 + ,0.0502 + ,50.4 + ,158.95 + ,33096200 + ,0.7439 + ,24.36 + ,2325.55 + ,0.056 + ,51.9 + ,169.53 + ,23273800 + ,0.7439 + ,25.94 + ,2367.52 + ,0.0537 + ,58.5 + ,113.66 + ,43697600 + ,0.7439 + ,25.37 + ,2091.88 + ,0.0494 + ,61.4 + ,107.59 + ,66902300 + ,0.139 + ,21.23 + ,1720.95 + ,0.0366 + ,38.8 + ,92.67 + ,44957200 + ,0.139 + ,19.35 + ,1535.57 + ,0.0107 + ,44.9 + ,85.35 + ,33800900 + ,0.139 + ,18.61 + ,1577.03 + ,0.0009 + ,38.6 + ,90.13 + ,33487900 + ,0.1383 + ,16.37 + ,1476.42 + ,0.0003 + ,4.0 + ,89.31 + ,27394900 + ,0.1383 + ,15.56 + ,1377.84 + ,0.0024 + ,25.3 + ,105.12 + ,25963400 + ,0.1383 + ,17.70 + ,1528.59 + ,-0.0038 + ,26.9 + ,125.83 + ,20952600 + ,0.2874 + ,19.52 + ,1717.30 + ,-0.0074 + ,40.8 + ,135.81 + ,17702900 + ,0.2874 + ,20.26 + ,1774.33 + ,-0.0128 + ,54.8 + ,142.43 + ,21282100 + ,0.2874 + ,23.05 + ,1835.04 + ,-0.0143 + ,49.3 + ,163.39 + ,18449100 + ,0.0596 + ,22.81 + ,1978.50 + ,-0.021 + ,47.4 + ,168.21 + ,14415700 + ,0.0596 + ,24.04 + ,2009.06 + ,-0.0148 + ,54.5 + ,185.35 + ,17906300 + ,0.0596 + ,25.08 + ,2122.42 + ,-0.0129 + ,53.4 + ,188.50 + ,22197500 + ,0.3201 + ,27.04 + ,2045.11 + ,-0.0018 + ,48.7 + ,199.91 + ,15856500 + ,0.3201 + ,28.81 + ,2144.60 + ,0.0184 + ,50.6 + ,210.73 + ,19068700 + ,0.3201 + ,29.86 + ,2269.15 + ,0.0272 + ,53.6 + ,192.06 + ,30855100 + ,0.486 + ,27.61 + ,2147.35 + ,0.0263 + ,56.5 + ,204.62 + ,21209000 + ,0.486 + ,28.22 + ,2238.26 + ,0.0214 + ,46.4 + ,235.00 + ,19541600 + ,0.486 + ,28.83 + ,2397.96 + ,0.0231 + ,52.3 + ,261.09 + ,21955000 + ,0.6129 + ,30.06 + ,2461.19 + ,0.0224 + ,57.7 + ,256.88 + ,33725900 + ,0.6129 + ,25.51 + ,2257.04 + ,0.0202 + ,62.7 + ,251.53 + ,28192800 + ,0.6129 + ,22.75 + ,2109.24 + ,0.0105 + ,54.3 + ,257.25 + ,27377000 + ,0.6665 + ,25.52 + ,2254.70 + ,0.0124 + ,51.0 + ,243.10 + ,16228100 + ,0.6665 + ,23.33 + ,2114.03 + ,0.0115 + ,53.2 + ,283.75 + ,21278900 + ,0.6665 + ,24.34 + ,2368.62 + ,0.0114 + ,48.6) + ,dim=c(7 + ,117) + ,dimnames=list(c('APPLE' + ,'VOLUME' + ,'REV.GROWTH' + ,'MICROSOFT' + ,'NASDAQ' + ,'INFLATION' + ,'CONS.CONF') + ,1:117)) > y <- array(NA,dim=c(7,117),dimnames=list(c('APPLE','VOLUME','REV.GROWTH','MICROSOFT','NASDAQ','INFLATION','CONS.CONF'),1:117)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = '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 APPLE VOLUME REV.GROWTH MICROSOFT NASDAQ INFLATION CONS.CONF t 1 10.81 24563400 -0.2643 24.45 2772.73 0.0373 115.7 1 2 9.12 14163200 -0.2643 23.62 2151.83 0.0353 109.2 2 3 11.03 18184800 -0.2643 21.90 1840.26 0.0292 116.9 3 4 12.74 20810300 -0.1918 27.12 2116.24 0.0327 109.9 4 5 9.98 12843000 -0.1918 27.70 2110.49 0.0362 116.1 5 6 11.62 13866700 -0.1918 29.23 2160.54 0.0325 118.9 6 7 9.40 15119200 -0.2246 26.50 2027.13 0.0272 116.3 7 8 9.27 8301600 -0.2246 22.84 1805.43 0.0272 114.0 8 9 7.76 14039600 -0.2246 20.49 1498.80 0.0265 97.0 9 10 8.78 12139700 0.3654 23.28 1690.20 0.0213 85.3 10 11 10.65 9649000 0.3654 25.71 1930.58 0.0190 84.9 11 12 10.95 8513600 0.3654 26.52 1950.40 0.0155 94.6 12 13 12.36 15278600 0.0447 25.51 1934.03 0.0114 97.8 13 14 10.85 15590900 0.0447 23.36 1731.49 0.0114 95.0 14 15 11.84 9691100 0.0447 24.15 1845.35 0.0148 110.7 15 16 12.14 10882700 -0.0312 20.92 1688.23 0.0164 108.5 16 17 11.65 10294800 -0.0312 20.38 1615.73 0.0118 110.3 17 18 8.86 16031900 -0.0312 21.90 1463.21 0.0107 106.3 18 19 7.63 13683600 -0.0048 19.21 1328.26 0.0146 97.4 19 20 7.38 8677200 -0.0048 19.65 1314.85 0.0180 94.5 20 21 7.25 9874100 -0.0048 17.51 1172.06 0.0151 93.7 21 22 8.03 10725500 0.0705 21.41 1329.75 0.0203 79.6 22 23 7.75 8348400 0.0705 23.09 1478.78 0.0220 84.9 23 24 7.16 8046200 0.0705 20.70 1335.51 0.0238 80.7 24 25 7.18 10862300 -0.0134 19.00 1320.91 0.0260 78.8 25 26 7.51 8100300 -0.0134 19.04 1337.52 0.0298 64.8 26 27 7.07 7287500 -0.0134 19.45 1341.17 0.0302 61.4 27 28 7.11 14002500 0.0812 20.54 1464.31 0.0222 81.0 28 29 8.98 19037900 0.0812 19.77 1595.91 0.0206 83.6 29 30 9.53 10774600 0.0812 20.60 1622.80 0.0211 83.5 30 31 10.54 8960600 0.1885 21.21 1735.02 0.0211 77.0 31 32 11.31 7773300 0.1885 21.30 1810.45 0.0216 81.7 32 33 10.36 9579700 0.1885 22.33 1786.94 0.0232 77.0 33 34 11.44 11270700 0.3628 21.12 1932.21 0.0204 81.7 34 35 10.45 9492800 0.3628 20.77 1960.26 0.0177 92.5 35 36 10.69 9136800 0.3628 22.11 2003.37 0.0188 91.7 36 37 11.28 14487600 0.2942 22.34 2066.15 0.0193 96.4 37 38 11.96 10133200 0.2942 21.43 2029.82 0.0169 88.5 38 39 13.52 18659700 0.2942 20.14 1994.22 0.0174 88.5 39 40 12.89 15980700 0.3036 21.11 1920.15 0.0229 93.0 40 41 14.03 9732100 0.3036 21.19 1986.74 0.0305 93.1 41 42 16.27 14626300 0.3036 23.07 2047.79 0.0327 102.8 42 43 16.17 16904000 0.3703 23.01 1887.36 0.0299 105.7 43 44 17.25 13616700 0.3703 22.12 1838.10 0.0265 98.7 44 45 19.38 13772900 0.3703 22.40 1896.84 0.0254 96.7 45 46 26.20 28749200 0.7398 22.66 1974.99 0.0319 92.9 46 47 33.53 31408300 0.7398 24.21 2096.81 0.0352 92.6 47 48 32.20 26342800 0.7398 24.13 2175.44 0.0326 102.7 48 49 38.45 48909500 0.6988 23.73 2062.41 0.0297 105.1 49 50 44.86 41542400 0.6988 22.79 2051.72 0.0301 104.4 50 51 41.67 24857200 0.6988 21.89 1999.23 0.0315 103.0 51 52 36.06 34093700 0.7478 22.92 1921.65 0.0351 97.5 52 53 39.76 22555200 0.7478 23.44 2068.22 0.0280 103.1 53 54 36.81 19067500 0.7478 22.57 2056.96 0.0253 106.2 54 55 42.65 19029100 0.5651 23.27 2184.83 0.0317 103.6 55 56 46.89 15223200 0.5651 24.95 2152.09 0.0364 105.5 56 57 53.61 21903700 0.5651 23.45 2151.69 0.0469 87.5 57 58 57.59 33306600 0.6473 23.42 2120.30 0.0435 85.2 58 59 67.82 23898100 0.6473 25.30 2232.82 0.0346 98.3 59 60 71.89 23279600 0.6473 23.90 2205.32 0.0342 103.8 60 61 75.51 40699800 0.3441 25.73 2305.82 0.0399 106.8 61 62 68.49 37646000 0.3441 24.64 2281.39 0.0360 102.7 62 63 62.72 37277000 0.3441 24.95 2339.79 0.0336 107.5 63 64 70.39 39246800 0.2415 22.15 2322.57 0.0355 109.8 64 65 59.77 27418400 0.2415 20.85 2178.88 0.0417 104.7 65 66 57.27 30318700 0.2415 21.45 2172.09 0.0432 105.7 66 67 67.96 32808100 0.3151 22.15 2091.47 0.0415 107.0 67 68 67.85 28668200 0.3151 23.75 2183.75 0.0382 100.2 68 69 76.98 32370300 0.3151 25.27 2258.43 0.0206 105.9 69 70 81.08 24171100 0.2390 26.53 2366.71 0.0131 105.1 70 71 91.66 25009100 0.2390 27.22 2431.77 0.0197 105.3 71 72 84.84 32084300 0.2390 27.69 2415.29 0.0254 110.0 72 73 85.73 50117500 0.2127 28.61 2463.93 0.0208 110.2 73 74 84.61 27522200 0.2127 26.21 2416.15 0.0242 111.2 74 75 92.91 26816800 0.2127 25.93 2421.64 0.0278 108.2 75 76 99.80 25136100 0.2730 27.86 2525.09 0.0257 106.3 76 77 121.19 30295600 0.2730 28.65 2604.52 0.0269 108.5 77 78 122.04 41526100 0.2730 27.51 2603.23 0.0269 105.3 78 79 131.76 43845100 0.3657 27.06 2546.27 0.0236 111.9 79 80 138.48 39188900 0.3657 26.91 2596.36 0.0197 105.6 80 81 153.47 40496400 0.3657 27.60 2701.50 0.0276 99.5 81 82 189.95 37438400 0.4643 34.48 2859.12 0.0354 95.2 82 83 182.22 46553700 0.4643 31.58 2660.96 0.0431 87.8 83 84 198.08 31771400 0.4643 33.46 2652.28 0.0408 90.6 84 85 135.36 62108100 0.5096 30.64 2389.86 0.0428 87.9 85 86 125.02 46645400 0.5096 25.66 2271.48 0.0403 76.4 86 87 143.50 42313100 0.5096 26.78 2279.10 0.0398 65.9 87 88 173.95 38841700 0.3592 26.91 2412.80 0.0394 62.3 88 89 188.75 32650300 0.3592 26.82 2522.66 0.0418 57.2 89 90 167.44 34281100 0.3592 26.05 2292.98 0.0502 50.4 90 91 158.95 33096200 0.7439 24.36 2325.55 0.0560 51.9 91 92 169.53 23273800 0.7439 25.94 2367.52 0.0537 58.5 92 93 113.66 43697600 0.7439 25.37 2091.88 0.0494 61.4 93 94 107.59 66902300 0.1390 21.23 1720.95 0.0366 38.8 94 95 92.67 44957200 0.1390 19.35 1535.57 0.0107 44.9 95 96 85.35 33800900 0.1390 18.61 1577.03 0.0009 38.6 96 97 90.13 33487900 0.1383 16.37 1476.42 0.0003 4.0 97 98 89.31 27394900 0.1383 15.56 1377.84 0.0024 25.3 98 99 105.12 25963400 0.1383 17.70 1528.59 -0.0038 26.9 99 100 125.83 20952600 0.2874 19.52 1717.30 -0.0074 40.8 100 101 135.81 17702900 0.2874 20.26 1774.33 -0.0128 54.8 101 102 142.43 21282100 0.2874 23.05 1835.04 -0.0143 49.3 102 103 163.39 18449100 0.0596 22.81 1978.50 -0.0210 47.4 103 104 168.21 14415700 0.0596 24.04 2009.06 -0.0148 54.5 104 105 185.35 17906300 0.0596 25.08 2122.42 -0.0129 53.4 105 106 188.50 22197500 0.3201 27.04 2045.11 -0.0018 48.7 106 107 199.91 15856500 0.3201 28.81 2144.60 0.0184 50.6 107 108 210.73 19068700 0.3201 29.86 2269.15 0.0272 53.6 108 109 192.06 30855100 0.4860 27.61 2147.35 0.0263 56.5 109 110 204.62 21209000 0.4860 28.22 2238.26 0.0214 46.4 110 111 235.00 19541600 0.4860 28.83 2397.96 0.0231 52.3 111 112 261.09 21955000 0.6129 30.06 2461.19 0.0224 57.7 112 113 256.88 33725900 0.6129 25.51 2257.04 0.0202 62.7 113 114 251.53 28192800 0.6129 22.75 2109.24 0.0105 54.3 114 115 257.25 27377000 0.6665 25.52 2254.70 0.0124 51.0 115 116 243.10 16228100 0.6665 23.33 2114.03 0.0115 53.2 116 117 283.75 21278900 0.6665 24.34 2368.62 0.0114 48.6 117 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) VOLUME REV.GROWTH MICROSOFT NASDAQ INFLATION -1.484e+02 -7.063e-07 -1.821e+01 6.833e+00 1.897e-02 8.227e+01 CONS.CONF t -6.112e-01 1.658e+00 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -33.588 -16.131 -5.664 11.160 82.828 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -1.484e+02 1.763e+01 -8.418 1.67e-13 *** VOLUME -7.063e-07 2.573e-07 -2.745 0.00708 ** REV.GROWTH -1.821e+01 1.110e+01 -1.640 0.10381 MICROSOFT 6.833e+00 1.128e+00 6.060 1.98e-08 *** NASDAQ 1.897e-02 1.442e-02 1.315 0.19120 INFLATION 8.227e+01 2.181e+02 0.377 0.70673 CONS.CONF -6.112e-01 1.778e-01 -3.438 0.00083 *** t 1.658e+00 1.753e-01 9.459 7.34e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 23.67 on 109 degrees of freedom Multiple R-squared: 0.9088, Adjusted R-squared: 0.903 F-statistic: 155.2 on 7 and 109 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,] 2.766377e-04 5.532754e-04 0.999723362 [2,] 1.321181e-05 2.642361e-05 0.999986788 [3,] 6.182891e-07 1.236578e-06 0.999999382 [4,] 2.526976e-08 5.053952e-08 0.999999975 [5,] 2.625173e-09 5.250346e-09 0.999999997 [6,] 3.524603e-10 7.049206e-10 1.000000000 [7,] 1.904919e-11 3.809838e-11 1.000000000 [8,] 1.648140e-11 3.296280e-11 1.000000000 [9,] 1.575053e-12 3.150106e-12 1.000000000 [10,] 1.138525e-13 2.277049e-13 1.000000000 [11,] 1.229241e-14 2.458481e-14 1.000000000 [12,] 1.629934e-15 3.259867e-15 1.000000000 [13,] 9.852056e-17 1.970411e-16 1.000000000 [14,] 8.059649e-18 1.611930e-17 1.000000000 [15,] 1.192837e-18 2.385674e-18 1.000000000 [16,] 3.065549e-19 6.131099e-19 1.000000000 [17,] 3.653192e-20 7.306385e-20 1.000000000 [18,] 7.628915e-21 1.525783e-20 1.000000000 [19,] 1.983395e-21 3.966791e-21 1.000000000 [20,] 5.452571e-22 1.090514e-21 1.000000000 [21,] 9.935438e-23 1.987088e-22 1.000000000 [22,] 1.811638e-23 3.623275e-23 1.000000000 [23,] 2.369781e-24 4.739563e-24 1.000000000 [24,] 1.953227e-25 3.906453e-25 1.000000000 [25,] 2.724525e-26 5.449050e-26 1.000000000 [26,] 2.551970e-27 5.103940e-27 1.000000000 [27,] 1.870016e-28 3.740032e-28 1.000000000 [28,] 1.260375e-29 2.520749e-29 1.000000000 [29,] 7.980551e-30 1.596110e-29 1.000000000 [30,] 3.587119e-30 7.174239e-30 1.000000000 [31,] 5.956260e-30 1.191252e-29 1.000000000 [32,] 9.456410e-30 1.891282e-29 1.000000000 [33,] 4.523612e-30 9.047223e-30 1.000000000 [34,] 2.120700e-29 4.241400e-29 1.000000000 [35,] 1.000465e-27 2.000930e-27 1.000000000 [36,] 1.681716e-26 3.363432e-26 1.000000000 [37,] 3.261263e-24 6.522527e-24 1.000000000 [38,] 5.596357e-24 1.119271e-23 1.000000000 [39,] 1.423662e-24 2.847324e-24 1.000000000 [40,] 9.207405e-22 1.841481e-21 1.000000000 [41,] 1.663905e-18 3.327810e-18 1.000000000 [42,] 7.710904e-19 1.542181e-18 1.000000000 [43,] 8.614082e-18 1.722816e-17 1.000000000 [44,] 1.139452e-17 2.278904e-17 1.000000000 [45,] 1.588700e-15 3.177399e-15 1.000000000 [46,] 8.126930e-14 1.625386e-13 1.000000000 [47,] 1.092447e-11 2.184893e-11 1.000000000 [48,] 1.753614e-10 3.507229e-10 1.000000000 [49,] 6.809011e-08 1.361802e-07 0.999999932 [50,] 8.148286e-06 1.629657e-05 0.999991852 [51,] 4.957806e-05 9.915611e-05 0.999950422 [52,] 8.154638e-05 1.630928e-04 0.999918454 [53,] 5.133413e-05 1.026683e-04 0.999948666 [54,] 5.165800e-05 1.033160e-04 0.999948342 [55,] 3.925786e-05 7.851572e-05 0.999960742 [56,] 2.671718e-05 5.343435e-05 0.999973283 [57,] 1.335744e-04 2.671488e-04 0.999866426 [58,] 2.598860e-04 5.197721e-04 0.999740114 [59,] 5.885936e-04 1.177187e-03 0.999411406 [60,] 7.025688e-04 1.405138e-03 0.999297431 [61,] 1.097868e-03 2.195736e-03 0.998902132 [62,] 7.722079e-04 1.544416e-03 0.999227792 [63,] 8.703011e-04 1.740602e-03 0.999129699 [64,] 5.489023e-04 1.097805e-03 0.999451098 [65,] 4.924666e-04 9.849331e-04 0.999507533 [66,] 5.929318e-04 1.185864e-03 0.999407068 [67,] 2.150175e-03 4.300350e-03 0.997849825 [68,] 6.660317e-03 1.332063e-02 0.993339683 [69,] 1.876643e-02 3.753285e-02 0.981233574 [70,] 6.786316e-02 1.357263e-01 0.932136836 [71,] 3.694165e-01 7.388330e-01 0.630583476 [72,] 5.920643e-01 8.158713e-01 0.407935653 [73,] 6.691349e-01 6.617301e-01 0.330865067 [74,] 9.732414e-01 5.351729e-02 0.026758647 [75,] 9.695298e-01 6.094043e-02 0.030470217 [76,] 9.661251e-01 6.774980e-02 0.033874899 [77,] 9.590627e-01 8.187452e-02 0.040937261 [78,] 9.679140e-01 6.417209e-02 0.032086045 [79,] 9.725229e-01 5.495412e-02 0.027477059 [80,] 9.869054e-01 2.618924e-02 0.013094620 [81,] 9.821822e-01 3.563553e-02 0.017817763 [82,] 9.977107e-01 4.578620e-03 0.002289310 [83,] 9.965454e-01 6.909120e-03 0.003454560 [84,] 9.957312e-01 8.537571e-03 0.004268786 [85,] 9.942663e-01 1.146746e-02 0.005733732 [86,] 9.917216e-01 1.655671e-02 0.008278354 [87,] 9.844404e-01 3.111930e-02 0.015559648 [88,] 9.736777e-01 5.264464e-02 0.026322319 [89,] 9.638682e-01 7.226355e-02 0.036131775 [90,] 9.583274e-01 8.334513e-02 0.041672566 [91,] 9.341197e-01 1.317605e-01 0.065880267 [92,] 8.849632e-01 2.300736e-01 0.115036798 [93,] 8.247107e-01 3.505786e-01 0.175289311 [94,] 7.292689e-01 5.414621e-01 0.270731074 [95,] 8.721238e-01 2.557525e-01 0.127876248 [96,] 9.712315e-01 5.753709e-02 0.028768544 > postscript(file="/var/www/html/rcomp/tmp/1jlr81292323666.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/2bc8t1292323666.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/3bc8t1292323666.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/4bc8t1292323666.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/5bc8t1292323666.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 = 117 Frequency = 1 1 2 3 4 5 18.066297200 21.013817266 46.977156068 4.734078365 -5.663511639 6 7 8 9 10 -14.346490890 2.094161134 23.298981671 35.724162534 15.068137275 11 12 13 14 15 -7.698086753 -9.551908392 -1.355946743 12.517833209 9.441441973 16 17 18 19 20 31.117377140 35.097738279 24.854463609 35.968082547 25.719733734 21 22 23 24 25 41.857566413 4.266222984 -10.557405589 3.314140027 12.687953109 26 27 28 29 30 -0.048996794 -7.702937332 -0.001713365 8.252289237 -4.975597136 31 32 33 34 35 -15.221056133 -16.161951003 -27.090505679 -14.685730510 -9.906799467 36 37 38 39 40 -22.129637905 -20.598452112 -22.376063890 -7.003559459 -13.937474919 41 42 43 44 45 -21.242769547 -25.460290055 -18.939208957 -18.822167587 -22.399362430 46 47 48 49 50 -6.049238775 -11.855971960 -12.979413638 13.387048225 19.100670352 51 52 53 54 55 8.642647052 -0.433957325 -8.867862971 -7.664128301 -16.160039912 56 57 58 59 60 -26.349690736 -18.178482528 -6.632093211 -10.946191396 4.511162774 61 62 63 64 65 0.210381072 -4.898425386 -12.681841763 13.561452475 0.910386244 66 67 68 69 70 -4.682431680 5.128408942 -16.131479282 -12.915514674 -28.185356798 71 72 73 74 75 -25.041207255 -29.017358290 -24.236140920 -25.335971682 -19.513071767 76 77 78 79 80 -30.508730431 -12.791578404 0.190152144 20.038474758 18.356754442 81 82 83 84 85 21.524565278 2.711741945 18.179289054 11.160341012 -8.535211763 86 87 88 89 90 -2.004258860 -2.416186264 15.593726064 19.579096377 2.533584041 91 92 93 94 95 9.922002702 4.537793587 -27.315753105 -7.104156140 -16.959811992 96 97 98 99 100 -32.591860679 -33.588469445 -20.119071954 -22.972141566 -11.968060083 101 102 103 104 105 -3.078140749 -19.041995143 -7.579958456 -12.421328481 -4.559342095 106 107 108 109 110 -11.005779171 -20.214438931 -17.211368014 -6.663587232 -14.237212909 111 112 113 114 115 9.575899778 31.777024127 72.421651195 78.831878330 59.433771173 116 117 54.802634859 82.827764625 > postscript(file="/var/www/html/rcomp/tmp/6m3qe1292323666.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 = 117 Frequency = 1 lag(myerror, k = 1) myerror 0 18.066297200 NA 1 21.013817266 18.066297200 2 46.977156068 21.013817266 3 4.734078365 46.977156068 4 -5.663511639 4.734078365 5 -14.346490890 -5.663511639 6 2.094161134 -14.346490890 7 23.298981671 2.094161134 8 35.724162534 23.298981671 9 15.068137275 35.724162534 10 -7.698086753 15.068137275 11 -9.551908392 -7.698086753 12 -1.355946743 -9.551908392 13 12.517833209 -1.355946743 14 9.441441973 12.517833209 15 31.117377140 9.441441973 16 35.097738279 31.117377140 17 24.854463609 35.097738279 18 35.968082547 24.854463609 19 25.719733734 35.968082547 20 41.857566413 25.719733734 21 4.266222984 41.857566413 22 -10.557405589 4.266222984 23 3.314140027 -10.557405589 24 12.687953109 3.314140027 25 -0.048996794 12.687953109 26 -7.702937332 -0.048996794 27 -0.001713365 -7.702937332 28 8.252289237 -0.001713365 29 -4.975597136 8.252289237 30 -15.221056133 -4.975597136 31 -16.161951003 -15.221056133 32 -27.090505679 -16.161951003 33 -14.685730510 -27.090505679 34 -9.906799467 -14.685730510 35 -22.129637905 -9.906799467 36 -20.598452112 -22.129637905 37 -22.376063890 -20.598452112 38 -7.003559459 -22.376063890 39 -13.937474919 -7.003559459 40 -21.242769547 -13.937474919 41 -25.460290055 -21.242769547 42 -18.939208957 -25.460290055 43 -18.822167587 -18.939208957 44 -22.399362430 -18.822167587 45 -6.049238775 -22.399362430 46 -11.855971960 -6.049238775 47 -12.979413638 -11.855971960 48 13.387048225 -12.979413638 49 19.100670352 13.387048225 50 8.642647052 19.100670352 51 -0.433957325 8.642647052 52 -8.867862971 -0.433957325 53 -7.664128301 -8.867862971 54 -16.160039912 -7.664128301 55 -26.349690736 -16.160039912 56 -18.178482528 -26.349690736 57 -6.632093211 -18.178482528 58 -10.946191396 -6.632093211 59 4.511162774 -10.946191396 60 0.210381072 4.511162774 61 -4.898425386 0.210381072 62 -12.681841763 -4.898425386 63 13.561452475 -12.681841763 64 0.910386244 13.561452475 65 -4.682431680 0.910386244 66 5.128408942 -4.682431680 67 -16.131479282 5.128408942 68 -12.915514674 -16.131479282 69 -28.185356798 -12.915514674 70 -25.041207255 -28.185356798 71 -29.017358290 -25.041207255 72 -24.236140920 -29.017358290 73 -25.335971682 -24.236140920 74 -19.513071767 -25.335971682 75 -30.508730431 -19.513071767 76 -12.791578404 -30.508730431 77 0.190152144 -12.791578404 78 20.038474758 0.190152144 79 18.356754442 20.038474758 80 21.524565278 18.356754442 81 2.711741945 21.524565278 82 18.179289054 2.711741945 83 11.160341012 18.179289054 84 -8.535211763 11.160341012 85 -2.004258860 -8.535211763 86 -2.416186264 -2.004258860 87 15.593726064 -2.416186264 88 19.579096377 15.593726064 89 2.533584041 19.579096377 90 9.922002702 2.533584041 91 4.537793587 9.922002702 92 -27.315753105 4.537793587 93 -7.104156140 -27.315753105 94 -16.959811992 -7.104156140 95 -32.591860679 -16.959811992 96 -33.588469445 -32.591860679 97 -20.119071954 -33.588469445 98 -22.972141566 -20.119071954 99 -11.968060083 -22.972141566 100 -3.078140749 -11.968060083 101 -19.041995143 -3.078140749 102 -7.579958456 -19.041995143 103 -12.421328481 -7.579958456 104 -4.559342095 -12.421328481 105 -11.005779171 -4.559342095 106 -20.214438931 -11.005779171 107 -17.211368014 -20.214438931 108 -6.663587232 -17.211368014 109 -14.237212909 -6.663587232 110 9.575899778 -14.237212909 111 31.777024127 9.575899778 112 72.421651195 31.777024127 113 78.831878330 72.421651195 114 59.433771173 78.831878330 115 54.802634859 59.433771173 116 82.827764625 54.802634859 117 NA 82.827764625 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 21.013817266 18.066297200 [2,] 46.977156068 21.013817266 [3,] 4.734078365 46.977156068 [4,] -5.663511639 4.734078365 [5,] -14.346490890 -5.663511639 [6,] 2.094161134 -14.346490890 [7,] 23.298981671 2.094161134 [8,] 35.724162534 23.298981671 [9,] 15.068137275 35.724162534 [10,] -7.698086753 15.068137275 [11,] -9.551908392 -7.698086753 [12,] -1.355946743 -9.551908392 [13,] 12.517833209 -1.355946743 [14,] 9.441441973 12.517833209 [15,] 31.117377140 9.441441973 [16,] 35.097738279 31.117377140 [17,] 24.854463609 35.097738279 [18,] 35.968082547 24.854463609 [19,] 25.719733734 35.968082547 [20,] 41.857566413 25.719733734 [21,] 4.266222984 41.857566413 [22,] -10.557405589 4.266222984 [23,] 3.314140027 -10.557405589 [24,] 12.687953109 3.314140027 [25,] -0.048996794 12.687953109 [26,] -7.702937332 -0.048996794 [27,] -0.001713365 -7.702937332 [28,] 8.252289237 -0.001713365 [29,] -4.975597136 8.252289237 [30,] -15.221056133 -4.975597136 [31,] -16.161951003 -15.221056133 [32,] -27.090505679 -16.161951003 [33,] -14.685730510 -27.090505679 [34,] -9.906799467 -14.685730510 [35,] -22.129637905 -9.906799467 [36,] -20.598452112 -22.129637905 [37,] -22.376063890 -20.598452112 [38,] -7.003559459 -22.376063890 [39,] -13.937474919 -7.003559459 [40,] -21.242769547 -13.937474919 [41,] -25.460290055 -21.242769547 [42,] -18.939208957 -25.460290055 [43,] -18.822167587 -18.939208957 [44,] -22.399362430 -18.822167587 [45,] -6.049238775 -22.399362430 [46,] -11.855971960 -6.049238775 [47,] -12.979413638 -11.855971960 [48,] 13.387048225 -12.979413638 [49,] 19.100670352 13.387048225 [50,] 8.642647052 19.100670352 [51,] -0.433957325 8.642647052 [52,] -8.867862971 -0.433957325 [53,] -7.664128301 -8.867862971 [54,] -16.160039912 -7.664128301 [55,] -26.349690736 -16.160039912 [56,] -18.178482528 -26.349690736 [57,] -6.632093211 -18.178482528 [58,] -10.946191396 -6.632093211 [59,] 4.511162774 -10.946191396 [60,] 0.210381072 4.511162774 [61,] -4.898425386 0.210381072 [62,] -12.681841763 -4.898425386 [63,] 13.561452475 -12.681841763 [64,] 0.910386244 13.561452475 [65,] -4.682431680 0.910386244 [66,] 5.128408942 -4.682431680 [67,] -16.131479282 5.128408942 [68,] -12.915514674 -16.131479282 [69,] -28.185356798 -12.915514674 [70,] -25.041207255 -28.185356798 [71,] -29.017358290 -25.041207255 [72,] -24.236140920 -29.017358290 [73,] -25.335971682 -24.236140920 [74,] -19.513071767 -25.335971682 [75,] -30.508730431 -19.513071767 [76,] -12.791578404 -30.508730431 [77,] 0.190152144 -12.791578404 [78,] 20.038474758 0.190152144 [79,] 18.356754442 20.038474758 [80,] 21.524565278 18.356754442 [81,] 2.711741945 21.524565278 [82,] 18.179289054 2.711741945 [83,] 11.160341012 18.179289054 [84,] -8.535211763 11.160341012 [85,] -2.004258860 -8.535211763 [86,] -2.416186264 -2.004258860 [87,] 15.593726064 -2.416186264 [88,] 19.579096377 15.593726064 [89,] 2.533584041 19.579096377 [90,] 9.922002702 2.533584041 [91,] 4.537793587 9.922002702 [92,] -27.315753105 4.537793587 [93,] -7.104156140 -27.315753105 [94,] -16.959811992 -7.104156140 [95,] -32.591860679 -16.959811992 [96,] -33.588469445 -32.591860679 [97,] -20.119071954 -33.588469445 [98,] -22.972141566 -20.119071954 [99,] -11.968060083 -22.972141566 [100,] -3.078140749 -11.968060083 [101,] -19.041995143 -3.078140749 [102,] -7.579958456 -19.041995143 [103,] -12.421328481 -7.579958456 [104,] -4.559342095 -12.421328481 [105,] -11.005779171 -4.559342095 [106,] -20.214438931 -11.005779171 [107,] -17.211368014 -20.214438931 [108,] -6.663587232 -17.211368014 [109,] -14.237212909 -6.663587232 [110,] 9.575899778 -14.237212909 [111,] 31.777024127 9.575899778 [112,] 72.421651195 31.777024127 [113,] 78.831878330 72.421651195 [114,] 59.433771173 78.831878330 [115,] 54.802634859 59.433771173 [116,] 82.827764625 54.802634859 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 21.013817266 18.066297200 2 46.977156068 21.013817266 3 4.734078365 46.977156068 4 -5.663511639 4.734078365 5 -14.346490890 -5.663511639 6 2.094161134 -14.346490890 7 23.298981671 2.094161134 8 35.724162534 23.298981671 9 15.068137275 35.724162534 10 -7.698086753 15.068137275 11 -9.551908392 -7.698086753 12 -1.355946743 -9.551908392 13 12.517833209 -1.355946743 14 9.441441973 12.517833209 15 31.117377140 9.441441973 16 35.097738279 31.117377140 17 24.854463609 35.097738279 18 35.968082547 24.854463609 19 25.719733734 35.968082547 20 41.857566413 25.719733734 21 4.266222984 41.857566413 22 -10.557405589 4.266222984 23 3.314140027 -10.557405589 24 12.687953109 3.314140027 25 -0.048996794 12.687953109 26 -7.702937332 -0.048996794 27 -0.001713365 -7.702937332 28 8.252289237 -0.001713365 29 -4.975597136 8.252289237 30 -15.221056133 -4.975597136 31 -16.161951003 -15.221056133 32 -27.090505679 -16.161951003 33 -14.685730510 -27.090505679 34 -9.906799467 -14.685730510 35 -22.129637905 -9.906799467 36 -20.598452112 -22.129637905 37 -22.376063890 -20.598452112 38 -7.003559459 -22.376063890 39 -13.937474919 -7.003559459 40 -21.242769547 -13.937474919 41 -25.460290055 -21.242769547 42 -18.939208957 -25.460290055 43 -18.822167587 -18.939208957 44 -22.399362430 -18.822167587 45 -6.049238775 -22.399362430 46 -11.855971960 -6.049238775 47 -12.979413638 -11.855971960 48 13.387048225 -12.979413638 49 19.100670352 13.387048225 50 8.642647052 19.100670352 51 -0.433957325 8.642647052 52 -8.867862971 -0.433957325 53 -7.664128301 -8.867862971 54 -16.160039912 -7.664128301 55 -26.349690736 -16.160039912 56 -18.178482528 -26.349690736 57 -6.632093211 -18.178482528 58 -10.946191396 -6.632093211 59 4.511162774 -10.946191396 60 0.210381072 4.511162774 61 -4.898425386 0.210381072 62 -12.681841763 -4.898425386 63 13.561452475 -12.681841763 64 0.910386244 13.561452475 65 -4.682431680 0.910386244 66 5.128408942 -4.682431680 67 -16.131479282 5.128408942 68 -12.915514674 -16.131479282 69 -28.185356798 -12.915514674 70 -25.041207255 -28.185356798 71 -29.017358290 -25.041207255 72 -24.236140920 -29.017358290 73 -25.335971682 -24.236140920 74 -19.513071767 -25.335971682 75 -30.508730431 -19.513071767 76 -12.791578404 -30.508730431 77 0.190152144 -12.791578404 78 20.038474758 0.190152144 79 18.356754442 20.038474758 80 21.524565278 18.356754442 81 2.711741945 21.524565278 82 18.179289054 2.711741945 83 11.160341012 18.179289054 84 -8.535211763 11.160341012 85 -2.004258860 -8.535211763 86 -2.416186264 -2.004258860 87 15.593726064 -2.416186264 88 19.579096377 15.593726064 89 2.533584041 19.579096377 90 9.922002702 2.533584041 91 4.537793587 9.922002702 92 -27.315753105 4.537793587 93 -7.104156140 -27.315753105 94 -16.959811992 -7.104156140 95 -32.591860679 -16.959811992 96 -33.588469445 -32.591860679 97 -20.119071954 -33.588469445 98 -22.972141566 -20.119071954 99 -11.968060083 -22.972141566 100 -3.078140749 -11.968060083 101 -19.041995143 -3.078140749 102 -7.579958456 -19.041995143 103 -12.421328481 -7.579958456 104 -4.559342095 -12.421328481 105 -11.005779171 -4.559342095 106 -20.214438931 -11.005779171 107 -17.211368014 -20.214438931 108 -6.663587232 -17.211368014 109 -14.237212909 -6.663587232 110 9.575899778 -14.237212909 111 31.777024127 9.575899778 112 72.421651195 31.777024127 113 78.831878330 72.421651195 114 59.433771173 78.831878330 115 54.802634859 59.433771173 116 82.827764625 54.802634859 > 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/7fvpz1292323666.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/8fvpz1292323666.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/9pm6k1292323666.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/10pm6k1292323666.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/11bnn81292323666.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/12w53w1292323666.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/13l6i71292323666.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/14wfzs1292323666.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/15zyyy1292323666.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/162yem1292323666.tab") + } > try(system("convert tmp/1jlr81292323666.ps tmp/1jlr81292323666.png",intern=TRUE)) character(0) > try(system("convert tmp/2bc8t1292323666.ps tmp/2bc8t1292323666.png",intern=TRUE)) character(0) > try(system("convert tmp/3bc8t1292323666.ps tmp/3bc8t1292323666.png",intern=TRUE)) character(0) > try(system("convert tmp/4bc8t1292323666.ps tmp/4bc8t1292323666.png",intern=TRUE)) character(0) > try(system("convert tmp/5bc8t1292323666.ps tmp/5bc8t1292323666.png",intern=TRUE)) character(0) > try(system("convert tmp/6m3qe1292323666.ps tmp/6m3qe1292323666.png",intern=TRUE)) character(0) > try(system("convert tmp/7fvpz1292323666.ps tmp/7fvpz1292323666.png",intern=TRUE)) character(0) > try(system("convert tmp/8fvpz1292323666.ps tmp/8fvpz1292323666.png",intern=TRUE)) character(0) > try(system("convert tmp/9pm6k1292323666.ps tmp/9pm6k1292323666.png",intern=TRUE)) character(0) > try(system("convert tmp/10pm6k1292323666.ps tmp/10pm6k1292323666.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.405 1.845 11.085