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(9 + ,26 + ,21 + ,21 + ,23 + ,17 + ,23 + ,4 + ,9 + ,20 + ,16 + ,15 + ,24 + ,17 + ,20 + ,4 + ,9 + ,19 + ,19 + ,18 + ,22 + ,18 + ,20 + ,6 + ,9 + ,19 + ,18 + ,11 + ,20 + ,21 + ,21 + ,8 + ,9 + ,20 + ,16 + ,8 + ,24 + ,20 + ,24 + ,8 + ,9 + ,25 + ,23 + ,19 + ,27 + ,28 + ,22 + ,4 + ,9 + ,25 + ,17 + ,4 + ,28 + ,19 + ,23 + ,4 + ,9 + ,22 + ,12 + ,20 + ,27 + ,22 + ,20 + ,8 + ,9 + ,26 + ,19 + ,16 + ,24 + ,16 + ,25 + ,5 + ,9 + ,22 + ,16 + ,14 + ,23 + ,18 + ,23 + ,4 + ,9 + ,17 + ,19 + ,10 + ,24 + ,25 + ,27 + ,4 + ,9 + ,22 + ,20 + ,13 + ,27 + ,17 + ,27 + ,4 + ,9 + ,19 + ,13 + ,14 + ,27 + ,14 + ,22 + ,4 + ,9 + ,24 + ,20 + ,8 + ,28 + ,11 + ,24 + ,4 + ,9 + ,26 + ,27 + ,23 + ,27 + ,27 + ,25 + ,4 + ,9 + ,21 + ,17 + ,11 + ,23 + ,20 + ,22 + ,8 + ,9 + ,13 + ,8 + ,9 + ,24 + ,22 + ,28 + ,4 + ,9 + ,26 + ,25 + ,24 + ,28 + ,22 + ,28 + ,4 + ,9 + ,20 + ,26 + ,5 + ,27 + ,21 + ,27 + ,4 + ,9 + ,22 + ,13 + ,15 + ,25 + ,23 + ,25 + ,8 + ,9 + ,14 + ,19 + ,5 + ,19 + ,17 + ,16 + ,4 + ,9 + ,21 + ,15 + ,19 + ,24 + ,24 + ,28 + ,7 + ,9 + ,7 + ,5 + ,6 + ,20 + ,14 + ,21 + ,4 + ,9 + ,23 + ,16 + ,13 + ,28 + ,17 + ,24 + ,4 + ,9 + ,17 + ,14 + ,11 + ,26 + ,23 + ,27 + ,5 + ,9 + ,25 + ,24 + ,17 + ,23 + ,24 + ,14 + ,4 + ,9 + ,25 + ,24 + ,17 + ,23 + ,24 + ,14 + ,4 + ,9 + ,19 + ,9 + ,5 + ,20 + ,8 + ,27 + ,4 + ,9 + ,20 + ,19 + ,9 + ,11 + ,22 + ,20 + ,4 + ,9 + ,23 + ,19 + ,15 + ,24 + ,23 + ,21 + ,4 + ,9 + ,22 + ,25 + ,17 + ,25 + ,25 + ,22 + ,4 + ,9 + ,22 + ,19 + ,17 + ,23 + ,21 + ,21 + ,4 + ,9 + ,21 + ,18 + ,20 + ,18 + ,24 + ,12 + ,15 + ,9 + ,15 + ,15 + ,12 + ,20 + ,15 + ,20 + ,10 + ,9 + ,20 + ,12 + ,7 + ,20 + ,22 + ,24 + ,4 + ,9 + ,22 + ,21 + ,16 + ,24 + ,21 + ,19 + ,8 + ,9 + ,18 + ,12 + ,7 + ,23 + ,25 + ,28 + ,4 + ,9 + ,20 + ,15 + ,14 + ,25 + ,16 + ,23 + ,4 + ,9 + ,28 + ,28 + ,24 + ,28 + ,28 + ,27 + ,4 + ,9 + ,22 + ,25 + ,15 + ,26 + ,23 + ,22 + ,4 + ,9 + ,18 + ,19 + ,15 + ,26 + ,21 + ,27 + ,7 + ,9 + ,23 + ,20 + ,10 + ,23 + ,21 + ,26 + ,4 + ,9 + ,20 + ,24 + ,14 + ,22 + ,26 + ,22 + ,6 + ,9 + ,25 + ,26 + ,18 + ,24 + ,22 + ,21 + ,5 + ,9 + ,26 + ,25 + ,12 + ,21 + ,21 + ,19 + ,4 + ,9 + ,15 + ,12 + ,9 + ,20 + ,18 + ,24 + ,16 + ,9 + ,17 + ,12 + ,9 + ,22 + ,12 + ,19 + ,5 + ,9 + ,23 + ,15 + ,8 + ,20 + ,25 + ,26 + ,12 + ,9 + ,21 + ,17 + ,18 + ,25 + ,17 + ,22 + ,6 + ,9 + ,13 + ,14 + ,10 + ,20 + ,24 + ,28 + ,9 + ,9 + ,18 + ,16 + ,17 + ,22 + ,15 + ,21 + ,9 + ,9 + ,19 + ,11 + ,14 + ,23 + ,13 + ,23 + ,4 + ,9 + ,22 + ,20 + ,16 + ,25 + ,26 + ,28 + ,5 + ,9 + ,16 + ,11 + ,10 + ,23 + ,16 + ,10 + ,4 + ,10 + ,24 + ,22 + ,19 + ,23 + ,24 + ,24 + ,4 + ,10 + ,18 + ,20 + ,10 + ,22 + ,21 + ,21 + ,5 + ,10 + ,20 + ,19 + ,14 + ,24 + ,20 + ,21 + ,4 + ,10 + ,24 + ,17 + ,10 + ,25 + ,14 + ,24 + ,4 + ,10 + ,14 + ,21 + ,4 + ,21 + ,25 + ,24 + ,4 + ,10 + ,22 + ,23 + ,19 + ,12 + ,25 + ,25 + ,5 + ,10 + ,24 + ,18 + ,9 + ,17 + ,20 + ,25 + ,4 + ,10 + ,18 + ,17 + ,12 + ,20 + ,22 + ,23 + ,6 + ,10 + ,21 + ,27 + ,16 + ,23 + ,20 + ,21 + ,4 + ,10 + ,23 + ,25 + ,11 + ,23 + ,26 + ,16 + ,4 + ,10 + ,17 + ,19 + ,18 + ,20 + ,18 + ,17 + ,18 + ,10 + ,22 + ,22 + ,11 + ,28 + ,22 + ,25 + ,4 + ,10 + ,24 + ,24 + ,24 + ,24 + ,24 + ,24 + ,6 + ,10 + ,21 + ,20 + ,17 + ,24 + ,17 + ,23 + ,4 + ,10 + ,22 + ,19 + ,18 + ,24 + ,24 + ,25 + ,4 + ,10 + ,16 + ,11 + ,9 + ,24 + ,20 + ,23 + ,5 + ,10 + ,21 + ,22 + ,19 + ,28 + ,19 + ,28 + ,4 + ,10 + ,23 + ,22 + ,18 + ,25 + ,20 + ,26 + ,4 + ,10 + ,22 + ,16 + ,12 + ,21 + ,15 + ,22 + ,5 + ,10 + ,24 + ,20 + ,23 + ,25 + ,23 + ,19 + ,10 + ,10 + ,24 + ,24 + ,22 + ,25 + ,26 + ,26 + ,5 + ,10 + ,16 + ,16 + ,14 + ,18 + ,22 + ,18 + ,8 + ,10 + ,16 + ,16 + ,14 + ,17 + ,20 + ,18 + ,8 + ,10 + ,21 + ,22 + ,16 + ,26 + ,24 + ,25 + ,5 + ,10 + ,26 + ,24 + ,23 + ,28 + ,26 + ,27 + ,4 + ,10 + ,15 + ,16 + ,7 + ,21 + ,21 + ,12 + ,4 + ,10 + ,25 + ,27 + ,10 + ,27 + ,25 + ,15 + ,4 + ,10 + ,18 + ,11 + ,12 + ,22 + ,13 + ,21 + ,5 + ,10 + ,23 + ,21 + ,12 + ,21 + ,20 + ,23 + ,4 + ,10 + ,20 + ,20 + ,12 + ,25 + ,22 + ,22 + ,4 + ,10 + ,17 + ,20 + ,17 + ,22 + ,23 + ,21 + ,8 + ,10 + ,25 + ,27 + ,21 + ,23 + ,28 + ,24 + ,4 + ,10 + ,24 + ,20 + ,16 + ,26 + ,22 + ,27 + ,5 + ,10 + ,17 + ,12 + ,11 + ,19 + ,20 + ,22 + ,14 + ,10 + ,19 + ,8 + ,14 + ,25 + ,6 + ,28 + ,8 + ,10 + ,20 + ,21 + ,13 + ,21 + ,21 + ,26 + ,8 + ,10 + ,15 + ,18 + ,9 + ,13 + ,20 + ,10 + ,4 + ,10 + ,27 + ,24 + ,19 + ,24 + ,18 + ,19 + ,4 + ,10 + ,22 + ,16 + ,13 + ,25 + ,23 + ,22 + ,6 + ,10 + ,23 + ,18 + ,19 + ,26 + ,20 + ,21 + ,4 + ,10 + ,16 + ,20 + ,13 + ,25 + ,24 + ,24 + ,7 + ,10 + ,19 + ,20 + ,13 + ,25 + ,22 + ,25 + ,7 + ,10 + ,25 + ,19 + ,13 + ,22 + ,21 + ,21 + ,4 + ,10 + ,19 + ,17 + ,14 + ,21 + ,18 + ,20 + ,6 + ,10 + ,19 + ,16 + ,12 + ,23 + ,21 + ,21 + ,4 + ,10 + ,26 + ,26 + ,22 + ,25 + ,23 + ,24 + ,7 + ,10 + ,21 + ,15 + ,11 + ,24 + ,23 + ,23 + ,4 + ,10 + ,20 + ,22 + ,5 + ,21 + ,15 + ,18 + ,4 + ,10 + ,24 + ,17 + ,18 + ,21 + ,21 + ,24 + ,8 + ,10 + ,22 + ,23 + ,19 + ,25 + ,24 + ,24 + ,4 + ,10 + ,20 + ,21 + ,14 + ,22 + ,23 + ,19 + ,4 + ,10 + ,18 + ,19 + ,15 + ,20 + ,21 + ,20 + ,10 + ,10 + ,18 + ,14 + ,12 + ,20 + ,21 + ,18 + ,8 + ,10 + ,24 + ,17 + ,19 + ,23 + ,20 + ,20 + ,6 + ,11 + ,24 + ,12 + ,15 + ,28 + ,11 + ,27 + ,4 + ,11 + ,22 + ,24 + ,17 + ,23 + ,22 + ,23 + ,4 + ,11 + ,23 + ,18 + ,8 + ,28 + ,27 + ,26 + ,4 + ,11 + ,22 + ,20 + ,10 + ,24 + ,25 + ,23 + ,5 + ,11 + ,20 + ,16 + ,12 + ,18 + ,18 + ,17 + ,4 + ,11 + ,18 + ,20 + ,12 + ,20 + ,20 + ,21 + ,6 + ,11 + ,25 + ,22 + ,20 + ,28 + ,24 + ,25 + ,4 + ,11 + ,18 + ,12 + ,12 + ,21 + ,10 + ,23 + ,5 + ,11 + ,16 + ,16 + ,12 + ,21 + ,27 + ,27 + ,7 + ,11 + ,20 + ,17 + ,14 + ,25 + ,21 + ,24 + ,8 + ,11 + ,19 + ,22 + ,6 + ,19 + ,21 + ,20 + ,5 + ,11 + ,15 + ,12 + ,10 + ,18 + ,18 + ,27 + ,8 + ,11 + ,19 + ,14 + ,18 + ,21 + ,15 + ,21 + ,10 + ,11 + ,19 + ,23 + ,18 + ,22 + ,24 + ,24 + ,8 + ,11 + ,16 + ,15 + ,7 + ,24 + ,22 + ,21 + ,5 + ,11 + ,17 + ,17 + ,18 + ,15 + ,14 + ,15 + ,12 + ,11 + ,28 + ,28 + ,9 + ,28 + ,28 + ,25 + ,4 + ,11 + ,23 + ,20 + ,17 + ,26 + ,18 + ,25 + ,5 + ,11 + ,25 + ,23 + ,22 + ,23 + ,26 + ,22 + ,4 + ,11 + ,20 + ,13 + ,11 + ,26 + ,17 + ,24 + ,6 + ,11 + ,17 + ,18 + ,15 + ,20 + ,19 + ,21 + ,4 + ,11 + ,23 + ,23 + ,17 + ,22 + ,22 + ,22 + ,4 + ,11 + ,16 + ,19 + ,15 + ,20 + ,18 + ,23 + ,7 + ,11 + ,23 + ,23 + ,22 + ,23 + ,24 + ,22 + ,7 + ,11 + ,11 + ,12 + ,9 + ,22 + ,15 + ,20 + ,10 + ,11 + ,18 + ,16 + ,13 + ,24 + ,18 + ,23 + ,4 + ,11 + ,24 + ,23 + ,20 + ,23 + ,26 + ,25 + ,5 + ,11 + ,23 + ,13 + ,14 + ,22 + ,11 + ,23 + ,8 + ,11 + ,21 + ,22 + ,14 + ,26 + ,26 + ,22 + ,11 + ,11 + ,16 + ,18 + ,12 + ,23 + ,21 + ,25 + ,7 + ,11 + ,24 + ,23 + ,20 + ,27 + ,23 + ,26 + ,4 + ,11 + ,23 + ,20 + ,20 + ,23 + ,23 + ,22 + ,8 + ,11 + ,18 + ,10 + ,8 + ,21 + ,15 + ,24 + ,6 + ,11 + ,20 + ,17 + ,17 + ,26 + ,22 + ,24 + ,7 + ,11 + ,9 + ,18 + ,9 + ,23 + ,26 + ,25 + ,5 + ,11 + ,24 + ,15 + ,18 + ,21 + ,16 + ,20 + ,4 + ,11 + ,25 + ,23 + ,22 + ,27 + ,20 + ,26 + ,8 + ,11 + ,20 + ,17 + ,10 + ,19 + ,18 + ,21 + ,4 + ,11 + ,21 + ,17 + ,13 + ,23 + ,22 + ,26 + ,8 + ,11 + ,25 + ,22 + ,15 + ,25 + ,16 + ,21 + ,6 + ,11 + ,22 + ,20 + ,18 + ,23 + ,19 + ,22 + ,4 + ,11 + ,21 + ,20 + ,18 + ,22 + ,20 + ,16 + ,9 + ,11 + ,21 + ,19 + ,12 + ,22 + ,19 + ,26 + ,5 + ,11 + ,22 + ,18 + ,12 + ,25 + ,23 + ,28 + ,6 + ,11 + ,27 + ,22 + ,20 + ,25 + ,24 + ,18 + ,4 + ,11 + ,24 + ,20 + ,12 + ,28 + ,25 + ,25 + ,4 + ,11 + ,24 + ,22 + ,16 + ,28 + ,21 + ,23 + ,4 + ,11 + ,21 + ,18 + ,16 + ,20 + ,21 + ,21 + ,5 + ,11 + ,18 + ,16 + ,18 + ,25 + ,23 + ,20 + ,6 + ,11 + ,16 + ,16 + ,16 + ,19 + ,27 + ,25 + ,16 + ,11 + ,22 + ,16 + ,13 + ,25 + ,23 + ,22 + ,6 + ,11 + ,20 + ,16 + ,17 + ,22 + ,18 + ,21 + ,6 + ,11 + ,18 + ,17 + ,13 + ,18 + ,16 + ,16 + ,4 + ,11 + ,20 + ,18 + ,17 + ,20 + ,16 + ,18 + ,4) + ,dim=c(8 + ,162) + ,dimnames=list(c('month' + ,'I1' + ,'I2' + ,'I3' + ,'E1' + ,'E2' + ,'E3' + ,'A') + ,1:162)) > y <- array(NA,dim=c(8,162),dimnames=list(c('month','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 = '2' > 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 I1 month I2 I3 E1 E2 E3 A 1 26 9 21 21 23 17 23 4 2 20 9 16 15 24 17 20 4 3 19 9 19 18 22 18 20 6 4 19 9 18 11 20 21 21 8 5 20 9 16 8 24 20 24 8 6 25 9 23 19 27 28 22 4 7 25 9 17 4 28 19 23 4 8 22 9 12 20 27 22 20 8 9 26 9 19 16 24 16 25 5 10 22 9 16 14 23 18 23 4 11 17 9 19 10 24 25 27 4 12 22 9 20 13 27 17 27 4 13 19 9 13 14 27 14 22 4 14 24 9 20 8 28 11 24 4 15 26 9 27 23 27 27 25 4 16 21 9 17 11 23 20 22 8 17 13 9 8 9 24 22 28 4 18 26 9 25 24 28 22 28 4 19 20 9 26 5 27 21 27 4 20 22 9 13 15 25 23 25 8 21 14 9 19 5 19 17 16 4 22 21 9 15 19 24 24 28 7 23 7 9 5 6 20 14 21 4 24 23 9 16 13 28 17 24 4 25 17 9 14 11 26 23 27 5 26 25 9 24 17 23 24 14 4 27 25 9 24 17 23 24 14 4 28 19 9 9 5 20 8 27 4 29 20 9 19 9 11 22 20 4 30 23 9 19 15 24 23 21 4 31 22 9 25 17 25 25 22 4 32 22 9 19 17 23 21 21 4 33 21 9 18 20 18 24 12 15 34 15 9 15 12 20 15 20 10 35 20 9 12 7 20 22 24 4 36 22 9 21 16 24 21 19 8 37 18 9 12 7 23 25 28 4 38 20 9 15 14 25 16 23 4 39 28 9 28 24 28 28 27 4 40 22 9 25 15 26 23 22 4 41 18 9 19 15 26 21 27 7 42 23 9 20 10 23 21 26 4 43 20 9 24 14 22 26 22 6 44 25 9 26 18 24 22 21 5 45 26 9 25 12 21 21 19 4 46 15 9 12 9 20 18 24 16 47 17 9 12 9 22 12 19 5 48 23 9 15 8 20 25 26 12 49 21 9 17 18 25 17 22 6 50 13 9 14 10 20 24 28 9 51 18 9 16 17 22 15 21 9 52 19 9 11 14 23 13 23 4 53 22 9 20 16 25 26 28 5 54 16 9 11 10 23 16 10 4 55 24 10 22 19 23 24 24 4 56 18 10 20 10 22 21 21 5 57 20 10 19 14 24 20 21 4 58 24 10 17 10 25 14 24 4 59 14 10 21 4 21 25 24 4 60 22 10 23 19 12 25 25 5 61 24 10 18 9 17 20 25 4 62 18 10 17 12 20 22 23 6 63 21 10 27 16 23 20 21 4 64 23 10 25 11 23 26 16 4 65 17 10 19 18 20 18 17 18 66 22 10 22 11 28 22 25 4 67 24 10 24 24 24 24 24 6 68 21 10 20 17 24 17 23 4 69 22 10 19 18 24 24 25 4 70 16 10 11 9 24 20 23 5 71 21 10 22 19 28 19 28 4 72 23 10 22 18 25 20 26 4 73 22 10 16 12 21 15 22 5 74 24 10 20 23 25 23 19 10 75 24 10 24 22 25 26 26 5 76 16 10 16 14 18 22 18 8 77 16 10 16 14 17 20 18 8 78 21 10 22 16 26 24 25 5 79 26 10 24 23 28 26 27 4 80 15 10 16 7 21 21 12 4 81 25 10 27 10 27 25 15 4 82 18 10 11 12 22 13 21 5 83 23 10 21 12 21 20 23 4 84 20 10 20 12 25 22 22 4 85 17 10 20 17 22 23 21 8 86 25 10 27 21 23 28 24 4 87 24 10 20 16 26 22 27 5 88 17 10 12 11 19 20 22 14 89 19 10 8 14 25 6 28 8 90 20 10 21 13 21 21 26 8 91 15 10 18 9 13 20 10 4 92 27 10 24 19 24 18 19 4 93 22 10 16 13 25 23 22 6 94 23 10 18 19 26 20 21 4 95 16 10 20 13 25 24 24 7 96 19 10 20 13 25 22 25 7 97 25 10 19 13 22 21 21 4 98 19 10 17 14 21 18 20 6 99 19 10 16 12 23 21 21 4 100 26 10 26 22 25 23 24 7 101 21 10 15 11 24 23 23 4 102 20 10 22 5 21 15 18 4 103 24 10 17 18 21 21 24 8 104 22 10 23 19 25 24 24 4 105 20 10 21 14 22 23 19 4 106 18 10 19 15 20 21 20 10 107 18 10 14 12 20 21 18 8 108 24 10 17 19 23 20 20 6 109 24 11 12 15 28 11 27 4 110 22 11 24 17 23 22 23 4 111 23 11 18 8 28 27 26 4 112 22 11 20 10 24 25 23 5 113 20 11 16 12 18 18 17 4 114 18 11 20 12 20 20 21 6 115 25 11 22 20 28 24 25 4 116 18 11 12 12 21 10 23 5 117 16 11 16 12 21 27 27 7 118 20 11 17 14 25 21 24 8 119 19 11 22 6 19 21 20 5 120 15 11 12 10 18 18 27 8 121 19 11 14 18 21 15 21 10 122 19 11 23 18 22 24 24 8 123 16 11 15 7 24 22 21 5 124 17 11 17 18 15 14 15 12 125 28 11 28 9 28 28 25 4 126 23 11 20 17 26 18 25 5 127 25 11 23 22 23 26 22 4 128 20 11 13 11 26 17 24 6 129 17 11 18 15 20 19 21 4 130 23 11 23 17 22 22 22 4 131 16 11 19 15 20 18 23 7 132 23 11 23 22 23 24 22 7 133 11 11 12 9 22 15 20 10 134 18 11 16 13 24 18 23 4 135 24 11 23 20 23 26 25 5 136 23 11 13 14 22 11 23 8 137 21 11 22 14 26 26 22 11 138 16 11 18 12 23 21 25 7 139 24 11 23 20 27 23 26 4 140 23 11 20 20 23 23 22 8 141 18 11 10 8 21 15 24 6 142 20 11 17 17 26 22 24 7 143 9 11 18 9 23 26 25 5 144 24 11 15 18 21 16 20 4 145 25 11 23 22 27 20 26 8 146 20 11 17 10 19 18 21 4 147 21 11 17 13 23 22 26 8 148 25 11 22 15 25 16 21 6 149 22 11 20 18 23 19 22 4 150 21 11 20 18 22 20 16 9 151 21 11 19 12 22 19 26 5 152 22 11 18 12 25 23 28 6 153 27 11 22 20 25 24 18 4 154 24 11 20 12 28 25 25 4 155 24 11 22 16 28 21 23 4 156 21 11 18 16 20 21 21 5 157 18 11 16 18 25 23 20 6 158 16 11 16 16 19 27 25 16 159 22 11 16 13 25 23 22 6 160 20 11 16 17 22 18 21 6 161 18 11 17 13 18 16 16 4 162 20 11 18 17 20 16 18 4 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) month I2 I3 E1 E2 9.07917 -0.20072 0.36214 0.25506 0.25766 -0.11655 E3 A 0.04076 -0.20983 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -9.5510 -1.4638 0.0039 1.7360 7.4735 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 9.07917 3.13588 2.895 0.004340 ** month -0.20072 0.24383 -0.823 0.411666 I2 0.36214 0.06303 5.746 4.75e-08 *** I3 0.25506 0.05055 5.046 1.26e-06 *** E1 0.25766 0.07522 3.425 0.000788 *** E2 -0.11655 0.05886 -1.980 0.049484 * E3 0.04076 0.06130 0.665 0.507092 A -0.20983 0.08415 -2.493 0.013711 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 2.503 on 154 degrees of freedom Multiple R-squared: 0.5521, Adjusted R-squared: 0.5317 F-statistic: 27.11 on 7 and 154 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.74870598 0.50258804 0.25129402 [2,] 0.87617009 0.24765983 0.12382991 [3,] 0.89428978 0.21142045 0.10571022 [4,] 0.86213026 0.27573948 0.13786974 [5,] 0.80162751 0.39674497 0.19837249 [6,] 0.72654416 0.54691167 0.27345584 [7,] 0.65450274 0.69099451 0.34549726 [8,] 0.56955889 0.86088222 0.43044111 [9,] 0.65922280 0.68155440 0.34077720 [10,] 0.64803456 0.70393088 0.35196544 [11,] 0.65479800 0.69040401 0.34520200 [12,] 0.57729075 0.84541849 0.42270925 [13,] 0.70968454 0.58063092 0.29031546 [14,] 0.64708339 0.70583321 0.35291661 [15,] 0.60608279 0.78783441 0.39391721 [16,] 0.58859721 0.82280558 0.41140279 [17,] 0.54255085 0.91489830 0.45744915 [18,] 0.77345399 0.45309203 0.22654601 [19,] 0.89739792 0.20520415 0.10260208 [20,] 0.88260137 0.23479727 0.11739863 [21,] 0.87506465 0.24987070 0.12493535 [22,] 0.84045475 0.31909050 0.15954525 [23,] 0.83707777 0.32584445 0.16292223 [24,] 0.89003076 0.21993847 0.10996924 [25,] 0.93141966 0.13716067 0.06858034 [26,] 0.91184901 0.17630198 0.08815099 [27,] 0.89490766 0.21018468 0.10509234 [28,] 0.86866568 0.26266864 0.13133432 [29,] 0.83660537 0.32678927 0.16339463 [30,] 0.82826331 0.34347338 0.17173669 [31,] 0.87095332 0.25809336 0.12904668 [32,] 0.86261649 0.27476702 0.13738351 [33,] 0.85215753 0.29568495 0.14784247 [34,] 0.81911759 0.36176482 0.18088241 [35,] 0.84553068 0.30893864 0.15446932 [36,] 0.81400266 0.37199467 0.18599734 [37,] 0.78079012 0.43841976 0.21920988 [38,] 0.94013149 0.11973703 0.05986851 [39,] 0.92487845 0.15024309 0.07512155 [40,] 0.94576188 0.10847624 0.05423812 [41,] 0.94155863 0.11688273 0.05844137 [42,] 0.92670745 0.14658511 0.07329255 [43,] 0.90768866 0.18462268 0.09231134 [44,] 0.89195232 0.21609536 0.10804768 [45,] 0.86814077 0.26371846 0.13185923 [46,] 0.85765556 0.28468887 0.14234444 [47,] 0.83307058 0.33385885 0.16692942 [48,] 0.86159067 0.27681867 0.13840933 [49,] 0.90459764 0.19080472 0.09540236 [50,] 0.89315696 0.21368607 0.10684304 [51,] 0.96386609 0.07226782 0.03613391 [52,] 0.95447834 0.09104332 0.04552166 [53,] 0.96308006 0.07383989 0.03691994 [54,] 0.95626476 0.08747048 0.04373524 [55,] 0.95015577 0.09968846 0.04984423 [56,] 0.93768527 0.12462946 0.06231473 [57,] 0.92291274 0.15417452 0.07708726 [58,] 0.91339254 0.17321492 0.08660746 [59,] 0.89351911 0.21296178 0.10648089 [60,] 0.87370626 0.25258748 0.12629374 [61,] 0.90778650 0.18442700 0.09221350 [62,] 0.89072318 0.21855365 0.10927682 [63,] 0.89575523 0.20848955 0.10424477 [64,] 0.88228975 0.23542049 0.11771025 [65,] 0.85929394 0.28141213 0.14070606 [66,] 0.84054032 0.31891935 0.15945968 [67,] 0.81896771 0.36206458 0.18103229 [68,] 0.80622009 0.38755981 0.19377991 [69,] 0.77812451 0.44375098 0.22187549 [70,] 0.76909040 0.46181920 0.23090960 [71,] 0.75239348 0.49521304 0.24760652 [72,] 0.71964931 0.56070138 0.28035069 [73,] 0.71173850 0.57652301 0.28826150 [74,] 0.68535235 0.62929531 0.31464765 [75,] 0.73489978 0.53020043 0.26510022 [76,] 0.69499022 0.61001957 0.30500978 [77,] 0.66891317 0.66217366 0.33108683 [78,] 0.67682822 0.64634356 0.32317178 [79,] 0.64240873 0.71518253 0.35759127 [80,] 0.59900376 0.80199247 0.40099624 [81,] 0.56253426 0.87493149 0.43746574 [82,] 0.55256084 0.89487832 0.44743916 [83,] 0.54696151 0.90607699 0.45303849 [84,] 0.50898782 0.98202436 0.49101218 [85,] 0.63938481 0.72123038 0.36061519 [86,] 0.63854333 0.72291334 0.36145667 [87,] 0.71987656 0.56024689 0.28012344 [88,] 0.68392817 0.63214365 0.31607183 [89,] 0.64848555 0.70302890 0.35151445 [90,] 0.60473655 0.79052691 0.39526345 [91,] 0.57985261 0.84029479 0.42014739 [92,] 0.53253750 0.93492499 0.46746250 [93,] 0.60899950 0.78200100 0.39100050 [94,] 0.60473569 0.79052862 0.39526431 [95,] 0.58306503 0.83386993 0.41693497 [96,] 0.56020894 0.87958213 0.43979106 [97,] 0.51452769 0.97094463 0.48547231 [98,] 0.48709577 0.97419154 0.51290423 [99,] 0.47322846 0.94645692 0.52677154 [100,] 0.44152326 0.88304651 0.55847674 [101,] 0.46650170 0.93300339 0.53349830 [102,] 0.45664762 0.91329524 0.54335238 [103,] 0.44968237 0.89936474 0.55031763 [104,] 0.41408726 0.82817451 0.58591274 [105,] 0.36571614 0.73143228 0.63428386 [106,] 0.32028034 0.64056069 0.67971966 [107,] 0.28398161 0.56796322 0.71601839 [108,] 0.24025449 0.48050898 0.75974551 [109,] 0.20915315 0.41830631 0.79084685 [110,] 0.17886308 0.35772615 0.82113692 [111,] 0.14528051 0.29056103 0.85471949 [112,] 0.15022671 0.30045343 0.84977329 [113,] 0.12366109 0.24732217 0.87633891 [114,] 0.09820082 0.19640165 0.90179918 [115,] 0.18705416 0.37410832 0.81294584 [116,] 0.15653954 0.31307908 0.84346046 [117,] 0.12915637 0.25831273 0.87084363 [118,] 0.10252484 0.20504968 0.89747516 [119,] 0.10719447 0.21438894 0.89280553 [120,] 0.08291305 0.16582610 0.91708695 [121,] 0.12159758 0.24319516 0.87840242 [122,] 0.09768900 0.19537799 0.90231100 [123,] 0.21502204 0.43004407 0.78497796 [124,] 0.21906932 0.43813864 0.78093068 [125,] 0.20142195 0.40284390 0.79857805 [126,] 0.17931607 0.35863214 0.82068393 [127,] 0.14018940 0.28037879 0.85981060 [128,] 0.16364088 0.32728176 0.83635912 [129,] 0.12779435 0.25558870 0.87220565 [130,] 0.09872327 0.19744653 0.90127673 [131,] 0.07219846 0.14439691 0.92780154 [132,] 0.06002001 0.12004002 0.93997999 [133,] 0.85877659 0.28244682 0.14122341 [134,] 0.97753554 0.04492891 0.02246446 [135,] 0.95756841 0.08486317 0.04243159 [136,] 0.92489955 0.15020090 0.07510045 [137,] 0.89344255 0.21311490 0.10655745 [138,] 0.87618920 0.24762161 0.12381080 [139,] 0.79418535 0.41162929 0.20581465 [140,] 0.68061731 0.63876538 0.31938269 [141,] 0.51559487 0.96881026 0.48440513 > postscript(file="/var/wessaorg/rcomp/tmp/1tney1353260895.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/2zvxz1353260895.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/303911353260895.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/4oq401353260895.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/5za0x1353260895.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.723203780 -1.071134895 -2.871210808 0.520201090 1.740205222 0.801189290 7 8 9 10 11 12 5.452579116 1.751180502 3.476886765 1.435858759 -3.235171577 -1.067838901 13 14 15 16 17 18 -1.933792092 1.372794224 -0.906419344 1.952059871 -3.386998044 -1.399868813 19 20 21 22 23 24 -2.733994286 3.092421301 -4.155625570 0.390012553 -7.151847206 1.245323980 25 26 27 28 29 30 -2.218128203 1.839675074 1.839675074 2.710839194 3.305104712 1.500976944 31 32 33 34 35 36 -2.247289313 0.015421052 2.925218449 -2.887317405 3.868234297 0.209369722 37 38 39 40 41 42 1.281871573 -0.950413948 0.253757403 -2.227920855 -3.862495983 2.234918985 43 44 45 46 47 48 -1.810796475 0.294114691 3.714728439 0.409847644 -0.909058305 7.473502286 49 50 51 52 53 54 -1.117971841 -3.502022216 -2.290655985 -0.336188661 -0.099711772 -1.436463924 55 56 57 58 59 60 0.846976586 -1.893091127 -1.392884450 3.272420114 -4.333120141 1.604695646 61 62 63 64 65 66 5.885132338 -0.556623753 -3.542445620 1.360197113 -1.514982738 -0.674683803 67 68 69 70 71 72 -0.990603714 -1.951357312 -0.109966483 -1.092172178 -4.187077371 -0.960981411 73 74 75 76 77 78 2.562957857 1.381893908 -0.796388961 -1.565850906 -1.541286441 -1.991747853 79 80 81 82 83 84 -0.075007636 -2.264714978 1.784560144 -0.076349982 2.084421328 -1.310223121 85 86 87 88 89 90 -3.815938374 -0.007643209 1.417918803 2.253059043 0.255319196 -0.337056511 91 92 93 94 95 96 -1.472877109 2.369548446 2.419466579 0.178635668 -4.784223675 -2.058074580 97 98 99 100 101 102 4.494038951 -0.668318161 -0.422146930 0.630863615 2.088971781 0.128756851 103 104 105 106 107 108 3.917706471 -2.030477153 -1.170687883 -1.201047284 1.036680976 2.774158300 109 110 111 112 113 114 2.763638410 -1.358795332 3.281742336 2.176984569 1.880251162 -1.593896214 115 116 117 118 119 120 0.463587311 -0.411265123 -1.621893258 0.108033459 0.417325575 -0.729343821 121 122 123 124 125 126 0.047481534 -2.962416380 -1.515274223 -0.945331702 4.562612461 -0.021095430 127 128 129 130 131 132 1.234985772 1.178264352 -3.171002381 0.301757413 -4.101720706 -0.368627660 133 134 135 136 137 138 -5.149603105 -2.165301239 0.832661326 4.204846107 0.333417358 -3.479251145 139 140 141 142 143 144 -0.798195928 1.321184723 2.085054205 -1.008085162 -9.550989840 3.583687638 145 146 147 148 149 150 0.181350186 1.607547209 1.913442483 2.162170158 -0.474189400 0.193692578 151 152 153 154 155 156 0.722765235 1.906427882 3.521862175 2.344890345 0.215701826 1.016857919 157 158 159 160 161 162 -2.573600933 -0.156862377 2.620185582 -0.169057689 -0.929282920 -0.908491748 > postscript(file="/var/wessaorg/rcomp/tmp/65h6a1353260895.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.723203780 NA 1 -1.071134895 1.723203780 2 -2.871210808 -1.071134895 3 0.520201090 -2.871210808 4 1.740205222 0.520201090 5 0.801189290 1.740205222 6 5.452579116 0.801189290 7 1.751180502 5.452579116 8 3.476886765 1.751180502 9 1.435858759 3.476886765 10 -3.235171577 1.435858759 11 -1.067838901 -3.235171577 12 -1.933792092 -1.067838901 13 1.372794224 -1.933792092 14 -0.906419344 1.372794224 15 1.952059871 -0.906419344 16 -3.386998044 1.952059871 17 -1.399868813 -3.386998044 18 -2.733994286 -1.399868813 19 3.092421301 -2.733994286 20 -4.155625570 3.092421301 21 0.390012553 -4.155625570 22 -7.151847206 0.390012553 23 1.245323980 -7.151847206 24 -2.218128203 1.245323980 25 1.839675074 -2.218128203 26 1.839675074 1.839675074 27 2.710839194 1.839675074 28 3.305104712 2.710839194 29 1.500976944 3.305104712 30 -2.247289313 1.500976944 31 0.015421052 -2.247289313 32 2.925218449 0.015421052 33 -2.887317405 2.925218449 34 3.868234297 -2.887317405 35 0.209369722 3.868234297 36 1.281871573 0.209369722 37 -0.950413948 1.281871573 38 0.253757403 -0.950413948 39 -2.227920855 0.253757403 40 -3.862495983 -2.227920855 41 2.234918985 -3.862495983 42 -1.810796475 2.234918985 43 0.294114691 -1.810796475 44 3.714728439 0.294114691 45 0.409847644 3.714728439 46 -0.909058305 0.409847644 47 7.473502286 -0.909058305 48 -1.117971841 7.473502286 49 -3.502022216 -1.117971841 50 -2.290655985 -3.502022216 51 -0.336188661 -2.290655985 52 -0.099711772 -0.336188661 53 -1.436463924 -0.099711772 54 0.846976586 -1.436463924 55 -1.893091127 0.846976586 56 -1.392884450 -1.893091127 57 3.272420114 -1.392884450 58 -4.333120141 3.272420114 59 1.604695646 -4.333120141 60 5.885132338 1.604695646 61 -0.556623753 5.885132338 62 -3.542445620 -0.556623753 63 1.360197113 -3.542445620 64 -1.514982738 1.360197113 65 -0.674683803 -1.514982738 66 -0.990603714 -0.674683803 67 -1.951357312 -0.990603714 68 -0.109966483 -1.951357312 69 -1.092172178 -0.109966483 70 -4.187077371 -1.092172178 71 -0.960981411 -4.187077371 72 2.562957857 -0.960981411 73 1.381893908 2.562957857 74 -0.796388961 1.381893908 75 -1.565850906 -0.796388961 76 -1.541286441 -1.565850906 77 -1.991747853 -1.541286441 78 -0.075007636 -1.991747853 79 -2.264714978 -0.075007636 80 1.784560144 -2.264714978 81 -0.076349982 1.784560144 82 2.084421328 -0.076349982 83 -1.310223121 2.084421328 84 -3.815938374 -1.310223121 85 -0.007643209 -3.815938374 86 1.417918803 -0.007643209 87 2.253059043 1.417918803 88 0.255319196 2.253059043 89 -0.337056511 0.255319196 90 -1.472877109 -0.337056511 91 2.369548446 -1.472877109 92 2.419466579 2.369548446 93 0.178635668 2.419466579 94 -4.784223675 0.178635668 95 -2.058074580 -4.784223675 96 4.494038951 -2.058074580 97 -0.668318161 4.494038951 98 -0.422146930 -0.668318161 99 0.630863615 -0.422146930 100 2.088971781 0.630863615 101 0.128756851 2.088971781 102 3.917706471 0.128756851 103 -2.030477153 3.917706471 104 -1.170687883 -2.030477153 105 -1.201047284 -1.170687883 106 1.036680976 -1.201047284 107 2.774158300 1.036680976 108 2.763638410 2.774158300 109 -1.358795332 2.763638410 110 3.281742336 -1.358795332 111 2.176984569 3.281742336 112 1.880251162 2.176984569 113 -1.593896214 1.880251162 114 0.463587311 -1.593896214 115 -0.411265123 0.463587311 116 -1.621893258 -0.411265123 117 0.108033459 -1.621893258 118 0.417325575 0.108033459 119 -0.729343821 0.417325575 120 0.047481534 -0.729343821 121 -2.962416380 0.047481534 122 -1.515274223 -2.962416380 123 -0.945331702 -1.515274223 124 4.562612461 -0.945331702 125 -0.021095430 4.562612461 126 1.234985772 -0.021095430 127 1.178264352 1.234985772 128 -3.171002381 1.178264352 129 0.301757413 -3.171002381 130 -4.101720706 0.301757413 131 -0.368627660 -4.101720706 132 -5.149603105 -0.368627660 133 -2.165301239 -5.149603105 134 0.832661326 -2.165301239 135 4.204846107 0.832661326 136 0.333417358 4.204846107 137 -3.479251145 0.333417358 138 -0.798195928 -3.479251145 139 1.321184723 -0.798195928 140 2.085054205 1.321184723 141 -1.008085162 2.085054205 142 -9.550989840 -1.008085162 143 3.583687638 -9.550989840 144 0.181350186 3.583687638 145 1.607547209 0.181350186 146 1.913442483 1.607547209 147 2.162170158 1.913442483 148 -0.474189400 2.162170158 149 0.193692578 -0.474189400 150 0.722765235 0.193692578 151 1.906427882 0.722765235 152 3.521862175 1.906427882 153 2.344890345 3.521862175 154 0.215701826 2.344890345 155 1.016857919 0.215701826 156 -2.573600933 1.016857919 157 -0.156862377 -2.573600933 158 2.620185582 -0.156862377 159 -0.169057689 2.620185582 160 -0.929282920 -0.169057689 161 -0.908491748 -0.929282920 162 NA -0.908491748 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -1.071134895 1.723203780 [2,] -2.871210808 -1.071134895 [3,] 0.520201090 -2.871210808 [4,] 1.740205222 0.520201090 [5,] 0.801189290 1.740205222 [6,] 5.452579116 0.801189290 [7,] 1.751180502 5.452579116 [8,] 3.476886765 1.751180502 [9,] 1.435858759 3.476886765 [10,] -3.235171577 1.435858759 [11,] -1.067838901 -3.235171577 [12,] -1.933792092 -1.067838901 [13,] 1.372794224 -1.933792092 [14,] -0.906419344 1.372794224 [15,] 1.952059871 -0.906419344 [16,] -3.386998044 1.952059871 [17,] -1.399868813 -3.386998044 [18,] -2.733994286 -1.399868813 [19,] 3.092421301 -2.733994286 [20,] -4.155625570 3.092421301 [21,] 0.390012553 -4.155625570 [22,] -7.151847206 0.390012553 [23,] 1.245323980 -7.151847206 [24,] -2.218128203 1.245323980 [25,] 1.839675074 -2.218128203 [26,] 1.839675074 1.839675074 [27,] 2.710839194 1.839675074 [28,] 3.305104712 2.710839194 [29,] 1.500976944 3.305104712 [30,] -2.247289313 1.500976944 [31,] 0.015421052 -2.247289313 [32,] 2.925218449 0.015421052 [33,] -2.887317405 2.925218449 [34,] 3.868234297 -2.887317405 [35,] 0.209369722 3.868234297 [36,] 1.281871573 0.209369722 [37,] -0.950413948 1.281871573 [38,] 0.253757403 -0.950413948 [39,] -2.227920855 0.253757403 [40,] -3.862495983 -2.227920855 [41,] 2.234918985 -3.862495983 [42,] -1.810796475 2.234918985 [43,] 0.294114691 -1.810796475 [44,] 3.714728439 0.294114691 [45,] 0.409847644 3.714728439 [46,] -0.909058305 0.409847644 [47,] 7.473502286 -0.909058305 [48,] -1.117971841 7.473502286 [49,] -3.502022216 -1.117971841 [50,] -2.290655985 -3.502022216 [51,] -0.336188661 -2.290655985 [52,] -0.099711772 -0.336188661 [53,] -1.436463924 -0.099711772 [54,] 0.846976586 -1.436463924 [55,] -1.893091127 0.846976586 [56,] -1.392884450 -1.893091127 [57,] 3.272420114 -1.392884450 [58,] -4.333120141 3.272420114 [59,] 1.604695646 -4.333120141 [60,] 5.885132338 1.604695646 [61,] -0.556623753 5.885132338 [62,] -3.542445620 -0.556623753 [63,] 1.360197113 -3.542445620 [64,] -1.514982738 1.360197113 [65,] -0.674683803 -1.514982738 [66,] -0.990603714 -0.674683803 [67,] -1.951357312 -0.990603714 [68,] -0.109966483 -1.951357312 [69,] -1.092172178 -0.109966483 [70,] -4.187077371 -1.092172178 [71,] -0.960981411 -4.187077371 [72,] 2.562957857 -0.960981411 [73,] 1.381893908 2.562957857 [74,] -0.796388961 1.381893908 [75,] -1.565850906 -0.796388961 [76,] -1.541286441 -1.565850906 [77,] -1.991747853 -1.541286441 [78,] -0.075007636 -1.991747853 [79,] -2.264714978 -0.075007636 [80,] 1.784560144 -2.264714978 [81,] -0.076349982 1.784560144 [82,] 2.084421328 -0.076349982 [83,] -1.310223121 2.084421328 [84,] -3.815938374 -1.310223121 [85,] -0.007643209 -3.815938374 [86,] 1.417918803 -0.007643209 [87,] 2.253059043 1.417918803 [88,] 0.255319196 2.253059043 [89,] -0.337056511 0.255319196 [90,] -1.472877109 -0.337056511 [91,] 2.369548446 -1.472877109 [92,] 2.419466579 2.369548446 [93,] 0.178635668 2.419466579 [94,] -4.784223675 0.178635668 [95,] -2.058074580 -4.784223675 [96,] 4.494038951 -2.058074580 [97,] -0.668318161 4.494038951 [98,] -0.422146930 -0.668318161 [99,] 0.630863615 -0.422146930 [100,] 2.088971781 0.630863615 [101,] 0.128756851 2.088971781 [102,] 3.917706471 0.128756851 [103,] -2.030477153 3.917706471 [104,] -1.170687883 -2.030477153 [105,] -1.201047284 -1.170687883 [106,] 1.036680976 -1.201047284 [107,] 2.774158300 1.036680976 [108,] 2.763638410 2.774158300 [109,] -1.358795332 2.763638410 [110,] 3.281742336 -1.358795332 [111,] 2.176984569 3.281742336 [112,] 1.880251162 2.176984569 [113,] -1.593896214 1.880251162 [114,] 0.463587311 -1.593896214 [115,] -0.411265123 0.463587311 [116,] -1.621893258 -0.411265123 [117,] 0.108033459 -1.621893258 [118,] 0.417325575 0.108033459 [119,] -0.729343821 0.417325575 [120,] 0.047481534 -0.729343821 [121,] -2.962416380 0.047481534 [122,] -1.515274223 -2.962416380 [123,] -0.945331702 -1.515274223 [124,] 4.562612461 -0.945331702 [125,] -0.021095430 4.562612461 [126,] 1.234985772 -0.021095430 [127,] 1.178264352 1.234985772 [128,] -3.171002381 1.178264352 [129,] 0.301757413 -3.171002381 [130,] -4.101720706 0.301757413 [131,] -0.368627660 -4.101720706 [132,] -5.149603105 -0.368627660 [133,] -2.165301239 -5.149603105 [134,] 0.832661326 -2.165301239 [135,] 4.204846107 0.832661326 [136,] 0.333417358 4.204846107 [137,] -3.479251145 0.333417358 [138,] -0.798195928 -3.479251145 [139,] 1.321184723 -0.798195928 [140,] 2.085054205 1.321184723 [141,] -1.008085162 2.085054205 [142,] -9.550989840 -1.008085162 [143,] 3.583687638 -9.550989840 [144,] 0.181350186 3.583687638 [145,] 1.607547209 0.181350186 [146,] 1.913442483 1.607547209 [147,] 2.162170158 1.913442483 [148,] -0.474189400 2.162170158 [149,] 0.193692578 -0.474189400 [150,] 0.722765235 0.193692578 [151,] 1.906427882 0.722765235 [152,] 3.521862175 1.906427882 [153,] 2.344890345 3.521862175 [154,] 0.215701826 2.344890345 [155,] 1.016857919 0.215701826 [156,] -2.573600933 1.016857919 [157,] -0.156862377 -2.573600933 [158,] 2.620185582 -0.156862377 [159,] -0.169057689 2.620185582 [160,] -0.929282920 -0.169057689 [161,] -0.908491748 -0.929282920 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -1.071134895 1.723203780 2 -2.871210808 -1.071134895 3 0.520201090 -2.871210808 4 1.740205222 0.520201090 5 0.801189290 1.740205222 6 5.452579116 0.801189290 7 1.751180502 5.452579116 8 3.476886765 1.751180502 9 1.435858759 3.476886765 10 -3.235171577 1.435858759 11 -1.067838901 -3.235171577 12 -1.933792092 -1.067838901 13 1.372794224 -1.933792092 14 -0.906419344 1.372794224 15 1.952059871 -0.906419344 16 -3.386998044 1.952059871 17 -1.399868813 -3.386998044 18 -2.733994286 -1.399868813 19 3.092421301 -2.733994286 20 -4.155625570 3.092421301 21 0.390012553 -4.155625570 22 -7.151847206 0.390012553 23 1.245323980 -7.151847206 24 -2.218128203 1.245323980 25 1.839675074 -2.218128203 26 1.839675074 1.839675074 27 2.710839194 1.839675074 28 3.305104712 2.710839194 29 1.500976944 3.305104712 30 -2.247289313 1.500976944 31 0.015421052 -2.247289313 32 2.925218449 0.015421052 33 -2.887317405 2.925218449 34 3.868234297 -2.887317405 35 0.209369722 3.868234297 36 1.281871573 0.209369722 37 -0.950413948 1.281871573 38 0.253757403 -0.950413948 39 -2.227920855 0.253757403 40 -3.862495983 -2.227920855 41 2.234918985 -3.862495983 42 -1.810796475 2.234918985 43 0.294114691 -1.810796475 44 3.714728439 0.294114691 45 0.409847644 3.714728439 46 -0.909058305 0.409847644 47 7.473502286 -0.909058305 48 -1.117971841 7.473502286 49 -3.502022216 -1.117971841 50 -2.290655985 -3.502022216 51 -0.336188661 -2.290655985 52 -0.099711772 -0.336188661 53 -1.436463924 -0.099711772 54 0.846976586 -1.436463924 55 -1.893091127 0.846976586 56 -1.392884450 -1.893091127 57 3.272420114 -1.392884450 58 -4.333120141 3.272420114 59 1.604695646 -4.333120141 60 5.885132338 1.604695646 61 -0.556623753 5.885132338 62 -3.542445620 -0.556623753 63 1.360197113 -3.542445620 64 -1.514982738 1.360197113 65 -0.674683803 -1.514982738 66 -0.990603714 -0.674683803 67 -1.951357312 -0.990603714 68 -0.109966483 -1.951357312 69 -1.092172178 -0.109966483 70 -4.187077371 -1.092172178 71 -0.960981411 -4.187077371 72 2.562957857 -0.960981411 73 1.381893908 2.562957857 74 -0.796388961 1.381893908 75 -1.565850906 -0.796388961 76 -1.541286441 -1.565850906 77 -1.991747853 -1.541286441 78 -0.075007636 -1.991747853 79 -2.264714978 -0.075007636 80 1.784560144 -2.264714978 81 -0.076349982 1.784560144 82 2.084421328 -0.076349982 83 -1.310223121 2.084421328 84 -3.815938374 -1.310223121 85 -0.007643209 -3.815938374 86 1.417918803 -0.007643209 87 2.253059043 1.417918803 88 0.255319196 2.253059043 89 -0.337056511 0.255319196 90 -1.472877109 -0.337056511 91 2.369548446 -1.472877109 92 2.419466579 2.369548446 93 0.178635668 2.419466579 94 -4.784223675 0.178635668 95 -2.058074580 -4.784223675 96 4.494038951 -2.058074580 97 -0.668318161 4.494038951 98 -0.422146930 -0.668318161 99 0.630863615 -0.422146930 100 2.088971781 0.630863615 101 0.128756851 2.088971781 102 3.917706471 0.128756851 103 -2.030477153 3.917706471 104 -1.170687883 -2.030477153 105 -1.201047284 -1.170687883 106 1.036680976 -1.201047284 107 2.774158300 1.036680976 108 2.763638410 2.774158300 109 -1.358795332 2.763638410 110 3.281742336 -1.358795332 111 2.176984569 3.281742336 112 1.880251162 2.176984569 113 -1.593896214 1.880251162 114 0.463587311 -1.593896214 115 -0.411265123 0.463587311 116 -1.621893258 -0.411265123 117 0.108033459 -1.621893258 118 0.417325575 0.108033459 119 -0.729343821 0.417325575 120 0.047481534 -0.729343821 121 -2.962416380 0.047481534 122 -1.515274223 -2.962416380 123 -0.945331702 -1.515274223 124 4.562612461 -0.945331702 125 -0.021095430 4.562612461 126 1.234985772 -0.021095430 127 1.178264352 1.234985772 128 -3.171002381 1.178264352 129 0.301757413 -3.171002381 130 -4.101720706 0.301757413 131 -0.368627660 -4.101720706 132 -5.149603105 -0.368627660 133 -2.165301239 -5.149603105 134 0.832661326 -2.165301239 135 4.204846107 0.832661326 136 0.333417358 4.204846107 137 -3.479251145 0.333417358 138 -0.798195928 -3.479251145 139 1.321184723 -0.798195928 140 2.085054205 1.321184723 141 -1.008085162 2.085054205 142 -9.550989840 -1.008085162 143 3.583687638 -9.550989840 144 0.181350186 3.583687638 145 1.607547209 0.181350186 146 1.913442483 1.607547209 147 2.162170158 1.913442483 148 -0.474189400 2.162170158 149 0.193692578 -0.474189400 150 0.722765235 0.193692578 151 1.906427882 0.722765235 152 3.521862175 1.906427882 153 2.344890345 3.521862175 154 0.215701826 2.344890345 155 1.016857919 0.215701826 156 -2.573600933 1.016857919 157 -0.156862377 -2.573600933 158 2.620185582 -0.156862377 159 -0.169057689 2.620185582 160 -0.929282920 -0.169057689 161 -0.908491748 -0.929282920 > 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/7wmnd1353260895.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/8pdw91353260895.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/90bb21353260895.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/wessaorg/rcomp/tmp/10wnpa1353260895.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/11kael1353260895.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/128ql41353260895.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/133pcc1353260895.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/149oi31353260895.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/1565hn1353260895.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/16p8h31353260896.tab") + } > > try(system("convert tmp/1tney1353260895.ps tmp/1tney1353260895.png",intern=TRUE)) character(0) > try(system("convert tmp/2zvxz1353260895.ps tmp/2zvxz1353260895.png",intern=TRUE)) character(0) > try(system("convert tmp/303911353260895.ps tmp/303911353260895.png",intern=TRUE)) character(0) > try(system("convert tmp/4oq401353260895.ps tmp/4oq401353260895.png",intern=TRUE)) character(0) > try(system("convert tmp/5za0x1353260895.ps tmp/5za0x1353260895.png",intern=TRUE)) character(0) > try(system("convert tmp/65h6a1353260895.ps tmp/65h6a1353260895.png",intern=TRUE)) character(0) > try(system("convert tmp/7wmnd1353260895.ps tmp/7wmnd1353260895.png",intern=TRUE)) character(0) > try(system("convert tmp/8pdw91353260895.ps tmp/8pdw91353260895.png",intern=TRUE)) character(0) > try(system("convert tmp/90bb21353260895.ps tmp/90bb21353260895.png",intern=TRUE)) character(0) > try(system("convert tmp/10wnpa1353260895.ps tmp/10wnpa1353260895.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 8.665 1.235 9.908