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(2350.44 + ,10892.76 + ,10540.05 + ,10570 + ,-4.9 + ,-3 + ,1.6 + ,3.38 + ,2440.25 + ,10631.92 + ,10601.61 + ,10297 + ,-4 + ,-1 + ,1.3 + ,3.35 + ,2408.64 + ,11441.08 + ,10323.73 + ,10635 + ,-3.1 + ,-3 + ,1.1 + ,3.22 + ,2472.81 + ,11950.95 + ,10418.4 + ,10872 + ,-1.3 + ,-4 + ,1.9 + ,3.06 + ,2407.6 + ,11037.54 + ,10092.96 + ,10296 + ,0 + ,-6 + ,2.6 + ,3.17 + ,2454.62 + ,11527.72 + ,10364.91 + ,10383 + ,-0.4 + ,0 + ,2.3 + ,3.19 + ,2448.05 + ,11383.89 + ,10152.09 + ,10431 + ,3 + ,-4 + ,2.4 + ,3.35 + ,2497.84 + ,10989.34 + ,10032.8 + ,10574 + ,0.4 + ,-2 + ,2.2 + ,3.24 + ,2645.64 + ,11079.42 + ,10204.59 + ,10653 + ,1.2 + ,-2 + ,2 + ,3.23 + ,2756.76 + ,11028.93 + ,10001.6 + ,10805 + ,0.6 + ,-6 + ,2.9 + ,3.31 + ,2849.27 + ,10973 + ,10411.75 + ,10872 + ,-1.3 + ,-7 + ,2.6 + ,3.25 + ,2921.44 + ,11068.05 + ,10673.38 + ,10625 + ,-3.2 + ,-6 + ,2.3 + ,3.2 + ,2981.85 + ,11394.84 + ,10539.51 + ,10407 + ,-1.8 + ,-6 + ,2.3 + ,3.1 + ,3080.58 + ,11545.71 + ,10723.78 + ,10463 + ,-3.6 + ,-3 + ,2.6 + ,2.93 + ,3106.22 + ,11809.38 + ,10682.06 + ,10556 + ,-4.2 + ,-2 + ,3.1 + ,2.92 + ,3119.31 + ,11395.64 + ,10283.19 + ,10646 + ,-6.9 + ,-5 + ,2.8 + ,2.9 + ,3061.26 + ,11082.38 + ,10377.18 + ,10702 + ,-8 + ,-11 + ,2.5 + ,2.87 + ,3097.31 + ,11402.75 + ,10486.64 + ,11353 + ,-7.5 + ,-11 + ,2.9 + ,2.76 + ,3161.69 + ,11716.87 + ,10545.38 + ,11346 + ,-8.2 + ,-11 + ,3.1 + ,2.67 + ,3257.16 + ,12204.98 + ,10554.27 + ,11451 + ,-7.6 + ,-10 + ,3.1 + ,2.75 + ,3277.01 + ,12986.62 + ,10532.54 + ,11964 + ,-3.7 + ,-14 + ,3.2 + ,2.72 + ,3295.32 + ,13392.79 + ,10324.31 + ,12574 + ,-1.7 + ,-8 + ,2.5 + ,2.72 + ,3363.99 + ,14368.05 + ,10695.25 + ,13031 + ,-0.7 + ,-9 + ,2.6 + ,2.86 + ,3494.17 + ,15650.83 + ,10827.81 + ,13812 + ,0.2 + ,-5 + ,2.9 + ,2.99 + ,3667.03 + ,16102.64 + ,10872.48 + ,14544 + ,0.6 + ,-1 + ,2.6 + ,3.07 + ,3813.06 + ,16187.64 + ,10971.19 + ,14931 + ,2.2 + ,-2 + ,2.4 + ,2.96 + ,3917.96 + ,16311.54 + ,11145.65 + ,14886 + ,3.3 + ,-5 + ,1.7 + ,3.04 + ,3895.51 + ,17232.97 + ,11234.68 + ,16005 + ,5.3 + ,-4 + ,2 + ,3.3 + ,3801.06 + ,16397.83 + ,11333.88 + ,17064 + ,5.5 + ,-6 + ,2.2 + ,3.48 + ,3570.12 + ,14990.31 + ,10997.97 + ,15168 + ,6.3 + ,-2 + ,1.9 + ,3.46 + ,3701.61 + ,15147.55 + ,11036.89 + ,16050 + ,7.7 + ,-2 + ,1.6 + ,3.57 + ,3862.27 + ,15786.78 + ,11257.35 + ,15839 + ,6.5 + ,-2 + ,1.6 + ,3.6 + ,3970.1 + ,15934.09 + ,11533.59 + ,15137 + ,5.5 + ,-2 + ,1.2 + ,3.51 + ,4138.52 + ,16519.44 + ,11963.12 + ,14954 + ,6.9 + ,2 + ,1.2 + ,3.52 + ,4199.75 + ,16101.07 + ,12185.15 + ,15648 + ,5.7 + ,1 + ,1.5 + ,3.49 + ,4290.89 + ,16775.08 + ,12377.62 + ,15305 + ,6.9 + ,-8 + ,1.6 + ,3.5 + ,4443.91 + ,17286.32 + ,12512.89 + ,15579 + ,6.1 + ,-1 + ,1.7 + ,3.64 + ,4502.64 + ,17741.23 + ,12631.48 + ,16348 + ,4.8 + ,1 + ,1.8 + ,3.94 + ,4356.98 + ,17128.37 + ,12268.53 + ,15928 + ,3.7 + ,-1 + ,1.8 + ,3.94 + ,4591.27 + ,17460.53 + ,12754.8 + ,16171 + ,5.8 + ,2 + ,1.8 + ,3.91 + ,4696.96 + ,17611.14 + ,13407.75 + ,15937 + ,6.8 + ,2 + ,1.3 + ,3.88 + ,4621.4 + ,18001.37 + ,13480.21 + ,15713 + ,8.5 + ,1 + ,1.3 + ,4.21 + ,4562.84 + ,17974.77 + ,13673.28 + ,15594 + ,7.2 + ,-1 + ,1.4 + ,4.39 + ,4202.52 + ,16460.95 + ,13239.71 + ,15683 + ,5 + ,-2 + ,1.1 + ,4.33 + ,4296.49 + ,16235.39 + ,13557.69 + ,16438 + ,4.7 + ,-2 + ,1.5 + ,4.27 + ,4435.23 + ,16903.36 + ,13901.28 + ,17032 + ,2.3 + ,-1 + ,2.2 + ,4.29 + ,4105.18 + ,15543.76 + ,13200.58 + ,17696 + ,2.4 + ,-8 + ,2.9 + ,4.18 + ,4116.68 + ,15532.18 + ,13406.97 + ,17745 + ,0.1 + ,-4 + ,3.1 + ,4.14 + ,3844.49 + ,13731.31 + ,12538.12 + ,19394 + ,1.9 + ,-6 + ,3.5 + ,4.23 + ,3720.98 + ,13547.84 + ,12419.57 + ,20148 + ,1.7 + ,-3 + ,3.6 + ,4.07 + ,3674.4 + ,12602.93 + ,12193.88 + ,20108 + ,2 + ,-3 + ,4.4 + ,3.74 + ,3857.62 + ,13357.7 + ,12656.63 + ,18584 + ,-1.9 + ,-7 + ,4.2 + ,3.66 + ,3801.06 + ,13995.33 + ,12812.48 + ,18441 + ,0.5 + ,-9 + ,5.2 + ,3.92 + ,3504.37 + ,14084.6 + ,12056.67 + ,18391 + ,-1.3 + ,-11 + ,5.8 + ,4.45 + ,3032.6 + ,13168.91 + ,11322.38 + ,19178 + ,-3.3 + ,-13 + ,5.9 + ,4.92 + ,3047.03 + ,12989.35 + ,11530.75 + ,18079 + ,-2.8 + ,-11 + ,5.4 + ,4.9 + ,2962.34 + ,12123.53 + ,11114.08 + ,18483 + ,-8 + ,-9 + ,5.5 + ,4.54 + ,2197.82 + ,9117.03 + ,9181.73 + ,19644 + ,-13.9 + ,-17 + ,4.7 + ,4.53 + ,2014.45 + ,8531.45 + ,8614.55 + ,19195 + ,-21.9 + ,-22 + ,3.1 + ,4.14 + ,1862.83 + ,8460.94 + ,8595.56 + ,19650 + ,-28.8 + ,-25 + ,2.6 + ,4.05 + ,1905.41 + ,8331.49 + ,8396.2 + ,20830 + ,-27.6 + ,-20 + ,2.3 + ,3.92 + ,1810.99 + ,7694.78 + ,7690.5 + ,23595 + ,-31.4 + ,-24 + ,1.9 + ,3.68 + ,1670.07 + ,7764.58 + ,7235.47 + ,22937 + ,-31.8 + ,-24 + ,0.6 + ,3.35 + ,1864.44 + ,8767.96 + ,7992.12 + ,21814 + ,-29.4 + ,-22 + ,0.6 + ,3.38 + ,2052.02 + ,9304.43 + ,8398.37 + ,21928 + ,-27.6 + ,-19 + ,-0.4 + ,3.44 + ,2029.6 + ,9810.31 + ,8593 + ,21777 + ,-23.6 + ,-18 + ,-1.1 + ,3.5 + ,2070.83 + ,9691.12 + ,8679.75 + ,21383 + ,-22.8 + ,-17 + ,-1.7 + ,3.54 + ,2293.41 + ,10430.35 + ,9374.63 + ,21467 + ,-18.2 + ,-11 + ,-0.8 + ,3.52 + ,2443.27 + ,10302.87 + ,9634.97 + ,22052 + ,-17.8 + ,-11 + ,-1.2 + ,3.53 + ,2513.17 + ,10066.24 + ,9857.34 + ,22680 + ,-14.2 + ,-12 + ,-1 + ,3.55 + ,2466.92 + ,9633.83 + ,10238.83 + ,24320 + ,-8.8 + ,-10 + ,-0.1 + ,3.37 + ,2502.66 + ,10169.02 + ,10433.44 + ,24977 + ,-7.9 + ,-15 + ,0.3 + ,3.36) + ,dim=c(8 + ,72) + ,dimnames=list(c('BEL_20' + ,'Nikkei' + ,'DJ_Indust' + ,'Goudprijs' + ,'Conjunct_Seizoenzuiver' + ,'Cons_vertrouw' + ,'Alg_consumptie_index_BE' + ,'Gem_rente_kasbon_5j') + ,1:72)) > y <- array(NA,dim=c(8,72),dimnames=list(c('BEL_20','Nikkei','DJ_Indust','Goudprijs','Conjunct_Seizoenzuiver','Cons_vertrouw','Alg_consumptie_index_BE','Gem_rente_kasbon_5j'),1:72)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.numeric > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x BEL_20 Nikkei DJ_Indust Goudprijs Conjunct_Seizoenzuiver Cons_vertrouw 1 2350.44 10892.76 10540.05 10570 -4.9 -3 2 2440.25 10631.92 10601.61 10297 -4.0 -1 3 2408.64 11441.08 10323.73 10635 -3.1 -3 4 2472.81 11950.95 10418.40 10872 -1.3 -4 5 2407.60 11037.54 10092.96 10296 0.0 -6 6 2454.62 11527.72 10364.91 10383 -0.4 0 7 2448.05 11383.89 10152.09 10431 3.0 -4 8 2497.84 10989.34 10032.80 10574 0.4 -2 9 2645.64 11079.42 10204.59 10653 1.2 -2 10 2756.76 11028.93 10001.60 10805 0.6 -6 11 2849.27 10973.00 10411.75 10872 -1.3 -7 12 2921.44 11068.05 10673.38 10625 -3.2 -6 13 2981.85 11394.84 10539.51 10407 -1.8 -6 14 3080.58 11545.71 10723.78 10463 -3.6 -3 15 3106.22 11809.38 10682.06 10556 -4.2 -2 16 3119.31 11395.64 10283.19 10646 -6.9 -5 17 3061.26 11082.38 10377.18 10702 -8.0 -11 18 3097.31 11402.75 10486.64 11353 -7.5 -11 19 3161.69 11716.87 10545.38 11346 -8.2 -11 20 3257.16 12204.98 10554.27 11451 -7.6 -10 21 3277.01 12986.62 10532.54 11964 -3.7 -14 22 3295.32 13392.79 10324.31 12574 -1.7 -8 23 3363.99 14368.05 10695.25 13031 -0.7 -9 24 3494.17 15650.83 10827.81 13812 0.2 -5 25 3667.03 16102.64 10872.48 14544 0.6 -1 26 3813.06 16187.64 10971.19 14931 2.2 -2 27 3917.96 16311.54 11145.65 14886 3.3 -5 28 3895.51 17232.97 11234.68 16005 5.3 -4 29 3801.06 16397.83 11333.88 17064 5.5 -6 30 3570.12 14990.31 10997.97 15168 6.3 -2 31 3701.61 15147.55 11036.89 16050 7.7 -2 32 3862.27 15786.78 11257.35 15839 6.5 -2 33 3970.10 15934.09 11533.59 15137 5.5 -2 34 4138.52 16519.44 11963.12 14954 6.9 2 35 4199.75 16101.07 12185.15 15648 5.7 1 36 4290.89 16775.08 12377.62 15305 6.9 -8 37 4443.91 17286.32 12512.89 15579 6.1 -1 38 4502.64 17741.23 12631.48 16348 4.8 1 39 4356.98 17128.37 12268.53 15928 3.7 -1 40 4591.27 17460.53 12754.80 16171 5.8 2 41 4696.96 17611.14 13407.75 15937 6.8 2 42 4621.40 18001.37 13480.21 15713 8.5 1 43 4562.84 17974.77 13673.28 15594 7.2 -1 44 4202.52 16460.95 13239.71 15683 5.0 -2 45 4296.49 16235.39 13557.69 16438 4.7 -2 46 4435.23 16903.36 13901.28 17032 2.3 -1 47 4105.18 15543.76 13200.58 17696 2.4 -8 48 4116.68 15532.18 13406.97 17745 0.1 -4 49 3844.49 13731.31 12538.12 19394 1.9 -6 50 3720.98 13547.84 12419.57 20148 1.7 -3 51 3674.40 12602.93 12193.88 20108 2.0 -3 52 3857.62 13357.70 12656.63 18584 -1.9 -7 53 3801.06 13995.33 12812.48 18441 0.5 -9 54 3504.37 14084.60 12056.67 18391 -1.3 -11 55 3032.60 13168.91 11322.38 19178 -3.3 -13 56 3047.03 12989.35 11530.75 18079 -2.8 -11 57 2962.34 12123.53 11114.08 18483 -8.0 -9 58 2197.82 9117.03 9181.73 19644 -13.9 -17 59 2014.45 8531.45 8614.55 19195 -21.9 -22 60 1862.83 8460.94 8595.56 19650 -28.8 -25 61 1905.41 8331.49 8396.20 20830 -27.6 -20 62 1810.99 7694.78 7690.50 23595 -31.4 -24 63 1670.07 7764.58 7235.47 22937 -31.8 -24 64 1864.44 8767.96 7992.12 21814 -29.4 -22 65 2052.02 9304.43 8398.37 21928 -27.6 -19 66 2029.60 9810.31 8593.00 21777 -23.6 -18 67 2070.83 9691.12 8679.75 21383 -22.8 -17 68 2293.41 10430.35 9374.63 21467 -18.2 -11 69 2443.27 10302.87 9634.97 22052 -17.8 -11 70 2513.17 10066.24 9857.34 22680 -14.2 -12 71 2466.92 9633.83 10238.83 24320 -8.8 -10 72 2502.66 10169.02 10433.44 24977 -7.9 -15 Alg_consumptie_index_BE Gem_rente_kasbon_5j t 1 1.6 3.38 1 2 1.3 3.35 2 3 1.1 3.22 3 4 1.9 3.06 4 5 2.6 3.17 5 6 2.3 3.19 6 7 2.4 3.35 7 8 2.2 3.24 8 9 2.0 3.23 9 10 2.9 3.31 10 11 2.6 3.25 11 12 2.3 3.20 12 13 2.3 3.10 13 14 2.6 2.93 14 15 3.1 2.92 15 16 2.8 2.90 16 17 2.5 2.87 17 18 2.9 2.76 18 19 3.1 2.67 19 20 3.1 2.75 20 21 3.2 2.72 21 22 2.5 2.72 22 23 2.6 2.86 23 24 2.9 2.99 24 25 2.6 3.07 25 26 2.4 2.96 26 27 1.7 3.04 27 28 2.0 3.30 28 29 2.2 3.48 29 30 1.9 3.46 30 31 1.6 3.57 31 32 1.6 3.60 32 33 1.2 3.51 33 34 1.2 3.52 34 35 1.5 3.49 35 36 1.6 3.50 36 37 1.7 3.64 37 38 1.8 3.94 38 39 1.8 3.94 39 40 1.8 3.91 40 41 1.3 3.88 41 42 1.3 4.21 42 43 1.4 4.39 43 44 1.1 4.33 44 45 1.5 4.27 45 46 2.2 4.29 46 47 2.9 4.18 47 48 3.1 4.14 48 49 3.5 4.23 49 50 3.6 4.07 50 51 4.4 3.74 51 52 4.2 3.66 52 53 5.2 3.92 53 54 5.8 4.45 54 55 5.9 4.92 55 56 5.4 4.90 56 57 5.5 4.54 57 58 4.7 4.53 58 59 3.1 4.14 59 60 2.6 4.05 60 61 2.3 3.92 61 62 1.9 3.68 62 63 0.6 3.35 63 64 0.6 3.38 64 65 -0.4 3.44 65 66 -1.1 3.50 66 67 -1.7 3.54 67 68 -0.8 3.52 68 69 -1.2 3.53 69 70 -1.0 3.55 70 71 -0.1 3.37 71 72 0.3 3.36 72 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Nikkei DJ_Indust -694.27683 0.18629 0.23867 Goudprijs Conjunct_Seizoenzuiver Cons_vertrouw -0.04016 -3.31443 3.19951 Alg_consumptie_index_BE Gem_rente_kasbon_5j t 39.66189 -302.74898 14.22945 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -306.513 -107.827 6.194 124.054 313.220 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -694.27683 463.18134 -1.499 0.13889 Nikkei 0.18629 0.01417 13.151 < 2e-16 *** DJ_Indust 0.23867 0.03512 6.796 4.52e-09 *** Goudprijs -0.04016 0.01945 -2.065 0.04302 * Conjunct_Seizoenzuiver -3.31443 6.07012 -0.546 0.58698 Cons_vertrouw 3.19951 7.42418 0.431 0.66797 Alg_consumptie_index_BE 39.66189 16.30885 2.432 0.01787 * Gem_rente_kasbon_5j -302.74898 54.97593 -5.507 7.17e-07 *** t 14.22945 4.62499 3.077 0.00310 ** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 150.5 on 63 degrees of freedom Multiple R-squared: 0.9719, Adjusted R-squared: 0.9683 F-statistic: 272.4 on 8 and 63 DF, p-value: < 2.2e-16 > if (n > n25) { + kp3 <- k + 3 + nmkm3 <- n - k - 3 + gqarr <- array(NA, dim=c(nmkm3-kp3+1,3)) + numgqtests <- 0 + numsignificant1 <- 0 + numsignificant5 <- 0 + numsignificant10 <- 0 + for (mypoint in kp3:nmkm3) { + j <- 0 + numgqtests <- numgqtests + 1 + for (myalt in c('greater', 'two.sided', 'less')) { + j <- j + 1 + gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value + } + if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1 + } + gqarr + } [,1] [,2] [,3] [1,] 0.158795515 0.317591030 0.841204485 [2,] 0.111718728 0.223437455 0.888281272 [3,] 0.060064082 0.120128163 0.939935918 [4,] 0.028927515 0.057855030 0.971072485 [5,] 0.014457511 0.028915023 0.985542489 [6,] 0.055985949 0.111971898 0.944014051 [7,] 0.078688301 0.157376601 0.921311699 [8,] 0.054723175 0.109446351 0.945276825 [9,] 0.032603584 0.065207167 0.967396416 [10,] 0.017594022 0.035188043 0.982405978 [11,] 0.009240105 0.018480210 0.990759895 [12,] 0.007362607 0.014725214 0.992637393 [13,] 0.007886240 0.015772479 0.992113760 [14,] 0.013213725 0.026427451 0.986786275 [15,] 0.028751677 0.057503355 0.971248323 [16,] 0.030194607 0.060389215 0.969805393 [17,] 0.043213506 0.086427013 0.956786494 [18,] 0.181641069 0.363282137 0.818358931 [19,] 0.739078904 0.521842192 0.260921096 [20,] 0.747750425 0.504499149 0.252249575 [21,] 0.761480134 0.477039732 0.238519866 [22,] 0.780823816 0.438352368 0.219176184 [23,] 0.874241188 0.251517624 0.125758812 [24,] 0.955211304 0.089577392 0.044788696 [25,] 0.958198902 0.083602196 0.041801098 [26,] 0.967636398 0.064727204 0.032363602 [27,] 0.962236835 0.075526331 0.037763165 [28,] 0.954909165 0.090181670 0.045090835 [29,] 0.940530170 0.118939660 0.059469830 [30,] 0.927301926 0.145396147 0.072698074 [31,] 0.935033813 0.129932374 0.064966187 [32,] 0.961604541 0.076790917 0.038395459 [33,] 0.992791252 0.014417496 0.007208748 [34,] 0.995875616 0.008248768 0.004124384 [35,] 0.995005548 0.009988903 0.004994452 [36,] 0.992590370 0.014819260 0.007409630 [37,] 0.992152065 0.015695870 0.007847935 [38,] 0.989609577 0.020780846 0.010390423 [39,] 0.987010804 0.025978391 0.012989196 [40,] 0.988967129 0.022065741 0.011032871 [41,] 0.981947039 0.036105922 0.018052961 [42,] 0.977982757 0.044034487 0.022017243 [43,] 0.978152858 0.043694283 0.021847142 [44,] 0.958349420 0.083301160 0.041650580 [45,] 0.934122144 0.131755711 0.065877856 [46,] 0.907942736 0.184114529 0.092057264 [47,] 0.830516148 0.338967705 0.169483852 [48,] 0.986618706 0.026762588 0.013381294 [49,] 0.954555268 0.090889464 0.045444732 > postscript(file="/var/www/html/freestat/rcomp/tmp/1u5my1291660799.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/25w3j1291660799.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/35w3j1291660799.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/45w3j1291660799.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/55w3j1291660799.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 = 72 Frequency = 1 1 2 3 4 5 6 -136.5813187 -38.6658010 -177.3900392 -306.5128404 -145.0084681 -267.5141260 7 8 9 10 11 12 -140.2576812 -37.3692714 49.1488336 209.3306734 193.4672862 148.6023235 13 14 15 16 17 18 131.4657375 67.2001591 15.1375573 196.3787556 180.6402650 95.2906502 19 20 21 22 23 24 35.1236100 50.5388705 -50.9863970 -33.1787820 -185.6633423 -291.3080616 25 26 27 28 29 30 -173.4609168 -82.3783495 6.9932512 -107.3998615 11.9790454 28.7352560 31 32 33 34 35 36 192.6793200 164.0422232 121.3795713 51.5304777 129.5914364 53.0631041 37 38 39 40 41 42 88.7055956 127.1934169 153.9826400 194.1470480 106.3771052 26.3428682 43 44 45 46 47 48 -39.7314032 -35.5772003 5.5898597 -85.3451119 -20.7806172 -109.1071430 49 50 51 52 53 54 237.2988229 129.6471581 166.4804850 6.7981496 -172.3081249 -184.3851850 55 56 57 58 59 60 -154.8458297 -206.0310086 -164.5758194 159.3155286 123.0070947 -27.5883237 61 62 63 64 65 66 80.3711273 313.2198708 177.5690608 -44.2620960 -9.0362507 -136.4557718 67 68 69 70 71 72 -88.4208012 -225.9542399 -84.9972116 0.1585691 -83.6418680 -181.8035454 > postscript(file="/var/www/html/freestat/rcomp/tmp/6fo241291660799.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 = 72 Frequency = 1 lag(myerror, k = 1) myerror 0 -136.5813187 NA 1 -38.6658010 -136.5813187 2 -177.3900392 -38.6658010 3 -306.5128404 -177.3900392 4 -145.0084681 -306.5128404 5 -267.5141260 -145.0084681 6 -140.2576812 -267.5141260 7 -37.3692714 -140.2576812 8 49.1488336 -37.3692714 9 209.3306734 49.1488336 10 193.4672862 209.3306734 11 148.6023235 193.4672862 12 131.4657375 148.6023235 13 67.2001591 131.4657375 14 15.1375573 67.2001591 15 196.3787556 15.1375573 16 180.6402650 196.3787556 17 95.2906502 180.6402650 18 35.1236100 95.2906502 19 50.5388705 35.1236100 20 -50.9863970 50.5388705 21 -33.1787820 -50.9863970 22 -185.6633423 -33.1787820 23 -291.3080616 -185.6633423 24 -173.4609168 -291.3080616 25 -82.3783495 -173.4609168 26 6.9932512 -82.3783495 27 -107.3998615 6.9932512 28 11.9790454 -107.3998615 29 28.7352560 11.9790454 30 192.6793200 28.7352560 31 164.0422232 192.6793200 32 121.3795713 164.0422232 33 51.5304777 121.3795713 34 129.5914364 51.5304777 35 53.0631041 129.5914364 36 88.7055956 53.0631041 37 127.1934169 88.7055956 38 153.9826400 127.1934169 39 194.1470480 153.9826400 40 106.3771052 194.1470480 41 26.3428682 106.3771052 42 -39.7314032 26.3428682 43 -35.5772003 -39.7314032 44 5.5898597 -35.5772003 45 -85.3451119 5.5898597 46 -20.7806172 -85.3451119 47 -109.1071430 -20.7806172 48 237.2988229 -109.1071430 49 129.6471581 237.2988229 50 166.4804850 129.6471581 51 6.7981496 166.4804850 52 -172.3081249 6.7981496 53 -184.3851850 -172.3081249 54 -154.8458297 -184.3851850 55 -206.0310086 -154.8458297 56 -164.5758194 -206.0310086 57 159.3155286 -164.5758194 58 123.0070947 159.3155286 59 -27.5883237 123.0070947 60 80.3711273 -27.5883237 61 313.2198708 80.3711273 62 177.5690608 313.2198708 63 -44.2620960 177.5690608 64 -9.0362507 -44.2620960 65 -136.4557718 -9.0362507 66 -88.4208012 -136.4557718 67 -225.9542399 -88.4208012 68 -84.9972116 -225.9542399 69 0.1585691 -84.9972116 70 -83.6418680 0.1585691 71 -181.8035454 -83.6418680 72 NA -181.8035454 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -38.6658010 -136.5813187 [2,] -177.3900392 -38.6658010 [3,] -306.5128404 -177.3900392 [4,] -145.0084681 -306.5128404 [5,] -267.5141260 -145.0084681 [6,] -140.2576812 -267.5141260 [7,] -37.3692714 -140.2576812 [8,] 49.1488336 -37.3692714 [9,] 209.3306734 49.1488336 [10,] 193.4672862 209.3306734 [11,] 148.6023235 193.4672862 [12,] 131.4657375 148.6023235 [13,] 67.2001591 131.4657375 [14,] 15.1375573 67.2001591 [15,] 196.3787556 15.1375573 [16,] 180.6402650 196.3787556 [17,] 95.2906502 180.6402650 [18,] 35.1236100 95.2906502 [19,] 50.5388705 35.1236100 [20,] -50.9863970 50.5388705 [21,] -33.1787820 -50.9863970 [22,] -185.6633423 -33.1787820 [23,] -291.3080616 -185.6633423 [24,] -173.4609168 -291.3080616 [25,] -82.3783495 -173.4609168 [26,] 6.9932512 -82.3783495 [27,] -107.3998615 6.9932512 [28,] 11.9790454 -107.3998615 [29,] 28.7352560 11.9790454 [30,] 192.6793200 28.7352560 [31,] 164.0422232 192.6793200 [32,] 121.3795713 164.0422232 [33,] 51.5304777 121.3795713 [34,] 129.5914364 51.5304777 [35,] 53.0631041 129.5914364 [36,] 88.7055956 53.0631041 [37,] 127.1934169 88.7055956 [38,] 153.9826400 127.1934169 [39,] 194.1470480 153.9826400 [40,] 106.3771052 194.1470480 [41,] 26.3428682 106.3771052 [42,] -39.7314032 26.3428682 [43,] -35.5772003 -39.7314032 [44,] 5.5898597 -35.5772003 [45,] -85.3451119 5.5898597 [46,] -20.7806172 -85.3451119 [47,] -109.1071430 -20.7806172 [48,] 237.2988229 -109.1071430 [49,] 129.6471581 237.2988229 [50,] 166.4804850 129.6471581 [51,] 6.7981496 166.4804850 [52,] -172.3081249 6.7981496 [53,] -184.3851850 -172.3081249 [54,] -154.8458297 -184.3851850 [55,] -206.0310086 -154.8458297 [56,] -164.5758194 -206.0310086 [57,] 159.3155286 -164.5758194 [58,] 123.0070947 159.3155286 [59,] -27.5883237 123.0070947 [60,] 80.3711273 -27.5883237 [61,] 313.2198708 80.3711273 [62,] 177.5690608 313.2198708 [63,] -44.2620960 177.5690608 [64,] -9.0362507 -44.2620960 [65,] -136.4557718 -9.0362507 [66,] -88.4208012 -136.4557718 [67,] -225.9542399 -88.4208012 [68,] -84.9972116 -225.9542399 [69,] 0.1585691 -84.9972116 [70,] -83.6418680 0.1585691 [71,] -181.8035454 -83.6418680 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -38.6658010 -136.5813187 2 -177.3900392 -38.6658010 3 -306.5128404 -177.3900392 4 -145.0084681 -306.5128404 5 -267.5141260 -145.0084681 6 -140.2576812 -267.5141260 7 -37.3692714 -140.2576812 8 49.1488336 -37.3692714 9 209.3306734 49.1488336 10 193.4672862 209.3306734 11 148.6023235 193.4672862 12 131.4657375 148.6023235 13 67.2001591 131.4657375 14 15.1375573 67.2001591 15 196.3787556 15.1375573 16 180.6402650 196.3787556 17 95.2906502 180.6402650 18 35.1236100 95.2906502 19 50.5388705 35.1236100 20 -50.9863970 50.5388705 21 -33.1787820 -50.9863970 22 -185.6633423 -33.1787820 23 -291.3080616 -185.6633423 24 -173.4609168 -291.3080616 25 -82.3783495 -173.4609168 26 6.9932512 -82.3783495 27 -107.3998615 6.9932512 28 11.9790454 -107.3998615 29 28.7352560 11.9790454 30 192.6793200 28.7352560 31 164.0422232 192.6793200 32 121.3795713 164.0422232 33 51.5304777 121.3795713 34 129.5914364 51.5304777 35 53.0631041 129.5914364 36 88.7055956 53.0631041 37 127.1934169 88.7055956 38 153.9826400 127.1934169 39 194.1470480 153.9826400 40 106.3771052 194.1470480 41 26.3428682 106.3771052 42 -39.7314032 26.3428682 43 -35.5772003 -39.7314032 44 5.5898597 -35.5772003 45 -85.3451119 5.5898597 46 -20.7806172 -85.3451119 47 -109.1071430 -20.7806172 48 237.2988229 -109.1071430 49 129.6471581 237.2988229 50 166.4804850 129.6471581 51 6.7981496 166.4804850 52 -172.3081249 6.7981496 53 -184.3851850 -172.3081249 54 -154.8458297 -184.3851850 55 -206.0310086 -154.8458297 56 -164.5758194 -206.0310086 57 159.3155286 -164.5758194 58 123.0070947 159.3155286 59 -27.5883237 123.0070947 60 80.3711273 -27.5883237 61 313.2198708 80.3711273 62 177.5690608 313.2198708 63 -44.2620960 177.5690608 64 -9.0362507 -44.2620960 65 -136.4557718 -9.0362507 66 -88.4208012 -136.4557718 67 -225.9542399 -88.4208012 68 -84.9972116 -225.9542399 69 0.1585691 -84.9972116 70 -83.6418680 0.1585691 71 -181.8035454 -83.6418680 > 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/7qx271291660799.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/8qx271291660799.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/9qx271291660799.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/10161a1291660799.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/11m7ig1291660799.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/12p7ym1291660799.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/133zeu1291660799.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/147zu01291660799.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/15s0t61291660799.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/166aqx1291660799.tab") + } > > try(system("convert tmp/1u5my1291660799.ps tmp/1u5my1291660799.png",intern=TRUE)) character(0) > try(system("convert tmp/25w3j1291660799.ps tmp/25w3j1291660799.png",intern=TRUE)) character(0) > try(system("convert tmp/35w3j1291660799.ps tmp/35w3j1291660799.png",intern=TRUE)) character(0) > try(system("convert tmp/45w3j1291660799.ps tmp/45w3j1291660799.png",intern=TRUE)) character(0) > try(system("convert tmp/55w3j1291660799.ps tmp/55w3j1291660799.png",intern=TRUE)) character(0) > try(system("convert tmp/6fo241291660799.ps tmp/6fo241291660799.png",intern=TRUE)) character(0) > try(system("convert tmp/7qx271291660799.ps tmp/7qx271291660799.png",intern=TRUE)) character(0) > try(system("convert tmp/8qx271291660799.ps tmp/8qx271291660799.png",intern=TRUE)) character(0) > try(system("convert tmp/9qx271291660799.ps tmp/9qx271291660799.png",intern=TRUE)) character(0) > try(system("convert tmp/10161a1291660799.ps tmp/10161a1291660799.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.156 2.535 4.492