R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(1 + ,26 + ,21 + ,21 + ,23 + ,17 + ,23 + ,4 + ,1 + ,20 + ,16 + ,15 + ,24 + ,17 + ,20 + ,4 + ,1 + ,19 + ,19 + ,18 + ,22 + ,18 + ,20 + ,6 + ,2 + ,19 + ,18 + ,11 + ,20 + ,21 + ,21 + ,8 + ,1 + ,20 + ,16 + ,8 + ,24 + ,20 + ,24 + ,8 + ,1 + ,25 + ,23 + ,19 + ,27 + ,28 + ,22 + ,4 + ,2 + ,25 + ,17 + ,4 + ,28 + ,19 + ,23 + ,4 + ,1 + ,22 + ,12 + ,20 + ,27 + ,22 + ,20 + ,8 + ,1 + ,26 + ,19 + ,16 + ,24 + ,16 + ,25 + ,5 + ,1 + ,22 + ,16 + ,14 + ,23 + ,18 + ,23 + ,4 + ,2 + ,17 + ,19 + ,10 + ,24 + ,25 + ,27 + ,4 + ,2 + ,22 + ,20 + ,13 + ,27 + ,17 + ,27 + ,4 + ,1 + ,19 + ,13 + ,14 + ,27 + ,14 + ,22 + ,4 + ,1 + ,24 + ,20 + ,8 + ,28 + ,11 + ,24 + ,4 + ,1 + ,26 + ,27 + ,23 + ,27 + ,27 + ,25 + ,4 + ,2 + ,21 + ,17 + ,11 + ,23 + ,20 + ,22 + ,8 + ,1 + ,13 + ,8 + ,9 + ,24 + ,22 + ,28 + ,4 + ,2 + ,26 + ,25 + ,24 + ,28 + ,22 + ,28 + ,4 + ,2 + ,20 + ,26 + ,5 + ,27 + ,21 + ,27 + ,4 + ,1 + ,22 + ,13 + ,15 + ,25 + ,23 + ,25 + ,8 + ,2 + ,14 + ,19 + ,5 + ,19 + ,17 + ,16 + ,4 + ,1 + ,21 + ,15 + ,19 + ,24 + ,24 + ,28 + ,7 + ,1 + ,7 + ,5 + ,6 + ,20 + ,14 + ,21 + ,4 + ,2 + ,23 + ,16 + ,13 + ,28 + ,17 + ,24 + ,4 + ,1 + ,17 + ,14 + ,11 + ,26 + ,23 + ,27 + ,5 + ,1 + ,25 + ,24 + ,17 + ,23 + ,24 + ,14 + ,4 + ,1 + ,25 + ,24 + ,17 + ,23 + ,24 + ,14 + ,4 + ,1 + ,19 + ,9 + ,5 + ,20 + ,8 + ,27 + ,4 + ,2 + ,20 + ,19 + ,9 + ,11 + ,22 + ,20 + ,4 + ,1 + ,23 + ,19 + ,15 + ,24 + ,23 + ,21 + ,4 + ,2 + ,22 + ,25 + ,17 + ,25 + ,25 + ,22 + ,4 + ,1 + ,22 + ,19 + ,17 + ,23 + ,21 + ,21 + ,4 + ,1 + ,21 + ,18 + ,20 + ,18 + ,24 + ,12 + ,15 + ,2 + ,15 + ,15 + ,12 + ,20 + ,15 + ,20 + ,10 + ,2 + ,20 + ,12 + ,7 + ,20 + ,22 + ,24 + ,4 + ,2 + ,22 + ,21 + ,16 + ,24 + ,21 + ,19 + ,8 + ,1 + ,18 + ,12 + ,7 + ,23 + ,25 + ,28 + ,4 + ,2 + ,20 + ,15 + ,14 + ,25 + ,16 + ,23 + ,4 + ,2 + ,28 + ,28 + ,24 + ,28 + ,28 + ,27 + ,4 + ,1 + ,22 + ,25 + ,15 + ,26 + ,23 + ,22 + ,4 + ,1 + ,18 + ,19 + ,15 + ,26 + ,21 + ,27 + ,7 + ,1 + ,23 + ,20 + ,10 + ,23 + ,21 + ,26 + ,4 + ,1 + ,20 + ,24 + ,14 + ,22 + ,26 + ,22 + ,6 + ,2 + ,25 + ,26 + ,18 + ,24 + ,22 + ,21 + ,5 + ,2 + ,26 + ,25 + ,12 + ,21 + ,21 + ,19 + ,4 + ,1 + ,15 + ,12 + ,9 + ,20 + ,18 + ,24 + ,16 + ,2 + ,17 + ,12 + ,9 + ,22 + ,12 + ,19 + ,5 + ,2 + ,23 + ,15 + ,8 + ,20 + ,25 + ,26 + ,12 + ,1 + ,21 + ,17 + ,18 + ,25 + ,17 + ,22 + ,6 + ,2 + ,13 + ,14 + ,10 + ,20 + ,24 + ,28 + ,9 + ,1 + ,18 + ,16 + ,17 + ,22 + ,15 + ,21 + ,9 + ,1 + ,19 + ,11 + ,14 + ,23 + ,13 + ,23 + ,4 + ,1 + ,22 + ,20 + ,16 + ,25 + ,26 + ,28 + ,5 + ,1 + ,16 + ,11 + ,10 + ,23 + ,16 + ,10 + ,4 + ,2 + ,24 + ,22 + ,19 + ,23 + ,24 + ,24 + ,4 + ,1 + ,18 + ,20 + ,10 + ,22 + ,21 + ,21 + ,5 + ,1 + ,20 + ,19 + ,14 + ,24 + ,20 + ,21 + ,4 + ,1 + ,24 + ,17 + ,10 + ,25 + ,14 + ,24 + ,4 + ,2 + ,14 + ,21 + ,4 + ,21 + ,25 + ,24 + ,4 + ,2 + ,22 + ,23 + ,19 + ,12 + ,25 + ,25 + ,5 + ,1 + ,24 + ,18 + ,9 + ,17 + ,20 + ,25 + ,4 + ,1 + ,18 + ,17 + ,12 + ,20 + ,22 + ,23 + ,6 + ,1 + ,21 + ,27 + ,16 + ,23 + ,20 + ,21 + ,4 + ,2 + ,23 + ,25 + ,11 + ,23 + ,26 + ,16 + ,4 + ,1 + ,17 + ,19 + ,18 + ,20 + ,18 + ,17 + ,18 + ,2 + ,22 + ,22 + ,11 + ,28 + ,22 + ,25 + ,4 + ,2 + ,24 + ,24 + ,24 + ,24 + ,24 + ,24 + ,6 + ,2 + ,21 + ,20 + ,17 + ,24 + ,17 + ,23 + ,4 + ,1 + ,22 + ,19 + ,18 + ,24 + ,24 + ,25 + ,4 + ,1 + ,16 + ,11 + ,9 + ,24 + ,20 + ,23 + ,5 + ,1 + ,21 + ,22 + ,19 + ,28 + ,19 + ,28 + ,4 + ,2 + ,23 + ,22 + ,18 + ,25 + ,20 + ,26 + ,4 + ,2 + ,22 + ,16 + ,12 + ,21 + ,15 + ,22 + ,5 + ,1 + ,24 + ,20 + ,23 + ,25 + ,23 + ,19 + ,10 + ,1 + ,24 + ,24 + ,22 + ,25 + ,26 + ,26 + ,5 + ,1 + ,16 + ,16 + ,14 + ,18 + ,22 + ,18 + ,8 + ,1 + ,16 + ,16 + ,14 + ,17 + ,20 + ,18 + ,8 + ,2 + ,21 + ,22 + ,16 + ,26 + ,24 + ,25 + ,5 + ,2 + ,26 + ,24 + ,23 + ,28 + ,26 + ,27 + ,4 + ,2 + ,15 + ,16 + ,7 + ,21 + ,21 + ,12 + ,4 + ,2 + ,25 + ,27 + ,10 + ,27 + ,25 + ,15 + ,4 + ,1 + ,18 + ,11 + ,12 + ,22 + ,13 + ,21 + ,5 + ,0 + ,23 + ,21 + ,12 + ,21 + ,20 + ,23 + ,4 + ,1 + ,20 + ,20 + ,12 + ,25 + ,22 + ,22 + ,4 + ,2 + ,17 + ,20 + ,17 + ,22 + ,23 + ,21 + ,8 + ,2 + ,25 + ,27 + ,21 + ,23 + ,28 + ,24 + ,4 + ,1 + ,24 + ,20 + ,16 + ,26 + ,22 + ,27 + ,5 + ,1 + ,17 + ,12 + ,11 + ,19 + ,20 + ,22 + ,14 + ,1 + ,19 + ,8 + ,14 + ,25 + ,6 + ,28 + ,8 + ,1 + ,20 + ,21 + ,13 + ,21 + ,21 + ,26 + ,8 + ,1 + ,15 + ,18 + ,9 + ,13 + ,20 + ,10 + ,4 + ,2 + ,27 + ,24 + ,19 + ,24 + ,18 + ,19 + ,4 + ,1 + ,22 + ,16 + ,13 + ,25 + ,23 + ,22 + ,6 + ,1 + ,23 + ,18 + ,19 + ,26 + ,20 + ,21 + ,4 + ,1 + ,16 + ,20 + ,13 + ,25 + ,24 + ,24 + ,7 + ,1 + ,19 + ,20 + ,13 + ,25 + ,22 + ,25 + ,7 + ,2 + ,25 + ,19 + ,13 + ,22 + ,21 + ,21 + ,4 + ,1 + ,19 + ,17 + ,14 + ,21 + ,18 + ,20 + ,6 + ,2 + ,19 + ,16 + ,12 + ,23 + ,21 + ,21 + ,4 + ,2 + ,26 + ,26 + ,22 + ,25 + ,23 + ,24 + ,7 + ,1 + ,21 + ,15 + ,11 + ,24 + ,23 + ,23 + ,4 + ,2 + ,20 + ,22 + ,5 + ,21 + ,15 + ,18 + ,4 + ,1 + ,24 + ,17 + ,18 + ,21 + ,21 + ,24 + ,8 + ,1 + ,22 + ,23 + ,19 + ,25 + ,24 + ,24 + ,4 + ,2 + ,20 + ,21 + ,14 + ,22 + ,23 + ,19 + ,4 + ,1 + ,18 + ,19 + ,15 + ,20 + ,21 + ,20 + ,10 + ,2 + ,18 + ,14 + ,12 + ,20 + ,21 + ,18 + ,8 + ,1 + ,24 + ,17 + ,19 + ,23 + ,20 + ,20 + ,6 + ,1 + ,24 + ,12 + ,15 + ,28 + ,11 + ,27 + ,4 + ,1 + ,22 + ,24 + ,17 + ,23 + ,22 + ,23 + ,4 + ,1 + ,23 + ,18 + ,8 + ,28 + ,27 + ,26 + ,4 + ,1 + ,22 + ,20 + ,10 + ,24 + ,25 + ,23 + ,5 + ,1 + ,20 + ,16 + ,12 + ,18 + ,18 + ,17 + ,4 + ,1 + ,18 + ,20 + ,12 + ,20 + ,20 + ,21 + ,6 + ,1 + ,25 + ,22 + ,20 + ,28 + ,24 + ,25 + ,4 + ,2 + ,18 + ,12 + ,12 + ,21 + ,10 + ,23 + ,5 + ,1 + ,16 + ,16 + ,12 + ,21 + ,27 + ,27 + ,7 + ,1 + ,20 + ,17 + ,14 + ,25 + ,21 + ,24 + ,8 + ,2 + ,19 + ,22 + ,6 + ,19 + ,21 + ,20 + ,5 + ,1 + ,15 + ,12 + ,10 + ,18 + ,18 + ,27 + ,8 + ,1 + ,19 + ,14 + ,18 + ,21 + ,15 + ,21 + ,10 + ,1 + ,19 + ,23 + ,18 + ,22 + ,24 + ,24 + ,8 + ,1 + ,16 + ,15 + ,7 + ,24 + ,22 + ,21 + ,5 + ,1 + ,17 + ,17 + ,18 + ,15 + ,14 + ,15 + ,12 + ,1 + ,28 + ,28 + ,9 + ,28 + ,28 + ,25 + ,4 + ,2 + ,23 + ,20 + ,17 + ,26 + ,18 + ,25 + ,5 + ,1 + ,25 + ,23 + ,22 + ,23 + ,26 + ,22 + ,4 + ,1 + ,20 + ,13 + ,11 + ,26 + ,17 + ,24 + ,6 + ,2 + ,17 + ,18 + ,15 + ,20 + ,19 + ,21 + ,4 + ,2 + ,23 + ,23 + ,17 + ,22 + ,22 + ,22 + ,4 + ,1 + ,16 + ,19 + ,15 + ,20 + ,18 + ,23 + ,7 + ,2 + ,23 + ,23 + ,22 + ,23 + ,24 + ,22 + ,7 + ,2 + ,11 + ,12 + ,9 + ,22 + ,15 + ,20 + ,10 + ,2 + ,18 + ,16 + ,13 + ,24 + ,18 + ,23 + ,4 + ,2 + ,24 + ,23 + ,20 + ,23 + ,26 + ,25 + ,5 + ,1 + ,23 + ,13 + ,14 + ,22 + ,11 + ,23 + ,8 + ,1 + ,21 + ,22 + ,14 + ,26 + ,26 + ,22 + ,11 + ,2 + ,16 + ,18 + ,12 + ,23 + ,21 + ,25 + ,7 + ,2 + ,24 + ,23 + ,20 + ,27 + ,23 + ,26 + ,4 + ,1 + ,23 + ,20 + ,20 + ,23 + ,23 + ,22 + ,8 + ,1 + ,18 + ,10 + ,8 + ,21 + ,15 + ,24 + ,6 + ,1 + ,20 + ,17 + ,17 + ,26 + ,22 + ,24 + ,7 + ,1 + ,9 + ,18 + ,9 + ,23 + ,26 + ,25 + ,5 + ,2 + ,24 + ,15 + ,18 + ,21 + ,16 + ,20 + ,4 + ,1 + ,25 + ,23 + ,22 + ,27 + ,20 + ,26 + ,8 + ,1 + ,20 + ,17 + ,10 + ,19 + ,18 + ,21 + ,4 + ,2 + ,21 + ,17 + ,13 + ,23 + ,22 + ,26 + ,8 + ,2 + ,25 + ,22 + ,15 + ,25 + ,16 + ,21 + ,6 + ,2 + ,22 + ,20 + ,18 + ,23 + ,19 + ,22 + ,4 + ,2 + ,21 + ,20 + ,18 + ,22 + ,20 + ,16 + ,9 + ,1 + ,21 + ,19 + ,12 + ,22 + ,19 + ,26 + ,5 + ,1 + ,22 + ,18 + ,12 + ,25 + ,23 + ,28 + ,6 + ,1 + ,27 + ,22 + ,20 + ,25 + ,24 + ,18 + ,4 + ,2 + ,24 + ,20 + ,12 + ,28 + ,25 + ,25 + ,4 + ,2 + ,24 + ,22 + ,16 + ,28 + ,21 + ,23 + ,4 + ,2 + ,21 + ,18 + ,16 + ,20 + ,21 + ,21 + ,5 + ,1 + ,18 + ,16 + ,18 + ,25 + ,23 + ,20 + ,6 + ,1 + ,16 + ,16 + ,16 + ,19 + ,27 + ,25 + ,16 + ,1 + ,22 + ,16 + ,13 + ,25 + ,23 + ,22 + ,6 + ,1 + ,20 + ,16 + ,17 + ,22 + ,18 + ,21 + ,6 + ,2 + ,18 + ,17 + ,13 + ,18 + ,16 + ,16 + ,4 + ,1 + ,20 + ,18 + ,17 + ,20 + ,16 + ,18 + ,4) + ,dim=c(8 + ,162) + ,dimnames=list(c('G' + ,'I1' + ,'I2' + ,'I3' + ,'E1' + ,'E2' + ,'E3' + ,'A') + ,1:162)) > y <- array(NA,dim=c(8,162),dimnames=list(c('G','I1','I2','I3','E1','E2','E3','A'),1:162)) > 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 = '8' > 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 A G I1 I2 I3 E1 E2 E3 1 4 1 26 21 21 23 17 23 2 4 1 20 16 15 24 17 20 3 6 1 19 19 18 22 18 20 4 8 2 19 18 11 20 21 21 5 8 1 20 16 8 24 20 24 6 4 1 25 23 19 27 28 22 7 4 2 25 17 4 28 19 23 8 8 1 22 12 20 27 22 20 9 5 1 26 19 16 24 16 25 10 4 1 22 16 14 23 18 23 11 4 2 17 19 10 24 25 27 12 4 2 22 20 13 27 17 27 13 4 1 19 13 14 27 14 22 14 4 1 24 20 8 28 11 24 15 4 1 26 27 23 27 27 25 16 8 2 21 17 11 23 20 22 17 4 1 13 8 9 24 22 28 18 4 2 26 25 24 28 22 28 19 4 2 20 26 5 27 21 27 20 8 1 22 13 15 25 23 25 21 4 2 14 19 5 19 17 16 22 7 1 21 15 19 24 24 28 23 4 1 7 5 6 20 14 21 24 4 2 23 16 13 28 17 24 25 5 1 17 14 11 26 23 27 26 4 1 25 24 17 23 24 14 27 4 1 25 24 17 23 24 14 28 4 1 19 9 5 20 8 27 29 4 2 20 19 9 11 22 20 30 4 1 23 19 15 24 23 21 31 4 2 22 25 17 25 25 22 32 4 1 22 19 17 23 21 21 33 15 1 21 18 20 18 24 12 34 10 2 15 15 12 20 15 20 35 4 2 20 12 7 20 22 24 36 8 2 22 21 16 24 21 19 37 4 1 18 12 7 23 25 28 38 4 2 20 15 14 25 16 23 39 4 2 28 28 24 28 28 27 40 4 1 22 25 15 26 23 22 41 7 1 18 19 15 26 21 27 42 4 1 23 20 10 23 21 26 43 6 1 20 24 14 22 26 22 44 5 2 25 26 18 24 22 21 45 4 2 26 25 12 21 21 19 46 16 1 15 12 9 20 18 24 47 5 2 17 12 9 22 12 19 48 12 2 23 15 8 20 25 26 49 6 1 21 17 18 25 17 22 50 9 2 13 14 10 20 24 28 51 9 1 18 16 17 22 15 21 52 4 1 19 11 14 23 13 23 53 5 1 22 20 16 25 26 28 54 4 1 16 11 10 23 16 10 55 4 2 24 22 19 23 24 24 56 5 1 18 20 10 22 21 21 57 4 1 20 19 14 24 20 21 58 4 1 24 17 10 25 14 24 59 4 2 14 21 4 21 25 24 60 5 2 22 23 19 12 25 25 61 4 1 24 18 9 17 20 25 62 6 1 18 17 12 20 22 23 63 4 1 21 27 16 23 20 21 64 4 2 23 25 11 23 26 16 65 18 1 17 19 18 20 18 17 66 4 2 22 22 11 28 22 25 67 6 2 24 24 24 24 24 24 68 4 2 21 20 17 24 17 23 69 4 1 22 19 18 24 24 25 70 5 1 16 11 9 24 20 23 71 4 1 21 22 19 28 19 28 72 4 2 23 22 18 25 20 26 73 5 2 22 16 12 21 15 22 74 10 1 24 20 23 25 23 19 75 5 1 24 24 22 25 26 26 76 8 1 16 16 14 18 22 18 77 8 1 16 16 14 17 20 18 78 5 2 21 22 16 26 24 25 79 4 2 26 24 23 28 26 27 80 4 2 15 16 7 21 21 12 81 4 2 25 27 10 27 25 15 82 5 1 18 11 12 22 13 21 83 4 0 23 21 12 21 20 23 84 4 1 20 20 12 25 22 22 85 8 2 17 20 17 22 23 21 86 4 2 25 27 21 23 28 24 87 5 1 24 20 16 26 22 27 88 14 1 17 12 11 19 20 22 89 8 1 19 8 14 25 6 28 90 8 1 20 21 13 21 21 26 91 4 1 15 18 9 13 20 10 92 4 2 27 24 19 24 18 19 93 6 1 22 16 13 25 23 22 94 4 1 23 18 19 26 20 21 95 7 1 16 20 13 25 24 24 96 7 1 19 20 13 25 22 25 97 4 2 25 19 13 22 21 21 98 6 1 19 17 14 21 18 20 99 4 2 19 16 12 23 21 21 100 7 2 26 26 22 25 23 24 101 4 1 21 15 11 24 23 23 102 4 2 20 22 5 21 15 18 103 8 1 24 17 18 21 21 24 104 4 1 22 23 19 25 24 24 105 4 2 20 21 14 22 23 19 106 10 1 18 19 15 20 21 20 107 8 2 18 14 12 20 21 18 108 6 1 24 17 19 23 20 20 109 4 1 24 12 15 28 11 27 110 4 1 22 24 17 23 22 23 111 4 1 23 18 8 28 27 26 112 5 1 22 20 10 24 25 23 113 4 1 20 16 12 18 18 17 114 6 1 18 20 12 20 20 21 115 4 1 25 22 20 28 24 25 116 5 2 18 12 12 21 10 23 117 7 1 16 16 12 21 27 27 118 8 1 20 17 14 25 21 24 119 5 2 19 22 6 19 21 20 120 8 1 15 12 10 18 18 27 121 10 1 19 14 18 21 15 21 122 8 1 19 23 18 22 24 24 123 5 1 16 15 7 24 22 21 124 12 1 17 17 18 15 14 15 125 4 1 28 28 9 28 28 25 126 5 2 23 20 17 26 18 25 127 4 1 25 23 22 23 26 22 128 6 1 20 13 11 26 17 24 129 4 2 17 18 15 20 19 21 130 4 2 23 23 17 22 22 22 131 7 1 16 19 15 20 18 23 132 7 2 23 23 22 23 24 22 133 10 2 11 12 9 22 15 20 134 4 2 18 16 13 24 18 23 135 5 2 24 23 20 23 26 25 136 8 1 23 13 14 22 11 23 137 11 1 21 22 14 26 26 22 138 7 2 16 18 12 23 21 25 139 4 2 24 23 20 27 23 26 140 8 1 23 20 20 23 23 22 141 6 1 18 10 8 21 15 24 142 7 1 20 17 17 26 22 24 143 5 1 9 18 9 23 26 25 144 4 2 24 15 18 21 16 20 145 8 1 25 23 22 27 20 26 146 4 1 20 17 10 19 18 21 147 8 2 21 17 13 23 22 26 148 6 2 25 22 15 25 16 21 149 4 2 22 20 18 23 19 22 150 9 2 21 20 18 22 20 16 151 5 1 21 19 12 22 19 26 152 6 1 22 18 12 25 23 28 153 4 1 27 22 20 25 24 18 154 4 2 24 20 12 28 25 25 155 4 2 24 22 16 28 21 23 156 5 2 21 18 16 20 21 21 157 6 1 18 16 18 25 23 20 158 16 1 16 16 16 19 27 25 159 6 1 22 16 13 25 23 22 160 6 1 20 16 17 22 18 21 161 4 2 18 17 13 18 16 16 162 4 1 20 18 17 20 16 18 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) G I1 I2 I3 E1 12.4312412 -0.3929378 -0.1864745 -0.1408935 0.1972449 -0.1808680 E2 E3 0.0841583 0.0002303 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -4.7777 -1.4346 -0.4772 0.9477 10.3569 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 12.4312412 1.7513544 7.098 4.35e-11 *** G -0.3929378 0.3888912 -1.010 0.3139 I1 -0.1864745 0.0737533 -2.528 0.0125 * I2 -0.1408935 0.0660314 -2.134 0.0344 * I3 0.1972449 0.0485598 4.062 7.73e-05 *** E1 -0.1808680 0.0715312 -2.529 0.0125 * E2 0.0841583 0.0556065 1.513 0.1322 E3 0.0002303 0.0573916 0.004 0.9968 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 2.343 on 154 degrees of freedom Multiple R-squared: 0.2389, Adjusted R-squared: 0.2043 F-statistic: 6.904 on 7 and 154 DF, p-value: 3.815e-07 > 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.497949325 0.995898651 0.502050675 [2,] 0.454541633 0.909083267 0.545458367 [3,] 0.326200697 0.652401394 0.673799303 [4,] 0.273879198 0.547758396 0.726120802 [5,] 0.193376693 0.386753386 0.806623307 [6,] 0.175356402 0.350712805 0.824643598 [7,] 0.142409221 0.284818441 0.857590779 [8,] 0.098060312 0.196120624 0.901939688 [9,] 0.065016661 0.130033322 0.934983339 [10,] 0.074759689 0.149519378 0.925240311 [11,] 0.074638434 0.149276867 0.925361566 [12,] 0.052477697 0.104955394 0.947522303 [13,] 0.043325554 0.086651108 0.956674446 [14,] 0.030292341 0.060584683 0.969707659 [15,] 0.019002114 0.038004227 0.980997886 [16,] 0.016704834 0.033409669 0.983295166 [17,] 0.011639399 0.023278799 0.988360601 [18,] 0.011412169 0.022824338 0.988587831 [19,] 0.016198992 0.032397984 0.983801008 [20,] 0.012308144 0.024616288 0.987691856 [21,] 0.007901864 0.015803729 0.992098136 [22,] 0.005557103 0.011114207 0.994442897 [23,] 0.334155751 0.668311502 0.665844249 [24,] 0.438760786 0.877521572 0.561239214 [25,] 0.447353099 0.894706198 0.552646901 [26,] 0.428917281 0.857834562 0.571082719 [27,] 0.389599489 0.779198979 0.610400511 [28,] 0.377839579 0.755679157 0.622160421 [29,] 0.327399510 0.654799020 0.672600490 [30,] 0.277343148 0.554686297 0.722656852 [31,] 0.296033913 0.592067827 0.703966087 [32,] 0.251278626 0.502557251 0.748721374 [33,] 0.217504072 0.435008143 0.782495928 [34,] 0.180558067 0.361116134 0.819441933 [35,] 0.151610353 0.303220705 0.848389647 [36,] 0.852291425 0.295417151 0.147708575 [37,] 0.826552046 0.346895908 0.173447954 [38,] 0.953634300 0.092731399 0.046365700 [39,] 0.940490137 0.119019726 0.059509863 [40,] 0.931191291 0.137617419 0.068808709 [41,] 0.929110207 0.141779586 0.070889793 [42,] 0.930510933 0.138978134 0.069489067 [43,] 0.914135942 0.171728116 0.085864058 [44,] 0.919990552 0.160018896 0.080009448 [45,] 0.913223801 0.173552398 0.086776199 [46,] 0.893095269 0.213809462 0.106904731 [47,] 0.880558482 0.238883036 0.119441518 [48,] 0.854506500 0.290987000 0.145493500 [49,] 0.831528193 0.336943615 0.168471807 [50,] 0.844075295 0.311849410 0.155924705 [51,] 0.822030825 0.355938351 0.177969175 [52,] 0.791815718 0.416368563 0.208184282 [53,] 0.761499184 0.477001632 0.238500816 [54,] 0.726932975 0.546134049 0.273067025 [55,] 0.997165532 0.005668937 0.002834468 [56,] 0.996027297 0.007945405 0.003972703 [57,] 0.994415273 0.011169455 0.005584727 [58,] 0.993072153 0.013855694 0.006927847 [59,] 0.993292359 0.013415281 0.006707641 [60,] 0.992179124 0.015641752 0.007820876 [61,] 0.990458846 0.019082309 0.009541154 [62,] 0.987771746 0.024456509 0.012228254 [63,] 0.983593495 0.032813009 0.016406505 [64,] 0.988256555 0.023486890 0.011743445 [65,] 0.985467461 0.029065077 0.014532539 [66,] 0.980551001 0.038897998 0.019448999 [67,] 0.974288560 0.051422880 0.025711440 [68,] 0.966546728 0.066906545 0.033453272 [69,] 0.959990702 0.080018597 0.040009298 [70,] 0.956904367 0.086191266 0.043095633 [71,] 0.956678363 0.086643274 0.043321637 [72,] 0.951034402 0.097931196 0.048965598 [73,] 0.943509353 0.112981294 0.056490647 [74,] 0.932432739 0.135134521 0.067567261 [75,] 0.919310544 0.161378912 0.080689456 [76,] 0.909440760 0.181118481 0.090559240 [77,] 0.891023654 0.217952692 0.108976346 [78,] 0.977882739 0.044234522 0.022117261 [79,] 0.973779971 0.052440058 0.026220029 [80,] 0.970903032 0.058193936 0.029096968 [81,] 0.978416505 0.043166990 0.021583495 [82,] 0.971605355 0.056789290 0.028394645 [83,] 0.963107160 0.073785679 0.036892840 [84,] 0.960178695 0.079642610 0.039821305 [85,] 0.949821466 0.100357069 0.050178534 [86,] 0.940141740 0.119716520 0.059858260 [87,] 0.925148829 0.149702342 0.074851171 [88,] 0.907744868 0.184510264 0.092255132 [89,] 0.897868790 0.204262420 0.102131210 [90,] 0.892731189 0.214537622 0.107268811 [91,] 0.885220691 0.229558618 0.114779309 [92,] 0.865503108 0.268993785 0.134496892 [93,] 0.843935139 0.312129722 0.156064861 [94,] 0.841021711 0.317956578 0.158978289 [95,] 0.823608876 0.352782247 0.176391124 [96,] 0.836275496 0.327449007 0.163724504 [97,] 0.815491105 0.369017790 0.184508895 [98,] 0.780807963 0.438384073 0.219192037 [99,] 0.751318592 0.497362816 0.248681408 [100,] 0.737809220 0.524381559 0.262190780 [101,] 0.696146107 0.607707786 0.303853893 [102,] 0.649629219 0.700741561 0.350370781 [103,] 0.657999857 0.684000286 0.342000143 [104,] 0.612093975 0.775812051 0.387906025 [105,] 0.592544608 0.814910784 0.407455392 [106,] 0.547741444 0.904517112 0.452258556 [107,] 0.509008895 0.981982210 0.490991105 [108,] 0.479265364 0.958530727 0.520734636 [109,] 0.433414568 0.866829137 0.566585432 [110,] 0.382617708 0.765235415 0.617382292 [111,] 0.370738395 0.741476789 0.629261605 [112,] 0.323745807 0.647491615 0.676254193 [113,] 0.288155498 0.576310996 0.711844502 [114,] 0.411013542 0.822027084 0.588986458 [115,] 0.376555964 0.753111928 0.623444036 [116,] 0.322047336 0.644094672 0.677952664 [117,] 0.340628025 0.681256051 0.659371975 [118,] 0.288972706 0.577945412 0.711027294 [119,] 0.289451026 0.578902053 0.710548974 [120,] 0.249386096 0.498772192 0.750613904 [121,] 0.202552134 0.405104267 0.797447866 [122,] 0.162087380 0.324174760 0.837912620 [123,] 0.247381706 0.494763411 0.752618294 [124,] 0.207659444 0.415318888 0.792340556 [125,] 0.214025694 0.428051388 0.785974306 [126,] 0.287843472 0.575686945 0.712156528 [127,] 0.532555306 0.934889389 0.467444694 [128,] 0.469396449 0.938792897 0.530603551 [129,] 0.507879055 0.984241889 0.492120945 [130,] 0.431846911 0.863693822 0.568153089 [131,] 0.435878970 0.871757940 0.564121030 [132,] 0.362584885 0.725169769 0.637415115 [133,] 0.492074749 0.984149497 0.507925251 [134,] 0.426836720 0.853673441 0.573163280 [135,] 0.358572670 0.717145339 0.641427330 [136,] 0.284062101 0.568124202 0.715937899 [137,] 0.239985911 0.479971822 0.760014089 [138,] 0.571227704 0.857544591 0.428772296 [139,] 0.453963325 0.907926651 0.546036675 [140,] 0.688468453 0.623063094 0.311531547 [141,] 0.571338959 0.857322081 0.428661041 > postscript(file="/var/fisher/rcomp/tmp/1nyoz1355073902.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/fisher/rcomp/tmp/2n3bd1355073902.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/fisher/rcomp/tmp/30a8t1355073902.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/fisher/rcomp/tmp/4v1571355073902.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/fisher/rcomp/tmp/5yvnp1355073902.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 = 162 Frequency = 1 1 2 3 4 5 6 -1.649370783 -2.107657060 -0.909079880 2.109237301 3.019660852 -1.361607778 7 8 9 10 11 12 2.082704430 0.837305957 0.319632216 -1.803180421 -1.540116462 0.157285181 13 14 15 16 17 18 -1.724948931 1.810029362 -1.317071368 2.967824661 -3.779291095 -0.802196814 19 20 21 22 23 24 1.871022858 1.517378025 -1.341855638 -0.442006084 -4.777677133 -0.038255455 25 26 27 28 29 30 -1.304714038 -1.211220792 -1.211220792 -1.275596549 -2.880644703 -1.630733307 31 32 33 34 35 36 -0.961077701 -2.224248854 6.701906535 3.248594211 -1.845518944 2.829049354 37 38 39 40 41 42 -2.322197915 -1.394032522 -0.511286936 -0.610341188 0.965565072 -0.517318348 43 44 45 46 47 48 0.097114445 0.613831614 0.384896779 8.771314399 -0.594961579 6.686404573 49 50 51 52 53 54 -0.191616313 1.369974320 1.931254653 -2.646279770 -0.946778206 -2.666204777 55 56 57 58 59 60 -1.683337178 -0.629407188 -1.740436942 0.197780335 -1.176196722 -2.989328860 61 62 63 64 65 66 -1.416205182 -0.892932231 -1.002172209 -0.035646495 10.356926139 0.594098915 67 68 69 70 71 72 -0.206906537 -1.359851440 -2.494021874 -1.627719077 -1.311488225 -0.974658225 73 74 75 76 77 78 -0.124783608 3.300004328 -1.193263857 -0.161848831 -0.174400180 -0.108652418 79 80 81 82 83 84 -1.082248380 -1.946527474 1.624194773 -1.618671887 -1.440739096 -1.192732675 85 86 87 88 89 90 1.028025480 -1.523518194 -0.056097758 6.401049640 1.880732341 2.110681205 91 92 93 94 95 96 -3.814492821 -0.155157454 0.335239129 -1.946395393 0.695347349 1.422857090 97 98 99 100 101 102 -0.663776153 -0.582755383 -1.827190652 2.107345398 -1.778737380 0.729263638 103 104 105 106 107 108 1.307241417 -1.946594497 -1.679462418 2.881969376 1.162634888 -0.443188009 109 110 111 112 113 114 -0.698523521 -1.604400293 -0.005225635 0.141132808 -2.684597676 -0.301474534 115 116 117 118 119 120 -1.182935833 -1.013694238 -0.647619448 2.073794829 0.478397921 0.211642708 121 122 123 124 125 126 2.457829313 1.148623046 -0.837511396 3.507893158 2.054908802 0.290214532 127 128 129 130 131 132 -2.508497609 0.619456641 -2.884374480 -1.346519184 -0.239195545 0.679807853 133 134 135 136 137 138 3.033486349 -1.778027697 -0.908235463 2.368853766 5.725273793 0.894251714 139 140 141 142 143 144 -0.932518976 1.342837611 -0.320461412 0.578769899 -2.633064357 -2.159895036 145 146 147 148 149 150 2.719002905 -1.969267690 2.404097122 2.327810042 -1.719576111 2.830304938 151 152 153 154 155 156 -0.438201863 0.812889181 -1.350978684 0.235541089 0.065442460 -1.504038061 157 158 159 160 161 162 -1.396422481 7.202125771 0.335239129 -0.948271323 -2.552413282 -2.859212751 > postscript(file="/var/fisher/rcomp/tmp/6clxh1355073902.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 = 162 Frequency = 1 lag(myerror, k = 1) myerror 0 -1.649370783 NA 1 -2.107657060 -1.649370783 2 -0.909079880 -2.107657060 3 2.109237301 -0.909079880 4 3.019660852 2.109237301 5 -1.361607778 3.019660852 6 2.082704430 -1.361607778 7 0.837305957 2.082704430 8 0.319632216 0.837305957 9 -1.803180421 0.319632216 10 -1.540116462 -1.803180421 11 0.157285181 -1.540116462 12 -1.724948931 0.157285181 13 1.810029362 -1.724948931 14 -1.317071368 1.810029362 15 2.967824661 -1.317071368 16 -3.779291095 2.967824661 17 -0.802196814 -3.779291095 18 1.871022858 -0.802196814 19 1.517378025 1.871022858 20 -1.341855638 1.517378025 21 -0.442006084 -1.341855638 22 -4.777677133 -0.442006084 23 -0.038255455 -4.777677133 24 -1.304714038 -0.038255455 25 -1.211220792 -1.304714038 26 -1.211220792 -1.211220792 27 -1.275596549 -1.211220792 28 -2.880644703 -1.275596549 29 -1.630733307 -2.880644703 30 -0.961077701 -1.630733307 31 -2.224248854 -0.961077701 32 6.701906535 -2.224248854 33 3.248594211 6.701906535 34 -1.845518944 3.248594211 35 2.829049354 -1.845518944 36 -2.322197915 2.829049354 37 -1.394032522 -2.322197915 38 -0.511286936 -1.394032522 39 -0.610341188 -0.511286936 40 0.965565072 -0.610341188 41 -0.517318348 0.965565072 42 0.097114445 -0.517318348 43 0.613831614 0.097114445 44 0.384896779 0.613831614 45 8.771314399 0.384896779 46 -0.594961579 8.771314399 47 6.686404573 -0.594961579 48 -0.191616313 6.686404573 49 1.369974320 -0.191616313 50 1.931254653 1.369974320 51 -2.646279770 1.931254653 52 -0.946778206 -2.646279770 53 -2.666204777 -0.946778206 54 -1.683337178 -2.666204777 55 -0.629407188 -1.683337178 56 -1.740436942 -0.629407188 57 0.197780335 -1.740436942 58 -1.176196722 0.197780335 59 -2.989328860 -1.176196722 60 -1.416205182 -2.989328860 61 -0.892932231 -1.416205182 62 -1.002172209 -0.892932231 63 -0.035646495 -1.002172209 64 10.356926139 -0.035646495 65 0.594098915 10.356926139 66 -0.206906537 0.594098915 67 -1.359851440 -0.206906537 68 -2.494021874 -1.359851440 69 -1.627719077 -2.494021874 70 -1.311488225 -1.627719077 71 -0.974658225 -1.311488225 72 -0.124783608 -0.974658225 73 3.300004328 -0.124783608 74 -1.193263857 3.300004328 75 -0.161848831 -1.193263857 76 -0.174400180 -0.161848831 77 -0.108652418 -0.174400180 78 -1.082248380 -0.108652418 79 -1.946527474 -1.082248380 80 1.624194773 -1.946527474 81 -1.618671887 1.624194773 82 -1.440739096 -1.618671887 83 -1.192732675 -1.440739096 84 1.028025480 -1.192732675 85 -1.523518194 1.028025480 86 -0.056097758 -1.523518194 87 6.401049640 -0.056097758 88 1.880732341 6.401049640 89 2.110681205 1.880732341 90 -3.814492821 2.110681205 91 -0.155157454 -3.814492821 92 0.335239129 -0.155157454 93 -1.946395393 0.335239129 94 0.695347349 -1.946395393 95 1.422857090 0.695347349 96 -0.663776153 1.422857090 97 -0.582755383 -0.663776153 98 -1.827190652 -0.582755383 99 2.107345398 -1.827190652 100 -1.778737380 2.107345398 101 0.729263638 -1.778737380 102 1.307241417 0.729263638 103 -1.946594497 1.307241417 104 -1.679462418 -1.946594497 105 2.881969376 -1.679462418 106 1.162634888 2.881969376 107 -0.443188009 1.162634888 108 -0.698523521 -0.443188009 109 -1.604400293 -0.698523521 110 -0.005225635 -1.604400293 111 0.141132808 -0.005225635 112 -2.684597676 0.141132808 113 -0.301474534 -2.684597676 114 -1.182935833 -0.301474534 115 -1.013694238 -1.182935833 116 -0.647619448 -1.013694238 117 2.073794829 -0.647619448 118 0.478397921 2.073794829 119 0.211642708 0.478397921 120 2.457829313 0.211642708 121 1.148623046 2.457829313 122 -0.837511396 1.148623046 123 3.507893158 -0.837511396 124 2.054908802 3.507893158 125 0.290214532 2.054908802 126 -2.508497609 0.290214532 127 0.619456641 -2.508497609 128 -2.884374480 0.619456641 129 -1.346519184 -2.884374480 130 -0.239195545 -1.346519184 131 0.679807853 -0.239195545 132 3.033486349 0.679807853 133 -1.778027697 3.033486349 134 -0.908235463 -1.778027697 135 2.368853766 -0.908235463 136 5.725273793 2.368853766 137 0.894251714 5.725273793 138 -0.932518976 0.894251714 139 1.342837611 -0.932518976 140 -0.320461412 1.342837611 141 0.578769899 -0.320461412 142 -2.633064357 0.578769899 143 -2.159895036 -2.633064357 144 2.719002905 -2.159895036 145 -1.969267690 2.719002905 146 2.404097122 -1.969267690 147 2.327810042 2.404097122 148 -1.719576111 2.327810042 149 2.830304938 -1.719576111 150 -0.438201863 2.830304938 151 0.812889181 -0.438201863 152 -1.350978684 0.812889181 153 0.235541089 -1.350978684 154 0.065442460 0.235541089 155 -1.504038061 0.065442460 156 -1.396422481 -1.504038061 157 7.202125771 -1.396422481 158 0.335239129 7.202125771 159 -0.948271323 0.335239129 160 -2.552413282 -0.948271323 161 -2.859212751 -2.552413282 162 NA -2.859212751 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -2.107657060 -1.649370783 [2,] -0.909079880 -2.107657060 [3,] 2.109237301 -0.909079880 [4,] 3.019660852 2.109237301 [5,] -1.361607778 3.019660852 [6,] 2.082704430 -1.361607778 [7,] 0.837305957 2.082704430 [8,] 0.319632216 0.837305957 [9,] -1.803180421 0.319632216 [10,] -1.540116462 -1.803180421 [11,] 0.157285181 -1.540116462 [12,] -1.724948931 0.157285181 [13,] 1.810029362 -1.724948931 [14,] -1.317071368 1.810029362 [15,] 2.967824661 -1.317071368 [16,] -3.779291095 2.967824661 [17,] -0.802196814 -3.779291095 [18,] 1.871022858 -0.802196814 [19,] 1.517378025 1.871022858 [20,] -1.341855638 1.517378025 [21,] -0.442006084 -1.341855638 [22,] -4.777677133 -0.442006084 [23,] -0.038255455 -4.777677133 [24,] -1.304714038 -0.038255455 [25,] -1.211220792 -1.304714038 [26,] -1.211220792 -1.211220792 [27,] -1.275596549 -1.211220792 [28,] -2.880644703 -1.275596549 [29,] -1.630733307 -2.880644703 [30,] -0.961077701 -1.630733307 [31,] -2.224248854 -0.961077701 [32,] 6.701906535 -2.224248854 [33,] 3.248594211 6.701906535 [34,] -1.845518944 3.248594211 [35,] 2.829049354 -1.845518944 [36,] -2.322197915 2.829049354 [37,] -1.394032522 -2.322197915 [38,] -0.511286936 -1.394032522 [39,] -0.610341188 -0.511286936 [40,] 0.965565072 -0.610341188 [41,] -0.517318348 0.965565072 [42,] 0.097114445 -0.517318348 [43,] 0.613831614 0.097114445 [44,] 0.384896779 0.613831614 [45,] 8.771314399 0.384896779 [46,] -0.594961579 8.771314399 [47,] 6.686404573 -0.594961579 [48,] -0.191616313 6.686404573 [49,] 1.369974320 -0.191616313 [50,] 1.931254653 1.369974320 [51,] -2.646279770 1.931254653 [52,] -0.946778206 -2.646279770 [53,] -2.666204777 -0.946778206 [54,] -1.683337178 -2.666204777 [55,] -0.629407188 -1.683337178 [56,] -1.740436942 -0.629407188 [57,] 0.197780335 -1.740436942 [58,] -1.176196722 0.197780335 [59,] -2.989328860 -1.176196722 [60,] -1.416205182 -2.989328860 [61,] -0.892932231 -1.416205182 [62,] -1.002172209 -0.892932231 [63,] -0.035646495 -1.002172209 [64,] 10.356926139 -0.035646495 [65,] 0.594098915 10.356926139 [66,] -0.206906537 0.594098915 [67,] -1.359851440 -0.206906537 [68,] -2.494021874 -1.359851440 [69,] -1.627719077 -2.494021874 [70,] -1.311488225 -1.627719077 [71,] -0.974658225 -1.311488225 [72,] -0.124783608 -0.974658225 [73,] 3.300004328 -0.124783608 [74,] -1.193263857 3.300004328 [75,] -0.161848831 -1.193263857 [76,] -0.174400180 -0.161848831 [77,] -0.108652418 -0.174400180 [78,] -1.082248380 -0.108652418 [79,] -1.946527474 -1.082248380 [80,] 1.624194773 -1.946527474 [81,] -1.618671887 1.624194773 [82,] -1.440739096 -1.618671887 [83,] -1.192732675 -1.440739096 [84,] 1.028025480 -1.192732675 [85,] -1.523518194 1.028025480 [86,] -0.056097758 -1.523518194 [87,] 6.401049640 -0.056097758 [88,] 1.880732341 6.401049640 [89,] 2.110681205 1.880732341 [90,] -3.814492821 2.110681205 [91,] -0.155157454 -3.814492821 [92,] 0.335239129 -0.155157454 [93,] -1.946395393 0.335239129 [94,] 0.695347349 -1.946395393 [95,] 1.422857090 0.695347349 [96,] -0.663776153 1.422857090 [97,] -0.582755383 -0.663776153 [98,] -1.827190652 -0.582755383 [99,] 2.107345398 -1.827190652 [100,] -1.778737380 2.107345398 [101,] 0.729263638 -1.778737380 [102,] 1.307241417 0.729263638 [103,] -1.946594497 1.307241417 [104,] -1.679462418 -1.946594497 [105,] 2.881969376 -1.679462418 [106,] 1.162634888 2.881969376 [107,] -0.443188009 1.162634888 [108,] -0.698523521 -0.443188009 [109,] -1.604400293 -0.698523521 [110,] -0.005225635 -1.604400293 [111,] 0.141132808 -0.005225635 [112,] -2.684597676 0.141132808 [113,] -0.301474534 -2.684597676 [114,] -1.182935833 -0.301474534 [115,] -1.013694238 -1.182935833 [116,] -0.647619448 -1.013694238 [117,] 2.073794829 -0.647619448 [118,] 0.478397921 2.073794829 [119,] 0.211642708 0.478397921 [120,] 2.457829313 0.211642708 [121,] 1.148623046 2.457829313 [122,] -0.837511396 1.148623046 [123,] 3.507893158 -0.837511396 [124,] 2.054908802 3.507893158 [125,] 0.290214532 2.054908802 [126,] -2.508497609 0.290214532 [127,] 0.619456641 -2.508497609 [128,] -2.884374480 0.619456641 [129,] -1.346519184 -2.884374480 [130,] -0.239195545 -1.346519184 [131,] 0.679807853 -0.239195545 [132,] 3.033486349 0.679807853 [133,] -1.778027697 3.033486349 [134,] -0.908235463 -1.778027697 [135,] 2.368853766 -0.908235463 [136,] 5.725273793 2.368853766 [137,] 0.894251714 5.725273793 [138,] -0.932518976 0.894251714 [139,] 1.342837611 -0.932518976 [140,] -0.320461412 1.342837611 [141,] 0.578769899 -0.320461412 [142,] -2.633064357 0.578769899 [143,] -2.159895036 -2.633064357 [144,] 2.719002905 -2.159895036 [145,] -1.969267690 2.719002905 [146,] 2.404097122 -1.969267690 [147,] 2.327810042 2.404097122 [148,] -1.719576111 2.327810042 [149,] 2.830304938 -1.719576111 [150,] -0.438201863 2.830304938 [151,] 0.812889181 -0.438201863 [152,] -1.350978684 0.812889181 [153,] 0.235541089 -1.350978684 [154,] 0.065442460 0.235541089 [155,] -1.504038061 0.065442460 [156,] -1.396422481 -1.504038061 [157,] 7.202125771 -1.396422481 [158,] 0.335239129 7.202125771 [159,] -0.948271323 0.335239129 [160,] -2.552413282 -0.948271323 [161,] -2.859212751 -2.552413282 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -2.107657060 -1.649370783 2 -0.909079880 -2.107657060 3 2.109237301 -0.909079880 4 3.019660852 2.109237301 5 -1.361607778 3.019660852 6 2.082704430 -1.361607778 7 0.837305957 2.082704430 8 0.319632216 0.837305957 9 -1.803180421 0.319632216 10 -1.540116462 -1.803180421 11 0.157285181 -1.540116462 12 -1.724948931 0.157285181 13 1.810029362 -1.724948931 14 -1.317071368 1.810029362 15 2.967824661 -1.317071368 16 -3.779291095 2.967824661 17 -0.802196814 -3.779291095 18 1.871022858 -0.802196814 19 1.517378025 1.871022858 20 -1.341855638 1.517378025 21 -0.442006084 -1.341855638 22 -4.777677133 -0.442006084 23 -0.038255455 -4.777677133 24 -1.304714038 -0.038255455 25 -1.211220792 -1.304714038 26 -1.211220792 -1.211220792 27 -1.275596549 -1.211220792 28 -2.880644703 -1.275596549 29 -1.630733307 -2.880644703 30 -0.961077701 -1.630733307 31 -2.224248854 -0.961077701 32 6.701906535 -2.224248854 33 3.248594211 6.701906535 34 -1.845518944 3.248594211 35 2.829049354 -1.845518944 36 -2.322197915 2.829049354 37 -1.394032522 -2.322197915 38 -0.511286936 -1.394032522 39 -0.610341188 -0.511286936 40 0.965565072 -0.610341188 41 -0.517318348 0.965565072 42 0.097114445 -0.517318348 43 0.613831614 0.097114445 44 0.384896779 0.613831614 45 8.771314399 0.384896779 46 -0.594961579 8.771314399 47 6.686404573 -0.594961579 48 -0.191616313 6.686404573 49 1.369974320 -0.191616313 50 1.931254653 1.369974320 51 -2.646279770 1.931254653 52 -0.946778206 -2.646279770 53 -2.666204777 -0.946778206 54 -1.683337178 -2.666204777 55 -0.629407188 -1.683337178 56 -1.740436942 -0.629407188 57 0.197780335 -1.740436942 58 -1.176196722 0.197780335 59 -2.989328860 -1.176196722 60 -1.416205182 -2.989328860 61 -0.892932231 -1.416205182 62 -1.002172209 -0.892932231 63 -0.035646495 -1.002172209 64 10.356926139 -0.035646495 65 0.594098915 10.356926139 66 -0.206906537 0.594098915 67 -1.359851440 -0.206906537 68 -2.494021874 -1.359851440 69 -1.627719077 -2.494021874 70 -1.311488225 -1.627719077 71 -0.974658225 -1.311488225 72 -0.124783608 -0.974658225 73 3.300004328 -0.124783608 74 -1.193263857 3.300004328 75 -0.161848831 -1.193263857 76 -0.174400180 -0.161848831 77 -0.108652418 -0.174400180 78 -1.082248380 -0.108652418 79 -1.946527474 -1.082248380 80 1.624194773 -1.946527474 81 -1.618671887 1.624194773 82 -1.440739096 -1.618671887 83 -1.192732675 -1.440739096 84 1.028025480 -1.192732675 85 -1.523518194 1.028025480 86 -0.056097758 -1.523518194 87 6.401049640 -0.056097758 88 1.880732341 6.401049640 89 2.110681205 1.880732341 90 -3.814492821 2.110681205 91 -0.155157454 -3.814492821 92 0.335239129 -0.155157454 93 -1.946395393 0.335239129 94 0.695347349 -1.946395393 95 1.422857090 0.695347349 96 -0.663776153 1.422857090 97 -0.582755383 -0.663776153 98 -1.827190652 -0.582755383 99 2.107345398 -1.827190652 100 -1.778737380 2.107345398 101 0.729263638 -1.778737380 102 1.307241417 0.729263638 103 -1.946594497 1.307241417 104 -1.679462418 -1.946594497 105 2.881969376 -1.679462418 106 1.162634888 2.881969376 107 -0.443188009 1.162634888 108 -0.698523521 -0.443188009 109 -1.604400293 -0.698523521 110 -0.005225635 -1.604400293 111 0.141132808 -0.005225635 112 -2.684597676 0.141132808 113 -0.301474534 -2.684597676 114 -1.182935833 -0.301474534 115 -1.013694238 -1.182935833 116 -0.647619448 -1.013694238 117 2.073794829 -0.647619448 118 0.478397921 2.073794829 119 0.211642708 0.478397921 120 2.457829313 0.211642708 121 1.148623046 2.457829313 122 -0.837511396 1.148623046 123 3.507893158 -0.837511396 124 2.054908802 3.507893158 125 0.290214532 2.054908802 126 -2.508497609 0.290214532 127 0.619456641 -2.508497609 128 -2.884374480 0.619456641 129 -1.346519184 -2.884374480 130 -0.239195545 -1.346519184 131 0.679807853 -0.239195545 132 3.033486349 0.679807853 133 -1.778027697 3.033486349 134 -0.908235463 -1.778027697 135 2.368853766 -0.908235463 136 5.725273793 2.368853766 137 0.894251714 5.725273793 138 -0.932518976 0.894251714 139 1.342837611 -0.932518976 140 -0.320461412 1.342837611 141 0.578769899 -0.320461412 142 -2.633064357 0.578769899 143 -2.159895036 -2.633064357 144 2.719002905 -2.159895036 145 -1.969267690 2.719002905 146 2.404097122 -1.969267690 147 2.327810042 2.404097122 148 -1.719576111 2.327810042 149 2.830304938 -1.719576111 150 -0.438201863 2.830304938 151 0.812889181 -0.438201863 152 -1.350978684 0.812889181 153 0.235541089 -1.350978684 154 0.065442460 0.235541089 155 -1.504038061 0.065442460 156 -1.396422481 -1.504038061 157 7.202125771 -1.396422481 158 0.335239129 7.202125771 159 -0.948271323 0.335239129 160 -2.552413282 -0.948271323 161 -2.859212751 -2.552413282 > 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/fisher/rcomp/tmp/7fdh01355073902.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/fisher/rcomp/tmp/8emc01355073902.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/fisher/rcomp/tmp/986f61355073902.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/fisher/rcomp/tmp/10z8br1355073902.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/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/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/fisher/rcomp/tmp/110mlt1355073902.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/fisher/rcomp/tmp/12omad1355073902.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/fisher/rcomp/tmp/13p8x31355073902.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/fisher/rcomp/tmp/14jpaa1355073902.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/fisher/rcomp/tmp/15sc4m1355073902.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/fisher/rcomp/tmp/161n641355073902.tab") + } > > try(system("convert tmp/1nyoz1355073902.ps tmp/1nyoz1355073902.png",intern=TRUE)) character(0) > try(system("convert tmp/2n3bd1355073902.ps tmp/2n3bd1355073902.png",intern=TRUE)) character(0) > try(system("convert tmp/30a8t1355073902.ps tmp/30a8t1355073902.png",intern=TRUE)) character(0) > try(system("convert tmp/4v1571355073902.ps tmp/4v1571355073902.png",intern=TRUE)) character(0) > try(system("convert tmp/5yvnp1355073902.ps tmp/5yvnp1355073902.png",intern=TRUE)) character(0) > try(system("convert tmp/6clxh1355073902.ps tmp/6clxh1355073902.png",intern=TRUE)) character(0) > try(system("convert tmp/7fdh01355073902.ps tmp/7fdh01355073902.png",intern=TRUE)) character(0) > try(system("convert tmp/8emc01355073902.ps tmp/8emc01355073902.png",intern=TRUE)) character(0) > try(system("convert tmp/986f61355073902.ps tmp/986f61355073902.png",intern=TRUE)) character(0) > try(system("convert tmp/10z8br1355073902.ps tmp/10z8br1355073902.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 9.045 1.712 10.769