R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-bit) 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 + ,5.98 + ,9.12 + ,14163200 + ,-0.2643 + ,23.62 + ,2151.83 + ,0.0353 + ,109.2 + ,5.49 + ,11.03 + ,18184800 + ,-0.2643 + ,21.90 + ,1840.26 + ,0.0292 + ,116.9 + ,5.31 + ,12.74 + ,20810300 + ,-0.1918 + ,27.12 + ,2116.24 + ,0.0327 + ,109.9 + ,4.8 + ,9.98 + ,12843000 + ,-0.1918 + ,27.70 + ,2110.49 + ,0.0362 + ,116.1 + ,4.21 + ,11.62 + ,13866700 + ,-0.1918 + ,29.23 + ,2160.54 + ,0.0325 + ,118.9 + ,3.97 + ,9.40 + ,15119200 + ,-0.2246 + ,26.50 + ,2027.13 + ,0.0272 + ,116.3 + ,3.77 + ,9.27 + ,8301600 + ,-0.2246 + ,22.84 + ,1805.43 + ,0.0272 + ,114.0 + ,3.65 + ,7.76 + ,14039600 + ,-0.2246 + ,20.49 + ,1498.80 + ,0.0265 + ,97.0 + ,3.07 + ,8.78 + ,12139700 + ,0.3654 + ,23.28 + ,1690.20 + ,0.0213 + ,85.3 + ,2.49 + ,10.65 + ,9649000 + ,0.3654 + ,25.71 + ,1930.58 + ,0.019 + ,84.9 + ,2.09 + ,10.95 + ,8513600 + ,0.3654 + ,26.52 + ,1950.40 + ,0.0155 + ,94.6 + ,1.82 + ,12.36 + ,15278600 + ,0.0447 + ,25.51 + ,1934.03 + ,0.0114 + ,97.8 + ,1.73 + ,10.85 + ,15590900 + ,0.0447 + ,23.36 + ,1731.49 + ,0.0114 + ,95.0 + ,1.74 + ,11.84 + ,9691100 + ,0.0447 + ,24.15 + ,1845.35 + ,0.0148 + ,110.7 + ,1.73 + ,12.14 + ,10882700 + ,-0.0312 + ,20.92 + ,1688.23 + ,0.0164 + ,108.5 + ,1.75 + ,11.65 + ,10294800 + ,-0.0312 + ,20.38 + ,1615.73 + ,0.0118 + ,110.3 + ,1.75 + ,8.86 + ,16031900 + ,-0.0312 + ,21.90 + ,1463.21 + ,0.0107 + ,106.3 + ,1.75 + ,7.63 + ,13683600 + ,-0.0048 + ,19.21 + ,1328.26 + ,0.0146 + ,97.4 + ,1.73 + ,7.38 + ,8677200 + ,-0.0048 + ,19.65 + ,1314.85 + ,0.018 + ,94.5 + ,1.74 + ,7.25 + ,9874100 + ,-0.0048 + ,17.51 + ,1172.06 + ,0.0151 + ,93.7 + ,1.75 + ,8.03 + ,10725500 + ,0.0705 + ,21.41 + ,1329.75 + ,0.0203 + ,79.6 + ,1.75 + ,7.75 + ,8348400 + ,0.0705 + ,23.09 + ,1478.78 + ,0.022 + ,84.9 + ,1.34 + ,7.16 + ,8046200 + ,0.0705 + ,20.70 + ,1335.51 + ,0.0238 + ,80.7 + ,1.24 + ,7.18 + ,10862300 + ,-0.0134 + ,19.00 + ,1320.91 + ,0.026 + ,78.8 + ,1.24 + ,7.51 + ,8100300 + ,-0.0134 + ,19.04 + ,1337.52 + ,0.0298 + ,64.8 + ,1.26 + ,7.07 + ,7287500 + ,-0.0134 + ,19.45 + ,1341.17 + ,0.0302 + ,61.4 + ,1.25 + ,7.11 + ,14002500 + ,0.0812 + ,20.54 + ,1464.31 + ,0.0222 + ,81.0 + ,1.26 + ,8.98 + ,19037900 + ,0.0812 + ,19.77 + ,1595.91 + ,0.0206 + ,83.6 + ,1.26 + ,9.53 + ,10774600 + ,0.0812 + ,20.60 + ,1622.80 + ,0.0211 + ,83.5 + ,1.22 + ,10.54 + ,8960600 + ,0.1885 + ,21.21 + ,1735.02 + ,0.0211 + ,77.0 + ,1.01 + ,11.31 + ,7773300 + ,0.1885 + ,21.30 + ,1810.45 + ,0.0216 + ,81.7 + ,1.03 + ,10.36 + ,9579700 + ,0.1885 + ,22.33 + ,1786.94 + ,0.0232 + ,77.0 + ,1.01 + ,11.44 + ,11270700 + ,0.3628 + ,21.12 + ,1932.21 + ,0.0204 + ,81.7 + ,1.01 + ,10.45 + ,9492800 + ,0.3628 + ,20.77 + ,1960.26 + ,0.0177 + ,92.5 + ,1 + ,10.69 + ,9136800 + ,0.3628 + ,22.11 + ,2003.37 + ,0.0188 + ,91.7 + ,0.98 + ,11.28 + ,14487600 + ,0.2942 + ,22.34 + ,2066.15 + ,0.0193 + ,96.4 + ,1 + ,11.96 + ,10133200 + ,0.2942 + ,21.43 + ,2029.82 + ,0.0169 + ,88.5 + ,1.01 + ,13.52 + ,18659700 + ,0.2942 + ,20.14 + ,1994.22 + ,0.0174 + ,88.5 + ,1 + ,12.89 + ,15980700 + ,0.3036 + ,21.11 + ,1920.15 + ,0.0229 + ,93.0 + ,1 + ,14.03 + ,9732100 + ,0.3036 + ,21.19 + ,1986.74 + ,0.0305 + ,93.1 + ,1 + ,16.27 + ,14626300 + ,0.3036 + ,23.07 + ,2047.79 + ,0.0327 + ,102.8 + ,1.03 + ,16.17 + ,16904000 + ,0.3703 + ,23.01 + ,1887.36 + ,0.0299 + ,105.7 + ,1.26 + ,17.25 + ,13616700 + ,0.3703 + ,22.12 + ,1838.10 + ,0.0265 + ,98.7 + ,1.43 + ,19.38 + ,13772900 + ,0.3703 + ,22.40 + ,1896.84 + ,0.0254 + ,96.7 + ,1.61 + ,26.20 + ,28749200 + ,0.7398 + ,22.66 + ,1974.99 + ,0.0319 + ,92.9 + ,1.76 + ,33.53 + ,31408300 + ,0.7398 + ,24.21 + ,2096.81 + ,0.0352 + ,92.6 + ,1.93 + ,32.20 + ,26342800 + ,0.7398 + ,24.13 + ,2175.44 + ,0.0326 + ,102.7 + ,2.16 + ,38.45 + ,48909500 + ,0.6988 + ,23.73 + ,2062.41 + ,0.0297 + ,105.1 + ,2.28 + ,44.86 + ,41542400 + ,0.6988 + ,22.79 + ,2051.72 + ,0.0301 + ,104.4 + ,2.5 + ,41.67 + ,24857200 + ,0.6988 + ,21.89 + ,1999.23 + ,0.0315 + ,103.0 + ,2.63 + ,36.06 + ,34093700 + ,0.7478 + ,22.92 + ,1921.65 + ,0.0351 + ,97.5 + ,2.79 + ,39.76 + ,22555200 + ,0.7478 + ,23.44 + ,2068.22 + ,0.028 + ,103.1 + ,3 + ,36.81 + ,19067500 + ,0.7478 + ,22.57 + ,2056.96 + ,0.0253 + ,106.2 + ,3.04 + ,42.65 + ,19029100 + ,0.5651 + ,23.27 + ,2184.83 + ,0.0317 + ,103.6 + ,3.26 + ,46.89 + ,15223200 + ,0.5651 + ,24.95 + ,2152.09 + ,0.0364 + ,105.5 + ,3.5 + ,53.61 + ,21903700 + ,0.5651 + ,23.45 + ,2151.69 + ,0.0469 + ,87.5 + ,3.62 + ,57.59 + ,33306600 + ,0.6473 + ,23.42 + ,2120.30 + ,0.0435 + ,85.2 + ,3.78 + ,67.82 + ,23898100 + ,0.6473 + ,25.30 + ,2232.82 + ,0.0346 + ,98.3 + ,4 + ,71.89 + ,23279600 + ,0.6473 + ,23.90 + ,2205.32 + ,0.0342 + ,103.8 + ,4.16 + ,75.51 + ,40699800 + ,0.3441 + ,25.73 + ,2305.82 + ,0.0399 + ,106.8 + ,4.29 + ,68.49 + ,37646000 + ,0.3441 + ,24.64 + ,2281.39 + ,0.036 + ,102.7 + ,4.49 + ,62.72 + ,37277000 + ,0.3441 + ,24.95 + ,2339.79 + ,0.0336 + ,107.5 + ,4.59 + ,70.39 + ,39246800 + ,0.2415 + ,22.15 + ,2322.57 + ,0.0355 + ,109.8 + ,4.79 + ,59.77 + ,27418400 + ,0.2415 + ,20.85 + ,2178.88 + ,0.0417 + ,104.7 + ,4.94 + ,57.27 + ,30318700 + ,0.2415 + ,21.45 + ,2172.09 + ,0.0432 + ,105.7 + ,4.99 + ,67.96 + ,32808100 + ,0.3151 + ,22.15 + ,2091.47 + ,0.0415 + ,107.0 + ,5.24 + ,67.85 + ,28668200 + ,0.3151 + ,23.75 + ,2183.75 + ,0.0382 + ,100.2 + ,5.25 + ,76.98 + ,32370300 + ,0.3151 + ,25.27 + ,2258.43 + ,0.0206 + ,105.9 + ,5.25 + ,81.08 + ,24171100 + ,0.239 + ,26.53 + ,2366.71 + ,0.0131 + ,105.1 + ,5.25 + ,91.66 + ,25009100 + ,0.239 + ,27.22 + ,2431.77 + ,0.0197 + ,105.3 + ,5.25 + ,84.84 + ,32084300 + ,0.239 + ,27.69 + ,2415.29 + ,0.0254 + ,110.0 + ,5.24 + ,85.73 + ,50117500 + ,0.2127 + ,28.61 + ,2463.93 + ,0.0208 + ,110.2 + ,5.25 + ,84.61 + ,27522200 + ,0.2127 + ,26.21 + ,2416.15 + ,0.0242 + ,111.2 + ,5.26 + ,92.91 + ,26816800 + ,0.2127 + ,25.93 + ,2421.64 + ,0.0278 + ,108.2 + ,5.26 + ,99.80 + ,25136100 + ,0.273 + ,27.86 + ,2525.09 + ,0.0257 + ,106.3 + ,5.25 + ,121.19 + ,30295600 + ,0.273 + ,28.65 + ,2604.52 + ,0.0269 + ,108.5 + ,5.25 + ,122.04 + ,41526100 + ,0.273 + ,27.51 + ,2603.23 + ,0.0269 + ,105.3 + ,5.25 + ,131.76 + ,43845100 + ,0.3657 + ,27.06 + ,2546.27 + ,0.0236 + ,111.9 + ,5.26 + ,138.48 + ,39188900 + ,0.3657 + ,26.91 + ,2596.36 + ,0.0197 + ,105.6 + ,5.02 + ,153.47 + ,40496400 + ,0.3657 + ,27.60 + ,2701.50 + ,0.0276 + ,99.5 + ,4.94 + ,189.95 + ,37438400 + ,0.4643 + ,34.48 + ,2859.12 + ,0.0354 + ,95.2 + ,4.76 + ,182.22 + ,46553700 + ,0.4643 + ,31.58 + ,2660.96 + ,0.0431 + ,87.8 + ,4.49 + ,198.08 + ,31771400 + ,0.4643 + ,33.46 + ,2652.28 + ,0.0408 + ,90.6 + ,4.24 + ,135.36 + ,62108100 + ,0.5096 + ,30.64 + ,2389.86 + ,0.0428 + ,87.9 + ,3.94 + ,125.02 + ,46645400 + ,0.5096 + ,25.66 + ,2271.48 + ,0.0403 + ,76.4 + ,2.98 + ,143.50 + ,42313100 + ,0.5096 + ,26.78 + ,2279.10 + ,0.0398 + ,65.9 + ,2.61 + ,173.95 + ,38841700 + ,0.3592 + ,26.91 + ,2412.80 + ,0.0394 + ,62.3 + ,2.28 + ,188.75 + ,32650300 + ,0.3592 + ,26.82 + ,2522.66 + ,0.0418 + ,57.2 + ,1.98 + ,167.44 + ,34281100 + ,0.3592 + ,26.05 + ,2292.98 + ,0.0502 + ,50.4 + ,2 + ,158.95 + ,33096200 + ,0.7439 + ,24.36 + ,2325.55 + ,0.056 + ,51.9 + ,2.01 + ,169.53 + ,23273800 + ,0.7439 + ,25.94 + ,2367.52 + ,0.0537 + ,58.5 + ,2 + ,113.66 + ,43697600 + ,0.7439 + ,25.37 + ,2091.88 + ,0.0494 + ,61.4 + ,1.81 + ,107.59 + ,66902300 + ,0.139 + ,21.23 + ,1720.95 + ,0.0366 + ,38.8 + ,0.97 + ,92.67 + ,44957200 + ,0.139 + ,19.35 + ,1535.57 + ,0.0107 + ,44.9 + ,0.39 + ,85.35 + ,33800900 + ,0.139 + ,18.61 + ,1577.03 + ,0.0009 + ,38.6 + ,0.16 + ,90.13 + ,33487900 + ,0.1383 + ,16.37 + ,1476.42 + ,0.0003 + ,4.0 + ,0.15 + ,89.31 + ,27394900 + ,0.1383 + ,15.56 + ,1377.84 + ,0.0024 + ,25.3 + ,0.22 + ,105.12 + ,25963400 + ,0.1383 + ,17.70 + ,1528.59 + ,-0.0038 + ,26.9 + ,0.18 + ,125.83 + ,20952600 + ,0.2874 + ,19.52 + ,1717.30 + ,-0.0074 + ,40.8 + ,0.15 + ,135.81 + ,17702900 + ,0.2874 + ,20.26 + ,1774.33 + ,-0.0128 + ,54.8 + ,0.18 + ,142.43 + ,21282100 + ,0.2874 + ,23.05 + ,1835.04 + ,-0.0143 + ,49.3 + ,0.21 + ,163.39 + ,18449100 + ,0.0596 + ,22.81 + ,1978.50 + ,-0.021 + ,47.4 + ,0.16 + ,168.21 + ,14415700 + ,0.0596 + ,24.04 + ,2009.06 + ,-0.0148 + ,54.5 + ,0.16 + ,185.35 + ,17906300 + ,0.0596 + ,25.08 + ,2122.42 + ,-0.0129 + ,53.4 + ,0.15 + ,188.50 + ,22197500 + ,0.3201 + ,27.04 + ,2045.11 + ,-0.0018 + ,48.7 + ,0.12 + ,199.91 + ,15856500 + ,0.3201 + ,28.81 + ,2144.60 + ,0.0184 + ,50.6 + ,0.12 + ,210.73 + ,19068700 + ,0.3201 + ,29.86 + ,2269.15 + ,0.0272 + ,53.6 + ,0.12 + ,192.06 + ,30855100 + ,0.486 + ,27.61 + ,2147.35 + ,0.0263 + ,56.5 + ,0.11 + ,204.62 + ,21209000 + ,0.486 + ,28.22 + ,2238.26 + ,0.0214 + ,46.4 + ,0.13 + ,235.00 + ,19541600 + ,0.486 + ,28.83 + ,2397.96 + ,0.0231 + ,52.3 + ,0.16 + ,261.09 + ,21955000 + ,0.6129 + ,30.06 + ,2461.19 + ,0.0224 + ,57.7 + ,0.2 + ,256.88 + ,33725900 + ,0.6129 + ,25.51 + ,2257.04 + ,0.0202 + ,62.7 + ,0.2 + ,251.53 + ,28192800 + ,0.6129 + ,22.75 + ,2109.24 + ,0.0105 + ,54.3 + ,0.18 + ,257.25 + ,27377000 + ,0.6665 + ,25.52 + ,2254.70 + ,0.0124 + ,51.0 + ,0.18 + ,243.10 + ,16228100 + ,0.6665 + ,23.33 + ,2114.03 + ,0.0115 + ,53.2 + ,0.19 + ,283.75 + ,21278900 + ,0.6665 + ,24.34 + ,2368.62 + ,0.0114 + ,48.6 + ,0.19) + ,dim=c(8 + ,117) + ,dimnames=list(c('APPLE' + ,'VOLUME' + ,'REV.GROWTH' + ,'MICROSOFT' + ,'NASDAQ' + ,'INFLATION' + ,'CONS.CONF' + ,'FED.FUNDS.RATE') + ,1:117)) > y <- array(NA,dim=c(8,117),dimnames=list(c('APPLE','VOLUME','REV.GROWTH','MICROSOFT','NASDAQ','INFLATION','CONS.CONF','FED.FUNDS.RATE'),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 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '1' > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from 'package:base': as.Date, 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 1 10.81 24563400 -0.2643 24.45 2772.73 0.0373 115.7 2 9.12 14163200 -0.2643 23.62 2151.83 0.0353 109.2 3 11.03 18184800 -0.2643 21.90 1840.26 0.0292 116.9 4 12.74 20810300 -0.1918 27.12 2116.24 0.0327 109.9 5 9.98 12843000 -0.1918 27.70 2110.49 0.0362 116.1 6 11.62 13866700 -0.1918 29.23 2160.54 0.0325 118.9 7 9.40 15119200 -0.2246 26.50 2027.13 0.0272 116.3 8 9.27 8301600 -0.2246 22.84 1805.43 0.0272 114.0 9 7.76 14039600 -0.2246 20.49 1498.80 0.0265 97.0 10 8.78 12139700 0.3654 23.28 1690.20 0.0213 85.3 11 10.65 9649000 0.3654 25.71 1930.58 0.0190 84.9 12 10.95 8513600 0.3654 26.52 1950.40 0.0155 94.6 13 12.36 15278600 0.0447 25.51 1934.03 0.0114 97.8 14 10.85 15590900 0.0447 23.36 1731.49 0.0114 95.0 15 11.84 9691100 0.0447 24.15 1845.35 0.0148 110.7 16 12.14 10882700 -0.0312 20.92 1688.23 0.0164 108.5 17 11.65 10294800 -0.0312 20.38 1615.73 0.0118 110.3 18 8.86 16031900 -0.0312 21.90 1463.21 0.0107 106.3 19 7.63 13683600 -0.0048 19.21 1328.26 0.0146 97.4 20 7.38 8677200 -0.0048 19.65 1314.85 0.0180 94.5 21 7.25 9874100 -0.0048 17.51 1172.06 0.0151 93.7 22 8.03 10725500 0.0705 21.41 1329.75 0.0203 79.6 23 7.75 8348400 0.0705 23.09 1478.78 0.0220 84.9 24 7.16 8046200 0.0705 20.70 1335.51 0.0238 80.7 25 7.18 10862300 -0.0134 19.00 1320.91 0.0260 78.8 26 7.51 8100300 -0.0134 19.04 1337.52 0.0298 64.8 27 7.07 7287500 -0.0134 19.45 1341.17 0.0302 61.4 28 7.11 14002500 0.0812 20.54 1464.31 0.0222 81.0 29 8.98 19037900 0.0812 19.77 1595.91 0.0206 83.6 30 9.53 10774600 0.0812 20.60 1622.80 0.0211 83.5 31 10.54 8960600 0.1885 21.21 1735.02 0.0211 77.0 32 11.31 7773300 0.1885 21.30 1810.45 0.0216 81.7 33 10.36 9579700 0.1885 22.33 1786.94 0.0232 77.0 34 11.44 11270700 0.3628 21.12 1932.21 0.0204 81.7 35 10.45 9492800 0.3628 20.77 1960.26 0.0177 92.5 36 10.69 9136800 0.3628 22.11 2003.37 0.0188 91.7 37 11.28 14487600 0.2942 22.34 2066.15 0.0193 96.4 38 11.96 10133200 0.2942 21.43 2029.82 0.0169 88.5 39 13.52 18659700 0.2942 20.14 1994.22 0.0174 88.5 40 12.89 15980700 0.3036 21.11 1920.15 0.0229 93.0 41 14.03 9732100 0.3036 21.19 1986.74 0.0305 93.1 42 16.27 14626300 0.3036 23.07 2047.79 0.0327 102.8 43 16.17 16904000 0.3703 23.01 1887.36 0.0299 105.7 44 17.25 13616700 0.3703 22.12 1838.10 0.0265 98.7 45 19.38 13772900 0.3703 22.40 1896.84 0.0254 96.7 46 26.20 28749200 0.7398 22.66 1974.99 0.0319 92.9 47 33.53 31408300 0.7398 24.21 2096.81 0.0352 92.6 48 32.20 26342800 0.7398 24.13 2175.44 0.0326 102.7 49 38.45 48909500 0.6988 23.73 2062.41 0.0297 105.1 50 44.86 41542400 0.6988 22.79 2051.72 0.0301 104.4 51 41.67 24857200 0.6988 21.89 1999.23 0.0315 103.0 52 36.06 34093700 0.7478 22.92 1921.65 0.0351 97.5 53 39.76 22555200 0.7478 23.44 2068.22 0.0280 103.1 54 36.81 19067500 0.7478 22.57 2056.96 0.0253 106.2 55 42.65 19029100 0.5651 23.27 2184.83 0.0317 103.6 56 46.89 15223200 0.5651 24.95 2152.09 0.0364 105.5 57 53.61 21903700 0.5651 23.45 2151.69 0.0469 87.5 58 57.59 33306600 0.6473 23.42 2120.30 0.0435 85.2 59 67.82 23898100 0.6473 25.30 2232.82 0.0346 98.3 60 71.89 23279600 0.6473 23.90 2205.32 0.0342 103.8 61 75.51 40699800 0.3441 25.73 2305.82 0.0399 106.8 62 68.49 37646000 0.3441 24.64 2281.39 0.0360 102.7 63 62.72 37277000 0.3441 24.95 2339.79 0.0336 107.5 64 70.39 39246800 0.2415 22.15 2322.57 0.0355 109.8 65 59.77 27418400 0.2415 20.85 2178.88 0.0417 104.7 66 57.27 30318700 0.2415 21.45 2172.09 0.0432 105.7 67 67.96 32808100 0.3151 22.15 2091.47 0.0415 107.0 68 67.85 28668200 0.3151 23.75 2183.75 0.0382 100.2 69 76.98 32370300 0.3151 25.27 2258.43 0.0206 105.9 70 81.08 24171100 0.2390 26.53 2366.71 0.0131 105.1 71 91.66 25009100 0.2390 27.22 2431.77 0.0197 105.3 72 84.84 32084300 0.2390 27.69 2415.29 0.0254 110.0 73 85.73 50117500 0.2127 28.61 2463.93 0.0208 110.2 74 84.61 27522200 0.2127 26.21 2416.15 0.0242 111.2 75 92.91 26816800 0.2127 25.93 2421.64 0.0278 108.2 76 99.80 25136100 0.2730 27.86 2525.09 0.0257 106.3 77 121.19 30295600 0.2730 28.65 2604.52 0.0269 108.5 78 122.04 41526100 0.2730 27.51 2603.23 0.0269 105.3 79 131.76 43845100 0.3657 27.06 2546.27 0.0236 111.9 80 138.48 39188900 0.3657 26.91 2596.36 0.0197 105.6 81 153.47 40496400 0.3657 27.60 2701.50 0.0276 99.5 82 189.95 37438400 0.4643 34.48 2859.12 0.0354 95.2 83 182.22 46553700 0.4643 31.58 2660.96 0.0431 87.8 84 198.08 31771400 0.4643 33.46 2652.28 0.0408 90.6 85 135.36 62108100 0.5096 30.64 2389.86 0.0428 87.9 86 125.02 46645400 0.5096 25.66 2271.48 0.0403 76.4 87 143.50 42313100 0.5096 26.78 2279.10 0.0398 65.9 88 173.95 38841700 0.3592 26.91 2412.80 0.0394 62.3 89 188.75 32650300 0.3592 26.82 2522.66 0.0418 57.2 90 167.44 34281100 0.3592 26.05 2292.98 0.0502 50.4 91 158.95 33096200 0.7439 24.36 2325.55 0.0560 51.9 92 169.53 23273800 0.7439 25.94 2367.52 0.0537 58.5 93 113.66 43697600 0.7439 25.37 2091.88 0.0494 61.4 94 107.59 66902300 0.1390 21.23 1720.95 0.0366 38.8 95 92.67 44957200 0.1390 19.35 1535.57 0.0107 44.9 96 85.35 33800900 0.1390 18.61 1577.03 0.0009 38.6 97 90.13 33487900 0.1383 16.37 1476.42 0.0003 4.0 98 89.31 27394900 0.1383 15.56 1377.84 0.0024 25.3 99 105.12 25963400 0.1383 17.70 1528.59 -0.0038 26.9 100 125.83 20952600 0.2874 19.52 1717.30 -0.0074 40.8 101 135.81 17702900 0.2874 20.26 1774.33 -0.0128 54.8 102 142.43 21282100 0.2874 23.05 1835.04 -0.0143 49.3 103 163.39 18449100 0.0596 22.81 1978.50 -0.0210 47.4 104 168.21 14415700 0.0596 24.04 2009.06 -0.0148 54.5 105 185.35 17906300 0.0596 25.08 2122.42 -0.0129 53.4 106 188.50 22197500 0.3201 27.04 2045.11 -0.0018 48.7 107 199.91 15856500 0.3201 28.81 2144.60 0.0184 50.6 108 210.73 19068700 0.3201 29.86 2269.15 0.0272 53.6 109 192.06 30855100 0.4860 27.61 2147.35 0.0263 56.5 110 204.62 21209000 0.4860 28.22 2238.26 0.0214 46.4 111 235.00 19541600 0.4860 28.83 2397.96 0.0231 52.3 112 261.09 21955000 0.6129 30.06 2461.19 0.0224 57.7 113 256.88 33725900 0.6129 25.51 2257.04 0.0202 62.7 114 251.53 28192800 0.6129 22.75 2109.24 0.0105 54.3 115 257.25 27377000 0.6665 25.52 2254.70 0.0124 51.0 116 243.10 16228100 0.6665 23.33 2114.03 0.0115 53.2 117 283.75 21278900 0.6665 24.34 2368.62 0.0114 48.6 FED.FUNDS.RATE 1 5.98 2 5.49 3 5.31 4 4.80 5 4.21 6 3.97 7 3.77 8 3.65 9 3.07 10 2.49 11 2.09 12 1.82 13 1.73 14 1.74 15 1.73 16 1.75 17 1.75 18 1.75 19 1.73 20 1.74 21 1.75 22 1.75 23 1.34 24 1.24 25 1.24 26 1.26 27 1.25 28 1.26 29 1.26 30 1.22 31 1.01 32 1.03 33 1.01 34 1.01 35 1.00 36 0.98 37 1.00 38 1.01 39 1.00 40 1.00 41 1.00 42 1.03 43 1.26 44 1.43 45 1.61 46 1.76 47 1.93 48 2.16 49 2.28 50 2.50 51 2.63 52 2.79 53 3.00 54 3.04 55 3.26 56 3.50 57 3.62 58 3.78 59 4.00 60 4.16 61 4.29 62 4.49 63 4.59 64 4.79 65 4.94 66 4.99 67 5.24 68 5.25 69 5.25 70 5.25 71 5.25 72 5.24 73 5.25 74 5.26 75 5.26 76 5.25 77 5.25 78 5.25 79 5.26 80 5.02 81 4.94 82 4.76 83 4.49 84 4.24 85 3.94 86 2.98 87 2.61 88 2.28 89 1.98 90 2.00 91 2.01 92 2.00 93 1.81 94 0.97 95 0.39 96 0.16 97 0.15 98 0.22 99 0.18 100 0.15 101 0.18 102 0.21 103 0.16 104 0.16 105 0.15 106 0.12 107 0.12 108 0.12 109 0.11 110 0.13 111 0.16 112 0.20 113 0.20 114 0.18 115 0.18 116 0.19 117 0.19 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) VOLUME REV.GROWTH MICROSOFT NASDAQ -8.520e+01 4.389e-07 2.816e+01 6.507e+00 8.815e-02 INFLATION CONS.CONF FED.FUNDS.RATE -9.618e+02 -1.981e+00 1.030e+00 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -71.861 -18.854 -3.797 12.983 90.629 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -8.520e+01 2.843e+01 -2.997 0.003372 ** VOLUME 4.389e-07 3.455e-07 1.270 0.206671 REV.GROWTH 2.816e+01 1.589e+01 1.772 0.079120 . MICROSOFT 6.507e+00 1.544e+00 4.214 5.18e-05 *** NASDAQ 8.815e-02 1.842e-02 4.785 5.39e-06 *** INFLATION -9.618e+02 2.685e+02 -3.582 0.000512 *** CONS.CONF -1.981e+00 2.162e-01 -9.163 3.47e-15 *** FED.FUNDS.RATE 1.030e+00 3.810e+00 0.270 0.787394 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 31.92 on 109 degrees of freedom Multiple R-squared: 0.8341, Adjusted R-squared: 0.8235 F-statistic: 78.3 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,] 9.939849e-05 1.987970e-04 0.99990060 [2,] 3.755285e-06 7.510570e-06 0.99999624 [3,] 1.404152e-07 2.808304e-07 0.99999986 [4,] 4.436795e-09 8.873590e-09 1.00000000 [5,] 3.278750e-10 6.557500e-10 1.00000000 [6,] 4.839382e-11 9.678763e-11 1.00000000 [7,] 1.872734e-12 3.745469e-12 1.00000000 [8,] 1.010784e-12 2.021567e-12 1.00000000 [9,] 8.595012e-14 1.719002e-13 1.00000000 [10,] 5.048295e-15 1.009659e-14 1.00000000 [11,] 4.496346e-16 8.992693e-16 1.00000000 [12,] 2.782934e-17 5.565869e-17 1.00000000 [13,] 1.195570e-18 2.391139e-18 1.00000000 [14,] 6.608528e-20 1.321706e-19 1.00000000 [15,] 5.809119e-21 1.161824e-20 1.00000000 [16,] 7.987360e-22 1.597472e-21 1.00000000 [17,] 4.977821e-23 9.955642e-23 1.00000000 [18,] 4.830349e-24 9.660697e-24 1.00000000 [19,] 2.841251e-25 5.682502e-25 1.00000000 [20,] 1.889037e-26 3.778073e-26 1.00000000 [21,] 1.292922e-27 2.585844e-27 1.00000000 [22,] 9.731980e-29 1.946396e-28 1.00000000 [23,] 4.390002e-30 8.780004e-30 1.00000000 [24,] 3.064150e-31 6.128300e-31 1.00000000 [25,] 2.200335e-32 4.400670e-32 1.00000000 [26,] 1.648296e-33 3.296592e-33 1.00000000 [27,] 1.152905e-34 2.305810e-34 1.00000000 [28,] 1.355298e-35 2.710596e-35 1.00000000 [29,] 1.342821e-35 2.685643e-35 1.00000000 [30,] 3.045636e-36 6.091271e-36 1.00000000 [31,] 2.487148e-36 4.974297e-36 1.00000000 [32,] 1.542509e-36 3.085018e-36 1.00000000 [33,] 1.973734e-37 3.947468e-37 1.00000000 [34,] 6.802757e-37 1.360551e-36 1.00000000 [35,] 4.480353e-35 8.960706e-35 1.00000000 [36,] 1.759259e-34 3.518519e-34 1.00000000 [37,] 5.418197e-32 1.083639e-31 1.00000000 [38,] 5.787310e-31 1.157462e-30 1.00000000 [39,] 2.114948e-31 4.229897e-31 1.00000000 [40,] 1.091901e-28 2.183802e-28 1.00000000 [41,] 6.059185e-26 1.211837e-25 1.00000000 [42,] 9.566150e-27 1.913230e-26 1.00000000 [43,] 7.717870e-26 1.543574e-25 1.00000000 [44,] 1.036567e-25 2.073133e-25 1.00000000 [45,] 1.922522e-22 3.845044e-22 1.00000000 [46,] 5.970324e-20 1.194065e-19 1.00000000 [47,] 2.814049e-17 5.628098e-17 1.00000000 [48,] 8.704414e-16 1.740883e-15 1.00000000 [49,] 3.280816e-12 6.561632e-12 1.00000000 [50,] 5.449240e-10 1.089848e-09 1.00000000 [51,] 2.461026e-07 4.922052e-07 0.99999975 [52,] 1.545666e-06 3.091331e-06 0.99999845 [53,] 8.087778e-06 1.617556e-05 0.99999191 [54,] 2.328259e-05 4.656518e-05 0.99997672 [55,] 1.766849e-05 3.533699e-05 0.99998233 [56,] 1.040325e-05 2.080650e-05 0.99998960 [57,] 3.172598e-05 6.345195e-05 0.99996827 [58,] 6.142904e-05 1.228581e-04 0.99993857 [59,] 1.069245e-04 2.138490e-04 0.99989308 [60,] 2.308856e-04 4.617712e-04 0.99976911 [61,] 7.472454e-04 1.494491e-03 0.99925275 [62,] 9.074061e-04 1.814812e-03 0.99909259 [63,] 8.690997e-04 1.738199e-03 0.99913090 [64,] 1.011960e-03 2.023920e-03 0.99898804 [65,] 2.389938e-03 4.779877e-03 0.99761006 [66,] 4.059596e-03 8.119192e-03 0.99594040 [67,] 1.642239e-02 3.284478e-02 0.98357761 [68,] 2.411437e-02 4.822874e-02 0.97588563 [69,] 3.691197e-02 7.382393e-02 0.96308803 [70,] 5.169095e-02 1.033819e-01 0.94830905 [71,] 1.018448e-01 2.036895e-01 0.89815525 [72,] 2.751694e-01 5.503388e-01 0.72483061 [73,] 3.699915e-01 7.399829e-01 0.63000853 [74,] 8.839452e-01 2.321097e-01 0.11605484 [75,] 9.279235e-01 1.441530e-01 0.07207649 [76,] 9.068329e-01 1.863343e-01 0.09316713 [77,] 9.219776e-01 1.560448e-01 0.07802239 [78,] 9.441659e-01 1.116681e-01 0.05583407 [79,] 9.444776e-01 1.110449e-01 0.05552243 [80,] 9.787187e-01 4.256252e-02 0.02128126 [81,] 9.713197e-01 5.736068e-02 0.02868034 [82,] 9.665494e-01 6.690112e-02 0.03345056 [83,] 9.852150e-01 2.956990e-02 0.01478495 [84,] 9.816591e-01 3.668179e-02 0.01834090 [85,] 9.688646e-01 6.227075e-02 0.03113538 [86,] 9.715700e-01 5.686008e-02 0.02843004 [87,] 9.592939e-01 8.141216e-02 0.04070608 [88,] 9.405161e-01 1.189677e-01 0.05948386 [89,] 9.548085e-01 9.038291e-02 0.04519145 [90,] 9.304403e-01 1.391193e-01 0.06955966 [91,] 9.731571e-01 5.368580e-02 0.02684290 [92,] 9.628075e-01 7.438497e-02 0.03719249 [93,] 9.460931e-01 1.078137e-01 0.05390686 [94,] 9.336822e-01 1.326356e-01 0.06631778 [95,] 9.625721e-01 7.485588e-02 0.03742794 [96,] 9.739778e-01 5.204443e-02 0.02602221 > postscript(file="/var/wessaorg/rcomp/tmp/1r4i41354803253.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/wessaorg/rcomp/tmp/28ga51354803253.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/wessaorg/rcomp/tmp/3028j1354803253.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/wessaorg/rcomp/tmp/4ugko1354803253.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/wessaorg/rcomp/tmp/5dg251354803253.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 6 -51.9093312 -3.1965486 45.1772909 -24.5744946 -10.8480167 -21.7889696 7 8 9 10 11 12 -4.1541424 37.6327192 42.1710920 -35.1952619 -71.8254217 -61.9167463 13 14 15 16 17 18 -43.9427536 -19.3036919 3.4813997 37.4221421 46.2362719 35.5008309 19 20 21 22 23 24 50.0973794 47.8788145 69.3503460 5.4289263 -5.3191199 15.9176197 25 26 27 28 29 30 27.7641839 3.4817901 -5.9314100 1.6740167 -1.6449259 -4.9148805 31 32 33 34 35 36 -32.6517031 -28.8242530 -42.9478493 -45.8327598 -27.4291385 -40.0581662 37 38 39 40 41 42 -37.1446430 -43.3986848 -33.5582193 -18.8544970 -13.8545806 -10.0756642 43 44 45 46 47 48 4.2940778 -0.3623477 -10.5062157 -30.6750375 -42.9314339 -31.1780485 49 50 51 52 53 54 -19.2705143 -3.7970358 9.2585606 -9.2462203 -12.7368457 -3.9995751 55 56 57 58 59 60 -8.0467007 -2.1440009 -14.2443168 -22.6128102 -13.2395425 12.9814861 61 62 63 64 65 66 8.0178705 -0.4953205 -6.1708034 29.4377637 40.8398858 37.1337201 67 68 69 70 71 72 47.8936255 14.4002621 -0.2036686 -16.9038306 -10.1722013 -6.8995552 73 74 75 76 77 78 -27.4962514 6.3697907 13.8366910 -7.6839184 4.8118633 1.9245250 79 80 81 82 83 84 25.8561566 15.1959950 11.4506820 -12.9941477 4.6365088 19.1097254 85 86 87 88 89 90 -19.8360269 -4.7485537 -13.2267847 3.1734780 4.1063566 1.9247396 91 92 93 94 95 96 -0.2124111 11.5716615 -23.4509922 -19.2557636 -8.1987888 -31.1312479 97 98 99 100 101 102 -71.8610596 -11.9027227 -25.4296550 -11.0907751 12.9832701 -17.8420681 103 104 105 106 107 108 -10.4655876 5.4562557 3.9630761 -6.6472072 10.4515318 16.4574569 109 110 111 112 113 114 18.2092897 -1.7216072 24.6357391 42.4995360 88.5133747 90.6293220 115 116 117 59.6424371 80.5179184 80.7280119 > postscript(file="/var/wessaorg/rcomp/tmp/6lame1354803253.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 -51.9093312 NA 1 -3.1965486 -51.9093312 2 45.1772909 -3.1965486 3 -24.5744946 45.1772909 4 -10.8480167 -24.5744946 5 -21.7889696 -10.8480167 6 -4.1541424 -21.7889696 7 37.6327192 -4.1541424 8 42.1710920 37.6327192 9 -35.1952619 42.1710920 10 -71.8254217 -35.1952619 11 -61.9167463 -71.8254217 12 -43.9427536 -61.9167463 13 -19.3036919 -43.9427536 14 3.4813997 -19.3036919 15 37.4221421 3.4813997 16 46.2362719 37.4221421 17 35.5008309 46.2362719 18 50.0973794 35.5008309 19 47.8788145 50.0973794 20 69.3503460 47.8788145 21 5.4289263 69.3503460 22 -5.3191199 5.4289263 23 15.9176197 -5.3191199 24 27.7641839 15.9176197 25 3.4817901 27.7641839 26 -5.9314100 3.4817901 27 1.6740167 -5.9314100 28 -1.6449259 1.6740167 29 -4.9148805 -1.6449259 30 -32.6517031 -4.9148805 31 -28.8242530 -32.6517031 32 -42.9478493 -28.8242530 33 -45.8327598 -42.9478493 34 -27.4291385 -45.8327598 35 -40.0581662 -27.4291385 36 -37.1446430 -40.0581662 37 -43.3986848 -37.1446430 38 -33.5582193 -43.3986848 39 -18.8544970 -33.5582193 40 -13.8545806 -18.8544970 41 -10.0756642 -13.8545806 42 4.2940778 -10.0756642 43 -0.3623477 4.2940778 44 -10.5062157 -0.3623477 45 -30.6750375 -10.5062157 46 -42.9314339 -30.6750375 47 -31.1780485 -42.9314339 48 -19.2705143 -31.1780485 49 -3.7970358 -19.2705143 50 9.2585606 -3.7970358 51 -9.2462203 9.2585606 52 -12.7368457 -9.2462203 53 -3.9995751 -12.7368457 54 -8.0467007 -3.9995751 55 -2.1440009 -8.0467007 56 -14.2443168 -2.1440009 57 -22.6128102 -14.2443168 58 -13.2395425 -22.6128102 59 12.9814861 -13.2395425 60 8.0178705 12.9814861 61 -0.4953205 8.0178705 62 -6.1708034 -0.4953205 63 29.4377637 -6.1708034 64 40.8398858 29.4377637 65 37.1337201 40.8398858 66 47.8936255 37.1337201 67 14.4002621 47.8936255 68 -0.2036686 14.4002621 69 -16.9038306 -0.2036686 70 -10.1722013 -16.9038306 71 -6.8995552 -10.1722013 72 -27.4962514 -6.8995552 73 6.3697907 -27.4962514 74 13.8366910 6.3697907 75 -7.6839184 13.8366910 76 4.8118633 -7.6839184 77 1.9245250 4.8118633 78 25.8561566 1.9245250 79 15.1959950 25.8561566 80 11.4506820 15.1959950 81 -12.9941477 11.4506820 82 4.6365088 -12.9941477 83 19.1097254 4.6365088 84 -19.8360269 19.1097254 85 -4.7485537 -19.8360269 86 -13.2267847 -4.7485537 87 3.1734780 -13.2267847 88 4.1063566 3.1734780 89 1.9247396 4.1063566 90 -0.2124111 1.9247396 91 11.5716615 -0.2124111 92 -23.4509922 11.5716615 93 -19.2557636 -23.4509922 94 -8.1987888 -19.2557636 95 -31.1312479 -8.1987888 96 -71.8610596 -31.1312479 97 -11.9027227 -71.8610596 98 -25.4296550 -11.9027227 99 -11.0907751 -25.4296550 100 12.9832701 -11.0907751 101 -17.8420681 12.9832701 102 -10.4655876 -17.8420681 103 5.4562557 -10.4655876 104 3.9630761 5.4562557 105 -6.6472072 3.9630761 106 10.4515318 -6.6472072 107 16.4574569 10.4515318 108 18.2092897 16.4574569 109 -1.7216072 18.2092897 110 24.6357391 -1.7216072 111 42.4995360 24.6357391 112 88.5133747 42.4995360 113 90.6293220 88.5133747 114 59.6424371 90.6293220 115 80.5179184 59.6424371 116 80.7280119 80.5179184 117 NA 80.7280119 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -3.1965486 -51.9093312 [2,] 45.1772909 -3.1965486 [3,] -24.5744946 45.1772909 [4,] -10.8480167 -24.5744946 [5,] -21.7889696 -10.8480167 [6,] -4.1541424 -21.7889696 [7,] 37.6327192 -4.1541424 [8,] 42.1710920 37.6327192 [9,] -35.1952619 42.1710920 [10,] -71.8254217 -35.1952619 [11,] -61.9167463 -71.8254217 [12,] -43.9427536 -61.9167463 [13,] -19.3036919 -43.9427536 [14,] 3.4813997 -19.3036919 [15,] 37.4221421 3.4813997 [16,] 46.2362719 37.4221421 [17,] 35.5008309 46.2362719 [18,] 50.0973794 35.5008309 [19,] 47.8788145 50.0973794 [20,] 69.3503460 47.8788145 [21,] 5.4289263 69.3503460 [22,] -5.3191199 5.4289263 [23,] 15.9176197 -5.3191199 [24,] 27.7641839 15.9176197 [25,] 3.4817901 27.7641839 [26,] -5.9314100 3.4817901 [27,] 1.6740167 -5.9314100 [28,] -1.6449259 1.6740167 [29,] -4.9148805 -1.6449259 [30,] -32.6517031 -4.9148805 [31,] -28.8242530 -32.6517031 [32,] -42.9478493 -28.8242530 [33,] -45.8327598 -42.9478493 [34,] -27.4291385 -45.8327598 [35,] -40.0581662 -27.4291385 [36,] -37.1446430 -40.0581662 [37,] -43.3986848 -37.1446430 [38,] -33.5582193 -43.3986848 [39,] -18.8544970 -33.5582193 [40,] -13.8545806 -18.8544970 [41,] -10.0756642 -13.8545806 [42,] 4.2940778 -10.0756642 [43,] -0.3623477 4.2940778 [44,] -10.5062157 -0.3623477 [45,] -30.6750375 -10.5062157 [46,] -42.9314339 -30.6750375 [47,] -31.1780485 -42.9314339 [48,] -19.2705143 -31.1780485 [49,] -3.7970358 -19.2705143 [50,] 9.2585606 -3.7970358 [51,] -9.2462203 9.2585606 [52,] -12.7368457 -9.2462203 [53,] -3.9995751 -12.7368457 [54,] -8.0467007 -3.9995751 [55,] -2.1440009 -8.0467007 [56,] -14.2443168 -2.1440009 [57,] -22.6128102 -14.2443168 [58,] -13.2395425 -22.6128102 [59,] 12.9814861 -13.2395425 [60,] 8.0178705 12.9814861 [61,] -0.4953205 8.0178705 [62,] -6.1708034 -0.4953205 [63,] 29.4377637 -6.1708034 [64,] 40.8398858 29.4377637 [65,] 37.1337201 40.8398858 [66,] 47.8936255 37.1337201 [67,] 14.4002621 47.8936255 [68,] -0.2036686 14.4002621 [69,] -16.9038306 -0.2036686 [70,] -10.1722013 -16.9038306 [71,] -6.8995552 -10.1722013 [72,] -27.4962514 -6.8995552 [73,] 6.3697907 -27.4962514 [74,] 13.8366910 6.3697907 [75,] -7.6839184 13.8366910 [76,] 4.8118633 -7.6839184 [77,] 1.9245250 4.8118633 [78,] 25.8561566 1.9245250 [79,] 15.1959950 25.8561566 [80,] 11.4506820 15.1959950 [81,] -12.9941477 11.4506820 [82,] 4.6365088 -12.9941477 [83,] 19.1097254 4.6365088 [84,] -19.8360269 19.1097254 [85,] -4.7485537 -19.8360269 [86,] -13.2267847 -4.7485537 [87,] 3.1734780 -13.2267847 [88,] 4.1063566 3.1734780 [89,] 1.9247396 4.1063566 [90,] -0.2124111 1.9247396 [91,] 11.5716615 -0.2124111 [92,] -23.4509922 11.5716615 [93,] -19.2557636 -23.4509922 [94,] -8.1987888 -19.2557636 [95,] -31.1312479 -8.1987888 [96,] -71.8610596 -31.1312479 [97,] -11.9027227 -71.8610596 [98,] -25.4296550 -11.9027227 [99,] -11.0907751 -25.4296550 [100,] 12.9832701 -11.0907751 [101,] -17.8420681 12.9832701 [102,] -10.4655876 -17.8420681 [103,] 5.4562557 -10.4655876 [104,] 3.9630761 5.4562557 [105,] -6.6472072 3.9630761 [106,] 10.4515318 -6.6472072 [107,] 16.4574569 10.4515318 [108,] 18.2092897 16.4574569 [109,] -1.7216072 18.2092897 [110,] 24.6357391 -1.7216072 [111,] 42.4995360 24.6357391 [112,] 88.5133747 42.4995360 [113,] 90.6293220 88.5133747 [114,] 59.6424371 90.6293220 [115,] 80.5179184 59.6424371 [116,] 80.7280119 80.5179184 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -3.1965486 -51.9093312 2 45.1772909 -3.1965486 3 -24.5744946 45.1772909 4 -10.8480167 -24.5744946 5 -21.7889696 -10.8480167 6 -4.1541424 -21.7889696 7 37.6327192 -4.1541424 8 42.1710920 37.6327192 9 -35.1952619 42.1710920 10 -71.8254217 -35.1952619 11 -61.9167463 -71.8254217 12 -43.9427536 -61.9167463 13 -19.3036919 -43.9427536 14 3.4813997 -19.3036919 15 37.4221421 3.4813997 16 46.2362719 37.4221421 17 35.5008309 46.2362719 18 50.0973794 35.5008309 19 47.8788145 50.0973794 20 69.3503460 47.8788145 21 5.4289263 69.3503460 22 -5.3191199 5.4289263 23 15.9176197 -5.3191199 24 27.7641839 15.9176197 25 3.4817901 27.7641839 26 -5.9314100 3.4817901 27 1.6740167 -5.9314100 28 -1.6449259 1.6740167 29 -4.9148805 -1.6449259 30 -32.6517031 -4.9148805 31 -28.8242530 -32.6517031 32 -42.9478493 -28.8242530 33 -45.8327598 -42.9478493 34 -27.4291385 -45.8327598 35 -40.0581662 -27.4291385 36 -37.1446430 -40.0581662 37 -43.3986848 -37.1446430 38 -33.5582193 -43.3986848 39 -18.8544970 -33.5582193 40 -13.8545806 -18.8544970 41 -10.0756642 -13.8545806 42 4.2940778 -10.0756642 43 -0.3623477 4.2940778 44 -10.5062157 -0.3623477 45 -30.6750375 -10.5062157 46 -42.9314339 -30.6750375 47 -31.1780485 -42.9314339 48 -19.2705143 -31.1780485 49 -3.7970358 -19.2705143 50 9.2585606 -3.7970358 51 -9.2462203 9.2585606 52 -12.7368457 -9.2462203 53 -3.9995751 -12.7368457 54 -8.0467007 -3.9995751 55 -2.1440009 -8.0467007 56 -14.2443168 -2.1440009 57 -22.6128102 -14.2443168 58 -13.2395425 -22.6128102 59 12.9814861 -13.2395425 60 8.0178705 12.9814861 61 -0.4953205 8.0178705 62 -6.1708034 -0.4953205 63 29.4377637 -6.1708034 64 40.8398858 29.4377637 65 37.1337201 40.8398858 66 47.8936255 37.1337201 67 14.4002621 47.8936255 68 -0.2036686 14.4002621 69 -16.9038306 -0.2036686 70 -10.1722013 -16.9038306 71 -6.8995552 -10.1722013 72 -27.4962514 -6.8995552 73 6.3697907 -27.4962514 74 13.8366910 6.3697907 75 -7.6839184 13.8366910 76 4.8118633 -7.6839184 77 1.9245250 4.8118633 78 25.8561566 1.9245250 79 15.1959950 25.8561566 80 11.4506820 15.1959950 81 -12.9941477 11.4506820 82 4.6365088 -12.9941477 83 19.1097254 4.6365088 84 -19.8360269 19.1097254 85 -4.7485537 -19.8360269 86 -13.2267847 -4.7485537 87 3.1734780 -13.2267847 88 4.1063566 3.1734780 89 1.9247396 4.1063566 90 -0.2124111 1.9247396 91 11.5716615 -0.2124111 92 -23.4509922 11.5716615 93 -19.2557636 -23.4509922 94 -8.1987888 -19.2557636 95 -31.1312479 -8.1987888 96 -71.8610596 -31.1312479 97 -11.9027227 -71.8610596 98 -25.4296550 -11.9027227 99 -11.0907751 -25.4296550 100 12.9832701 -11.0907751 101 -17.8420681 12.9832701 102 -10.4655876 -17.8420681 103 5.4562557 -10.4655876 104 3.9630761 5.4562557 105 -6.6472072 3.9630761 106 10.4515318 -6.6472072 107 16.4574569 10.4515318 108 18.2092897 16.4574569 109 -1.7216072 18.2092897 110 24.6357391 -1.7216072 111 42.4995360 24.6357391 112 88.5133747 42.4995360 113 90.6293220 88.5133747 114 59.6424371 90.6293220 115 80.5179184 59.6424371 116 80.7280119 80.5179184 > 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/wessaorg/rcomp/tmp/7rzcz1354803253.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/wessaorg/rcomp/tmp/8yi861354803253.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/wessaorg/rcomp/tmp/9dfew1354803253.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/wessaorg/rcomp/tmp/10hc9z1354803253.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/11v8sj1354803253.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/wessaorg/rcomp/tmp/123lbn1354803253.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/wessaorg/rcomp/tmp/13wscl1354803253.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/wessaorg/rcomp/tmp/14txf81354803253.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/wessaorg/rcomp/tmp/15cqad1354803253.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/wessaorg/rcomp/tmp/16rnvm1354803254.tab") + } > > try(system("convert tmp/1r4i41354803253.ps tmp/1r4i41354803253.png",intern=TRUE)) character(0) > try(system("convert tmp/28ga51354803253.ps tmp/28ga51354803253.png",intern=TRUE)) character(0) > try(system("convert tmp/3028j1354803253.ps tmp/3028j1354803253.png",intern=TRUE)) character(0) > try(system("convert tmp/4ugko1354803253.ps tmp/4ugko1354803253.png",intern=TRUE)) character(0) > try(system("convert tmp/5dg251354803253.ps tmp/5dg251354803253.png",intern=TRUE)) character(0) > try(system("convert tmp/6lame1354803253.ps tmp/6lame1354803253.png",intern=TRUE)) character(0) > try(system("convert tmp/7rzcz1354803253.ps tmp/7rzcz1354803253.png",intern=TRUE)) character(0) > try(system("convert tmp/8yi861354803253.ps tmp/8yi861354803253.png",intern=TRUE)) character(0) > try(system("convert tmp/9dfew1354803253.ps tmp/9dfew1354803253.png",intern=TRUE)) character(0) > try(system("convert tmp/10hc9z1354803253.ps tmp/10hc9z1354803253.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 8.031 1.104 9.125