R version 2.8.0 (2008-10-20) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale 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(25.94 + ,23688100 + ,39.18 + ,3940.35 + ,0.02740 + ,144.7 + ,5.45 + ,28.66 + ,13741000 + ,35.78 + ,4696.69 + ,0.03220 + ,140.8 + ,5.73 + ,33.95 + ,14143500 + ,42.54 + ,4572.83 + ,0.03760 + ,137.1 + ,5.85 + ,31.01 + ,16763800 + ,27.92 + ,3860.66 + ,0.03070 + ,137.7 + ,6.02 + ,21.00 + ,16634600 + ,25.05 + ,3400.91 + ,0.03190 + ,144.7 + ,6.27 + ,26.19 + ,13693300 + ,32.03 + ,3966.11 + ,0.03730 + ,139.2 + ,6.53 + ,25.41 + ,10545800 + ,27.95 + ,3766.99 + ,0.03660 + ,143.0 + ,6.54 + ,30.47 + ,9409900 + ,27.95 + ,4206.35 + ,0.03410 + ,140.8 + ,6.5 + ,12.88 + ,39182200 + ,24.15 + ,3672.82 + ,0.03450 + ,142.5 + ,6.52 + ,9.78 + ,37005800 + ,27.57 + ,3369.63 + ,0.03450 + ,135.8 + ,6.51 + ,8.25 + ,15818500 + ,22.97 + ,2597.93 + ,0.03450 + ,132.6 + ,6.51 + ,7.44 + ,16952000 + ,17.37 + ,2470.52 + ,0.03390 + ,128.6 + ,6.4 + ,10.81 + ,24563400 + ,24.45 + ,2772.73 + ,0.03730 + ,115.7 + ,5.98 + ,9.12 + ,14163200 + ,23.62 + ,2151.83 + ,0.03530 + ,109.2 + ,5.49 + ,11.03 + ,18184800 + ,21.90 + ,1840.26 + ,0.02920 + ,116.9 + ,5.31 + ,12.74 + ,20810300 + ,27.12 + ,2116.24 + ,0.03270 + ,109.9 + ,4.8 + ,9.98 + ,12843000 + ,27.70 + ,2110.49 + ,0.03620 + ,116.1 + ,4.21 + ,11.62 + ,13866700 + ,29.23 + ,2160.54 + ,0.03250 + ,118.9 + ,3.97 + ,9.40 + ,15119200 + ,26.50 + ,2027.13 + ,0.02720 + ,116.3 + ,3.77 + ,9.27 + ,8301600 + ,22.84 + ,1805.43 + ,0.02720 + ,114.0 + ,3.65 + ,7.76 + ,14039600 + ,20.49 + ,1498.80 + ,0.02650 + ,97.0 + ,3.07 + ,8.78 + ,12139700 + ,23.28 + ,1690.20 + ,0.02130 + ,85.3 + ,2.49 + ,10.65 + ,9649000 + ,25.71 + ,1930.58 + ,0.01900 + ,84.9 + ,2.09 + ,10.95 + ,8513600 + ,26.52 + ,1950.40 + ,0.01550 + ,94.6 + ,1.82 + ,12.36 + ,15278600 + ,25.51 + ,1934.03 + ,0.01140 + ,97.8 + ,1.73 + ,10.85 + ,15590900 + ,23.36 + ,1731.49 + ,0.01140 + ,95.0 + ,1.74 + ,11.84 + ,9691100 + ,24.15 + ,1845.35 + ,0.01480 + ,110.7 + ,1.73 + ,12.14 + ,10882700 + ,20.92 + ,1688.23 + ,0.01640 + ,108.5 + ,1.75 + ,11.65 + ,10294800 + ,20.38 + ,1615.73 + ,0.01180 + ,110.3 + ,1.75 + ,8.86 + ,16031900 + ,21.90 + ,1463.21 + ,0.01070 + ,106.3 + ,1.75 + ,7.63 + ,13683600 + ,19.21 + ,1328.26 + ,0.01460 + ,97.4 + ,1.73 + ,7.38 + ,8677200 + ,19.65 + ,1314.85 + ,0.01800 + ,94.5 + ,1.74 + ,7.25 + ,9874100 + ,17.51 + ,1172.06 + ,0.01510 + ,93.7 + ,1.75 + ,8.03 + ,10725500 + ,21.41 + ,1329.75 + ,0.02030 + ,79.6 + ,1.75 + ,7.75 + ,8348400 + ,23.09 + ,1478.78 + ,0.02200 + ,84.9 + ,1.34 + ,7.16 + ,8046200 + ,20.70 + ,1335.51 + ,0.02380 + ,80.7 + ,1.24 + ,7.18 + ,10862300 + ,19.00 + ,1320.91 + ,0.02600 + ,78.8 + ,1.24 + ,7.51 + ,8100300 + ,19.04 + ,1337.52 + ,0.02980 + ,64.8 + ,1.26 + ,7.07 + ,7287500 + ,19.45 + ,1341.17 + ,0.03020 + ,61.4 + ,1.25 + ,7.11 + ,14002500 + ,20.54 + ,1464.31 + ,0.02220 + ,81.0 + ,1.26 + ,8.98 + ,19037900 + ,19.77 + ,1595.91 + ,0.02060 + ,83.6 + ,1.26 + ,9.53 + ,10774600 + ,20.60 + ,1622.80 + ,0.02110 + ,83.5 + ,1.22 + ,10.54 + ,8960600 + ,21.21 + ,1735.02 + ,0.02110 + ,77.0 + ,1.01 + ,11.31 + ,7773300 + ,21.30 + ,1810.45 + ,0.02160 + ,81.7 + ,1.03 + ,10.36 + ,9579700 + ,22.33 + ,1786.94 + ,0.02320 + ,77.0 + ,1.01 + ,11.44 + ,11270700 + ,21.12 + ,1932.21 + ,0.02040 + ,81.7 + ,1.01 + ,10.45 + ,9492800 + ,20.77 + ,1960.26 + ,0.01770 + ,92.5 + ,1 + ,10.69 + ,9136800 + ,22.11 + ,2003.37 + ,0.01880 + ,91.7 + ,0.98 + ,11.28 + ,14487600 + ,22.34 + ,2066.15 + ,0.01930 + ,96.4 + ,1 + ,11.96 + ,10133200 + ,21.43 + ,2029.82 + ,0.01690 + ,88.5 + ,1.01 + ,13.52 + ,18659700 + ,20.14 + ,1994.22 + ,0.01740 + ,88.5 + ,1 + ,12.89 + ,15980700 + ,21.11 + ,1920.15 + ,0.02290 + ,93.0 + ,1 + ,14.03 + ,9732100 + ,21.19 + ,1986.74 + ,0.03050 + ,93.1 + ,1 + ,16.27 + ,14626300 + ,23.07 + ,2047.79 + ,0.03270 + ,102.8 + ,1.03 + ,16.17 + ,16904000 + ,23.01 + ,1887.36 + ,0.02990 + ,105.7 + ,1.26 + ,17.25 + ,13616700 + ,22.12 + ,1838.10 + ,0.02650 + ,98.7 + ,1.43 + ,19.38 + ,13772900 + ,22.40 + ,1896.84 + ,0.02540 + ,96.7 + ,1.61 + ,26.20 + ,28749200 + ,22.66 + ,1974.99 + ,0.03190 + ,92.9 + ,1.76 + ,33.53 + ,31408300 + ,24.21 + ,2096.81 + ,0.03520 + ,92.6 + ,1.93 + ,32.20 + ,26342800 + ,24.13 + ,2175.44 + ,0.03260 + ,102.7 + ,2.16 + ,38.45 + ,48909500 + ,23.73 + ,2062.41 + ,0.02970 + ,105.1 + ,2.28 + ,44.86 + ,41542400 + ,22.79 + ,2051.72 + ,0.03010 + ,104.4 + ,2.5 + ,41.67 + ,24857200 + ,21.89 + ,1999.23 + ,0.03150 + ,103.0 + ,2.63 + ,36.06 + ,34093700 + ,22.92 + ,1921.65 + ,0.03510 + ,97.5 + ,2.79 + ,39.76 + ,22555200 + ,23.44 + ,2068.22 + ,0.02800 + ,103.1 + ,3 + ,36.81 + ,19067500 + ,22.57 + ,2056.96 + ,0.02530 + ,106.2 + ,3.04 + ,42.65 + ,19029100 + ,23.27 + ,2184.83 + ,0.03170 + ,103.6 + ,3.26 + ,46.89 + ,15223200 + ,24.95 + ,2152.09 + ,0.03640 + ,105.5 + ,3.5 + ,53.61 + ,21903700 + ,23.45 + ,2151.69 + ,0.04690 + ,87.5 + ,3.62 + ,57.59 + ,33306600 + ,23.42 + ,2120.30 + ,0.04350 + ,85.2 + ,3.78 + ,67.82 + ,23898100 + ,25.30 + ,2232.82 + ,0.03460 + ,98.3 + ,4 + ,71.89 + ,23279600 + ,23.90 + ,2205.32 + ,0.03420 + ,103.8 + ,4.16 + ,75.51 + ,40699800 + ,25.73 + ,2305.82 + ,0.03990 + ,106.8 + ,4.29 + ,68.49 + ,37646000 + ,24.64 + ,2281.39 + ,0.03600 + ,102.7 + ,4.49 + ,62.72 + ,37277000 + ,24.95 + ,2339.79 + ,0.03360 + ,107.5 + ,4.59 + ,70.39 + ,39246800 + ,22.15 + ,2322.57 + ,0.03550 + ,109.8 + ,4.79 + ,59.77 + ,27418400 + ,20.85 + ,2178.88 + ,0.04170 + ,104.7 + ,4.94 + ,57.27 + ,30318700 + ,21.45 + ,2172.09 + ,0.04320 + ,105.7 + ,4.99 + ,67.96 + ,32808100 + ,22.15 + ,2091.47 + ,0.04150 + ,107.0 + ,5.24 + ,67.85 + ,28668200 + ,23.75 + ,2183.75 + ,0.03820 + ,100.2 + ,5.25 + ,76.98 + ,32370300 + ,25.27 + ,2258.43 + ,0.02060 + ,105.9 + ,5.25 + ,81.08 + ,24171100 + ,26.53 + ,2366.71 + ,0.01310 + ,105.1 + ,5.25 + ,91.66 + ,25009100 + ,27.22 + ,2431.77 + ,0.01970 + ,105.3 + ,5.25 + ,84.84 + ,32084300 + ,27.69 + ,2415.29 + ,0.02540 + ,110.0 + ,5.24 + ,85.73 + ,50117500 + ,28.61 + ,2463.93 + ,0.02080 + ,110.2 + ,5.25 + ,84.61 + ,27522200 + ,26.21 + ,2416.15 + ,0.02420 + ,111.2 + ,5.26 + ,92.91 + ,26816800 + ,25.93 + ,2421.64 + ,0.02780 + ,108.2 + ,5.26 + ,99.80 + ,25136100 + ,27.86 + ,2525.09 + ,0.02570 + ,106.3 + ,5.25 + ,121.19 + ,30295600 + ,28.65 + ,2604.52 + ,0.02690 + ,108.5 + ,5.25 + ,122.04 + ,41526100 + ,27.51 + ,2603.23 + ,0.02690 + ,105.3 + ,5.25 + ,131.76 + ,43845100 + ,27.06 + ,2546.27 + ,0.02360 + ,111.9 + ,5.26 + ,138.48 + ,39188900 + ,26.91 + ,2596.36 + ,0.01970 + ,105.6 + ,5.02 + ,153.47 + ,40496400 + ,27.60 + ,2701.50 + ,0.02760 + ,99.5 + ,4.94 + ,189.95 + ,37438400 + ,34.48 + ,2859.12 + ,0.03540 + ,95.2 + ,4.76 + ,182.22 + ,46553700 + ,31.58 + ,2660.96 + ,0.04310 + ,87.8 + ,4.49 + ,198.08 + ,31771400 + ,33.46 + ,2652.28 + ,0.04080 + ,90.6 + ,4.24 + ,135.36 + ,62108100 + ,30.64 + ,2389.86 + ,0.04280 + ,87.9 + ,3.94 + ,125.02 + ,46645400 + ,25.66 + ,2271.48 + ,0.04030 + ,76.4 + ,2.98 + ,143.50 + ,42313100 + ,26.78 + ,2279.10 + ,0.03980 + ,65.9 + ,2.61 + ,173.95 + ,38841700 + ,26.91 + ,2412.80 + ,0.03940 + ,62.3 + ,2.28 + ,188.75 + ,32650300 + ,26.82 + ,2522.66 + ,0.04180 + ,57.2 + ,1.98 + ,167.44 + ,34281100 + ,26.05 + ,2292.98 + ,0.05020 + ,50.4 + ,2 + ,158.95 + ,33096200 + ,24.36 + ,2325.55 + ,0.05600 + ,51.9 + ,2.01 + ,169.53 + ,23273800 + ,25.94 + ,2367.52 + ,0.05370 + ,58.5 + ,2 + ,113.66 + ,43697600 + ,25.37 + ,2091.88 + ,0.04940 + ,61.4 + ,1.81 + ,107.59 + ,66902300 + ,21.23 + ,1720.95 + ,0.03660 + ,38.8 + ,0.97 + ,92.67 + ,44957200 + ,19.35 + ,1535.57 + ,0.01070 + ,44.9 + ,0.39 + ,85.35 + ,33800900 + ,18.61 + ,1577.03 + ,0.00090 + ,38.6 + ,0.16 + ,90.13 + ,33487900 + ,16.37 + ,1476.42 + ,0.00030 + ,4.0 + ,0.15 + ,89.31 + ,27394900 + ,15.56 + ,1377.84 + ,0.00240 + ,25.3 + ,0.22 + ,105.12 + ,25963400 + ,17.70 + ,1528.59 + ,-0.00380 + ,26.9 + ,0.18 + ,125.83 + ,20952600 + ,19.52 + ,1717.30 + ,-0.00740 + ,40.8 + ,0.15 + ,135.81 + ,17702900 + ,20.26 + ,1774.33 + ,-0.01280 + ,54.8 + ,0.18 + ,142.43 + ,21282100 + ,23.05 + ,1835.04 + ,-0.01430 + ,49.3 + ,0.21 + ,163.39 + ,18449100 + ,22.81 + ,1978.50 + ,-0.02100 + ,47.4 + ,0.16 + ,168.21 + ,14415700 + ,24.04 + ,2009.06 + ,-0.01480 + ,54.5 + ,0.16 + ,185.35 + ,17906300 + ,25.08 + ,2122.42 + ,-0.01290 + ,53.4 + ,0.15 + ,188.50 + ,22197500 + ,27.04 + ,2045.11 + ,-0.00180 + ,48.7 + ,0.12 + ,199.91 + ,15856500 + ,28.81 + ,2144.60 + ,0.01840 + ,50.6 + ,0.12 + ,210.73 + ,19068700 + ,29.86 + ,2269.15 + ,0.02720 + ,53.6 + ,0.12 + ,192.06 + ,30855100 + ,27.61 + ,2147.35 + ,0.02630 + ,56.5 + ,0.11 + ,204.62 + ,21209000 + ,28.22 + ,2238.26 + ,0.02140 + ,46.4 + ,0.13 + ,235.00 + ,19541600 + ,28.83 + ,2397.96 + ,0.02310 + ,52.3 + ,0.16 + ,261.09 + ,21955000 + ,30.06 + ,2461.19 + ,0.02240 + ,57.7 + ,0.2 + ,256.88 + ,33725900 + ,25.51 + ,2257.04 + ,0.02020 + ,62.7 + ,0.2 + ,251.53 + ,28192800 + ,22.75 + ,2109.24 + ,0.01050 + ,54.3 + ,0.18 + ,257.25 + ,27377000 + ,25.52 + ,2254.70 + ,0.01240 + ,51.0 + ,0.18 + ,243.10 + ,16228100 + ,23.33 + ,2114.03 + ,0.01150 + ,53.2 + ,0.19 + ,283.75 + ,21278900 + ,24.34 + ,2368.62 + ,0.01140 + ,48.6 + ,0.19 + ,300.98 + ,21457400 + ,26.51 + ,2507.41 + ,0.01170 + ,49.9 + ,0.19) + ,dim=c(7 + ,130) + ,dimnames=list(c('APPLE' + ,'VOLUME' + ,'MICROSOFT' + ,'NASDAQ' + ,'INFLATION' + ,'CONS.CONF' + ,'FED.FUNDS.RATE') + ,1:130)) > y <- array(NA,dim=c(7,130),dimnames=list(c('APPLE','VOLUME','MICROSOFT','NASDAQ','INFLATION','CONS.CONF','FED.FUNDS.RATE'),1:130)) > 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 MICROSOFT NASDAQ INFLATION CONS.CONF FED.FUNDS.RATE 1 25.94 23688100 39.18 3940.35 0.0274 144.7 5.45 2 28.66 13741000 35.78 4696.69 0.0322 140.8 5.73 3 33.95 14143500 42.54 4572.83 0.0376 137.1 5.85 4 31.01 16763800 27.92 3860.66 0.0307 137.7 6.02 5 21.00 16634600 25.05 3400.91 0.0319 144.7 6.27 6 26.19 13693300 32.03 3966.11 0.0373 139.2 6.53 7 25.41 10545800 27.95 3766.99 0.0366 143.0 6.54 8 30.47 9409900 27.95 4206.35 0.0341 140.8 6.50 9 12.88 39182200 24.15 3672.82 0.0345 142.5 6.52 10 9.78 37005800 27.57 3369.63 0.0345 135.8 6.51 11 8.25 15818500 22.97 2597.93 0.0345 132.6 6.51 12 7.44 16952000 17.37 2470.52 0.0339 128.6 6.40 13 10.81 24563400 24.45 2772.73 0.0373 115.7 5.98 14 9.12 14163200 23.62 2151.83 0.0353 109.2 5.49 15 11.03 18184800 21.90 1840.26 0.0292 116.9 5.31 16 12.74 20810300 27.12 2116.24 0.0327 109.9 4.80 17 9.98 12843000 27.70 2110.49 0.0362 116.1 4.21 18 11.62 13866700 29.23 2160.54 0.0325 118.9 3.97 19 9.40 15119200 26.50 2027.13 0.0272 116.3 3.77 20 9.27 8301600 22.84 1805.43 0.0272 114.0 3.65 21 7.76 14039600 20.49 1498.80 0.0265 97.0 3.07 22 8.78 12139700 23.28 1690.20 0.0213 85.3 2.49 23 10.65 9649000 25.71 1930.58 0.0190 84.9 2.09 24 10.95 8513600 26.52 1950.40 0.0155 94.6 1.82 25 12.36 15278600 25.51 1934.03 0.0114 97.8 1.73 26 10.85 15590900 23.36 1731.49 0.0114 95.0 1.74 27 11.84 9691100 24.15 1845.35 0.0148 110.7 1.73 28 12.14 10882700 20.92 1688.23 0.0164 108.5 1.75 29 11.65 10294800 20.38 1615.73 0.0118 110.3 1.75 30 8.86 16031900 21.90 1463.21 0.0107 106.3 1.75 31 7.63 13683600 19.21 1328.26 0.0146 97.4 1.73 32 7.38 8677200 19.65 1314.85 0.0180 94.5 1.74 33 7.25 9874100 17.51 1172.06 0.0151 93.7 1.75 34 8.03 10725500 21.41 1329.75 0.0203 79.6 1.75 35 7.75 8348400 23.09 1478.78 0.0220 84.9 1.34 36 7.16 8046200 20.70 1335.51 0.0238 80.7 1.24 37 7.18 10862300 19.00 1320.91 0.0260 78.8 1.24 38 7.51 8100300 19.04 1337.52 0.0298 64.8 1.26 39 7.07 7287500 19.45 1341.17 0.0302 61.4 1.25 40 7.11 14002500 20.54 1464.31 0.0222 81.0 1.26 41 8.98 19037900 19.77 1595.91 0.0206 83.6 1.26 42 9.53 10774600 20.60 1622.80 0.0211 83.5 1.22 43 10.54 8960600 21.21 1735.02 0.0211 77.0 1.01 44 11.31 7773300 21.30 1810.45 0.0216 81.7 1.03 45 10.36 9579700 22.33 1786.94 0.0232 77.0 1.01 46 11.44 11270700 21.12 1932.21 0.0204 81.7 1.01 47 10.45 9492800 20.77 1960.26 0.0177 92.5 1.00 48 10.69 9136800 22.11 2003.37 0.0188 91.7 0.98 49 11.28 14487600 22.34 2066.15 0.0193 96.4 1.00 50 11.96 10133200 21.43 2029.82 0.0169 88.5 1.01 51 13.52 18659700 20.14 1994.22 0.0174 88.5 1.00 52 12.89 15980700 21.11 1920.15 0.0229 93.0 1.00 53 14.03 9732100 21.19 1986.74 0.0305 93.1 1.00 54 16.27 14626300 23.07 2047.79 0.0327 102.8 1.03 55 16.17 16904000 23.01 1887.36 0.0299 105.7 1.26 56 17.25 13616700 22.12 1838.10 0.0265 98.7 1.43 57 19.38 13772900 22.40 1896.84 0.0254 96.7 1.61 58 26.20 28749200 22.66 1974.99 0.0319 92.9 1.76 59 33.53 31408300 24.21 2096.81 0.0352 92.6 1.93 60 32.20 26342800 24.13 2175.44 0.0326 102.7 2.16 61 38.45 48909500 23.73 2062.41 0.0297 105.1 2.28 62 44.86 41542400 22.79 2051.72 0.0301 104.4 2.50 63 41.67 24857200 21.89 1999.23 0.0315 103.0 2.63 64 36.06 34093700 22.92 1921.65 0.0351 97.5 2.79 65 39.76 22555200 23.44 2068.22 0.0280 103.1 3.00 66 36.81 19067500 22.57 2056.96 0.0253 106.2 3.04 67 42.65 19029100 23.27 2184.83 0.0317 103.6 3.26 68 46.89 15223200 24.95 2152.09 0.0364 105.5 3.50 69 53.61 21903700 23.45 2151.69 0.0469 87.5 3.62 70 57.59 33306600 23.42 2120.30 0.0435 85.2 3.78 71 67.82 23898100 25.30 2232.82 0.0346 98.3 4.00 72 71.89 23279600 23.90 2205.32 0.0342 103.8 4.16 73 75.51 40699800 25.73 2305.82 0.0399 106.8 4.29 74 68.49 37646000 24.64 2281.39 0.0360 102.7 4.49 75 62.72 37277000 24.95 2339.79 0.0336 107.5 4.59 76 70.39 39246800 22.15 2322.57 0.0355 109.8 4.79 77 59.77 27418400 20.85 2178.88 0.0417 104.7 4.94 78 57.27 30318700 21.45 2172.09 0.0432 105.7 4.99 79 67.96 32808100 22.15 2091.47 0.0415 107.0 5.24 80 67.85 28668200 23.75 2183.75 0.0382 100.2 5.25 81 76.98 32370300 25.27 2258.43 0.0206 105.9 5.25 82 81.08 24171100 26.53 2366.71 0.0131 105.1 5.25 83 91.66 25009100 27.22 2431.77 0.0197 105.3 5.25 84 84.84 32084300 27.69 2415.29 0.0254 110.0 5.24 85 85.73 50117500 28.61 2463.93 0.0208 110.2 5.25 86 84.61 27522200 26.21 2416.15 0.0242 111.2 5.26 87 92.91 26816800 25.93 2421.64 0.0278 108.2 5.26 88 99.80 25136100 27.86 2525.09 0.0257 106.3 5.25 89 121.19 30295600 28.65 2604.52 0.0269 108.5 5.25 90 122.04 41526100 27.51 2603.23 0.0269 105.3 5.25 91 131.76 43845100 27.06 2546.27 0.0236 111.9 5.26 92 138.48 39188900 26.91 2596.36 0.0197 105.6 5.02 93 153.47 40496400 27.60 2701.50 0.0276 99.5 4.94 94 189.95 37438400 34.48 2859.12 0.0354 95.2 4.76 95 182.22 46553700 31.58 2660.96 0.0431 87.8 4.49 96 198.08 31771400 33.46 2652.28 0.0408 90.6 4.24 97 135.36 62108100 30.64 2389.86 0.0428 87.9 3.94 98 125.02 46645400 25.66 2271.48 0.0403 76.4 2.98 99 143.50 42313100 26.78 2279.10 0.0398 65.9 2.61 100 173.95 38841700 26.91 2412.80 0.0394 62.3 2.28 101 188.75 32650300 26.82 2522.66 0.0418 57.2 1.98 102 167.44 34281100 26.05 2292.98 0.0502 50.4 2.00 103 158.95 33096200 24.36 2325.55 0.0560 51.9 2.01 104 169.53 23273800 25.94 2367.52 0.0537 58.5 2.00 105 113.66 43697600 25.37 2091.88 0.0494 61.4 1.81 106 107.59 66902300 21.23 1720.95 0.0366 38.8 0.97 107 92.67 44957200 19.35 1535.57 0.0107 44.9 0.39 108 85.35 33800900 18.61 1577.03 0.0009 38.6 0.16 109 90.13 33487900 16.37 1476.42 0.0003 4.0 0.15 110 89.31 27394900 15.56 1377.84 0.0024 25.3 0.22 111 105.12 25963400 17.70 1528.59 -0.0038 26.9 0.18 112 125.83 20952600 19.52 1717.30 -0.0074 40.8 0.15 113 135.81 17702900 20.26 1774.33 -0.0128 54.8 0.18 114 142.43 21282100 23.05 1835.04 -0.0143 49.3 0.21 115 163.39 18449100 22.81 1978.50 -0.0210 47.4 0.16 116 168.21 14415700 24.04 2009.06 -0.0148 54.5 0.16 117 185.35 17906300 25.08 2122.42 -0.0129 53.4 0.15 118 188.50 22197500 27.04 2045.11 -0.0018 48.7 0.12 119 199.91 15856500 28.81 2144.60 0.0184 50.6 0.12 120 210.73 19068700 29.86 2269.15 0.0272 53.6 0.12 121 192.06 30855100 27.61 2147.35 0.0263 56.5 0.11 122 204.62 21209000 28.22 2238.26 0.0214 46.4 0.13 123 235.00 19541600 28.83 2397.96 0.0231 52.3 0.16 124 261.09 21955000 30.06 2461.19 0.0224 57.7 0.20 125 256.88 33725900 25.51 2257.04 0.0202 62.7 0.20 126 251.53 28192800 22.75 2109.24 0.0105 54.3 0.18 127 257.25 27377000 25.52 2254.70 0.0124 51.0 0.18 128 243.10 16228100 23.33 2114.03 0.0115 53.2 0.19 129 283.75 21278900 24.34 2368.62 0.0114 48.6 0.19 130 300.98 21457400 26.51 2507.41 0.0117 49.9 0.19 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) VOLUME MICROSOFT NASDAQ INFLATION 2.301e+01 1.248e-06 6.926e+00 2.889e-02 -6.059e+02 CONS.CONF FED.FUNDS.RATE -2.262e+00 3.363e+00 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -121.9718 -23.6245 0.9706 20.4217 114.4975 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 2.301e+01 2.940e+01 0.783 0.43526 VOLUME 1.248e-06 3.795e-07 3.288 0.00132 ** MICROSOFT 6.926e+00 1.398e+00 4.953 2.35e-06 *** NASDAQ 2.889e-02 1.078e-02 2.679 0.00839 ** INFLATION -6.059e+02 3.201e+02 -1.893 0.06070 . CONS.CONF -2.262e+00 2.646e-01 -8.550 4.04e-14 *** FED.FUNDS.RATE 3.363e+00 4.016e+00 0.837 0.40406 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 41.23 on 123 degrees of freedom Multiple R-squared: 0.724, Adjusted R-squared: 0.7106 F-statistic: 53.79 on 6 and 123 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.657875e-03 5.315750e-03 0.9973421249 [2,] 7.859505e-04 1.571901e-03 0.9992140495 [3,] 9.451052e-05 1.890210e-04 0.9999054895 [4,] 1.654998e-05 3.309995e-05 0.9999834500 [5,] 1.869352e-06 3.738704e-06 0.9999981306 [6,] 3.605839e-07 7.211677e-07 0.9999996394 [7,] 4.512456e-08 9.024912e-08 0.9999999549 [8,] 6.014297e-09 1.202859e-08 0.9999999940 [9,] 6.652149e-10 1.330430e-09 0.9999999993 [10,] 1.113408e-10 2.226817e-10 0.9999999999 [11,] 1.389337e-11 2.778674e-11 1.0000000000 [12,] 1.463536e-12 2.927072e-12 1.0000000000 [13,] 2.552328e-13 5.104655e-13 1.0000000000 [14,] 5.675392e-14 1.135078e-13 1.0000000000 [15,] 1.121542e-14 2.243085e-14 1.0000000000 [16,] 1.499753e-15 2.999507e-15 1.0000000000 [17,] 1.666738e-16 3.333477e-16 1.0000000000 [18,] 1.548218e-17 3.096436e-17 1.0000000000 [19,] 2.361519e-18 4.723037e-18 1.0000000000 [20,] 2.725973e-19 5.451946e-19 1.0000000000 [21,] 2.906523e-20 5.813045e-20 1.0000000000 [22,] 4.433322e-21 8.866644e-21 1.0000000000 [23,] 6.417934e-22 1.283587e-21 1.0000000000 [24,] 2.619094e-22 5.238188e-22 1.0000000000 [25,] 3.345913e-23 6.691826e-23 1.0000000000 [26,] 3.261800e-24 6.523599e-24 1.0000000000 [27,] 4.487206e-25 8.974412e-25 1.0000000000 [28,] 1.182268e-25 2.364535e-25 1.0000000000 [29,] 1.693379e-26 3.386757e-26 1.0000000000 [30,] 2.016533e-27 4.033065e-27 1.0000000000 [31,] 3.059422e-28 6.118845e-28 1.0000000000 [32,] 5.345453e-29 1.069091e-28 1.0000000000 [33,] 5.838224e-30 1.167645e-29 1.0000000000 [34,] 5.322594e-31 1.064519e-30 1.0000000000 [35,] 5.050116e-32 1.010023e-31 1.0000000000 [36,] 5.148536e-33 1.029707e-32 1.0000000000 [37,] 8.345427e-34 1.669085e-33 1.0000000000 [38,] 1.921848e-34 3.843697e-34 1.0000000000 [39,] 6.703679e-35 1.340736e-34 1.0000000000 [40,] 1.870116e-35 3.740232e-35 1.0000000000 [41,] 1.170864e-35 2.341727e-35 1.0000000000 [42,] 2.427840e-35 4.855681e-35 1.0000000000 [43,] 1.007157e-35 2.014314e-35 1.0000000000 [44,] 4.626772e-36 9.253544e-36 1.0000000000 [45,] 5.290230e-36 1.058046e-35 1.0000000000 [46,] 2.620444e-36 5.240888e-36 1.0000000000 [47,] 2.512129e-36 5.024258e-36 1.0000000000 [48,] 1.406486e-35 2.812972e-35 1.0000000000 [49,] 7.936591e-31 1.587318e-30 1.0000000000 [50,] 2.268274e-26 4.536549e-26 1.0000000000 [51,] 5.947426e-24 1.189485e-23 1.0000000000 [52,] 3.241162e-22 6.482325e-22 1.0000000000 [53,] 9.255309e-20 1.851062e-19 1.0000000000 [54,] 1.290659e-17 2.581318e-17 1.0000000000 [55,] 1.306664e-17 2.613328e-17 1.0000000000 [56,] 7.024592e-16 1.404918e-15 1.0000000000 [57,] 1.935337e-14 3.870675e-14 1.0000000000 [58,] 3.451979e-12 6.903958e-12 1.0000000000 [59,] 1.542190e-10 3.084379e-10 0.9999999998 [60,] 1.885049e-09 3.770098e-09 0.9999999981 [61,] 7.532374e-09 1.506475e-08 0.9999999925 [62,] 8.853979e-07 1.770796e-06 0.9999991146 [63,] 3.432061e-05 6.864122e-05 0.9999656794 [64,] 1.048718e-04 2.097437e-04 0.9998951282 [65,] 2.103437e-04 4.206875e-04 0.9997896563 [66,] 6.321733e-04 1.264347e-03 0.9993678267 [67,] 1.709531e-03 3.419063e-03 0.9982904685 [68,] 1.754292e-03 3.508584e-03 0.9982457081 [69,] 1.386375e-03 2.772751e-03 0.9986136247 [70,] 2.949281e-03 5.898563e-03 0.9970507186 [71,] 5.190320e-03 1.038064e-02 0.9948096800 [72,] 1.288189e-02 2.576377e-02 0.9871181134 [73,] 2.729542e-02 5.459083e-02 0.9727045845 [74,] 4.751136e-02 9.502273e-02 0.9524886355 [75,] 4.684057e-02 9.368114e-02 0.9531594306 [76,] 4.278531e-02 8.557063e-02 0.9572146864 [77,] 4.837485e-02 9.674970e-02 0.9516251519 [78,] 6.382269e-02 1.276454e-01 0.9361773095 [79,] 8.232921e-02 1.646584e-01 0.9176707898 [80,] 1.336011e-01 2.672022e-01 0.8663989028 [81,] 1.455353e-01 2.910706e-01 0.8544647097 [82,] 1.650180e-01 3.300359e-01 0.8349820333 [83,] 1.949021e-01 3.898042e-01 0.8050978925 [84,] 2.806722e-01 5.613445e-01 0.7193277744 [85,] 4.253612e-01 8.507225e-01 0.5746387562 [86,] 4.792453e-01 9.584906e-01 0.5207547177 [87,] 9.139367e-01 1.721266e-01 0.0860632828 [88,] 9.774611e-01 4.507785e-02 0.0225389231 [89,] 9.708042e-01 5.839159e-02 0.0291957948 [90,] 9.849021e-01 3.019580e-02 0.0150979003 [91,] 9.878109e-01 2.437817e-02 0.0121890832 [92,] 9.890668e-01 2.186646e-02 0.0109332312 [93,] 9.912653e-01 1.746942e-02 0.0087347121 [94,] 9.890086e-01 2.198287e-02 0.0109914361 [95,] 9.862043e-01 2.759142e-02 0.0137957081 [96,] 9.843856e-01 3.122879e-02 0.0156143962 [97,] 9.888594e-01 2.228111e-02 0.0111405533 [98,] 9.865828e-01 2.683447e-02 0.0134172363 [99,] 9.919899e-01 1.602011e-02 0.0080100537 [100,] 9.884002e-01 2.319964e-02 0.0115998182 [101,] 9.792739e-01 4.145229e-02 0.0207261457 [102,] 9.647858e-01 7.042838e-02 0.0352141906 [103,] 9.690314e-01 6.193729e-02 0.0309686440 [104,] 9.769854e-01 4.602910e-02 0.0230145508 [105,] 9.790087e-01 4.198267e-02 0.0209913365 [106,] 9.880080e-01 2.398397e-02 0.0119919827 [107,] 9.856849e-01 2.863026e-02 0.0143151285 [108,] 9.977771e-01 4.445868e-03 0.0022229339 [109,] 9.994133e-01 1.173354e-03 0.0005866768 [110,] 9.975079e-01 4.984217e-03 0.0024921083 [111,] 9.995172e-01 9.656851e-04 0.0004828426 > postscript(file="/var/www/html/freestat/rcomp/tmp/112sq1292063578.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/freestat/rcomp/tmp/2ut9b1292063578.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/freestat/rcomp/tmp/3ut9b1292063578.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/freestat/rcomp/tmp/4ut9b1292063578.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/freestat/rcomp/tmp/5nkrw1292063578.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 = 130 Frequency = 1 1 2 3 4 5 6 -86.1672898 -76.1915398 -120.1487845 -7.9225600 31.1104016 -34.7458156 7 8 9 10 11 12 10.5513318 -2.0203872 -11.0086488 -41.4466972 30.3726033 61.5710050 13 14 15 16 17 18 -28.0359068 -7.3341339 24.8009145 -32.8926947 -11.4301045 -18.2098853 19 20 21 22 23 24 -7.6519267 27.6784645 7.2068062 -41.9257732 -61.6751753 -45.4078358 25 26 27 28 29 30 -39.9127177 -27.4392794 9.7661239 31.4137140 38.7769854 12.9900614 31 32 33 34 35 36 19.5139175 18.3161263 32.0383778 -28.5606476 -27.4153652 -15.0119225 37 38 39 40 41 42 -9.2756030 -35.6952416 -45.4824890 -25.4645960 -23.4332598 -18.8863724 43 44 45 46 47 48 -37.0790899 -26.7605952 -46.0162006 -33.9250112 -8.2504368 -19.1686313 49 50 51 52 53 54 -17.7926853 -23.6882025 -22.4681555 -10.8205219 0.4698706 4.9962154 55 56 57 58 59 60 11.1950586 5.4952439 -2.0024389 -23.0918058 -32.5851776 -8.8096267 61 62 63 64 65 66 -21.4138894 -1.0730705 21.5502162 -11.2783882 6.6458365 19.6419489 67 68 69 70 71 72 14.2433627 18.8816155 -7.0997258 -24.0355743 5.1691655 32.1648377 73 74 75 76 77 78 8.2736896 1.0077548 0.9335293 31.7181515 40.7258178 33.6504371 79 80 81 82 83 84 39.7851952 13.6759980 7.7341311 3.8564896 11.1838188 6.8767961 85 86 87 88 89 90 -24.8804194 24.4857561 30.8404808 17.9347480 30.8251043 18.3546523 91 92 93 94 95 96 42.8422138 39.1549648 35.9519045 19.6461610 15.1827359 42.5001121 97 98 99 100 101 102 -34.8505727 -12.2893336 -19.1951378 3.5465945 14.4466554 -7.2931351 103 104 105 106 107 108 3.3337316 27.5870276 -37.2631661 -88.9615231 -58.0631534 -66.9521820 109 110 111 112 113 114 -121.9718087 -57.5039873 -59.0861105 -20.8123032 14.7517464 -17.6249550 115 116 117 118 119 120 -3.8016195 16.4693925 17.4722486 0.1184588 20.8453084 28.9060669 121 122 123 124 125 126 20.6802541 12.5389726 50.4391192 74.8307528 103.3228347 103.4479710 127 128 129 130 80.4840814 103.8757490 113.4059484 114.4975269 > postscript(file="/var/www/html/freestat/rcomp/tmp/6nkrw1292063578.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 = 130 Frequency = 1 lag(myerror, k = 1) myerror 0 -86.1672898 NA 1 -76.1915398 -86.1672898 2 -120.1487845 -76.1915398 3 -7.9225600 -120.1487845 4 31.1104016 -7.9225600 5 -34.7458156 31.1104016 6 10.5513318 -34.7458156 7 -2.0203872 10.5513318 8 -11.0086488 -2.0203872 9 -41.4466972 -11.0086488 10 30.3726033 -41.4466972 11 61.5710050 30.3726033 12 -28.0359068 61.5710050 13 -7.3341339 -28.0359068 14 24.8009145 -7.3341339 15 -32.8926947 24.8009145 16 -11.4301045 -32.8926947 17 -18.2098853 -11.4301045 18 -7.6519267 -18.2098853 19 27.6784645 -7.6519267 20 7.2068062 27.6784645 21 -41.9257732 7.2068062 22 -61.6751753 -41.9257732 23 -45.4078358 -61.6751753 24 -39.9127177 -45.4078358 25 -27.4392794 -39.9127177 26 9.7661239 -27.4392794 27 31.4137140 9.7661239 28 38.7769854 31.4137140 29 12.9900614 38.7769854 30 19.5139175 12.9900614 31 18.3161263 19.5139175 32 32.0383778 18.3161263 33 -28.5606476 32.0383778 34 -27.4153652 -28.5606476 35 -15.0119225 -27.4153652 36 -9.2756030 -15.0119225 37 -35.6952416 -9.2756030 38 -45.4824890 -35.6952416 39 -25.4645960 -45.4824890 40 -23.4332598 -25.4645960 41 -18.8863724 -23.4332598 42 -37.0790899 -18.8863724 43 -26.7605952 -37.0790899 44 -46.0162006 -26.7605952 45 -33.9250112 -46.0162006 46 -8.2504368 -33.9250112 47 -19.1686313 -8.2504368 48 -17.7926853 -19.1686313 49 -23.6882025 -17.7926853 50 -22.4681555 -23.6882025 51 -10.8205219 -22.4681555 52 0.4698706 -10.8205219 53 4.9962154 0.4698706 54 11.1950586 4.9962154 55 5.4952439 11.1950586 56 -2.0024389 5.4952439 57 -23.0918058 -2.0024389 58 -32.5851776 -23.0918058 59 -8.8096267 -32.5851776 60 -21.4138894 -8.8096267 61 -1.0730705 -21.4138894 62 21.5502162 -1.0730705 63 -11.2783882 21.5502162 64 6.6458365 -11.2783882 65 19.6419489 6.6458365 66 14.2433627 19.6419489 67 18.8816155 14.2433627 68 -7.0997258 18.8816155 69 -24.0355743 -7.0997258 70 5.1691655 -24.0355743 71 32.1648377 5.1691655 72 8.2736896 32.1648377 73 1.0077548 8.2736896 74 0.9335293 1.0077548 75 31.7181515 0.9335293 76 40.7258178 31.7181515 77 33.6504371 40.7258178 78 39.7851952 33.6504371 79 13.6759980 39.7851952 80 7.7341311 13.6759980 81 3.8564896 7.7341311 82 11.1838188 3.8564896 83 6.8767961 11.1838188 84 -24.8804194 6.8767961 85 24.4857561 -24.8804194 86 30.8404808 24.4857561 87 17.9347480 30.8404808 88 30.8251043 17.9347480 89 18.3546523 30.8251043 90 42.8422138 18.3546523 91 39.1549648 42.8422138 92 35.9519045 39.1549648 93 19.6461610 35.9519045 94 15.1827359 19.6461610 95 42.5001121 15.1827359 96 -34.8505727 42.5001121 97 -12.2893336 -34.8505727 98 -19.1951378 -12.2893336 99 3.5465945 -19.1951378 100 14.4466554 3.5465945 101 -7.2931351 14.4466554 102 3.3337316 -7.2931351 103 27.5870276 3.3337316 104 -37.2631661 27.5870276 105 -88.9615231 -37.2631661 106 -58.0631534 -88.9615231 107 -66.9521820 -58.0631534 108 -121.9718087 -66.9521820 109 -57.5039873 -121.9718087 110 -59.0861105 -57.5039873 111 -20.8123032 -59.0861105 112 14.7517464 -20.8123032 113 -17.6249550 14.7517464 114 -3.8016195 -17.6249550 115 16.4693925 -3.8016195 116 17.4722486 16.4693925 117 0.1184588 17.4722486 118 20.8453084 0.1184588 119 28.9060669 20.8453084 120 20.6802541 28.9060669 121 12.5389726 20.6802541 122 50.4391192 12.5389726 123 74.8307528 50.4391192 124 103.3228347 74.8307528 125 103.4479710 103.3228347 126 80.4840814 103.4479710 127 103.8757490 80.4840814 128 113.4059484 103.8757490 129 114.4975269 113.4059484 130 NA 114.4975269 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -76.1915398 -86.1672898 [2,] -120.1487845 -76.1915398 [3,] -7.9225600 -120.1487845 [4,] 31.1104016 -7.9225600 [5,] -34.7458156 31.1104016 [6,] 10.5513318 -34.7458156 [7,] -2.0203872 10.5513318 [8,] -11.0086488 -2.0203872 [9,] -41.4466972 -11.0086488 [10,] 30.3726033 -41.4466972 [11,] 61.5710050 30.3726033 [12,] -28.0359068 61.5710050 [13,] -7.3341339 -28.0359068 [14,] 24.8009145 -7.3341339 [15,] -32.8926947 24.8009145 [16,] -11.4301045 -32.8926947 [17,] -18.2098853 -11.4301045 [18,] -7.6519267 -18.2098853 [19,] 27.6784645 -7.6519267 [20,] 7.2068062 27.6784645 [21,] -41.9257732 7.2068062 [22,] -61.6751753 -41.9257732 [23,] -45.4078358 -61.6751753 [24,] -39.9127177 -45.4078358 [25,] -27.4392794 -39.9127177 [26,] 9.7661239 -27.4392794 [27,] 31.4137140 9.7661239 [28,] 38.7769854 31.4137140 [29,] 12.9900614 38.7769854 [30,] 19.5139175 12.9900614 [31,] 18.3161263 19.5139175 [32,] 32.0383778 18.3161263 [33,] -28.5606476 32.0383778 [34,] -27.4153652 -28.5606476 [35,] -15.0119225 -27.4153652 [36,] -9.2756030 -15.0119225 [37,] -35.6952416 -9.2756030 [38,] -45.4824890 -35.6952416 [39,] -25.4645960 -45.4824890 [40,] -23.4332598 -25.4645960 [41,] -18.8863724 -23.4332598 [42,] -37.0790899 -18.8863724 [43,] -26.7605952 -37.0790899 [44,] -46.0162006 -26.7605952 [45,] -33.9250112 -46.0162006 [46,] -8.2504368 -33.9250112 [47,] -19.1686313 -8.2504368 [48,] -17.7926853 -19.1686313 [49,] -23.6882025 -17.7926853 [50,] -22.4681555 -23.6882025 [51,] -10.8205219 -22.4681555 [52,] 0.4698706 -10.8205219 [53,] 4.9962154 0.4698706 [54,] 11.1950586 4.9962154 [55,] 5.4952439 11.1950586 [56,] -2.0024389 5.4952439 [57,] -23.0918058 -2.0024389 [58,] -32.5851776 -23.0918058 [59,] -8.8096267 -32.5851776 [60,] -21.4138894 -8.8096267 [61,] -1.0730705 -21.4138894 [62,] 21.5502162 -1.0730705 [63,] -11.2783882 21.5502162 [64,] 6.6458365 -11.2783882 [65,] 19.6419489 6.6458365 [66,] 14.2433627 19.6419489 [67,] 18.8816155 14.2433627 [68,] -7.0997258 18.8816155 [69,] -24.0355743 -7.0997258 [70,] 5.1691655 -24.0355743 [71,] 32.1648377 5.1691655 [72,] 8.2736896 32.1648377 [73,] 1.0077548 8.2736896 [74,] 0.9335293 1.0077548 [75,] 31.7181515 0.9335293 [76,] 40.7258178 31.7181515 [77,] 33.6504371 40.7258178 [78,] 39.7851952 33.6504371 [79,] 13.6759980 39.7851952 [80,] 7.7341311 13.6759980 [81,] 3.8564896 7.7341311 [82,] 11.1838188 3.8564896 [83,] 6.8767961 11.1838188 [84,] -24.8804194 6.8767961 [85,] 24.4857561 -24.8804194 [86,] 30.8404808 24.4857561 [87,] 17.9347480 30.8404808 [88,] 30.8251043 17.9347480 [89,] 18.3546523 30.8251043 [90,] 42.8422138 18.3546523 [91,] 39.1549648 42.8422138 [92,] 35.9519045 39.1549648 [93,] 19.6461610 35.9519045 [94,] 15.1827359 19.6461610 [95,] 42.5001121 15.1827359 [96,] -34.8505727 42.5001121 [97,] -12.2893336 -34.8505727 [98,] -19.1951378 -12.2893336 [99,] 3.5465945 -19.1951378 [100,] 14.4466554 3.5465945 [101,] -7.2931351 14.4466554 [102,] 3.3337316 -7.2931351 [103,] 27.5870276 3.3337316 [104,] -37.2631661 27.5870276 [105,] -88.9615231 -37.2631661 [106,] -58.0631534 -88.9615231 [107,] -66.9521820 -58.0631534 [108,] -121.9718087 -66.9521820 [109,] -57.5039873 -121.9718087 [110,] -59.0861105 -57.5039873 [111,] -20.8123032 -59.0861105 [112,] 14.7517464 -20.8123032 [113,] -17.6249550 14.7517464 [114,] -3.8016195 -17.6249550 [115,] 16.4693925 -3.8016195 [116,] 17.4722486 16.4693925 [117,] 0.1184588 17.4722486 [118,] 20.8453084 0.1184588 [119,] 28.9060669 20.8453084 [120,] 20.6802541 28.9060669 [121,] 12.5389726 20.6802541 [122,] 50.4391192 12.5389726 [123,] 74.8307528 50.4391192 [124,] 103.3228347 74.8307528 [125,] 103.4479710 103.3228347 [126,] 80.4840814 103.4479710 [127,] 103.8757490 80.4840814 [128,] 113.4059484 103.8757490 [129,] 114.4975269 113.4059484 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -76.1915398 -86.1672898 2 -120.1487845 -76.1915398 3 -7.9225600 -120.1487845 4 31.1104016 -7.9225600 5 -34.7458156 31.1104016 6 10.5513318 -34.7458156 7 -2.0203872 10.5513318 8 -11.0086488 -2.0203872 9 -41.4466972 -11.0086488 10 30.3726033 -41.4466972 11 61.5710050 30.3726033 12 -28.0359068 61.5710050 13 -7.3341339 -28.0359068 14 24.8009145 -7.3341339 15 -32.8926947 24.8009145 16 -11.4301045 -32.8926947 17 -18.2098853 -11.4301045 18 -7.6519267 -18.2098853 19 27.6784645 -7.6519267 20 7.2068062 27.6784645 21 -41.9257732 7.2068062 22 -61.6751753 -41.9257732 23 -45.4078358 -61.6751753 24 -39.9127177 -45.4078358 25 -27.4392794 -39.9127177 26 9.7661239 -27.4392794 27 31.4137140 9.7661239 28 38.7769854 31.4137140 29 12.9900614 38.7769854 30 19.5139175 12.9900614 31 18.3161263 19.5139175 32 32.0383778 18.3161263 33 -28.5606476 32.0383778 34 -27.4153652 -28.5606476 35 -15.0119225 -27.4153652 36 -9.2756030 -15.0119225 37 -35.6952416 -9.2756030 38 -45.4824890 -35.6952416 39 -25.4645960 -45.4824890 40 -23.4332598 -25.4645960 41 -18.8863724 -23.4332598 42 -37.0790899 -18.8863724 43 -26.7605952 -37.0790899 44 -46.0162006 -26.7605952 45 -33.9250112 -46.0162006 46 -8.2504368 -33.9250112 47 -19.1686313 -8.2504368 48 -17.7926853 -19.1686313 49 -23.6882025 -17.7926853 50 -22.4681555 -23.6882025 51 -10.8205219 -22.4681555 52 0.4698706 -10.8205219 53 4.9962154 0.4698706 54 11.1950586 4.9962154 55 5.4952439 11.1950586 56 -2.0024389 5.4952439 57 -23.0918058 -2.0024389 58 -32.5851776 -23.0918058 59 -8.8096267 -32.5851776 60 -21.4138894 -8.8096267 61 -1.0730705 -21.4138894 62 21.5502162 -1.0730705 63 -11.2783882 21.5502162 64 6.6458365 -11.2783882 65 19.6419489 6.6458365 66 14.2433627 19.6419489 67 18.8816155 14.2433627 68 -7.0997258 18.8816155 69 -24.0355743 -7.0997258 70 5.1691655 -24.0355743 71 32.1648377 5.1691655 72 8.2736896 32.1648377 73 1.0077548 8.2736896 74 0.9335293 1.0077548 75 31.7181515 0.9335293 76 40.7258178 31.7181515 77 33.6504371 40.7258178 78 39.7851952 33.6504371 79 13.6759980 39.7851952 80 7.7341311 13.6759980 81 3.8564896 7.7341311 82 11.1838188 3.8564896 83 6.8767961 11.1838188 84 -24.8804194 6.8767961 85 24.4857561 -24.8804194 86 30.8404808 24.4857561 87 17.9347480 30.8404808 88 30.8251043 17.9347480 89 18.3546523 30.8251043 90 42.8422138 18.3546523 91 39.1549648 42.8422138 92 35.9519045 39.1549648 93 19.6461610 35.9519045 94 15.1827359 19.6461610 95 42.5001121 15.1827359 96 -34.8505727 42.5001121 97 -12.2893336 -34.8505727 98 -19.1951378 -12.2893336 99 3.5465945 -19.1951378 100 14.4466554 3.5465945 101 -7.2931351 14.4466554 102 3.3337316 -7.2931351 103 27.5870276 3.3337316 104 -37.2631661 27.5870276 105 -88.9615231 -37.2631661 106 -58.0631534 -88.9615231 107 -66.9521820 -58.0631534 108 -121.9718087 -66.9521820 109 -57.5039873 -121.9718087 110 -59.0861105 -57.5039873 111 -20.8123032 -59.0861105 112 14.7517464 -20.8123032 113 -17.6249550 14.7517464 114 -3.8016195 -17.6249550 115 16.4693925 -3.8016195 116 17.4722486 16.4693925 117 0.1184588 17.4722486 118 20.8453084 0.1184588 119 28.9060669 20.8453084 120 20.6802541 28.9060669 121 12.5389726 20.6802541 122 50.4391192 12.5389726 123 74.8307528 50.4391192 124 103.3228347 74.8307528 125 103.4479710 103.3228347 126 80.4840814 103.4479710 127 103.8757490 80.4840814 128 113.4059484 103.8757490 129 114.4975269 113.4059484 > 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/freestat/rcomp/tmp/7fuqh1292063578.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/freestat/rcomp/tmp/8fuqh1292063578.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/freestat/rcomp/tmp/98lpk1292063578.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/freestat/rcomp/tmp/10juo51292063578.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/11tmo71292063578.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/freestat/rcomp/tmp/12qwmz1292063578.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/freestat/rcomp/tmp/134n1p1292063578.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/freestat/rcomp/tmp/14eeis1292063578.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/freestat/rcomp/tmp/15ixhg1292063578.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/freestat/rcomp/tmp/16ozhk1292063579.tab") + } > > try(system("convert tmp/112sq1292063578.ps tmp/112sq1292063578.png",intern=TRUE)) character(0) > try(system("convert tmp/2ut9b1292063578.ps tmp/2ut9b1292063578.png",intern=TRUE)) character(0) > try(system("convert tmp/3ut9b1292063578.ps tmp/3ut9b1292063578.png",intern=TRUE)) character(0) > try(system("convert tmp/4ut9b1292063578.ps tmp/4ut9b1292063578.png",intern=TRUE)) character(0) > try(system("convert tmp/5nkrw1292063578.ps tmp/5nkrw1292063578.png",intern=TRUE)) character(0) > try(system("convert tmp/6nkrw1292063578.ps tmp/6nkrw1292063578.png",intern=TRUE)) character(0) > try(system("convert tmp/7fuqh1292063578.ps tmp/7fuqh1292063578.png",intern=TRUE)) character(0) > try(system("convert tmp/8fuqh1292063578.ps tmp/8fuqh1292063578.png",intern=TRUE)) character(0) > try(system("convert tmp/98lpk1292063578.ps tmp/98lpk1292063578.png",intern=TRUE)) character(0) > try(system("convert tmp/10juo51292063578.ps tmp/10juo51292063578.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.228 2.625 5.604