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 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.numeric > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x 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 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) VOLUME REV.GROWTH MICROSOFT NASDAQ INFLATION -8.998e+01 4.839e-07 2.593e+01 6.433e+00 9.032e-02 -9.395e+02 CONS.CONF -1.938e+00 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -70.875 -19.699 -3.199 14.202 90.223 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -8.998e+01 2.218e+01 -4.057 9.30e-05 *** VOLUME 4.839e-07 3.015e-07 1.605 0.111338 REV.GROWTH 2.593e+01 1.353e+01 1.917 0.057842 . MICROSOFT 6.433e+00 1.513e+00 4.251 4.48e-05 *** NASDAQ 9.032e-02 1.651e-02 5.470 2.86e-07 *** INFLATION -9.395e+02 2.545e+02 -3.692 0.000348 *** CONS.CONF -1.938e+00 1.467e-01 -13.217 < 2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 31.79 on 110 degrees of freedom Multiple R-squared: 0.834, Adjusted R-squared: 0.8249 F-statistic: 92.11 on 6 and 110 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,] 7.053496e-05 1.410699e-04 0.999929465 [2,] 6.639958e-06 1.327992e-05 0.999993360 [3,] 2.760885e-07 5.521769e-07 0.999999724 [4,] 1.144861e-08 2.289722e-08 0.999999989 [5,] 4.133202e-10 8.266405e-10 1.000000000 [6,] 1.672609e-11 3.345219e-11 1.000000000 [7,] 1.798870e-12 3.597740e-12 1.000000000 [8,] 6.654338e-14 1.330868e-13 1.000000000 [9,] 4.507941e-14 9.015881e-14 1.000000000 [10,] 3.996475e-15 7.992950e-15 1.000000000 [11,] 2.369285e-16 4.738571e-16 1.000000000 [12,] 2.200919e-17 4.401837e-17 1.000000000 [13,] 1.348685e-18 2.697369e-18 1.000000000 [14,] 5.744356e-20 1.148871e-19 1.000000000 [15,] 3.108862e-21 6.217724e-21 1.000000000 [16,] 2.955822e-22 5.911645e-22 1.000000000 [17,] 4.596148e-23 9.192297e-23 1.000000000 [18,] 2.855993e-24 5.711986e-24 1.000000000 [19,] 2.538589e-25 5.077179e-25 1.000000000 [20,] 1.577394e-26 3.154788e-26 1.000000000 [21,] 1.106737e-27 2.213475e-27 1.000000000 [22,] 8.226084e-29 1.645217e-28 1.000000000 [23,] 7.351159e-30 1.470232e-29 1.000000000 [24,] 3.567661e-31 7.135322e-31 1.000000000 [25,] 2.944917e-32 5.889834e-32 1.000000000 [26,] 1.771759e-33 3.543517e-33 1.000000000 [27,] 1.185156e-34 2.370312e-34 1.000000000 [28,] 7.218534e-36 1.443707e-35 1.000000000 [29,] 7.002640e-37 1.400528e-36 1.000000000 [30,] 7.000603e-37 1.400121e-36 1.000000000 [31,] 2.841065e-37 5.682130e-37 1.000000000 [32,] 5.748727e-37 1.149745e-36 1.000000000 [33,] 1.651681e-36 3.303362e-36 1.000000000 [34,] 3.748096e-37 7.496191e-37 1.000000000 [35,] 4.338045e-37 8.676089e-37 1.000000000 [36,] 5.112392e-36 1.022478e-35 1.000000000 [37,] 5.500042e-36 1.100008e-35 1.000000000 [38,] 6.750226e-34 1.350045e-33 1.000000000 [39,] 1.444018e-33 2.888035e-33 1.000000000 [40,] 2.092995e-34 4.185990e-34 1.000000000 [41,] 4.191635e-32 8.383271e-32 1.000000000 [42,] 2.211466e-29 4.422933e-29 1.000000000 [43,] 2.718935e-30 5.437869e-30 1.000000000 [44,] 3.712066e-29 7.424132e-29 1.000000000 [45,] 5.616328e-29 1.123266e-28 1.000000000 [46,] 4.073909e-26 8.147818e-26 1.000000000 [47,] 9.319270e-24 1.863854e-23 1.000000000 [48,] 4.519830e-21 9.039659e-21 1.000000000 [49,] 4.130061e-19 8.260122e-19 1.000000000 [50,] 1.093229e-14 2.186458e-14 1.000000000 [51,] 8.900944e-12 1.780189e-11 1.000000000 [52,] 5.719497e-10 1.143899e-09 0.999999999 [53,] 3.290925e-09 6.581851e-09 0.999999997 [54,] 6.240797e-09 1.248159e-08 0.999999994 [55,] 1.678249e-08 3.356498e-08 0.999999983 [56,] 2.449142e-08 4.898285e-08 0.999999976 [57,] 2.981730e-08 5.963461e-08 0.999999970 [58,] 2.344383e-07 4.688766e-07 0.999999766 [59,] 6.600406e-07 1.320081e-06 0.999999340 [60,] 7.596424e-06 1.519285e-05 0.999992404 [61,] 1.896613e-04 3.793227e-04 0.999810339 [62,] 1.271526e-03 2.543052e-03 0.998728474 [63,] 1.509377e-03 3.018753e-03 0.998490623 [64,] 1.153118e-03 2.306236e-03 0.998846882 [65,] 1.672621e-03 3.345241e-03 0.998327379 [66,] 3.831855e-03 7.663711e-03 0.996168145 [67,] 6.801524e-03 1.360305e-02 0.993198476 [68,] 1.375958e-02 2.751916e-02 0.986240420 [69,] 1.386749e-02 2.773497e-02 0.986132513 [70,] 1.679016e-02 3.358033e-02 0.983209836 [71,] 2.145306e-02 4.290612e-02 0.978546939 [72,] 2.997879e-02 5.995758e-02 0.970021208 [73,] 8.639284e-02 1.727857e-01 0.913607164 [74,] 8.922787e-02 1.784557e-01 0.910772130 [75,] 1.338436e-01 2.676873e-01 0.866156353 [76,] 1.609389e-01 3.218779e-01 0.839061051 [77,] 1.657530e-01 3.315061e-01 0.834246960 [78,] 1.988508e-01 3.977017e-01 0.801149156 [79,] 1.920325e-01 3.840650e-01 0.807967502 [80,] 2.035917e-01 4.071834e-01 0.796408284 [81,] 1.704389e-01 3.408779e-01 0.829561073 [82,] 2.172448e-01 4.344896e-01 0.782755183 [83,] 4.063036e-01 8.126072e-01 0.593696377 [84,] 9.947400e-01 1.052003e-02 0.005260015 [85,] 9.929479e-01 1.410417e-02 0.007052086 [86,] 9.876931e-01 2.461381e-02 0.012306904 [87,] 9.892581e-01 2.148379e-02 0.010741894 [88,] 9.822932e-01 3.541362e-02 0.017706812 [89,] 9.740346e-01 5.193080e-02 0.025965402 [90,] 9.703239e-01 5.935229e-02 0.029676144 [91,] 9.587634e-01 8.247316e-02 0.041236581 [92,] 9.807247e-01 3.855053e-02 0.019275267 [93,] 9.865580e-01 2.688401e-02 0.013442006 [94,] 9.751012e-01 4.979759e-02 0.024898793 [95,] 9.628983e-01 7.420336e-02 0.037101681 [96,] 9.789848e-01 4.203045e-02 0.021015227 [97,] 9.945520e-01 1.089604e-02 0.005448020 [98,] 9.879319e-01 2.413625e-02 0.012068125 > postscript(file="/var/www/html/rcomp/tmp/1r1n81292323154.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/2js4b1292323154.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/3js4b1292323154.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/4js4b1292323154.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/5u1mw1292323154.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 -52.67001438 -2.38565401 45.97765779 -24.25019375 -11.06119184 -22.32911539 7 8 9 10 11 12 -4.71124828 37.56958501 42.48797423 -33.67027129 -70.87499330 -61.51402126 13 14 15 16 17 18 -44.73549189 -19.69885011 2.40484060 36.30584456 45.28952133 34.93377062 19 20 21 22 23 24 50.06350695 48.19024325 69.86975291 6.50932121 -5.01870560 16.40364539 25 26 27 28 29 30 27.87590344 4.21979274 -5.00838013 1.66819864 -2.29480840 -5.23836614 31 32 33 34 35 36 -32.79133941 -29.25909831 -43.19259313 -46.30795221 -28.32313231 -40.94222189 37 38 39 40 41 42 -38.73322501 -44.37737622 -34.95951030 -20.19769162 -15.22873014 -12.09783746 43 44 45 46 47 48 2.83659617 -1.07988606 -11.04210674 -31.04025898 -43.45240841 -31.78480129 49 50 51 52 53 54 -20.68292580 -4.67599127 9.34097196 -8.90667761 -12.02280383 -3.19924815 55 56 57 58 59 60 -7.68217548 -1.35283633 -13.20302488 -21.49679753 -11.94187619 14.20228618 61 62 63 64 65 66 7.57425260 -0.36007724 -6.17178285 29.01688241 41.40217945 37.59948504 67 68 69 70 71 72 48.87715798 15.86221723 1.18950796 -15.25210461 -8.80430967 -6.11836008 73 74 75 76 77 78 -27.51896612 7.18332549 14.69769221 -6.57796000 5.45042112 2.11378176 79 80 81 82 83 84 26.03937010 15.57847521 11.59953028 -12.50053230 4.80386455 19.77299230 85 86 87 88 89 90 -20.31304027 -5.07914371 -13.21738819 2.54688512 3.36935983 1.68032000 91 92 93 94 95 96 0.07543957 12.08495024 -23.52499390 -20.83320207 -8.80573068 -31.12914697 97 98 99 100 101 102 -70.30872872 -10.80807268 -24.41201866 -10.33685825 13.36615064 -17.24759246 103 104 105 106 107 108 -10.40042988 5.28485406 3.45947266 -6.52960645 10.23709917 15.58088279 109 110 111 112 113 114 17.15643312 -1.93067742 23.94067554 41.75724157 87.18535246 90.22345844 115 116 117 59.37926618 80.83713643 80.54102904 > postscript(file="/var/www/html/rcomp/tmp/6u1mw1292323154.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 -52.67001438 NA 1 -2.38565401 -52.67001438 2 45.97765779 -2.38565401 3 -24.25019375 45.97765779 4 -11.06119184 -24.25019375 5 -22.32911539 -11.06119184 6 -4.71124828 -22.32911539 7 37.56958501 -4.71124828 8 42.48797423 37.56958501 9 -33.67027129 42.48797423 10 -70.87499330 -33.67027129 11 -61.51402126 -70.87499330 12 -44.73549189 -61.51402126 13 -19.69885011 -44.73549189 14 2.40484060 -19.69885011 15 36.30584456 2.40484060 16 45.28952133 36.30584456 17 34.93377062 45.28952133 18 50.06350695 34.93377062 19 48.19024325 50.06350695 20 69.86975291 48.19024325 21 6.50932121 69.86975291 22 -5.01870560 6.50932121 23 16.40364539 -5.01870560 24 27.87590344 16.40364539 25 4.21979274 27.87590344 26 -5.00838013 4.21979274 27 1.66819864 -5.00838013 28 -2.29480840 1.66819864 29 -5.23836614 -2.29480840 30 -32.79133941 -5.23836614 31 -29.25909831 -32.79133941 32 -43.19259313 -29.25909831 33 -46.30795221 -43.19259313 34 -28.32313231 -46.30795221 35 -40.94222189 -28.32313231 36 -38.73322501 -40.94222189 37 -44.37737622 -38.73322501 38 -34.95951030 -44.37737622 39 -20.19769162 -34.95951030 40 -15.22873014 -20.19769162 41 -12.09783746 -15.22873014 42 2.83659617 -12.09783746 43 -1.07988606 2.83659617 44 -11.04210674 -1.07988606 45 -31.04025898 -11.04210674 46 -43.45240841 -31.04025898 47 -31.78480129 -43.45240841 48 -20.68292580 -31.78480129 49 -4.67599127 -20.68292580 50 9.34097196 -4.67599127 51 -8.90667761 9.34097196 52 -12.02280383 -8.90667761 53 -3.19924815 -12.02280383 54 -7.68217548 -3.19924815 55 -1.35283633 -7.68217548 56 -13.20302488 -1.35283633 57 -21.49679753 -13.20302488 58 -11.94187619 -21.49679753 59 14.20228618 -11.94187619 60 7.57425260 14.20228618 61 -0.36007724 7.57425260 62 -6.17178285 -0.36007724 63 29.01688241 -6.17178285 64 41.40217945 29.01688241 65 37.59948504 41.40217945 66 48.87715798 37.59948504 67 15.86221723 48.87715798 68 1.18950796 15.86221723 69 -15.25210461 1.18950796 70 -8.80430967 -15.25210461 71 -6.11836008 -8.80430967 72 -27.51896612 -6.11836008 73 7.18332549 -27.51896612 74 14.69769221 7.18332549 75 -6.57796000 14.69769221 76 5.45042112 -6.57796000 77 2.11378176 5.45042112 78 26.03937010 2.11378176 79 15.57847521 26.03937010 80 11.59953028 15.57847521 81 -12.50053230 11.59953028 82 4.80386455 -12.50053230 83 19.77299230 4.80386455 84 -20.31304027 19.77299230 85 -5.07914371 -20.31304027 86 -13.21738819 -5.07914371 87 2.54688512 -13.21738819 88 3.36935983 2.54688512 89 1.68032000 3.36935983 90 0.07543957 1.68032000 91 12.08495024 0.07543957 92 -23.52499390 12.08495024 93 -20.83320207 -23.52499390 94 -8.80573068 -20.83320207 95 -31.12914697 -8.80573068 96 -70.30872872 -31.12914697 97 -10.80807268 -70.30872872 98 -24.41201866 -10.80807268 99 -10.33685825 -24.41201866 100 13.36615064 -10.33685825 101 -17.24759246 13.36615064 102 -10.40042988 -17.24759246 103 5.28485406 -10.40042988 104 3.45947266 5.28485406 105 -6.52960645 3.45947266 106 10.23709917 -6.52960645 107 15.58088279 10.23709917 108 17.15643312 15.58088279 109 -1.93067742 17.15643312 110 23.94067554 -1.93067742 111 41.75724157 23.94067554 112 87.18535246 41.75724157 113 90.22345844 87.18535246 114 59.37926618 90.22345844 115 80.83713643 59.37926618 116 80.54102904 80.83713643 117 NA 80.54102904 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -2.38565401 -52.67001438 [2,] 45.97765779 -2.38565401 [3,] -24.25019375 45.97765779 [4,] -11.06119184 -24.25019375 [5,] -22.32911539 -11.06119184 [6,] -4.71124828 -22.32911539 [7,] 37.56958501 -4.71124828 [8,] 42.48797423 37.56958501 [9,] -33.67027129 42.48797423 [10,] -70.87499330 -33.67027129 [11,] -61.51402126 -70.87499330 [12,] -44.73549189 -61.51402126 [13,] -19.69885011 -44.73549189 [14,] 2.40484060 -19.69885011 [15,] 36.30584456 2.40484060 [16,] 45.28952133 36.30584456 [17,] 34.93377062 45.28952133 [18,] 50.06350695 34.93377062 [19,] 48.19024325 50.06350695 [20,] 69.86975291 48.19024325 [21,] 6.50932121 69.86975291 [22,] -5.01870560 6.50932121 [23,] 16.40364539 -5.01870560 [24,] 27.87590344 16.40364539 [25,] 4.21979274 27.87590344 [26,] -5.00838013 4.21979274 [27,] 1.66819864 -5.00838013 [28,] -2.29480840 1.66819864 [29,] -5.23836614 -2.29480840 [30,] -32.79133941 -5.23836614 [31,] -29.25909831 -32.79133941 [32,] -43.19259313 -29.25909831 [33,] -46.30795221 -43.19259313 [34,] -28.32313231 -46.30795221 [35,] -40.94222189 -28.32313231 [36,] -38.73322501 -40.94222189 [37,] -44.37737622 -38.73322501 [38,] -34.95951030 -44.37737622 [39,] -20.19769162 -34.95951030 [40,] -15.22873014 -20.19769162 [41,] -12.09783746 -15.22873014 [42,] 2.83659617 -12.09783746 [43,] -1.07988606 2.83659617 [44,] -11.04210674 -1.07988606 [45,] -31.04025898 -11.04210674 [46,] -43.45240841 -31.04025898 [47,] -31.78480129 -43.45240841 [48,] -20.68292580 -31.78480129 [49,] -4.67599127 -20.68292580 [50,] 9.34097196 -4.67599127 [51,] -8.90667761 9.34097196 [52,] -12.02280383 -8.90667761 [53,] -3.19924815 -12.02280383 [54,] -7.68217548 -3.19924815 [55,] -1.35283633 -7.68217548 [56,] -13.20302488 -1.35283633 [57,] -21.49679753 -13.20302488 [58,] -11.94187619 -21.49679753 [59,] 14.20228618 -11.94187619 [60,] 7.57425260 14.20228618 [61,] -0.36007724 7.57425260 [62,] -6.17178285 -0.36007724 [63,] 29.01688241 -6.17178285 [64,] 41.40217945 29.01688241 [65,] 37.59948504 41.40217945 [66,] 48.87715798 37.59948504 [67,] 15.86221723 48.87715798 [68,] 1.18950796 15.86221723 [69,] -15.25210461 1.18950796 [70,] -8.80430967 -15.25210461 [71,] -6.11836008 -8.80430967 [72,] -27.51896612 -6.11836008 [73,] 7.18332549 -27.51896612 [74,] 14.69769221 7.18332549 [75,] -6.57796000 14.69769221 [76,] 5.45042112 -6.57796000 [77,] 2.11378176 5.45042112 [78,] 26.03937010 2.11378176 [79,] 15.57847521 26.03937010 [80,] 11.59953028 15.57847521 [81,] -12.50053230 11.59953028 [82,] 4.80386455 -12.50053230 [83,] 19.77299230 4.80386455 [84,] -20.31304027 19.77299230 [85,] -5.07914371 -20.31304027 [86,] -13.21738819 -5.07914371 [87,] 2.54688512 -13.21738819 [88,] 3.36935983 2.54688512 [89,] 1.68032000 3.36935983 [90,] 0.07543957 1.68032000 [91,] 12.08495024 0.07543957 [92,] -23.52499390 12.08495024 [93,] -20.83320207 -23.52499390 [94,] -8.80573068 -20.83320207 [95,] -31.12914697 -8.80573068 [96,] -70.30872872 -31.12914697 [97,] -10.80807268 -70.30872872 [98,] -24.41201866 -10.80807268 [99,] -10.33685825 -24.41201866 [100,] 13.36615064 -10.33685825 [101,] -17.24759246 13.36615064 [102,] -10.40042988 -17.24759246 [103,] 5.28485406 -10.40042988 [104,] 3.45947266 5.28485406 [105,] -6.52960645 3.45947266 [106,] 10.23709917 -6.52960645 [107,] 15.58088279 10.23709917 [108,] 17.15643312 15.58088279 [109,] -1.93067742 17.15643312 [110,] 23.94067554 -1.93067742 [111,] 41.75724157 23.94067554 [112,] 87.18535246 41.75724157 [113,] 90.22345844 87.18535246 [114,] 59.37926618 90.22345844 [115,] 80.83713643 59.37926618 [116,] 80.54102904 80.83713643 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -2.38565401 -52.67001438 2 45.97765779 -2.38565401 3 -24.25019375 45.97765779 4 -11.06119184 -24.25019375 5 -22.32911539 -11.06119184 6 -4.71124828 -22.32911539 7 37.56958501 -4.71124828 8 42.48797423 37.56958501 9 -33.67027129 42.48797423 10 -70.87499330 -33.67027129 11 -61.51402126 -70.87499330 12 -44.73549189 -61.51402126 13 -19.69885011 -44.73549189 14 2.40484060 -19.69885011 15 36.30584456 2.40484060 16 45.28952133 36.30584456 17 34.93377062 45.28952133 18 50.06350695 34.93377062 19 48.19024325 50.06350695 20 69.86975291 48.19024325 21 6.50932121 69.86975291 22 -5.01870560 6.50932121 23 16.40364539 -5.01870560 24 27.87590344 16.40364539 25 4.21979274 27.87590344 26 -5.00838013 4.21979274 27 1.66819864 -5.00838013 28 -2.29480840 1.66819864 29 -5.23836614 -2.29480840 30 -32.79133941 -5.23836614 31 -29.25909831 -32.79133941 32 -43.19259313 -29.25909831 33 -46.30795221 -43.19259313 34 -28.32313231 -46.30795221 35 -40.94222189 -28.32313231 36 -38.73322501 -40.94222189 37 -44.37737622 -38.73322501 38 -34.95951030 -44.37737622 39 -20.19769162 -34.95951030 40 -15.22873014 -20.19769162 41 -12.09783746 -15.22873014 42 2.83659617 -12.09783746 43 -1.07988606 2.83659617 44 -11.04210674 -1.07988606 45 -31.04025898 -11.04210674 46 -43.45240841 -31.04025898 47 -31.78480129 -43.45240841 48 -20.68292580 -31.78480129 49 -4.67599127 -20.68292580 50 9.34097196 -4.67599127 51 -8.90667761 9.34097196 52 -12.02280383 -8.90667761 53 -3.19924815 -12.02280383 54 -7.68217548 -3.19924815 55 -1.35283633 -7.68217548 56 -13.20302488 -1.35283633 57 -21.49679753 -13.20302488 58 -11.94187619 -21.49679753 59 14.20228618 -11.94187619 60 7.57425260 14.20228618 61 -0.36007724 7.57425260 62 -6.17178285 -0.36007724 63 29.01688241 -6.17178285 64 41.40217945 29.01688241 65 37.59948504 41.40217945 66 48.87715798 37.59948504 67 15.86221723 48.87715798 68 1.18950796 15.86221723 69 -15.25210461 1.18950796 70 -8.80430967 -15.25210461 71 -6.11836008 -8.80430967 72 -27.51896612 -6.11836008 73 7.18332549 -27.51896612 74 14.69769221 7.18332549 75 -6.57796000 14.69769221 76 5.45042112 -6.57796000 77 2.11378176 5.45042112 78 26.03937010 2.11378176 79 15.57847521 26.03937010 80 11.59953028 15.57847521 81 -12.50053230 11.59953028 82 4.80386455 -12.50053230 83 19.77299230 4.80386455 84 -20.31304027 19.77299230 85 -5.07914371 -20.31304027 86 -13.21738819 -5.07914371 87 2.54688512 -13.21738819 88 3.36935983 2.54688512 89 1.68032000 3.36935983 90 0.07543957 1.68032000 91 12.08495024 0.07543957 92 -23.52499390 12.08495024 93 -20.83320207 -23.52499390 94 -8.80573068 -20.83320207 95 -31.12914697 -8.80573068 96 -70.30872872 -31.12914697 97 -10.80807268 -70.30872872 98 -24.41201866 -10.80807268 99 -10.33685825 -24.41201866 100 13.36615064 -10.33685825 101 -17.24759246 13.36615064 102 -10.40042988 -17.24759246 103 5.28485406 -10.40042988 104 3.45947266 5.28485406 105 -6.52960645 3.45947266 106 10.23709917 -6.52960645 107 15.58088279 10.23709917 108 17.15643312 15.58088279 109 -1.93067742 17.15643312 110 23.94067554 -1.93067742 111 41.75724157 23.94067554 112 87.18535246 41.75724157 113 90.22345844 87.18535246 114 59.37926618 90.22345844 115 80.83713643 59.37926618 116 80.54102904 80.83713643 > 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/7nb3z1292323154.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/8nb3z1292323154.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/9x2kk1292323154.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/10x2kk1292323154.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/111kjq1292323154.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/1243hd1292323154.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/13idx41292323154.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/14mdda1292323154.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/15pwcg1292323154.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/16twt41292323154.tab") + } > try(system("convert tmp/1r1n81292323154.ps tmp/1r1n81292323154.png",intern=TRUE)) character(0) > try(system("convert tmp/2js4b1292323154.ps tmp/2js4b1292323154.png",intern=TRUE)) character(0) > try(system("convert tmp/3js4b1292323154.ps tmp/3js4b1292323154.png",intern=TRUE)) character(0) > try(system("convert tmp/4js4b1292323154.ps tmp/4js4b1292323154.png",intern=TRUE)) character(0) > try(system("convert tmp/5u1mw1292323154.ps tmp/5u1mw1292323154.png",intern=TRUE)) character(0) > try(system("convert tmp/6u1mw1292323154.ps tmp/6u1mw1292323154.png",intern=TRUE)) character(0) > try(system("convert tmp/7nb3z1292323154.ps tmp/7nb3z1292323154.png",intern=TRUE)) character(0) > try(system("convert tmp/8nb3z1292323154.ps tmp/8nb3z1292323154.png",intern=TRUE)) character(0) > try(system("convert tmp/9x2kk1292323154.ps tmp/9x2kk1292323154.png",intern=TRUE)) character(0) > try(system("convert tmp/10x2kk1292323154.ps tmp/10x2kk1292323154.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.393 1.796 9.053