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 = '1' > par3 <- 'No Linear Trend' > par2 <- 'Do not include Seasonal Dummies' > par1 <- '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from 'package:base': as.Date, 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 G I1 I2 I3 E1 E2 E3 A 1 1 26 21 21 23 17 23 4 2 1 20 16 15 24 17 20 4 3 1 19 19 18 22 18 20 6 4 2 19 18 11 20 21 21 8 5 1 20 16 8 24 20 24 8 6 1 25 23 19 27 28 22 4 7 2 25 17 4 28 19 23 4 8 1 22 12 20 27 22 20 8 9 1 26 19 16 24 16 25 5 10 1 22 16 14 23 18 23 4 11 2 17 19 10 24 25 27 4 12 2 22 20 13 27 17 27 4 13 1 19 13 14 27 14 22 4 14 1 24 20 8 28 11 24 4 15 1 26 27 23 27 27 25 4 16 2 21 17 11 23 20 22 8 17 1 13 8 9 24 22 28 4 18 2 26 25 24 28 22 28 4 19 2 20 26 5 27 21 27 4 20 1 22 13 15 25 23 25 8 21 2 14 19 5 19 17 16 4 22 1 21 15 19 24 24 28 7 23 1 7 5 6 20 14 21 4 24 2 23 16 13 28 17 24 4 25 1 17 14 11 26 23 27 5 26 1 25 24 17 23 24 14 4 27 1 25 24 17 23 24 14 4 28 1 19 9 5 20 8 27 4 29 2 20 19 9 11 22 20 4 30 1 23 19 15 24 23 21 4 31 2 22 25 17 25 25 22 4 32 1 22 19 17 23 21 21 4 33 1 21 18 20 18 24 12 15 34 2 15 15 12 20 15 20 10 35 2 20 12 7 20 22 24 4 36 2 22 21 16 24 21 19 8 37 1 18 12 7 23 25 28 4 38 2 20 15 14 25 16 23 4 39 2 28 28 24 28 28 27 4 40 1 22 25 15 26 23 22 4 41 1 18 19 15 26 21 27 7 42 1 23 20 10 23 21 26 4 43 1 20 24 14 22 26 22 6 44 2 25 26 18 24 22 21 5 45 2 26 25 12 21 21 19 4 46 1 15 12 9 20 18 24 16 47 2 17 12 9 22 12 19 5 48 2 23 15 8 20 25 26 12 49 1 21 17 18 25 17 22 6 50 2 13 14 10 20 24 28 9 51 1 18 16 17 22 15 21 9 52 1 19 11 14 23 13 23 4 53 1 22 20 16 25 26 28 5 54 1 16 11 10 23 16 10 4 55 2 24 22 19 23 24 24 4 56 1 18 20 10 22 21 21 5 57 1 20 19 14 24 20 21 4 58 1 24 17 10 25 14 24 4 59 2 14 21 4 21 25 24 4 60 2 22 23 19 12 25 25 5 61 1 24 18 9 17 20 25 4 62 1 18 17 12 20 22 23 6 63 1 21 27 16 23 20 21 4 64 2 23 25 11 23 26 16 4 65 1 17 19 18 20 18 17 18 66 2 22 22 11 28 22 25 4 67 2 24 24 24 24 24 24 6 68 2 21 20 17 24 17 23 4 69 1 22 19 18 24 24 25 4 70 1 16 11 9 24 20 23 5 71 1 21 22 19 28 19 28 4 72 2 23 22 18 25 20 26 4 73 2 22 16 12 21 15 22 5 74 1 24 20 23 25 23 19 10 75 1 24 24 22 25 26 26 5 76 1 16 16 14 18 22 18 8 77 1 16 16 14 17 20 18 8 78 2 21 22 16 26 24 25 5 79 2 26 24 23 28 26 27 4 80 2 15 16 7 21 21 12 4 81 2 25 27 10 27 25 15 4 82 1 18 11 12 22 13 21 5 83 0 23 21 12 21 20 23 4 84 1 20 20 12 25 22 22 4 85 2 17 20 17 22 23 21 8 86 2 25 27 21 23 28 24 4 87 1 24 20 16 26 22 27 5 88 1 17 12 11 19 20 22 14 89 1 19 8 14 25 6 28 8 90 1 20 21 13 21 21 26 8 91 1 15 18 9 13 20 10 4 92 2 27 24 19 24 18 19 4 93 1 22 16 13 25 23 22 6 94 1 23 18 19 26 20 21 4 95 1 16 20 13 25 24 24 7 96 1 19 20 13 25 22 25 7 97 2 25 19 13 22 21 21 4 98 1 19 17 14 21 18 20 6 99 2 19 16 12 23 21 21 4 100 2 26 26 22 25 23 24 7 101 1 21 15 11 24 23 23 4 102 2 20 22 5 21 15 18 4 103 1 24 17 18 21 21 24 8 104 1 22 23 19 25 24 24 4 105 2 20 21 14 22 23 19 4 106 1 18 19 15 20 21 20 10 107 2 18 14 12 20 21 18 8 108 1 24 17 19 23 20 20 6 109 1 24 12 15 28 11 27 4 110 1 22 24 17 23 22 23 4 111 1 23 18 8 28 27 26 4 112 1 22 20 10 24 25 23 5 113 1 20 16 12 18 18 17 4 114 1 18 20 12 20 20 21 6 115 1 25 22 20 28 24 25 4 116 2 18 12 12 21 10 23 5 117 1 16 16 12 21 27 27 7 118 1 20 17 14 25 21 24 8 119 2 19 22 6 19 21 20 5 120 1 15 12 10 18 18 27 8 121 1 19 14 18 21 15 21 10 122 1 19 23 18 22 24 24 8 123 1 16 15 7 24 22 21 5 124 1 17 17 18 15 14 15 12 125 1 28 28 9 28 28 25 4 126 2 23 20 17 26 18 25 5 127 1 25 23 22 23 26 22 4 128 1 20 13 11 26 17 24 6 129 2 17 18 15 20 19 21 4 130 2 23 23 17 22 22 22 4 131 1 16 19 15 20 18 23 7 132 2 23 23 22 23 24 22 7 133 2 11 12 9 22 15 20 10 134 2 18 16 13 24 18 23 4 135 2 24 23 20 23 26 25 5 136 1 23 13 14 22 11 23 8 137 1 21 22 14 26 26 22 11 138 2 16 18 12 23 21 25 7 139 2 24 23 20 27 23 26 4 140 1 23 20 20 23 23 22 8 141 1 18 10 8 21 15 24 6 142 1 20 17 17 26 22 24 7 143 1 9 18 9 23 26 25 5 144 2 24 15 18 21 16 20 4 145 1 25 23 22 27 20 26 8 146 1 20 17 10 19 18 21 4 147 2 21 17 13 23 22 26 8 148 2 25 22 15 25 16 21 6 149 2 22 20 18 23 19 22 4 150 2 21 20 18 22 20 16 9 151 1 21 19 12 22 19 26 5 152 1 22 18 12 25 23 28 6 153 1 27 22 20 25 24 18 4 154 2 24 20 12 28 25 25 4 155 2 24 22 16 28 21 23 4 156 2 21 18 16 20 21 21 5 157 1 18 16 18 25 23 20 6 158 1 16 16 16 19 27 25 16 159 1 22 16 13 25 23 22 6 160 1 20 16 17 22 18 21 6 161 2 18 17 13 18 16 16 4 162 1 20 18 17 20 16 18 4 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) I1 I2 I3 E1 E2 1.4860146 -0.0025839 0.0428608 -0.0150766 -0.0118362 -0.0135082 E3 A 0.0007656 -0.0167601 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.5776 -0.3719 -0.2014 0.5142 0.8068 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1.4860146 0.3991125 3.723 0.000275 *** I1 -0.0025839 0.0155436 -0.166 0.868190 I2 0.0428608 0.0133994 3.199 0.001676 ** I3 -0.0150766 0.0104823 -1.438 0.152382 E1 -0.0118362 0.0150465 -0.787 0.432699 E2 -0.0135082 0.0115180 -1.173 0.242693 E3 0.0007656 0.0118528 0.065 0.948582 A -0.0167601 0.0165875 -1.010 0.313886 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.4838 on 154 degrees of freedom Multiple R-squared: 0.105, Adjusted R-squared: 0.06427 F-statistic: 2.58 on 7 and 154 DF, p-value: 0.01528 > 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.6597401 0.6805199 0.3402599 [2,] 0.6957172 0.6085656 0.3042828 [3,] 0.5817418 0.8365163 0.4182582 [4,] 0.5564906 0.8870187 0.4435094 [5,] 0.4524202 0.9048404 0.5475798 [6,] 0.4679635 0.9359269 0.5320365 [7,] 0.4734036 0.9468071 0.5265964 [8,] 0.6026481 0.7947039 0.3973519 [9,] 0.5255848 0.9488305 0.4744152 [10,] 0.4793741 0.9587482 0.5206259 [11,] 0.4389076 0.8778153 0.5610924 [12,] 0.3664528 0.7329057 0.6335472 [13,] 0.2952751 0.5905502 0.7047249 [14,] 0.4239021 0.8478042 0.5760979 [15,] 0.3938328 0.7876656 0.6061672 [16,] 0.3602301 0.7204602 0.6397699 [17,] 0.3147310 0.6294620 0.6852690 [18,] 0.2650052 0.5300104 0.7349948 [19,] 0.2707807 0.5415614 0.7292193 [20,] 0.2327069 0.4654139 0.7672931 [21,] 0.2269641 0.4539282 0.7730359 [22,] 0.1904769 0.3809538 0.8095231 [23,] 0.1547935 0.3095871 0.8452065 [24,] 0.1683363 0.3366725 0.8316637 [25,] 0.2157461 0.4314921 0.7842539 [26,] 0.2377171 0.4754343 0.7622829 [27,] 0.2311286 0.4622573 0.7688714 [28,] 0.3305864 0.6611728 0.6694136 [29,] 0.3340597 0.6681193 0.6659403 [30,] 0.3839829 0.7679658 0.6160171 [31,] 0.3976675 0.7953349 0.6023325 [32,] 0.4312428 0.8624856 0.5687572 [33,] 0.4713420 0.9426840 0.5286580 [34,] 0.4602084 0.9204167 0.5397916 [35,] 0.4262807 0.8525614 0.5737193 [36,] 0.4119434 0.8238867 0.5880566 [37,] 0.4621625 0.9243249 0.5378375 [38,] 0.5089737 0.9820526 0.4910263 [39,] 0.4692470 0.9384940 0.5307530 [40,] 0.5172641 0.9654718 0.4827359 [41,] 0.4816251 0.9632502 0.5183749 [42,] 0.4349551 0.8699103 0.5650449 [43,] 0.4154931 0.8309862 0.5845069 [44,] 0.3769948 0.7539895 0.6230052 [45,] 0.4032517 0.8065035 0.5967483 [46,] 0.4245306 0.8490611 0.5754694 [47,] 0.4117039 0.8234078 0.5882961 [48,] 0.4059578 0.8119156 0.5940422 [49,] 0.3805677 0.7611354 0.6194323 [50,] 0.3770788 0.7541575 0.6229212 [51,] 0.3993907 0.7987814 0.6006093 [52,] 0.3851129 0.7702257 0.6148871 [53,] 0.4511442 0.9022883 0.5488558 [54,] 0.4277676 0.8555352 0.5722324 [55,] 0.3979551 0.7959103 0.6020449 [56,] 0.3909283 0.7818566 0.6090717 [57,] 0.4256036 0.8512073 0.5743964 [58,] 0.4437991 0.8875981 0.5562009 [59,] 0.4159376 0.8318752 0.5840624 [60,] 0.3761173 0.7522346 0.6238827 [61,] 0.3776040 0.7552081 0.6223960 [62,] 0.3859121 0.7718241 0.6140879 [63,] 0.4175513 0.8351027 0.5824487 [64,] 0.3841970 0.7683940 0.6158030 [65,] 0.3725338 0.7450675 0.6274662 [66,] 0.3436117 0.6872235 0.6563883 [67,] 0.3178852 0.6357703 0.6821148 [68,] 0.3290844 0.6581688 0.6709156 [69,] 0.3541239 0.7082477 0.6458761 [70,] 0.3647684 0.7295368 0.6352316 [71,] 0.3299801 0.6599602 0.6700199 [72,] 0.2978975 0.5957950 0.7021025 [73,] 0.6991104 0.6017792 0.3008896 [74,] 0.6991883 0.6016234 0.3008117 [75,] 0.7258188 0.5483625 0.2741812 [76,] 0.7215804 0.5568393 0.2784196 [77,] 0.7036073 0.5927854 0.2963927 [78,] 0.6683130 0.6633741 0.3316870 [79,] 0.6345093 0.7309813 0.3654907 [80,] 0.6298089 0.7403822 0.3701911 [81,] 0.6536713 0.6926573 0.3463287 [82,] 0.6416800 0.7166400 0.3583200 [83,] 0.6064143 0.7871713 0.3935857 [84,] 0.5862201 0.8275598 0.4137799 [85,] 0.5714949 0.8570102 0.4285051 [86,] 0.5565754 0.8868491 0.4434246 [87,] 0.5769404 0.8461193 0.4230596 [88,] 0.5648339 0.8703321 0.4351661 [89,] 0.5986019 0.8027962 0.4013981 [90,] 0.6053356 0.7893288 0.3946644 [91,] 0.5706354 0.8587292 0.4293646 [92,] 0.5283318 0.9433365 0.4716682 [93,] 0.4845829 0.9691657 0.5154171 [94,] 0.4835454 0.9670907 0.5164546 [95,] 0.4801565 0.9603130 0.5198435 [96,] 0.4530220 0.9060440 0.5469780 [97,] 0.5455455 0.9089090 0.4544545 [98,] 0.5074969 0.9850062 0.4925031 [99,] 0.4942704 0.9885409 0.5057296 [100,] 0.5301143 0.9397715 0.4698857 [101,] 0.4968301 0.9936602 0.5031699 [102,] 0.4726753 0.9453506 0.5273247 [103,] 0.4595801 0.9191602 0.5404199 [104,] 0.4729084 0.9458168 0.5270916 [105,] 0.4680362 0.9360724 0.5319638 [106,] 0.4798221 0.9596442 0.5201779 [107,] 0.4318879 0.8637758 0.5681121 [108,] 0.3933710 0.7867421 0.6066290 [109,] 0.3776584 0.7553169 0.6223416 [110,] 0.3315373 0.6630746 0.6684627 [111,] 0.2981195 0.5962389 0.7018805 [112,] 0.2963614 0.5927227 0.7036386 [113,] 0.2662005 0.5324011 0.7337995 [114,] 0.2578329 0.5156658 0.7421671 [115,] 0.2927204 0.5854408 0.7072796 [116,] 0.2834359 0.5668718 0.7165641 [117,] 0.2910144 0.5820287 0.7089856 [118,] 0.2507698 0.5015395 0.7492302 [119,] 0.2369922 0.4739843 0.7630078 [120,] 0.2091843 0.4183685 0.7908157 [121,] 0.2257617 0.4515234 0.7742383 [122,] 0.2200771 0.4401542 0.7799229 [123,] 0.2849450 0.5698901 0.7150550 [124,] 0.3150265 0.6300531 0.6849735 [125,] 0.2878345 0.5756689 0.7121655 [126,] 0.2493887 0.4987773 0.7506113 [127,] 0.2382889 0.4765778 0.7617111 [128,] 0.2741620 0.5483240 0.7258380 [129,] 0.2974905 0.5949809 0.7025095 [130,] 0.2611557 0.5223113 0.7388443 [131,] 0.2152788 0.4305577 0.7847212 [132,] 0.1680089 0.3360177 0.8319911 [133,] 0.1250228 0.2500456 0.8749772 [134,] 0.2214833 0.4429665 0.7785167 [135,] 0.2028020 0.4056040 0.7971980 [136,] 0.2157752 0.4315504 0.7842248 [137,] 0.3684594 0.7369188 0.6315406 [138,] 0.2872188 0.5744376 0.7127812 [139,] 0.3412185 0.6824370 0.6587815 [140,] 0.2606348 0.5212697 0.7393652 [141,] 0.3108566 0.6217131 0.6891434 > postscript(file="/var/wessaorg/rcomp/tmp/15me11354891092.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/2d11z1354891092.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/3ounu1354891092.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/49arz1354891092.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/5mrbz1354891092.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 -0.45099819 -0.32852410 -0.39110457 0.59582694 -0.32955748 -0.37275645 7 8 9 10 11 12 0.54775670 0.09355952 -0.42710254 -0.33905774 0.56246524 0.50519692 13 14 15 16 17 18 -0.22414935 -0.63193413 -0.49711430 0.66509034 -0.03276861 0.54568236 19 20 21 22 23 24 0.17628471 -0.03867634 0.32050596 -0.08406045 -0.11497033 0.69335686 25 26 27 28 29 30 -0.19473817 -0.54102305 -0.54102305 -0.35612590 0.36610430 -0.36907132 31 32 33 34 35 36 0.43942031 -0.38035462 -0.12225280 0.68238709 0.73943998 0.59925521 37 38 39 40 41 42 -0.19275706 0.69529133 0.50408246 -0.60591295 -0.33964790 -0.52999547 43 44 45 46 47 48 -0.55659662 0.38455279 0.27529231 -0.09623748 0.67102034 0.80676023 49 50 51 52 53 54 -0.27974601 0.78861551 -0.27119247 -0.20004644 -0.33567777 -0.21762706 55 56 57 58 59 60 0.56461171 -0.53416299 -0.43242405 -0.46818285 0.34532082 0.41588754 61 62 63 64 65 66 -0.54052646 -0.37036290 -0.75440932 0.34597414 -0.21652646 0.47023051 67 68 69 70 71 72 0.59962949 0.53047308 -0.31597974 -0.16002744 -0.45456214 0.51505981 73 74 75 76 77 78 0.58411792 -0.17480748 -0.40996243 -0.28884095 -0.32769349 0.56313350 79 80 81 82 83 84 0.62826482 0.56259276 0.28494611 -0.22632835 -1.57758688 -0.46735100 85 86 87 88 89 90 0.64608581 0.43707760 -0.37194085 -0.07772550 -0.07913641 -0.49201011 91 92 93 94 95 96 -0.59964228 0.42125707 -0.22863520 -0.28275637 -0.38684448 -0.40687475 97 98 99 100 101 102 0.55525456 -0.37752553 0.66509316 0.50401078 -0.26463353 0.20255189 103 104 105 106 107 108 -0.23331748 -0.45974440 0.50023771 -0.35502558 0.78205947 -0.23853450 109 110 111 112 113 114 -0.18580888 -0.58268145 -0.33419703 -0.44765355 -0.42896610 -0.52443032 115 116 117 118 119 120 -0.35931238 0.67691898 -0.23959515 -0.25661446 0.28765007 -0.24121114 121 122 123 124 125 126 -0.16288658 -0.45104076 -0.33307608 -0.34304821 -0.72053486 0.58805036 127 128 129 130 131 132 -0.40188792 -0.20611783 0.55690860 0.45169258 -0.45329504 0.61620835 133 134 135 136 137 138 0.77907654 0.64736635 0.57983838 -0.24724445 -0.33714575 0.61883795 139 140 141 142 143 144 0.56913299 -0.28211055 -0.21413041 -0.20280050 -0.41045838 0.72088511 145 146 147 148 149 150 -0.37161398 -0.49320619 0.71919741 0.45831347 0.56407926 0.65156156 151 152 153 154 155 156 -0.48424177 -0.33402690 -0.38429403 0.61672088 0.53880416 0.62609718 157 158 159 160 161 162 -0.16205671 -0.05058897 -0.22863520 -0.27578057 0.51183120 -0.44341430 > postscript(file="/var/wessaorg/rcomp/tmp/6szlj1354891092.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 -0.45099819 NA 1 -0.32852410 -0.45099819 2 -0.39110457 -0.32852410 3 0.59582694 -0.39110457 4 -0.32955748 0.59582694 5 -0.37275645 -0.32955748 6 0.54775670 -0.37275645 7 0.09355952 0.54775670 8 -0.42710254 0.09355952 9 -0.33905774 -0.42710254 10 0.56246524 -0.33905774 11 0.50519692 0.56246524 12 -0.22414935 0.50519692 13 -0.63193413 -0.22414935 14 -0.49711430 -0.63193413 15 0.66509034 -0.49711430 16 -0.03276861 0.66509034 17 0.54568236 -0.03276861 18 0.17628471 0.54568236 19 -0.03867634 0.17628471 20 0.32050596 -0.03867634 21 -0.08406045 0.32050596 22 -0.11497033 -0.08406045 23 0.69335686 -0.11497033 24 -0.19473817 0.69335686 25 -0.54102305 -0.19473817 26 -0.54102305 -0.54102305 27 -0.35612590 -0.54102305 28 0.36610430 -0.35612590 29 -0.36907132 0.36610430 30 0.43942031 -0.36907132 31 -0.38035462 0.43942031 32 -0.12225280 -0.38035462 33 0.68238709 -0.12225280 34 0.73943998 0.68238709 35 0.59925521 0.73943998 36 -0.19275706 0.59925521 37 0.69529133 -0.19275706 38 0.50408246 0.69529133 39 -0.60591295 0.50408246 40 -0.33964790 -0.60591295 41 -0.52999547 -0.33964790 42 -0.55659662 -0.52999547 43 0.38455279 -0.55659662 44 0.27529231 0.38455279 45 -0.09623748 0.27529231 46 0.67102034 -0.09623748 47 0.80676023 0.67102034 48 -0.27974601 0.80676023 49 0.78861551 -0.27974601 50 -0.27119247 0.78861551 51 -0.20004644 -0.27119247 52 -0.33567777 -0.20004644 53 -0.21762706 -0.33567777 54 0.56461171 -0.21762706 55 -0.53416299 0.56461171 56 -0.43242405 -0.53416299 57 -0.46818285 -0.43242405 58 0.34532082 -0.46818285 59 0.41588754 0.34532082 60 -0.54052646 0.41588754 61 -0.37036290 -0.54052646 62 -0.75440932 -0.37036290 63 0.34597414 -0.75440932 64 -0.21652646 0.34597414 65 0.47023051 -0.21652646 66 0.59962949 0.47023051 67 0.53047308 0.59962949 68 -0.31597974 0.53047308 69 -0.16002744 -0.31597974 70 -0.45456214 -0.16002744 71 0.51505981 -0.45456214 72 0.58411792 0.51505981 73 -0.17480748 0.58411792 74 -0.40996243 -0.17480748 75 -0.28884095 -0.40996243 76 -0.32769349 -0.28884095 77 0.56313350 -0.32769349 78 0.62826482 0.56313350 79 0.56259276 0.62826482 80 0.28494611 0.56259276 81 -0.22632835 0.28494611 82 -1.57758688 -0.22632835 83 -0.46735100 -1.57758688 84 0.64608581 -0.46735100 85 0.43707760 0.64608581 86 -0.37194085 0.43707760 87 -0.07772550 -0.37194085 88 -0.07913641 -0.07772550 89 -0.49201011 -0.07913641 90 -0.59964228 -0.49201011 91 0.42125707 -0.59964228 92 -0.22863520 0.42125707 93 -0.28275637 -0.22863520 94 -0.38684448 -0.28275637 95 -0.40687475 -0.38684448 96 0.55525456 -0.40687475 97 -0.37752553 0.55525456 98 0.66509316 -0.37752553 99 0.50401078 0.66509316 100 -0.26463353 0.50401078 101 0.20255189 -0.26463353 102 -0.23331748 0.20255189 103 -0.45974440 -0.23331748 104 0.50023771 -0.45974440 105 -0.35502558 0.50023771 106 0.78205947 -0.35502558 107 -0.23853450 0.78205947 108 -0.18580888 -0.23853450 109 -0.58268145 -0.18580888 110 -0.33419703 -0.58268145 111 -0.44765355 -0.33419703 112 -0.42896610 -0.44765355 113 -0.52443032 -0.42896610 114 -0.35931238 -0.52443032 115 0.67691898 -0.35931238 116 -0.23959515 0.67691898 117 -0.25661446 -0.23959515 118 0.28765007 -0.25661446 119 -0.24121114 0.28765007 120 -0.16288658 -0.24121114 121 -0.45104076 -0.16288658 122 -0.33307608 -0.45104076 123 -0.34304821 -0.33307608 124 -0.72053486 -0.34304821 125 0.58805036 -0.72053486 126 -0.40188792 0.58805036 127 -0.20611783 -0.40188792 128 0.55690860 -0.20611783 129 0.45169258 0.55690860 130 -0.45329504 0.45169258 131 0.61620835 -0.45329504 132 0.77907654 0.61620835 133 0.64736635 0.77907654 134 0.57983838 0.64736635 135 -0.24724445 0.57983838 136 -0.33714575 -0.24724445 137 0.61883795 -0.33714575 138 0.56913299 0.61883795 139 -0.28211055 0.56913299 140 -0.21413041 -0.28211055 141 -0.20280050 -0.21413041 142 -0.41045838 -0.20280050 143 0.72088511 -0.41045838 144 -0.37161398 0.72088511 145 -0.49320619 -0.37161398 146 0.71919741 -0.49320619 147 0.45831347 0.71919741 148 0.56407926 0.45831347 149 0.65156156 0.56407926 150 -0.48424177 0.65156156 151 -0.33402690 -0.48424177 152 -0.38429403 -0.33402690 153 0.61672088 -0.38429403 154 0.53880416 0.61672088 155 0.62609718 0.53880416 156 -0.16205671 0.62609718 157 -0.05058897 -0.16205671 158 -0.22863520 -0.05058897 159 -0.27578057 -0.22863520 160 0.51183120 -0.27578057 161 -0.44341430 0.51183120 162 NA -0.44341430 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -0.32852410 -0.45099819 [2,] -0.39110457 -0.32852410 [3,] 0.59582694 -0.39110457 [4,] -0.32955748 0.59582694 [5,] -0.37275645 -0.32955748 [6,] 0.54775670 -0.37275645 [7,] 0.09355952 0.54775670 [8,] -0.42710254 0.09355952 [9,] -0.33905774 -0.42710254 [10,] 0.56246524 -0.33905774 [11,] 0.50519692 0.56246524 [12,] -0.22414935 0.50519692 [13,] -0.63193413 -0.22414935 [14,] -0.49711430 -0.63193413 [15,] 0.66509034 -0.49711430 [16,] -0.03276861 0.66509034 [17,] 0.54568236 -0.03276861 [18,] 0.17628471 0.54568236 [19,] -0.03867634 0.17628471 [20,] 0.32050596 -0.03867634 [21,] -0.08406045 0.32050596 [22,] -0.11497033 -0.08406045 [23,] 0.69335686 -0.11497033 [24,] -0.19473817 0.69335686 [25,] -0.54102305 -0.19473817 [26,] -0.54102305 -0.54102305 [27,] -0.35612590 -0.54102305 [28,] 0.36610430 -0.35612590 [29,] -0.36907132 0.36610430 [30,] 0.43942031 -0.36907132 [31,] -0.38035462 0.43942031 [32,] -0.12225280 -0.38035462 [33,] 0.68238709 -0.12225280 [34,] 0.73943998 0.68238709 [35,] 0.59925521 0.73943998 [36,] -0.19275706 0.59925521 [37,] 0.69529133 -0.19275706 [38,] 0.50408246 0.69529133 [39,] -0.60591295 0.50408246 [40,] -0.33964790 -0.60591295 [41,] -0.52999547 -0.33964790 [42,] -0.55659662 -0.52999547 [43,] 0.38455279 -0.55659662 [44,] 0.27529231 0.38455279 [45,] -0.09623748 0.27529231 [46,] 0.67102034 -0.09623748 [47,] 0.80676023 0.67102034 [48,] -0.27974601 0.80676023 [49,] 0.78861551 -0.27974601 [50,] -0.27119247 0.78861551 [51,] -0.20004644 -0.27119247 [52,] -0.33567777 -0.20004644 [53,] -0.21762706 -0.33567777 [54,] 0.56461171 -0.21762706 [55,] -0.53416299 0.56461171 [56,] -0.43242405 -0.53416299 [57,] -0.46818285 -0.43242405 [58,] 0.34532082 -0.46818285 [59,] 0.41588754 0.34532082 [60,] -0.54052646 0.41588754 [61,] -0.37036290 -0.54052646 [62,] -0.75440932 -0.37036290 [63,] 0.34597414 -0.75440932 [64,] -0.21652646 0.34597414 [65,] 0.47023051 -0.21652646 [66,] 0.59962949 0.47023051 [67,] 0.53047308 0.59962949 [68,] -0.31597974 0.53047308 [69,] -0.16002744 -0.31597974 [70,] -0.45456214 -0.16002744 [71,] 0.51505981 -0.45456214 [72,] 0.58411792 0.51505981 [73,] -0.17480748 0.58411792 [74,] -0.40996243 -0.17480748 [75,] -0.28884095 -0.40996243 [76,] -0.32769349 -0.28884095 [77,] 0.56313350 -0.32769349 [78,] 0.62826482 0.56313350 [79,] 0.56259276 0.62826482 [80,] 0.28494611 0.56259276 [81,] -0.22632835 0.28494611 [82,] -1.57758688 -0.22632835 [83,] -0.46735100 -1.57758688 [84,] 0.64608581 -0.46735100 [85,] 0.43707760 0.64608581 [86,] -0.37194085 0.43707760 [87,] -0.07772550 -0.37194085 [88,] -0.07913641 -0.07772550 [89,] -0.49201011 -0.07913641 [90,] -0.59964228 -0.49201011 [91,] 0.42125707 -0.59964228 [92,] -0.22863520 0.42125707 [93,] -0.28275637 -0.22863520 [94,] -0.38684448 -0.28275637 [95,] -0.40687475 -0.38684448 [96,] 0.55525456 -0.40687475 [97,] -0.37752553 0.55525456 [98,] 0.66509316 -0.37752553 [99,] 0.50401078 0.66509316 [100,] -0.26463353 0.50401078 [101,] 0.20255189 -0.26463353 [102,] -0.23331748 0.20255189 [103,] -0.45974440 -0.23331748 [104,] 0.50023771 -0.45974440 [105,] -0.35502558 0.50023771 [106,] 0.78205947 -0.35502558 [107,] -0.23853450 0.78205947 [108,] -0.18580888 -0.23853450 [109,] -0.58268145 -0.18580888 [110,] -0.33419703 -0.58268145 [111,] -0.44765355 -0.33419703 [112,] -0.42896610 -0.44765355 [113,] -0.52443032 -0.42896610 [114,] -0.35931238 -0.52443032 [115,] 0.67691898 -0.35931238 [116,] -0.23959515 0.67691898 [117,] -0.25661446 -0.23959515 [118,] 0.28765007 -0.25661446 [119,] -0.24121114 0.28765007 [120,] -0.16288658 -0.24121114 [121,] -0.45104076 -0.16288658 [122,] -0.33307608 -0.45104076 [123,] -0.34304821 -0.33307608 [124,] -0.72053486 -0.34304821 [125,] 0.58805036 -0.72053486 [126,] -0.40188792 0.58805036 [127,] -0.20611783 -0.40188792 [128,] 0.55690860 -0.20611783 [129,] 0.45169258 0.55690860 [130,] -0.45329504 0.45169258 [131,] 0.61620835 -0.45329504 [132,] 0.77907654 0.61620835 [133,] 0.64736635 0.77907654 [134,] 0.57983838 0.64736635 [135,] -0.24724445 0.57983838 [136,] -0.33714575 -0.24724445 [137,] 0.61883795 -0.33714575 [138,] 0.56913299 0.61883795 [139,] -0.28211055 0.56913299 [140,] -0.21413041 -0.28211055 [141,] -0.20280050 -0.21413041 [142,] -0.41045838 -0.20280050 [143,] 0.72088511 -0.41045838 [144,] -0.37161398 0.72088511 [145,] -0.49320619 -0.37161398 [146,] 0.71919741 -0.49320619 [147,] 0.45831347 0.71919741 [148,] 0.56407926 0.45831347 [149,] 0.65156156 0.56407926 [150,] -0.48424177 0.65156156 [151,] -0.33402690 -0.48424177 [152,] -0.38429403 -0.33402690 [153,] 0.61672088 -0.38429403 [154,] 0.53880416 0.61672088 [155,] 0.62609718 0.53880416 [156,] -0.16205671 0.62609718 [157,] -0.05058897 -0.16205671 [158,] -0.22863520 -0.05058897 [159,] -0.27578057 -0.22863520 [160,] 0.51183120 -0.27578057 [161,] -0.44341430 0.51183120 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -0.32852410 -0.45099819 2 -0.39110457 -0.32852410 3 0.59582694 -0.39110457 4 -0.32955748 0.59582694 5 -0.37275645 -0.32955748 6 0.54775670 -0.37275645 7 0.09355952 0.54775670 8 -0.42710254 0.09355952 9 -0.33905774 -0.42710254 10 0.56246524 -0.33905774 11 0.50519692 0.56246524 12 -0.22414935 0.50519692 13 -0.63193413 -0.22414935 14 -0.49711430 -0.63193413 15 0.66509034 -0.49711430 16 -0.03276861 0.66509034 17 0.54568236 -0.03276861 18 0.17628471 0.54568236 19 -0.03867634 0.17628471 20 0.32050596 -0.03867634 21 -0.08406045 0.32050596 22 -0.11497033 -0.08406045 23 0.69335686 -0.11497033 24 -0.19473817 0.69335686 25 -0.54102305 -0.19473817 26 -0.54102305 -0.54102305 27 -0.35612590 -0.54102305 28 0.36610430 -0.35612590 29 -0.36907132 0.36610430 30 0.43942031 -0.36907132 31 -0.38035462 0.43942031 32 -0.12225280 -0.38035462 33 0.68238709 -0.12225280 34 0.73943998 0.68238709 35 0.59925521 0.73943998 36 -0.19275706 0.59925521 37 0.69529133 -0.19275706 38 0.50408246 0.69529133 39 -0.60591295 0.50408246 40 -0.33964790 -0.60591295 41 -0.52999547 -0.33964790 42 -0.55659662 -0.52999547 43 0.38455279 -0.55659662 44 0.27529231 0.38455279 45 -0.09623748 0.27529231 46 0.67102034 -0.09623748 47 0.80676023 0.67102034 48 -0.27974601 0.80676023 49 0.78861551 -0.27974601 50 -0.27119247 0.78861551 51 -0.20004644 -0.27119247 52 -0.33567777 -0.20004644 53 -0.21762706 -0.33567777 54 0.56461171 -0.21762706 55 -0.53416299 0.56461171 56 -0.43242405 -0.53416299 57 -0.46818285 -0.43242405 58 0.34532082 -0.46818285 59 0.41588754 0.34532082 60 -0.54052646 0.41588754 61 -0.37036290 -0.54052646 62 -0.75440932 -0.37036290 63 0.34597414 -0.75440932 64 -0.21652646 0.34597414 65 0.47023051 -0.21652646 66 0.59962949 0.47023051 67 0.53047308 0.59962949 68 -0.31597974 0.53047308 69 -0.16002744 -0.31597974 70 -0.45456214 -0.16002744 71 0.51505981 -0.45456214 72 0.58411792 0.51505981 73 -0.17480748 0.58411792 74 -0.40996243 -0.17480748 75 -0.28884095 -0.40996243 76 -0.32769349 -0.28884095 77 0.56313350 -0.32769349 78 0.62826482 0.56313350 79 0.56259276 0.62826482 80 0.28494611 0.56259276 81 -0.22632835 0.28494611 82 -1.57758688 -0.22632835 83 -0.46735100 -1.57758688 84 0.64608581 -0.46735100 85 0.43707760 0.64608581 86 -0.37194085 0.43707760 87 -0.07772550 -0.37194085 88 -0.07913641 -0.07772550 89 -0.49201011 -0.07913641 90 -0.59964228 -0.49201011 91 0.42125707 -0.59964228 92 -0.22863520 0.42125707 93 -0.28275637 -0.22863520 94 -0.38684448 -0.28275637 95 -0.40687475 -0.38684448 96 0.55525456 -0.40687475 97 -0.37752553 0.55525456 98 0.66509316 -0.37752553 99 0.50401078 0.66509316 100 -0.26463353 0.50401078 101 0.20255189 -0.26463353 102 -0.23331748 0.20255189 103 -0.45974440 -0.23331748 104 0.50023771 -0.45974440 105 -0.35502558 0.50023771 106 0.78205947 -0.35502558 107 -0.23853450 0.78205947 108 -0.18580888 -0.23853450 109 -0.58268145 -0.18580888 110 -0.33419703 -0.58268145 111 -0.44765355 -0.33419703 112 -0.42896610 -0.44765355 113 -0.52443032 -0.42896610 114 -0.35931238 -0.52443032 115 0.67691898 -0.35931238 116 -0.23959515 0.67691898 117 -0.25661446 -0.23959515 118 0.28765007 -0.25661446 119 -0.24121114 0.28765007 120 -0.16288658 -0.24121114 121 -0.45104076 -0.16288658 122 -0.33307608 -0.45104076 123 -0.34304821 -0.33307608 124 -0.72053486 -0.34304821 125 0.58805036 -0.72053486 126 -0.40188792 0.58805036 127 -0.20611783 -0.40188792 128 0.55690860 -0.20611783 129 0.45169258 0.55690860 130 -0.45329504 0.45169258 131 0.61620835 -0.45329504 132 0.77907654 0.61620835 133 0.64736635 0.77907654 134 0.57983838 0.64736635 135 -0.24724445 0.57983838 136 -0.33714575 -0.24724445 137 0.61883795 -0.33714575 138 0.56913299 0.61883795 139 -0.28211055 0.56913299 140 -0.21413041 -0.28211055 141 -0.20280050 -0.21413041 142 -0.41045838 -0.20280050 143 0.72088511 -0.41045838 144 -0.37161398 0.72088511 145 -0.49320619 -0.37161398 146 0.71919741 -0.49320619 147 0.45831347 0.71919741 148 0.56407926 0.45831347 149 0.65156156 0.56407926 150 -0.48424177 0.65156156 151 -0.33402690 -0.48424177 152 -0.38429403 -0.33402690 153 0.61672088 -0.38429403 154 0.53880416 0.61672088 155 0.62609718 0.53880416 156 -0.16205671 0.62609718 157 -0.05058897 -0.16205671 158 -0.22863520 -0.05058897 159 -0.27578057 -0.22863520 160 0.51183120 -0.27578057 161 -0.44341430 0.51183120 > 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/7m5mv1354891092.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/831gj1354891093.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/9mjx91354891093.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/10pyrk1354891093.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/11733v1354891093.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/12ayv91354891093.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/136hvk1354891093.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/14zhj41354891093.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/15r3ko1354891093.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/16nstw1354891093.tab") + } > > try(system("convert tmp/15me11354891092.ps tmp/15me11354891092.png",intern=TRUE)) character(0) > try(system("convert tmp/2d11z1354891092.ps tmp/2d11z1354891092.png",intern=TRUE)) character(0) > try(system("convert tmp/3ounu1354891092.ps tmp/3ounu1354891092.png",intern=TRUE)) character(0) > try(system("convert tmp/49arz1354891092.ps tmp/49arz1354891092.png",intern=TRUE)) character(0) > try(system("convert tmp/5mrbz1354891092.ps tmp/5mrbz1354891092.png",intern=TRUE)) character(0) > try(system("convert tmp/6szlj1354891092.ps tmp/6szlj1354891092.png",intern=TRUE)) character(0) > try(system("convert tmp/7m5mv1354891092.ps tmp/7m5mv1354891092.png",intern=TRUE)) character(0) > try(system("convert tmp/831gj1354891093.ps tmp/831gj1354891093.png",intern=TRUE)) character(0) > try(system("convert tmp/9mjx91354891093.ps tmp/9mjx91354891093.png",intern=TRUE)) character(0) > try(system("convert tmp/10pyrk1354891093.ps tmp/10pyrk1354891093.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 8.740 1.257 10.111