R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(18.2 + ,2687 + ,1870 + ,1890 + ,145.7 + ,352.2 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,143.8 + ,13271 + ,9115 + ,8190 + ,-279 + ,83 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,23.4 + ,13621 + ,4848 + ,4572 + ,485 + ,898.9 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,1.1 + ,3614 + ,367 + ,90 + ,14.1 + ,24.6 + ,1 + ,0 + ,3614 + ,367 + ,90 + ,14.1 + ,24.6 + ,0 + ,0 + ,0 + ,0 + ,0 + ,49.5 + ,6425 + ,6131 + ,2448 + ,345.8 + ,682.5 + ,1 + ,0 + ,6425 + ,6131 + ,2448 + ,345.8 + ,682.5 + ,0 + ,0 + ,0 + ,0 + ,0 + ,4.8 + ,1022 + ,1754 + ,1370 + ,72 + ,119.5 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,0 + ,1022 + ,1754 + ,1370 + ,72 + ,119.5 + ,20.8 + ,1093 + ,1679 + ,1070 + ,100.9 + ,164.5 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,0 + ,1093 + ,1679 + ,1070 + ,100.9 + ,164.5 + ,19.4 + ,1529 + ,1295 + ,444 + ,25.6 + ,137 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,2.1 + ,2788 + ,271 + ,304 + ,23.5 + ,28.9 + ,1 + ,0 + ,2788 + ,271 + ,304 + ,23.5 + ,28.9 + ,0 + ,0 + ,0 + ,0 + ,0 + ,79.4 + ,19788 + ,9084 + ,10636 + ,1092.9 + ,2576.8 + ,1 + ,0 + ,19788 + ,9084 + ,10636 + ,1092.9 + ,2576.8 + ,0 + ,0 + ,0 + ,0 + ,0 + ,2.8 + ,327 + ,542 + ,959 + ,54.1 + ,72.5 + ,1 + ,0 + ,327 + ,542 + ,959 + ,54.1 + ,72.5 + ,0 + ,0 + ,0 + ,0 + ,0 + ,3.8 + ,1117 + ,1038 + ,478 + ,59.7 + ,91.7 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,4.1 + ,5401 + ,550 + ,376 + ,25.6 + ,37.5 + ,1 + ,0 + ,5401 + ,550 + ,376 + ,25.6 + ,37.5 + ,0 + ,0 + ,0 + ,0 + ,0 + ,13.2 + ,1128 + ,1516 + ,430 + ,-47 + ,26.7 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,0 + ,1128 + ,1516 + ,430 + ,-47 + ,26.7 + ,2.8 + ,1633 + ,701 + ,679 + ,74.3 + ,135.9 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,48.5 + ,44736 + ,16197 + ,4653 + ,-732.5 + ,-651.9 + ,1 + ,0 + ,44736 + ,16197 + ,4653 + ,-732.5 + ,-651.9 + ,0 + ,0 + ,0 + ,0 + ,0 + ,6.2 + ,5651 + ,1254 + ,2002 + ,310.7 + ,407.9 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,10.8 + ,5835 + ,4053 + ,1601 + ,-93.8 + ,173.8 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,3.8 + ,278 + ,205 + ,853 + ,44.8 + ,50.5 + ,1 + ,0 + ,278 + ,205 + ,853 + ,44.8 + ,50.5 + ,0 + ,0 + ,0 + ,0 + ,0 + ,21.9 + ,5074 + ,2557 + ,1892 + ,239.9 + ,578.3 + ,1 + ,0 + ,5074 + ,2557 + ,1892 + ,239.9 + ,578.3 + ,0 + ,0 + ,0 + ,0 + ,0 + ,12.6 + ,866 + ,1487 + ,944 + ,71.7 + ,115.4 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,128.0 + ,4418 + ,8793 + ,4459 + ,283.6 + ,456.5 + ,1 + ,0 + ,4418 + ,8793 + ,4459 + ,283.6 + ,456.5 + ,0 + ,0 + ,0 + ,0 + ,0 + ,87.3 + ,6914 + ,7029 + ,7957 + ,400.6 + ,754.7 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,0 + ,6914 + ,7029 + ,7957 + ,400.6 + ,754.7 + ,16.0 + ,862 + ,1601 + ,1093 + ,66.9 + ,106.8 + ,1 + ,0 + ,862 + ,1601 + ,1093 + ,66.9 + ,106.8 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0.7 + ,401 + ,176 + ,1084 + ,55.6 + ,57 + ,1 + ,0 + ,401 + ,176 + ,1084 + ,55.6 + ,57 + ,0 + ,0 + ,0 + ,0 + ,0 + ,22.5 + ,430 + ,1155 + ,1045 + ,55.7 + ,70.8 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,0 + ,430 + ,1155 + ,1045 + ,55.7 + ,70.8 + ,15.4 + ,799 + ,1140 + ,683 + ,57.6 + ,89.2 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,3.0 + ,4789 + ,453 + ,367 + ,40.2 + ,51.4 + ,1 + ,0 + ,4789 + ,453 + ,367 + ,40.2 + ,51.4 + ,0 + ,0 + ,0 + ,0 + ,0 + ,2.1 + ,2548 + ,264 + ,181 + ,22.2 + ,26.2 + ,1 + ,0 + ,2548 + ,264 + ,181 + ,22.2 + ,26.2 + ,0 + ,0 + ,0 + ,0 + ,0 + ,4.1 + ,5249 + ,527 + ,346 + ,37.8 + ,56.2 + ,1 + ,0 + ,5249 + ,527 + ,346 + ,37.8 + ,56.2 + ,0 + ,0 + ,0 + ,0 + ,0 + ,6.4 + ,3494 + ,1653 + ,1442 + ,160.9 + ,320.3 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,26.6 + ,1804 + ,2564 + ,483 + ,70.5 + ,164.9 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,0 + ,1804 + ,2564 + ,483 + ,70.5 + ,164.9 + ,304.0 + ,26432 + ,28285 + ,33172 + ,2336 + ,3562 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,0 + ,26432 + ,28285 + ,33172 + ,2336 + ,3562 + ,18.6 + ,623 + ,2247 + ,797 + ,57 + ,93.8 + ,1 + ,0 + ,623 + ,2247 + ,797 + ,57 + ,93.8 + ,0 + ,0 + ,0 + ,0 + ,0 + ,65.0 + ,1608 + ,6615 + ,829 + ,56.1 + ,134 + ,1 + ,0 + ,1608 + ,6615 + ,829 + ,56.1 + ,134 + ,0 + ,0 + ,0 + ,0 + ,0 + ,66.2 + ,4662 + ,4781 + ,2988 + ,28.7 + ,371.5 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,0 + ,4662 + ,4781 + ,2988 + ,28.7 + ,371.5 + ,83.0 + ,5769 + ,6571 + ,9462 + ,482 + ,792 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,0 + ,5769 + ,6571 + ,9462 + ,482 + ,792 + ,62.0 + ,6259 + ,4152 + ,3090 + ,283.7 + ,524.5 + ,1 + ,0 + ,6259 + ,4152 + ,3090 + ,283.7 + ,524.5 + ,0 + ,0 + ,0 + ,0 + ,0 + ,1.6 + ,1654 + ,451 + ,779 + ,84.8 + ,130.4 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,400.2 + ,52634 + ,50056 + ,95697 + ,6555 + ,9874 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,0 + ,52634 + ,50056 + ,95697 + ,6555 + ,9874 + ,23.3 + ,999 + ,1878 + ,393 + ,-173.5 + ,-108.1 + ,1 + ,0 + ,999 + ,1878 + ,393 + ,-173.5 + ,-108.1 + ,0 + ,0 + ,0 + ,0 + ,0 + ,4.6 + ,1679 + ,1354 + ,687 + ,93.8 + ,154.6 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,164.6 + ,4178 + ,17124 + ,2091 + ,180.8 + ,390.4 + ,1 + ,0 + ,4178 + ,17124 + ,2091 + ,180.8 + ,390.4 + ,0 + ,0 + ,0 + ,0 + ,0 + ,1.9 + ,223 + ,557 + ,1040 + ,60.6 + ,63.7 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,57.5 + ,6307 + ,8199 + ,598 + ,-771.5 + ,-524.3 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,0 + ,6307 + ,8199 + ,598 + ,-771.5 + ,-524.3 + ,2.4 + ,3720 + ,356 + ,211 + ,26.6 + ,34.8 + ,1 + ,0 + ,3720 + ,356 + ,211 + ,26.6 + ,34.8 + ,0 + ,0 + ,0 + ,0 + ,0 + ,77.3 + ,3442 + ,5080 + ,2673 + ,235.4 + ,361.5 + ,1 + ,0 + ,3442 + ,5080 + ,2673 + ,235.4 + ,361.5 + ,0 + ,0 + ,0 + ,0 + ,0 + ,15.8 + ,33406 + ,3222 + ,1413 + ,201.7 + ,246.7 + ,1 + ,0 + ,33406 + ,3222 + ,1413 + ,201.7 + ,246.7 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0.6 + ,1257 + ,355 + ,181 + ,167.5 + ,304 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,3.5 + ,1743 + ,597 + ,717 + ,121.6 + ,172.4 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,9.0 + ,12505 + ,1302 + ,702 + ,108.4 + ,131.4 + ,1 + ,0 + ,12505 + ,1302 + ,702 + ,108.4 + ,131.4 + ,0 + ,0 + ,0 + ,0 + ,0 + ,62.0 + ,3940 + ,4317 + ,3940 + ,315.2 + ,566.3 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,0 + ,3940 + ,4317 + ,3940 + ,315.2 + ,566.3 + ,7.4 + ,8998 + ,882 + ,988 + ,93 + ,119 + ,1 + ,0 + ,8998 + ,882 + ,988 + ,93 + ,119 + ,0 + ,0 + ,0 + ,0 + ,0 + ,15.6 + ,21419 + ,2516 + ,930 + ,107.6 + ,164.7 + ,1 + ,0 + ,21419 + ,2516 + ,930 + ,107.6 + ,164.7 + ,0 + ,0 + ,0 + ,0 + ,0 + ,25.2 + ,2366 + ,3305 + ,1117 + ,131.2 + ,256.5 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,0 + ,2366 + ,3305 + ,1117 + ,131.2 + ,256.5 + ,25.4 + ,2448 + ,3484 + ,1036 + ,48.8 + ,257.1 + ,1 + ,0 + ,2448 + ,3484 + ,1036 + ,48.8 + ,257.1 + ,0 + ,0 + ,0 + ,0 + ,0 + ,3.5 + ,1440 + ,1617 + ,639 + ,81.7 + ,126.4 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,27.3 + ,14045 + ,15636 + ,2754 + ,418 + ,1462 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,37.5 + ,4084 + ,4346 + ,3023 + ,302.7 + ,521.7 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,0 + ,4084 + ,4346 + ,3023 + ,302.7 + ,521.7 + ,3.4 + ,3010 + ,749 + ,1120 + ,146.3 + ,209.2 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,14.3 + ,1286 + ,1734 + ,361 + ,69.2 + ,145.7 + ,1 + ,0 + ,1286 + ,1734 + ,361 + ,69.2 + ,145.7 + ,0 + ,0 + ,0 + ,0 + ,0 + ,6.1 + ,707 + ,706 + ,275 + ,61.4 + ,77.8 + ,1 + ,0 + ,707 + ,706 + ,275 + ,61.4 + ,77.8 + ,0 + ,0 + ,0 + ,0 + ,0 + ,4.9 + ,3086 + ,1739 + ,1507 + ,202.7 + ,335.2 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,3.3 + ,252 + ,312 + ,883 + ,41.7 + ,60.6 + ,1 + ,0 + ,252 + ,312 + ,883 + ,41.7 + ,60.6 + ,0 + ,0 + ,0 + ,0 + ,0 + ,7.0 + ,11052 + ,1097 + ,606 + ,64.9 + ,97.6 + ,1 + ,0 + ,11052 + ,1097 + ,606 + ,64.9 + ,97.6 + ,0 + ,0 + ,0 + ,0 + ,0 + ,8.2 + ,9672 + ,1037 + ,829 + ,92.6 + ,118.2 + ,1 + ,0 + ,9672 + ,1037 + ,829 + ,92.6 + ,118.2 + ,0 + ,0 + ,0 + ,0 + ,0 + ,43.5 + ,1112 + ,3689 + ,542 + ,30.3 + ,96.9 + ,1 + ,0 + ,1112 + ,3689 + ,542 + ,30.3 + ,96.9 + ,0 + ,0 + ,0 + ,0 + ,0 + ,48.5 + ,1104 + ,5123 + ,910 + ,63.7 + ,133.3 + ,1 + ,0 + ,1104 + ,5123 + ,910 + ,63.7 + ,133.3 + ,0 + ,0 + ,0 + ,0 + ,0 + ,5.4 + ,478 + ,672 + ,866 + ,67.1 + ,101.6 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,0 + ,478 + ,672 + ,866 + ,67.1 + ,101.6 + ,49.5 + ,10348 + ,5721 + ,1915 + ,223.6 + ,322.5 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,0 + ,10348 + ,5721 + ,1915 + ,223.6 + ,322.5 + ,29.1 + ,2769 + ,3725 + ,663 + ,-208.4 + ,12.4 + ,1 + ,0 + ,2769 + ,3725 + ,663 + ,-208.4 + ,12.4 + ,0 + ,0 + ,0 + ,0 + ,0 + ,2.6 + ,752 + ,2149 + ,101 + ,11.1 + ,15.2 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,0 + ,752 + ,2149 + ,101 + ,11.1 + ,15.2 + ,0.8 + ,4989 + ,518 + ,53 + ,-3.1 + ,-0.3 + ,1 + ,0 + ,4989 + ,518 + ,53 + ,-3.1 + ,-0.3 + ,0 + ,0 + ,0 + ,0 + ,0 + ,184.8 + ,10528 + ,14992 + ,5377 + ,312.7 + ,710.7 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,0 + ,10528 + ,14992 + ,5377 + ,312.7 + ,710.7 + ,2.3 + ,1995 + ,2662 + ,341 + ,34.7 + ,100.7 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,8.0 + ,2286 + ,2235 + ,2306 + ,195.3 + ,219 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,10.3 + ,952 + ,1307 + ,309 + ,35.4 + ,92.8 + ,1 + ,0 + ,952 + ,1307 + ,309 + ,35.4 + ,92.8 + ,0 + ,0 + ,0 + ,0 + ,0 + ,50.0 + ,2957 + ,2806 + ,457 + ,40.6 + ,93.5 + ,1 + ,0 + ,2957 + ,2806 + ,457 + ,40.6 + ,93.5 + ,0 + ,0 + ,0 + ,0 + ,0 + ,118.1 + ,2535 + ,5958 + ,1921 + ,177 + ,288 + ,1 + ,0 + ,2535 + ,5958 + ,1921 + ,177 + ,288 + ,0 + ,0 + ,0 + ,0 + ,0) + ,dim=c(18 + ,79) + ,dimnames=list(c('wn' + ,'ta' + ,'omzet' + ,'mw' + ,'winst' + ,'cf' + ,'dienst' + ,'product' + ,'ta_d' + ,'omzet_d' + ,'mw_d' + ,'winst_d' + ,'cf_d' + ,'ta_p' + ,'omzet_p' + ,'mw_p' + ,'winst_p' + ,'cf_p') + ,1:79)) > y <- array(NA,dim=c(18,79),dimnames=list(c('wn','ta','omzet','mw','winst','cf','dienst','product','ta_d','omzet_d','mw_d','winst_d','cf_d','ta_p','omzet_p','mw_p','winst_p','cf_p'),1:79)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '1' > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from 'package:base': as.Date, as.Date.numeric > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x wn ta omzet mw winst cf dienst product ta_d omzet_d mw_d 1 18.2 2687 1870 1890 145.7 352.2 0 0 0 0 0 2 143.8 13271 9115 8190 -279.0 83.0 0 0 0 0 0 3 23.4 13621 4848 4572 485.0 898.9 0 0 0 0 0 4 1.1 3614 367 90 14.1 24.6 1 0 3614 367 90 5 49.5 6425 6131 2448 345.8 682.5 1 0 6425 6131 2448 6 4.8 1022 1754 1370 72.0 119.5 0 1 0 0 0 7 20.8 1093 1679 1070 100.9 164.5 0 1 0 0 0 8 19.4 1529 1295 444 25.6 137.0 0 0 0 0 0 9 2.1 2788 271 304 23.5 28.9 1 0 2788 271 304 10 79.4 19788 9084 10636 1092.9 2576.8 1 0 19788 9084 10636 11 2.8 327 542 959 54.1 72.5 1 0 327 542 959 12 3.8 1117 1038 478 59.7 91.7 0 0 0 0 0 13 4.1 5401 550 376 25.6 37.5 1 0 5401 550 376 14 13.2 1128 1516 430 -47.0 26.7 0 1 0 0 0 15 2.8 1633 701 679 74.3 135.9 0 0 0 0 0 16 48.5 44736 16197 4653 -732.5 -651.9 1 0 44736 16197 4653 17 6.2 5651 1254 2002 310.7 407.9 0 0 0 0 0 18 10.8 5835 4053 1601 -93.8 173.8 0 0 0 0 0 19 3.8 278 205 853 44.8 50.5 1 0 278 205 853 20 21.9 5074 2557 1892 239.9 578.3 1 0 5074 2557 1892 21 12.6 866 1487 944 71.7 115.4 0 0 0 0 0 22 128.0 4418 8793 4459 283.6 456.5 1 0 4418 8793 4459 23 87.3 6914 7029 7957 400.6 754.7 0 1 0 0 0 24 16.0 862 1601 1093 66.9 106.8 1 0 862 1601 1093 25 0.7 401 176 1084 55.6 57.0 1 0 401 176 1084 26 22.5 430 1155 1045 55.7 70.8 0 1 0 0 0 27 15.4 799 1140 683 57.6 89.2 0 0 0 0 0 28 3.0 4789 453 367 40.2 51.4 1 0 4789 453 367 29 2.1 2548 264 181 22.2 26.2 1 0 2548 264 181 30 4.1 5249 527 346 37.8 56.2 1 0 5249 527 346 31 6.4 3494 1653 1442 160.9 320.3 0 0 0 0 0 32 26.6 1804 2564 483 70.5 164.9 0 1 0 0 0 33 304.0 26432 28285 33172 2336.0 3562.0 0 1 0 0 0 34 18.6 623 2247 797 57.0 93.8 1 0 623 2247 797 35 65.0 1608 6615 829 56.1 134.0 1 0 1608 6615 829 36 66.2 4662 4781 2988 28.7 371.5 0 1 0 0 0 37 83.0 5769 6571 9462 482.0 792.0 0 1 0 0 0 38 62.0 6259 4152 3090 283.7 524.5 1 0 6259 4152 3090 39 1.6 1654 451 779 84.8 130.4 0 0 0 0 0 40 400.2 52634 50056 95697 6555.0 9874.0 0 1 0 0 0 41 23.3 999 1878 393 -173.5 -108.1 1 0 999 1878 393 42 4.6 1679 1354 687 93.8 154.6 0 0 0 0 0 43 164.6 4178 17124 2091 180.8 390.4 1 0 4178 17124 2091 44 1.9 223 557 1040 60.6 63.7 0 0 0 0 0 45 57.5 6307 8199 598 -771.5 -524.3 0 1 0 0 0 46 2.4 3720 356 211 26.6 34.8 1 0 3720 356 211 47 77.3 3442 5080 2673 235.4 361.5 1 0 3442 5080 2673 48 15.8 33406 3222 1413 201.7 246.7 1 0 33406 3222 1413 49 0.6 1257 355 181 167.5 304.0 0 0 0 0 0 50 3.5 1743 597 717 121.6 172.4 0 0 0 0 0 51 9.0 12505 1302 702 108.4 131.4 1 0 12505 1302 702 52 62.0 3940 4317 3940 315.2 566.3 0 1 0 0 0 53 7.4 8998 882 988 93.0 119.0 1 0 8998 882 988 54 15.6 21419 2516 930 107.6 164.7 1 0 21419 2516 930 55 25.2 2366 3305 1117 131.2 256.5 0 1 0 0 0 56 25.4 2448 3484 1036 48.8 257.1 1 0 2448 3484 1036 57 3.5 1440 1617 639 81.7 126.4 0 0 0 0 0 58 27.3 14045 15636 2754 418.0 1462.0 0 0 0 0 0 59 37.5 4084 4346 3023 302.7 521.7 0 1 0 0 0 60 3.4 3010 749 1120 146.3 209.2 0 0 0 0 0 61 14.3 1286 1734 361 69.2 145.7 1 0 1286 1734 361 62 6.1 707 706 275 61.4 77.8 1 0 707 706 275 63 4.9 3086 1739 1507 202.7 335.2 0 0 0 0 0 64 3.3 252 312 883 41.7 60.6 1 0 252 312 883 65 7.0 11052 1097 606 64.9 97.6 1 0 11052 1097 606 66 8.2 9672 1037 829 92.6 118.2 1 0 9672 1037 829 67 43.5 1112 3689 542 30.3 96.9 1 0 1112 3689 542 68 48.5 1104 5123 910 63.7 133.3 1 0 1104 5123 910 69 5.4 478 672 866 67.1 101.6 0 1 0 0 0 70 49.5 10348 5721 1915 223.6 322.5 0 1 0 0 0 71 29.1 2769 3725 663 -208.4 12.4 1 0 2769 3725 663 72 2.6 752 2149 101 11.1 15.2 0 1 0 0 0 73 0.8 4989 518 53 -3.1 -0.3 1 0 4989 518 53 74 184.8 10528 14992 5377 312.7 710.7 0 1 0 0 0 75 2.3 1995 2662 341 34.7 100.7 0 0 0 0 0 76 8.0 2286 2235 2306 195.3 219.0 0 0 0 0 0 77 10.3 952 1307 309 35.4 92.8 1 0 952 1307 309 78 50.0 2957 2806 457 40.6 93.5 1 0 2957 2806 457 79 118.1 2535 5958 1921 177.0 288.0 1 0 2535 5958 1921 winst_d cf_d ta_p omzet_p mw_p winst_p cf_p 1 0.0 0.0 0 0 0 0.0 0.0 2 0.0 0.0 0 0 0 0.0 0.0 3 0.0 0.0 0 0 0 0.0 0.0 4 14.1 24.6 0 0 0 0.0 0.0 5 345.8 682.5 0 0 0 0.0 0.0 6 0.0 0.0 1022 1754 1370 72.0 119.5 7 0.0 0.0 1093 1679 1070 100.9 164.5 8 0.0 0.0 0 0 0 0.0 0.0 9 23.5 28.9 0 0 0 0.0 0.0 10 1092.9 2576.8 0 0 0 0.0 0.0 11 54.1 72.5 0 0 0 0.0 0.0 12 0.0 0.0 0 0 0 0.0 0.0 13 25.6 37.5 0 0 0 0.0 0.0 14 0.0 0.0 1128 1516 430 -47.0 26.7 15 0.0 0.0 0 0 0 0.0 0.0 16 -732.5 -651.9 0 0 0 0.0 0.0 17 0.0 0.0 0 0 0 0.0 0.0 18 0.0 0.0 0 0 0 0.0 0.0 19 44.8 50.5 0 0 0 0.0 0.0 20 239.9 578.3 0 0 0 0.0 0.0 21 0.0 0.0 0 0 0 0.0 0.0 22 283.6 456.5 0 0 0 0.0 0.0 23 0.0 0.0 6914 7029 7957 400.6 754.7 24 66.9 106.8 0 0 0 0.0 0.0 25 55.6 57.0 0 0 0 0.0 0.0 26 0.0 0.0 430 1155 1045 55.7 70.8 27 0.0 0.0 0 0 0 0.0 0.0 28 40.2 51.4 0 0 0 0.0 0.0 29 22.2 26.2 0 0 0 0.0 0.0 30 37.8 56.2 0 0 0 0.0 0.0 31 0.0 0.0 0 0 0 0.0 0.0 32 0.0 0.0 1804 2564 483 70.5 164.9 33 0.0 0.0 26432 28285 33172 2336.0 3562.0 34 57.0 93.8 0 0 0 0.0 0.0 35 56.1 134.0 0 0 0 0.0 0.0 36 0.0 0.0 4662 4781 2988 28.7 371.5 37 0.0 0.0 5769 6571 9462 482.0 792.0 38 283.7 524.5 0 0 0 0.0 0.0 39 0.0 0.0 0 0 0 0.0 0.0 40 0.0 0.0 52634 50056 95697 6555.0 9874.0 41 -173.5 -108.1 0 0 0 0.0 0.0 42 0.0 0.0 0 0 0 0.0 0.0 43 180.8 390.4 0 0 0 0.0 0.0 44 0.0 0.0 0 0 0 0.0 0.0 45 0.0 0.0 6307 8199 598 -771.5 -524.3 46 26.6 34.8 0 0 0 0.0 0.0 47 235.4 361.5 0 0 0 0.0 0.0 48 201.7 246.7 0 0 0 0.0 0.0 49 0.0 0.0 0 0 0 0.0 0.0 50 0.0 0.0 0 0 0 0.0 0.0 51 108.4 131.4 0 0 0 0.0 0.0 52 0.0 0.0 3940 4317 3940 315.2 566.3 53 93.0 119.0 0 0 0 0.0 0.0 54 107.6 164.7 0 0 0 0.0 0.0 55 0.0 0.0 2366 3305 1117 131.2 256.5 56 48.8 257.1 0 0 0 0.0 0.0 57 0.0 0.0 0 0 0 0.0 0.0 58 0.0 0.0 0 0 0 0.0 0.0 59 0.0 0.0 4084 4346 3023 302.7 521.7 60 0.0 0.0 0 0 0 0.0 0.0 61 69.2 145.7 0 0 0 0.0 0.0 62 61.4 77.8 0 0 0 0.0 0.0 63 0.0 0.0 0 0 0 0.0 0.0 64 41.7 60.6 0 0 0 0.0 0.0 65 64.9 97.6 0 0 0 0.0 0.0 66 92.6 118.2 0 0 0 0.0 0.0 67 30.3 96.9 0 0 0 0.0 0.0 68 63.7 133.3 0 0 0 0.0 0.0 69 0.0 0.0 478 672 866 67.1 101.6 70 0.0 0.0 10348 5721 1915 223.6 322.5 71 -208.4 12.4 0 0 0 0.0 0.0 72 0.0 0.0 752 2149 101 11.1 15.2 73 -3.1 -0.3 0 0 0 0.0 0.0 74 0.0 0.0 10528 14992 5377 312.7 710.7 75 0.0 0.0 0 0 0 0.0 0.0 76 0.0 0.0 0 0 0 0.0 0.0 77 35.4 92.8 0 0 0 0.0 0.0 78 40.6 93.5 0 0 0 0.0 0.0 79 177.0 288.0 0 0 0 0.0 0.0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) ta omzet mw winst cf -0.4188508 -0.0022508 0.0003531 0.0160241 -0.1073373 0.0363907 dienst product ta_d omzet_d mw_d winst_d 3.9698600 -2.3577154 0.0008554 0.0097410 -0.0117758 0.2671643 cf_d ta_p omzet_p mw_p winst_p cf_p -0.1157611 -0.0008801 0.0153333 -0.0216816 0.1350404 -0.0209938 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -25.949 -7.581 -1.204 5.065 44.354 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -0.4188508 4.8286961 -0.087 0.931161 ta -0.0022508 0.0029553 -0.762 0.449215 omzet 0.0003531 0.0035090 0.101 0.920178 mw 0.0160241 0.0049036 3.268 0.001782 ** winst -0.1073373 0.0759260 -1.414 0.162531 cf 0.0363907 0.0627607 0.580 0.564163 dienst 3.9698600 5.6992322 0.697 0.488724 product -2.3577154 6.8468331 -0.344 0.731766 ta_d 0.0008554 0.0029711 0.288 0.774382 omzet_d 0.0097410 0.0035967 2.708 0.008764 ** mw_d -0.0117758 0.0059082 -1.993 0.050725 . winst_d 0.2671643 0.0828179 3.226 0.002020 ** cf_d -0.1157611 0.0668545 -1.732 0.088411 . ta_p -0.0008801 0.0036561 -0.241 0.810570 omzet_p 0.0153333 0.0040524 3.784 0.000355 *** mw_p -0.0216816 0.0054926 -3.947 0.000207 *** winst_p 0.1350404 0.0914183 1.477 0.144775 cf_p -0.0209938 0.0840111 -0.250 0.803510 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 13.15 on 61 degrees of freedom Multiple R-squared: 0.9675, Adjusted R-squared: 0.9584 F-statistic: 106.7 on 17 and 61 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.40396454 0.80792908 0.5960355 [2,] 0.59309662 0.81380677 0.4069034 [3,] 0.48634564 0.97269129 0.5136544 [4,] 0.37006779 0.74013558 0.6299322 [5,] 0.34687334 0.69374669 0.6531267 [6,] 0.25476977 0.50953955 0.7452302 [7,] 0.18855811 0.37711623 0.8114419 [8,] 0.12165743 0.24331487 0.8783426 [9,] 0.07914967 0.15829935 0.9208503 [10,] 0.04708059 0.09416118 0.9529194 [11,] 0.02791616 0.05583232 0.9720838 [12,] 0.01533401 0.03066803 0.9846660 [13,] 0.02608667 0.05217334 0.9739133 [14,] 0.01702650 0.03405301 0.9829735 [15,] 0.01286695 0.02573390 0.9871331 [16,] 0.01793021 0.03586041 0.9820698 [17,] 0.04927411 0.09854822 0.9507259 [18,] 0.03639980 0.07279960 0.9636002 [19,] 0.02416464 0.04832929 0.9758354 [20,] 0.06904152 0.13808305 0.9309585 [21,] 0.18822166 0.37644333 0.8117783 [22,] 0.13570191 0.27140383 0.8642981 [23,] 0.31685461 0.63370922 0.6831454 [24,] 0.31770541 0.63541082 0.6822946 [25,] 0.66434469 0.67131062 0.3356553 [26,] 0.58629080 0.82741840 0.4137092 [27,] 0.60058321 0.79883359 0.3994168 [28,] 0.58566683 0.82866633 0.4143332 [29,] 0.51479434 0.97041132 0.4852057 [30,] 0.41747707 0.83495414 0.5825229 [31,] 0.32157630 0.64315259 0.6784237 [32,] 0.24292439 0.48584878 0.7570756 [33,] 0.17600617 0.35201234 0.8239938 [34,] 0.13175897 0.26351794 0.8682410 [35,] 0.09461809 0.18923619 0.9053819 [36,] 0.10728047 0.21456094 0.8927195 [37,] 0.05723046 0.11446092 0.9427695 [38,] 0.02594877 0.05189754 0.9740512 > postscript(file="/var/wessaorg/rcomp/tmp/1dibk1351944599.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') > points(x[,1]-mysum$resid) > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/2j5kq1351944599.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/3iw5a1351944599.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/44x901351944599.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/57kax1351944599.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 = 79 Frequency = 1 1 2 3 4 5 6 -3.4568545 6.6657972 -1.1499156 -1.7960304 -18.4700693 -12.8214065 7 8 9 10 11 12 1.3866572 13.4506902 -3.0497970 -3.5717620 -12.7320953 1.7779790 13 14 15 16 17 18 -0.1788469 -0.9486635 -1.2038038 -10.5564749 5.3210560 -19.1263018 19 20 21 22 23 24 -8.2082102 -0.8617240 2.8128294 13.8192404 23.7626357 -9.3678286 25 26 27 28 29 30 -13.0354296 11.7839466 9.2068258 -2.3456849 -2.7980146 -0.4969949 31 32 33 34 35 36 -3.3926248 -6.9546153 13.9545872 -11.8141210 -4.9319370 18.9657803 37 38 39 40 41 42 28.7471971 8.4317724 -2.5434869 -9.6495030 19.6667954 1.7535446 43 44 45 46 47 48 -12.7654825 -9.8544330 -15.7607010 -1.9393880 6.9875103 7.6806439 49 50 51 52 53 54 7.7386416 2.9203852 -0.1225563 14.2333679 -2.1145067 8.4639343 55 56 57 58 59 60 -17.7237590 -1.6974797 0.5193315 1.3439725 -14.4255723 0.4728259 61 62 63 64 65 66 -5.9890447 -8.3975227 -2.9384128 -8.6548981 2.5968333 -1.2626894 67 68 69 70 71 72 4.8093273 -8.6892260 0.6080444 -5.3921818 23.2879450 -25.9491842 73 74 75 76 77 78 -0.7717020 -3.8166296 0.8651327 -11.1831783 -4.7205684 21.2418797 79 44.3542031 > postscript(file="/var/wessaorg/rcomp/tmp/63sbq1351944599.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 = 79 Frequency = 1 lag(myerror, k = 1) myerror 0 -3.4568545 NA 1 6.6657972 -3.4568545 2 -1.1499156 6.6657972 3 -1.7960304 -1.1499156 4 -18.4700693 -1.7960304 5 -12.8214065 -18.4700693 6 1.3866572 -12.8214065 7 13.4506902 1.3866572 8 -3.0497970 13.4506902 9 -3.5717620 -3.0497970 10 -12.7320953 -3.5717620 11 1.7779790 -12.7320953 12 -0.1788469 1.7779790 13 -0.9486635 -0.1788469 14 -1.2038038 -0.9486635 15 -10.5564749 -1.2038038 16 5.3210560 -10.5564749 17 -19.1263018 5.3210560 18 -8.2082102 -19.1263018 19 -0.8617240 -8.2082102 20 2.8128294 -0.8617240 21 13.8192404 2.8128294 22 23.7626357 13.8192404 23 -9.3678286 23.7626357 24 -13.0354296 -9.3678286 25 11.7839466 -13.0354296 26 9.2068258 11.7839466 27 -2.3456849 9.2068258 28 -2.7980146 -2.3456849 29 -0.4969949 -2.7980146 30 -3.3926248 -0.4969949 31 -6.9546153 -3.3926248 32 13.9545872 -6.9546153 33 -11.8141210 13.9545872 34 -4.9319370 -11.8141210 35 18.9657803 -4.9319370 36 28.7471971 18.9657803 37 8.4317724 28.7471971 38 -2.5434869 8.4317724 39 -9.6495030 -2.5434869 40 19.6667954 -9.6495030 41 1.7535446 19.6667954 42 -12.7654825 1.7535446 43 -9.8544330 -12.7654825 44 -15.7607010 -9.8544330 45 -1.9393880 -15.7607010 46 6.9875103 -1.9393880 47 7.6806439 6.9875103 48 7.7386416 7.6806439 49 2.9203852 7.7386416 50 -0.1225563 2.9203852 51 14.2333679 -0.1225563 52 -2.1145067 14.2333679 53 8.4639343 -2.1145067 54 -17.7237590 8.4639343 55 -1.6974797 -17.7237590 56 0.5193315 -1.6974797 57 1.3439725 0.5193315 58 -14.4255723 1.3439725 59 0.4728259 -14.4255723 60 -5.9890447 0.4728259 61 -8.3975227 -5.9890447 62 -2.9384128 -8.3975227 63 -8.6548981 -2.9384128 64 2.5968333 -8.6548981 65 -1.2626894 2.5968333 66 4.8093273 -1.2626894 67 -8.6892260 4.8093273 68 0.6080444 -8.6892260 69 -5.3921818 0.6080444 70 23.2879450 -5.3921818 71 -25.9491842 23.2879450 72 -0.7717020 -25.9491842 73 -3.8166296 -0.7717020 74 0.8651327 -3.8166296 75 -11.1831783 0.8651327 76 -4.7205684 -11.1831783 77 21.2418797 -4.7205684 78 44.3542031 21.2418797 79 NA 44.3542031 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 6.6657972 -3.4568545 [2,] -1.1499156 6.6657972 [3,] -1.7960304 -1.1499156 [4,] -18.4700693 -1.7960304 [5,] -12.8214065 -18.4700693 [6,] 1.3866572 -12.8214065 [7,] 13.4506902 1.3866572 [8,] -3.0497970 13.4506902 [9,] -3.5717620 -3.0497970 [10,] -12.7320953 -3.5717620 [11,] 1.7779790 -12.7320953 [12,] -0.1788469 1.7779790 [13,] -0.9486635 -0.1788469 [14,] -1.2038038 -0.9486635 [15,] -10.5564749 -1.2038038 [16,] 5.3210560 -10.5564749 [17,] -19.1263018 5.3210560 [18,] -8.2082102 -19.1263018 [19,] -0.8617240 -8.2082102 [20,] 2.8128294 -0.8617240 [21,] 13.8192404 2.8128294 [22,] 23.7626357 13.8192404 [23,] -9.3678286 23.7626357 [24,] -13.0354296 -9.3678286 [25,] 11.7839466 -13.0354296 [26,] 9.2068258 11.7839466 [27,] -2.3456849 9.2068258 [28,] -2.7980146 -2.3456849 [29,] -0.4969949 -2.7980146 [30,] -3.3926248 -0.4969949 [31,] -6.9546153 -3.3926248 [32,] 13.9545872 -6.9546153 [33,] -11.8141210 13.9545872 [34,] -4.9319370 -11.8141210 [35,] 18.9657803 -4.9319370 [36,] 28.7471971 18.9657803 [37,] 8.4317724 28.7471971 [38,] -2.5434869 8.4317724 [39,] -9.6495030 -2.5434869 [40,] 19.6667954 -9.6495030 [41,] 1.7535446 19.6667954 [42,] -12.7654825 1.7535446 [43,] -9.8544330 -12.7654825 [44,] -15.7607010 -9.8544330 [45,] -1.9393880 -15.7607010 [46,] 6.9875103 -1.9393880 [47,] 7.6806439 6.9875103 [48,] 7.7386416 7.6806439 [49,] 2.9203852 7.7386416 [50,] -0.1225563 2.9203852 [51,] 14.2333679 -0.1225563 [52,] -2.1145067 14.2333679 [53,] 8.4639343 -2.1145067 [54,] -17.7237590 8.4639343 [55,] -1.6974797 -17.7237590 [56,] 0.5193315 -1.6974797 [57,] 1.3439725 0.5193315 [58,] -14.4255723 1.3439725 [59,] 0.4728259 -14.4255723 [60,] -5.9890447 0.4728259 [61,] -8.3975227 -5.9890447 [62,] -2.9384128 -8.3975227 [63,] -8.6548981 -2.9384128 [64,] 2.5968333 -8.6548981 [65,] -1.2626894 2.5968333 [66,] 4.8093273 -1.2626894 [67,] -8.6892260 4.8093273 [68,] 0.6080444 -8.6892260 [69,] -5.3921818 0.6080444 [70,] 23.2879450 -5.3921818 [71,] -25.9491842 23.2879450 [72,] -0.7717020 -25.9491842 [73,] -3.8166296 -0.7717020 [74,] 0.8651327 -3.8166296 [75,] -11.1831783 0.8651327 [76,] -4.7205684 -11.1831783 [77,] 21.2418797 -4.7205684 [78,] 44.3542031 21.2418797 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 6.6657972 -3.4568545 2 -1.1499156 6.6657972 3 -1.7960304 -1.1499156 4 -18.4700693 -1.7960304 5 -12.8214065 -18.4700693 6 1.3866572 -12.8214065 7 13.4506902 1.3866572 8 -3.0497970 13.4506902 9 -3.5717620 -3.0497970 10 -12.7320953 -3.5717620 11 1.7779790 -12.7320953 12 -0.1788469 1.7779790 13 -0.9486635 -0.1788469 14 -1.2038038 -0.9486635 15 -10.5564749 -1.2038038 16 5.3210560 -10.5564749 17 -19.1263018 5.3210560 18 -8.2082102 -19.1263018 19 -0.8617240 -8.2082102 20 2.8128294 -0.8617240 21 13.8192404 2.8128294 22 23.7626357 13.8192404 23 -9.3678286 23.7626357 24 -13.0354296 -9.3678286 25 11.7839466 -13.0354296 26 9.2068258 11.7839466 27 -2.3456849 9.2068258 28 -2.7980146 -2.3456849 29 -0.4969949 -2.7980146 30 -3.3926248 -0.4969949 31 -6.9546153 -3.3926248 32 13.9545872 -6.9546153 33 -11.8141210 13.9545872 34 -4.9319370 -11.8141210 35 18.9657803 -4.9319370 36 28.7471971 18.9657803 37 8.4317724 28.7471971 38 -2.5434869 8.4317724 39 -9.6495030 -2.5434869 40 19.6667954 -9.6495030 41 1.7535446 19.6667954 42 -12.7654825 1.7535446 43 -9.8544330 -12.7654825 44 -15.7607010 -9.8544330 45 -1.9393880 -15.7607010 46 6.9875103 -1.9393880 47 7.6806439 6.9875103 48 7.7386416 7.6806439 49 2.9203852 7.7386416 50 -0.1225563 2.9203852 51 14.2333679 -0.1225563 52 -2.1145067 14.2333679 53 8.4639343 -2.1145067 54 -17.7237590 8.4639343 55 -1.6974797 -17.7237590 56 0.5193315 -1.6974797 57 1.3439725 0.5193315 58 -14.4255723 1.3439725 59 0.4728259 -14.4255723 60 -5.9890447 0.4728259 61 -8.3975227 -5.9890447 62 -2.9384128 -8.3975227 63 -8.6548981 -2.9384128 64 2.5968333 -8.6548981 65 -1.2626894 2.5968333 66 4.8093273 -1.2626894 67 -8.6892260 4.8093273 68 0.6080444 -8.6892260 69 -5.3921818 0.6080444 70 23.2879450 -5.3921818 71 -25.9491842 23.2879450 72 -0.7717020 -25.9491842 73 -3.8166296 -0.7717020 74 0.8651327 -3.8166296 75 -11.1831783 0.8651327 76 -4.7205684 -11.1831783 77 21.2418797 -4.7205684 78 44.3542031 21.2418797 > plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals') > lines(lowess(z)) > abline(lm(z)) > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7y3es1351944599.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/82h911351944599.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/90pnt1351944599.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') Warning messages: 1: In sqrt(crit * p * (1 - hh)/hh) : NaNs produced 2: In sqrt(crit * p * (1 - hh)/hh) : NaNs produced > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/wessaorg/rcomp/tmp/108xp01351944599.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) > a<-table.row.end(a) > myeq <- colnames(x)[1] > myeq <- paste(myeq, '[t] = ', sep='') > for (i in 1:k){ + if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') + myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ') + if (rownames(mysum$coefficients)[i] != '(Intercept)') { + myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') + if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') + } + } > myeq <- paste(myeq, ' + e[t]') > a<-table.row.start(a) > a<-table.element(a, myeq) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/11ium51351944599.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Variable',header=TRUE) > a<-table.element(a,'Parameter',header=TRUE) > a<-table.element(a,'S.D.',header=TRUE) > a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE) > a<-table.element(a,'2-tail p-value',header=TRUE) > a<-table.element(a,'1-tail p-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:k){ + a<-table.row.start(a) + a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE) + a<-table.element(a,mysum$coefficients[i,1]) + a<-table.element(a, round(mysum$coefficients[i,2],6)) + a<-table.element(a, round(mysum$coefficients[i,3],4)) + a<-table.element(a, round(mysum$coefficients[i,4],6)) + a<-table.element(a, round(mysum$coefficients[i,4]/2,6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/12c4ds1351944599.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple R',1,TRUE) > a<-table.element(a, sqrt(mysum$r.squared)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'R-squared',1,TRUE) > a<-table.element(a, mysum$r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Adjusted R-squared',1,TRUE) > a<-table.element(a, mysum$adj.r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (value)',1,TRUE) > a<-table.element(a, mysum$fstatistic[1]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'p-value',1,TRUE) > a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3])) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Residual Standard Deviation',1,TRUE) > a<-table.element(a, mysum$sigma) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Sum Squared Residuals',1,TRUE) > a<-table.element(a, sum(myerror*myerror)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/1379b21351944599.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Time or Index', 1, TRUE) > a<-table.element(a, 'Actuals', 1, TRUE) > a<-table.element(a, 'Interpolation
Forecast', 1, TRUE) > a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE) > a<-table.row.end(a) > for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,i, 1, TRUE) + a<-table.element(a,x[i]) + a<-table.element(a,x[i]-mysum$resid[i]) + a<-table.element(a,mysum$resid[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/1471491351944599.tab") > if (n > n25) { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'p-values',header=TRUE) + a<-table.element(a,'Alternative Hypothesis',3,header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'breakpoint index',header=TRUE) + a<-table.element(a,'greater',header=TRUE) + a<-table.element(a,'2-sided',header=TRUE) + a<-table.element(a,'less',header=TRUE) + a<-table.row.end(a) + for (mypoint in kp3:nmkm3) { + a<-table.row.start(a) + a<-table.element(a,mypoint,header=TRUE) + a<-table.element(a,gqarr[mypoint-kp3+1,1]) + a<-table.element(a,gqarr[mypoint-kp3+1,2]) + a<-table.element(a,gqarr[mypoint-kp3+1,3]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/wessaorg/rcomp/tmp/157fw51351944599.tab") + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Description',header=TRUE) + a<-table.element(a,'# significant tests',header=TRUE) + a<-table.element(a,'% significant tests',header=TRUE) + a<-table.element(a,'OK/NOK',header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'1% type I error level',header=TRUE) + a<-table.element(a,numsignificant1) + a<-table.element(a,numsignificant1/numgqtests) + if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'5% type I error level',header=TRUE) + a<-table.element(a,numsignificant5) + a<-table.element(a,numsignificant5/numgqtests) + if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'10% type I error level',header=TRUE) + a<-table.element(a,numsignificant10) + a<-table.element(a,numsignificant10/numgqtests) + if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/wessaorg/rcomp/tmp/16t66z1351944599.tab") + } > > try(system("convert tmp/1dibk1351944599.ps tmp/1dibk1351944599.png",intern=TRUE)) character(0) > try(system("convert tmp/2j5kq1351944599.ps tmp/2j5kq1351944599.png",intern=TRUE)) character(0) > try(system("convert tmp/3iw5a1351944599.ps tmp/3iw5a1351944599.png",intern=TRUE)) character(0) > try(system("convert tmp/44x901351944599.ps tmp/44x901351944599.png",intern=TRUE)) character(0) > try(system("convert tmp/57kax1351944599.ps tmp/57kax1351944599.png",intern=TRUE)) character(0) > try(system("convert tmp/63sbq1351944599.ps tmp/63sbq1351944599.png",intern=TRUE)) character(0) > try(system("convert tmp/7y3es1351944599.ps tmp/7y3es1351944599.png",intern=TRUE)) character(0) > try(system("convert tmp/82h911351944599.ps tmp/82h911351944599.png",intern=TRUE)) character(0) > try(system("convert tmp/90pnt1351944599.ps tmp/90pnt1351944599.png",intern=TRUE)) character(0) > try(system("convert tmp/108xp01351944599.ps tmp/108xp01351944599.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 10.222 1.300 12.064