R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-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(12 + ,13 + ,12 + ,53 + ,32 + ,41 + ,38 + ,11 + ,16 + ,11 + ,86 + ,51 + ,39 + ,32 + ,14 + ,19 + ,15 + ,66 + ,42 + ,30 + ,35 + ,12 + ,15 + ,6 + ,67 + ,41 + ,31 + ,33 + ,21 + ,14 + ,13 + ,76 + ,46 + ,34 + ,37 + ,12 + ,13 + ,10 + ,78 + ,47 + ,35 + ,29 + ,22 + ,19 + ,12 + ,53 + ,37 + ,39 + ,31 + ,11 + ,15 + ,14 + ,80 + ,49 + ,34 + ,36 + ,10 + ,14 + ,12 + ,74 + ,45 + ,36 + ,35 + ,13 + ,15 + ,6 + ,76 + ,47 + ,37 + ,38 + ,10 + ,16 + ,10 + ,79 + ,49 + ,38 + ,31 + ,8 + ,16 + ,12 + ,54 + ,33 + ,36 + ,34 + ,15 + ,16 + ,12 + ,67 + ,42 + ,38 + ,35 + ,14 + ,16 + ,11 + ,54 + ,33 + ,39 + ,38 + ,10 + ,17 + ,15 + ,87 + ,53 + ,33 + ,37 + ,14 + ,15 + ,12 + ,58 + ,36 + ,32 + ,33 + ,14 + ,15 + ,10 + ,75 + ,45 + ,36 + ,32 + ,11 + ,20 + ,12 + ,88 + ,54 + ,38 + ,38 + ,10 + ,18 + ,11 + ,64 + ,41 + ,39 + ,38 + ,13 + ,16 + ,12 + ,57 + ,36 + ,32 + ,32 + ,7 + ,16 + ,11 + ,66 + ,41 + ,32 + ,33 + ,14 + ,16 + ,12 + ,68 + ,44 + ,31 + ,31 + ,12 + ,19 + ,13 + ,54 + ,33 + ,39 + ,38 + ,14 + ,16 + ,11 + ,56 + ,37 + ,37 + ,39 + ,11 + ,17 + ,9 + ,86 + ,52 + ,39 + ,32 + ,9 + ,17 + ,13 + ,80 + ,47 + ,41 + ,32 + ,11 + ,16 + ,10 + ,76 + ,43 + ,36 + ,35 + ,15 + ,15 + ,14 + ,69 + ,44 + ,33 + ,37 + ,14 + ,16 + ,12 + ,78 + ,45 + ,33 + ,33 + ,13 + ,14 + ,10 + ,67 + ,44 + ,34 + ,33 + ,9 + ,15 + ,12 + ,80 + ,49 + ,31 + ,28 + ,15 + ,12 + ,8 + ,54 + ,33 + ,27 + ,32 + ,10 + ,14 + ,10 + ,71 + ,43 + ,37 + ,31 + ,11 + ,16 + ,12 + ,84 + ,54 + ,34 + ,37 + ,13 + ,14 + ,12 + ,74 + ,42 + ,34 + ,30 + ,8 + ,7 + ,7 + ,71 + ,44 + ,32 + ,33 + ,20 + ,10 + ,6 + ,63 + ,37 + ,29 + ,31 + ,12 + ,14 + ,12 + ,71 + ,43 + ,36 + ,33 + ,10 + ,16 + ,10 + ,76 + ,46 + ,29 + ,31 + ,10 + ,16 + ,10 + ,69 + ,42 + ,35 + ,33 + ,9 + ,16 + ,10 + ,74 + ,45 + ,37 + ,32 + ,14 + ,14 + ,12 + ,75 + ,44 + ,34 + ,33 + ,8 + ,20 + ,15 + ,54 + ,33 + ,38 + ,32 + ,14 + ,14 + ,10 + ,52 + ,31 + ,35 + ,33 + ,11 + ,14 + ,10 + ,69 + ,42 + ,38 + ,28 + ,13 + ,11 + ,12 + ,68 + ,40 + ,37 + ,35 + ,9 + ,14 + ,13 + ,65 + ,43 + ,38 + ,39 + ,11 + ,15 + ,11 + ,75 + ,46 + ,33 + ,34 + ,15 + ,16 + ,11 + ,74 + ,42 + ,36 + ,38 + ,11 + ,14 + ,12 + ,75 + ,45 + ,38 + ,32 + ,10 + ,16 + ,14 + ,72 + ,44 + ,32 + ,38 + ,14 + ,14 + ,10 + ,67 + ,40 + ,32 + ,30 + ,18 + ,12 + ,12 + ,63 + ,37 + ,32 + ,33 + ,14 + ,16 + ,13 + ,62 + ,46 + ,34 + ,38 + ,11 + ,9 + ,5 + ,63 + ,36 + ,32 + ,32 + ,12 + ,14 + ,6 + ,76 + ,47 + ,37 + ,32 + ,13 + ,16 + ,12 + ,74 + ,45 + ,39 + ,34 + ,9 + ,16 + ,12 + ,67 + ,42 + ,29 + ,34 + ,10 + ,15 + ,11 + ,73 + ,43 + ,37 + ,36 + ,15 + ,16 + ,10 + ,70 + ,43 + ,35 + ,34 + ,20 + ,12 + ,7 + ,53 + ,32 + ,30 + ,28 + ,12 + ,16 + ,12 + ,77 + ,45 + ,38 + ,34 + ,12 + ,16 + ,14 + ,77 + ,45 + ,34 + ,35 + ,14 + ,14 + ,11 + ,52 + ,31 + ,31 + ,35 + ,13 + ,16 + ,12 + ,54 + ,33 + ,34 + ,31 + ,11 + ,17 + ,13 + ,80 + ,49 + ,35 + ,37 + ,17 + ,18 + ,14 + ,66 + ,42 + ,36 + ,35 + ,12 + ,18 + ,11 + ,73 + ,41 + ,30 + ,27 + ,13 + ,12 + ,12 + ,63 + ,38 + ,39 + ,40 + ,14 + ,16 + ,12 + ,69 + ,42 + ,35 + ,37 + ,13 + ,10 + ,8 + ,67 + ,44 + ,38 + ,36 + ,15 + ,14 + ,11 + ,54 + ,33 + ,31 + ,38 + ,13 + ,18 + ,14 + ,81 + ,48 + ,34 + ,39 + ,10 + ,18 + ,14 + ,69 + ,40 + ,38 + ,41 + ,11 + ,16 + ,12 + ,84 + ,50 + ,34 + ,27 + ,19 + ,17 + ,9 + ,80 + ,49 + ,39 + ,30 + ,13 + ,16 + ,13 + ,70 + ,43 + ,37 + ,37 + ,17 + ,16 + ,11 + ,69 + ,44 + ,34 + ,31 + ,13 + ,13 + ,12 + ,77 + ,47 + ,28 + ,31 + ,9 + ,16 + ,12 + ,54 + ,33 + ,37 + ,27 + ,11 + ,16 + ,12 + ,79 + ,46 + ,33 + ,36 + ,10 + ,20 + ,12 + ,30 + ,0 + ,37 + ,38 + ,9 + ,16 + ,12 + ,71 + ,45 + ,35 + ,37 + ,12 + ,15 + ,12 + ,73 + ,43 + ,37 + ,33 + ,12 + ,15 + ,11 + ,72 + ,44 + ,32 + ,34 + ,13 + ,16 + ,10 + ,77 + ,47 + ,33 + ,31 + ,13 + ,14 + ,9 + ,75 + ,45 + ,38 + ,39 + ,12 + ,16 + ,12 + ,69 + ,42 + ,33 + ,34 + ,15 + ,16 + ,12 + ,54 + ,33 + ,29 + ,32 + ,22 + ,15 + ,12 + ,70 + ,43 + ,33 + ,33 + ,13 + ,12 + ,9 + ,73 + ,46 + ,31 + ,36 + ,15 + ,17 + ,15 + ,54 + ,33 + ,36 + ,32 + ,13 + ,16 + ,12 + ,77 + ,46 + ,35 + ,41 + ,15 + ,15 + ,12 + ,82 + ,48 + ,32 + ,28 + ,10 + ,13 + ,12 + ,80 + ,47 + ,29 + ,30 + ,11 + ,16 + ,10 + ,80 + ,47 + ,39 + ,36 + ,16 + ,16 + ,13 + ,69 + ,43 + ,37 + ,35 + ,11 + ,16 + ,9 + ,78 + ,46 + ,35 + ,31 + ,11 + ,16 + ,12 + ,81 + ,48 + ,37 + ,34 + ,10 + ,14 + ,10 + ,76 + ,46 + ,32 + ,36 + ,10 + ,16 + ,14 + ,76 + ,45 + ,38 + ,36 + ,16 + ,16 + ,11 + ,73 + ,45 + ,37 + ,35 + ,12 + ,20 + ,15 + ,85 + ,52 + ,36 + ,37 + ,11 + ,15 + ,11 + ,66 + ,42 + ,32 + ,28 + ,16 + ,16 + ,11 + ,79 + ,47 + ,33 + ,39 + ,19 + ,13 + ,12 + ,68 + ,41 + ,40 + ,32 + ,11 + ,17 + ,12 + ,76 + ,47 + ,38 + ,35 + ,16 + ,16 + ,12 + ,71 + ,43 + ,41 + ,39 + ,15 + ,16 + ,11 + ,54 + ,33 + ,36 + ,35 + ,24 + ,12 + ,7 + ,46 + ,30 + ,43 + ,42 + ,14 + ,16 + ,12 + ,82 + ,49 + ,30 + ,34 + ,15 + ,16 + ,14 + ,74 + ,44 + ,31 + ,33 + ,11 + ,17 + ,11 + ,88 + ,55 + ,32 + ,41 + ,15 + ,13 + ,11 + ,38 + ,11 + ,32 + ,33 + ,12 + ,12 + ,10 + ,76 + ,47 + ,37 + ,34 + ,10 + ,18 + ,13 + ,86 + ,53 + ,37 + ,32 + ,14 + ,14 + ,13 + ,54 + ,33 + ,33 + ,40 + ,13 + ,14 + ,8 + ,70 + ,44 + ,34 + ,40 + ,9 + ,13 + ,11 + ,69 + ,42 + ,33 + ,35 + ,15 + ,16 + ,12 + ,90 + ,55 + ,38 + ,36 + ,15 + ,13 + ,11 + ,54 + ,33 + ,33 + ,37 + ,14 + ,16 + ,13 + ,76 + ,46 + ,31 + ,27 + ,11 + ,13 + ,12 + ,89 + ,54 + ,38 + ,39 + ,8 + ,16 + ,14 + ,76 + ,47 + ,37 + ,38 + ,11 + ,15 + ,13 + ,73 + ,45 + ,33 + ,31 + ,11 + ,16 + ,15 + ,79 + ,47 + ,31 + ,33 + ,8 + ,15 + ,10 + ,90 + ,55 + ,39 + ,32 + ,10 + ,17 + ,11 + ,74 + ,44 + ,44 + ,39 + ,11 + ,15 + ,9 + ,81 + ,53 + ,33 + ,36 + ,13 + ,12 + ,11 + ,72 + ,44 + ,35 + ,33 + ,11 + ,16 + ,10 + ,71 + ,42 + ,32 + ,33 + ,20 + ,10 + ,11 + ,66 + ,40 + ,28 + ,32 + ,10 + ,16 + ,8 + ,77 + ,46 + ,40 + ,37 + ,15 + ,12 + ,11 + ,65 + ,40 + ,27 + ,30 + ,12 + ,14 + ,12 + ,74 + ,46 + ,37 + ,38 + ,14 + ,15 + ,12 + ,82 + ,53 + ,32 + ,29 + ,23 + ,13 + ,9 + ,54 + ,33 + ,28 + ,22 + ,14 + ,15 + ,11 + ,63 + ,42 + ,34 + ,35 + ,16 + ,11 + ,10 + ,54 + ,35 + ,30 + ,35 + ,11 + ,12 + ,8 + ,64 + ,40 + ,35 + ,34 + ,12 + ,8 + ,9 + ,69 + ,41 + ,31 + ,35 + ,10 + ,16 + ,8 + ,54 + ,33 + ,32 + ,34 + ,14 + ,15 + ,9 + ,84 + ,51 + ,30 + ,34 + ,12 + ,17 + ,15 + ,86 + ,53 + ,30 + ,35 + ,12 + ,16 + ,11 + ,77 + ,46 + ,31 + ,23 + ,11 + ,10 + ,8 + ,89 + ,55 + ,40 + ,31 + ,12 + ,18 + ,13 + ,76 + ,47 + ,32 + ,27 + ,13 + ,13 + ,12 + ,60 + ,38 + ,36 + ,36 + ,11 + ,16 + ,12 + ,75 + ,46 + ,32 + ,31 + ,19 + ,13 + ,9 + ,73 + ,46 + ,35 + ,32 + ,12 + ,10 + ,7 + ,85 + ,53 + ,38 + ,39 + ,17 + ,15 + ,13 + ,79 + ,47 + ,42 + ,37 + ,9 + ,16 + ,9 + ,71 + ,41 + ,34 + ,38 + ,12 + ,16 + ,6 + ,72 + ,44 + ,35 + ,39 + ,19 + ,14 + ,8 + ,69 + ,43 + ,35 + ,34 + ,18 + ,10 + ,8 + ,78 + ,51 + ,33 + ,31 + ,15 + ,17 + ,15 + ,54 + ,33 + ,36 + ,32 + ,14 + ,13 + ,6 + ,69 + ,43 + ,32 + ,37 + ,11 + ,15 + ,9 + ,81 + ,53 + ,33 + ,36 + ,9 + ,16 + ,11 + ,84 + ,51 + ,34 + ,32 + ,18 + ,12 + ,8 + ,84 + ,50 + ,32 + ,35 + ,16 + ,13 + ,8 + ,69 + ,46 + ,34 + ,36) + ,dim=c(7 + ,162) + ,dimnames=list(c('CESDS' + ,'PCL' + ,'PCC' + ,'PBS' + ,'PBSA' + ,'ATC' + ,'ATS') + ,1:162)) > y <- array(NA,dim=c(7,162),dimnames=list(c('CESDS','PCL','PCC','PBS','PBSA','ATC','ATS'),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' > #'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 > 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 CESDS PCL PCC PBS PBSA ATC ATS 1 12 13 12 53 32 41 38 2 11 16 11 86 51 39 32 3 14 19 15 66 42 30 35 4 12 15 6 67 41 31 33 5 21 14 13 76 46 34 37 6 12 13 10 78 47 35 29 7 22 19 12 53 37 39 31 8 11 15 14 80 49 34 36 9 10 14 12 74 45 36 35 10 13 15 6 76 47 37 38 11 10 16 10 79 49 38 31 12 8 16 12 54 33 36 34 13 15 16 12 67 42 38 35 14 14 16 11 54 33 39 38 15 10 17 15 87 53 33 37 16 14 15 12 58 36 32 33 17 14 15 10 75 45 36 32 18 11 20 12 88 54 38 38 19 10 18 11 64 41 39 38 20 13 16 12 57 36 32 32 21 7 16 11 66 41 32 33 22 14 16 12 68 44 31 31 23 12 19 13 54 33 39 38 24 14 16 11 56 37 37 39 25 11 17 9 86 52 39 32 26 9 17 13 80 47 41 32 27 11 16 10 76 43 36 35 28 15 15 14 69 44 33 37 29 14 16 12 78 45 33 33 30 13 14 10 67 44 34 33 31 9 15 12 80 49 31 28 32 15 12 8 54 33 27 32 33 10 14 10 71 43 37 31 34 11 16 12 84 54 34 37 35 13 14 12 74 42 34 30 36 8 7 7 71 44 32 33 37 20 10 6 63 37 29 31 38 12 14 12 71 43 36 33 39 10 16 10 76 46 29 31 40 10 16 10 69 42 35 33 41 9 16 10 74 45 37 32 42 14 14 12 75 44 34 33 43 8 20 15 54 33 38 32 44 14 14 10 52 31 35 33 45 11 14 10 69 42 38 28 46 13 11 12 68 40 37 35 47 9 14 13 65 43 38 39 48 11 15 11 75 46 33 34 49 15 16 11 74 42 36 38 50 11 14 12 75 45 38 32 51 10 16 14 72 44 32 38 52 14 14 10 67 40 32 30 53 18 12 12 63 37 32 33 54 14 16 13 62 46 34 38 55 11 9 5 63 36 32 32 56 12 14 6 76 47 37 32 57 13 16 12 74 45 39 34 58 9 16 12 67 42 29 34 59 10 15 11 73 43 37 36 60 15 16 10 70 43 35 34 61 20 12 7 53 32 30 28 62 12 16 12 77 45 38 34 63 12 16 14 77 45 34 35 64 14 14 11 52 31 31 35 65 13 16 12 54 33 34 31 66 11 17 13 80 49 35 37 67 17 18 14 66 42 36 35 68 12 18 11 73 41 30 27 69 13 12 12 63 38 39 40 70 14 16 12 69 42 35 37 71 13 10 8 67 44 38 36 72 15 14 11 54 33 31 38 73 13 18 14 81 48 34 39 74 10 18 14 69 40 38 41 75 11 16 12 84 50 34 27 76 19 17 9 80 49 39 30 77 13 16 13 70 43 37 37 78 17 16 11 69 44 34 31 79 13 13 12 77 47 28 31 80 9 16 12 54 33 37 27 81 11 16 12 79 46 33 36 82 10 20 12 30 0 37 38 83 9 16 12 71 45 35 37 84 12 15 12 73 43 37 33 85 12 15 11 72 44 32 34 86 13 16 10 77 47 33 31 87 13 14 9 75 45 38 39 88 12 16 12 69 42 33 34 89 15 16 12 54 33 29 32 90 22 15 12 70 43 33 33 91 13 12 9 73 46 31 36 92 15 17 15 54 33 36 32 93 13 16 12 77 46 35 41 94 15 15 12 82 48 32 28 95 10 13 12 80 47 29 30 96 11 16 10 80 47 39 36 97 16 16 13 69 43 37 35 98 11 16 9 78 46 35 31 99 11 16 12 81 48 37 34 100 10 14 10 76 46 32 36 101 10 16 14 76 45 38 36 102 16 16 11 73 45 37 35 103 12 20 15 85 52 36 37 104 11 15 11 66 42 32 28 105 16 16 11 79 47 33 39 106 19 13 12 68 41 40 32 107 11 17 12 76 47 38 35 108 16 16 12 71 43 41 39 109 15 16 11 54 33 36 35 110 24 12 7 46 30 43 42 111 14 16 12 82 49 30 34 112 15 16 14 74 44 31 33 113 11 17 11 88 55 32 41 114 15 13 11 38 11 32 33 115 12 12 10 76 47 37 34 116 10 18 13 86 53 37 32 117 14 14 13 54 33 33 40 118 13 14 8 70 44 34 40 119 9 13 11 69 42 33 35 120 15 16 12 90 55 38 36 121 15 13 11 54 33 33 37 122 14 16 13 76 46 31 27 123 11 13 12 89 54 38 39 124 8 16 14 76 47 37 38 125 11 15 13 73 45 33 31 126 11 16 15 79 47 31 33 127 8 15 10 90 55 39 32 128 10 17 11 74 44 44 39 129 11 15 9 81 53 33 36 130 13 12 11 72 44 35 33 131 11 16 10 71 42 32 33 132 20 10 11 66 40 28 32 133 10 16 8 77 46 40 37 134 15 12 11 65 40 27 30 135 12 14 12 74 46 37 38 136 14 15 12 82 53 32 29 137 23 13 9 54 33 28 22 138 14 15 11 63 42 34 35 139 16 11 10 54 35 30 35 140 11 12 8 64 40 35 34 141 12 8 9 69 41 31 35 142 10 16 8 54 33 32 34 143 14 15 9 84 51 30 34 144 12 17 15 86 53 30 35 145 12 16 11 77 46 31 23 146 11 10 8 89 55 40 31 147 12 18 13 76 47 32 27 148 13 13 12 60 38 36 36 149 11 16 12 75 46 32 31 150 19 13 9 73 46 35 32 151 12 10 7 85 53 38 39 152 17 15 13 79 47 42 37 153 9 16 9 71 41 34 38 154 12 16 6 72 44 35 39 155 19 14 8 69 43 35 34 156 18 10 8 78 51 33 31 157 15 17 15 54 33 36 32 158 14 13 6 69 43 32 37 159 11 15 9 81 53 33 36 160 9 16 11 84 51 34 32 161 18 12 8 84 50 32 35 162 16 13 8 69 46 34 36 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) PCL PCC PBS PBSA ATC 25.70538 -0.24077 -0.02191 -0.20575 0.20150 -0.03240 ATS -0.05725 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -7.1986 -1.6676 -0.4623 1.2658 8.8653 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 25.70538 3.36503 7.639 2.12e-12 *** PCL -0.24077 0.12814 -1.879 0.06212 . PCC -0.02191 0.13142 -0.167 0.86784 PBS -0.20575 0.06961 -2.956 0.00361 ** PBSA 0.20150 0.10189 1.978 0.04974 * ATC -0.03240 0.07693 -0.421 0.67422 ATS -0.05725 0.07153 -0.800 0.42477 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 2.982 on 155 degrees of freedom Multiple R-squared: 0.1463, Adjusted R-squared: 0.1132 F-statistic: 4.426 on 6 and 155 DF, p-value: 0.0003682 > 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.9833152 0.03336951 0.01668475 [2,] 0.9801164 0.03976728 0.01988364 [3,] 0.9772045 0.04559108 0.02279554 [4,] 0.9584909 0.08301826 0.04150913 [5,] 0.9442979 0.11140424 0.05570212 [6,] 0.9313269 0.13734619 0.06867309 [7,] 0.8955067 0.20898667 0.10449334 [8,] 0.8978590 0.20428204 0.10214102 [9,] 0.8542100 0.29157994 0.14578997 [10,] 0.8883016 0.22339688 0.11169844 [11,] 0.8512850 0.29743002 0.14871501 [12,] 0.9275105 0.14497891 0.07248945 [13,] 0.9051735 0.18965303 0.09482652 [14,] 0.8774919 0.24501615 0.12250808 [15,] 0.8510094 0.29798123 0.14899062 [16,] 0.8065329 0.38693427 0.19346713 [17,] 0.7627028 0.47459437 0.23729718 [18,] 0.7653699 0.46926028 0.23463014 [19,] 0.7153579 0.56928412 0.28464206 [20,] 0.7536359 0.49272821 0.24636411 [21,] 0.7197412 0.56051753 0.28025877 [22,] 0.7241733 0.55165345 0.27582673 [23,] 0.6885726 0.62285490 0.31142745 [24,] 0.6639173 0.67216540 0.33608270 [25,] 0.6367076 0.72658480 0.36329240 [26,] 0.6053814 0.78923726 0.39461863 [27,] 0.6988694 0.60226114 0.30113057 [28,] 0.8656494 0.26870128 0.13435064 [29,] 0.8343074 0.33138512 0.16569256 [30,] 0.8227383 0.35452350 0.17726175 [31,] 0.8110710 0.37785810 0.18892905 [32,] 0.8076463 0.38470731 0.19235365 [33,] 0.7866805 0.42663893 0.21331946 [34,] 0.8381212 0.32375766 0.16187883 [35,] 0.8062709 0.38745825 0.19372913 [36,] 0.7832698 0.43346043 0.21673021 [37,] 0.7451781 0.50964374 0.25482187 [38,] 0.7941831 0.41163385 0.20581693 [39,] 0.7642516 0.47149684 0.23574842 [40,] 0.7689871 0.46202583 0.23101292 [41,] 0.7370065 0.52598701 0.26299351 [42,] 0.7248309 0.55033816 0.27516908 [43,] 0.6870509 0.62589825 0.31294912 [44,] 0.7309152 0.53816967 0.26908484 [45,] 0.6950749 0.60985021 0.30492511 [46,] 0.7058719 0.58825625 0.29412813 [47,] 0.6696743 0.66065140 0.33032570 [48,] 0.6336471 0.73270571 0.36635285 [49,] 0.6811647 0.63767058 0.31883529 [50,] 0.6601278 0.67974435 0.33987218 [51,] 0.6456412 0.70871767 0.35435884 [52,] 0.7125272 0.57494554 0.28747277 [53,] 0.6724396 0.65512084 0.32756042 [54,] 0.6286883 0.74262342 0.37131171 [55,] 0.5855462 0.82890767 0.41445384 [56,] 0.5494331 0.90113382 0.45056691 [57,] 0.5028906 0.99421873 0.49710937 [58,] 0.5528696 0.89426082 0.44713041 [59,] 0.5059601 0.98807977 0.49403989 [60,] 0.4630693 0.92613864 0.53693068 [61,] 0.4266915 0.85338307 0.57330846 [62,] 0.4022975 0.80459495 0.59770252 [63,] 0.3582417 0.71648334 0.64175833 [64,] 0.3381505 0.67630105 0.66184947 [65,] 0.3092084 0.61841683 0.69079158 [66,] 0.2716652 0.54333042 0.72833479 [67,] 0.4861604 0.97232086 0.51383957 [68,] 0.4419373 0.88387467 0.55806267 [69,] 0.4643530 0.92870590 0.53564705 [70,] 0.4193659 0.83873186 0.58063407 [71,] 0.5374587 0.92508265 0.46254133 [72,] 0.4925073 0.98501459 0.50749270 [73,] 0.4552158 0.91043168 0.54478416 [74,] 0.4882175 0.97643504 0.51178248 [75,] 0.4458543 0.89170851 0.55414574 [76,] 0.4050728 0.81014556 0.59492722 [77,] 0.3616429 0.72328574 0.63835713 [78,] 0.3213542 0.64270833 0.67864583 [79,] 0.2851962 0.57039239 0.71480380 [80,] 0.2490845 0.49816900 0.75091550 [81,] 0.5862938 0.82741235 0.41370617 [82,] 0.5436126 0.91277479 0.45638740 [83,] 0.5047249 0.99055029 0.49527515 [84,] 0.4701956 0.94039123 0.52980439 [85,] 0.4692068 0.93841362 0.53079319 [86,] 0.4582053 0.91641054 0.54179473 [87,] 0.4121543 0.82430860 0.58784570 [88,] 0.4113162 0.82263234 0.58868383 [89,] 0.3713242 0.74264846 0.62867577 [90,] 0.3284726 0.65694520 0.67152740 [91,] 0.3185677 0.63713535 0.68143233 [92,] 0.2932974 0.58659472 0.70670264 [93,] 0.3038755 0.60775095 0.69612452 [94,] 0.2818375 0.56367493 0.71816254 [95,] 0.2961038 0.59220760 0.70389620 [96,] 0.3681508 0.73630151 0.63184925 [97,] 0.4556382 0.91127631 0.54436184 [98,] 0.4117624 0.82352477 0.58823762 [99,] 0.4479326 0.89586517 0.55206742 [100,] 0.4027395 0.80547906 0.59726047 [101,] 0.7560805 0.48783893 0.24391947 [102,] 0.7370666 0.52586673 0.26293337 [103,] 0.7312079 0.53758415 0.26879208 [104,] 0.6974065 0.60518695 0.30259347 [105,] 0.6567903 0.68641941 0.34320971 [106,] 0.6213996 0.75720076 0.37860038 [107,] 0.5727056 0.85458873 0.42729437 [108,] 0.5239053 0.95218948 0.47609474 [109,] 0.4740609 0.94812180 0.52593910 [110,] 0.5455175 0.90896496 0.45448248 [111,] 0.6359189 0.72816225 0.36408112 [112,] 0.5832948 0.83341049 0.41670525 [113,] 0.5351289 0.92974219 0.46487109 [114,] 0.4811027 0.96220546 0.51889727 [115,] 0.4829316 0.96586320 0.51706840 [116,] 0.4604061 0.92081217 0.53959391 [117,] 0.4080028 0.81600562 0.59199719 [118,] 0.4256805 0.85136104 0.57431948 [119,] 0.3729927 0.74598532 0.62700734 [120,] 0.3320121 0.66402426 0.66798787 [121,] 0.2914239 0.58284779 0.70857611 [122,] 0.2518940 0.50378795 0.74810603 [123,] 0.2976942 0.59538836 0.70230582 [124,] 0.2556785 0.51135703 0.74432148 [125,] 0.2077993 0.41559855 0.79220073 [126,] 0.1648971 0.32979430 0.83510285 [127,] 0.1286618 0.25732368 0.87133816 [128,] 0.3019807 0.60396139 0.69801931 [129,] 0.2453553 0.49071052 0.75464474 [130,] 0.1968270 0.39365404 0.80317298 [131,] 0.2031607 0.40632134 0.79683933 [132,] 0.2226848 0.44536966 0.77731517 [133,] 0.2618144 0.52362884 0.73818558 [134,] 0.2201009 0.44020187 0.77989906 [135,] 0.1759081 0.35181619 0.82409190 [136,] 0.1367050 0.27340991 0.86329504 [137,] 0.4733829 0.94676570 0.52661715 [138,] 0.3896317 0.77926344 0.61036828 [139,] 0.3417819 0.68356385 0.65821808 [140,] 0.2641365 0.52827301 0.73586350 [141,] 0.1938262 0.38765234 0.80617383 [142,] 0.4708681 0.94173628 0.52913186 [143,] 0.3513026 0.70260526 0.64869737 > postscript(file="/var/wessaorg/rcomp/tmp/19kpp1322167162.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/28io11322167162.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/3l2wq1322167162.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/4bmfx1322167162.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/5i5jf1322167162.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 -2.35202835 -0.09868999 1.28989497 -1.54517740 8.53781686 -0.98424390 7 8 9 10 11 12 7.61955017 -1.03826089 -2.74377895 0.57819159 -2.24749378 -6.01645481 13 14 15 16 17 18 1.96681851 0.28782632 -0.87572493 -0.22558284 1.48719378 1.00436776 19 20 21 22 23 24 -2.78515443 -1.24780935 -6.36822898 0.31377173 -0.94604793 -0.11424487 25 26 27 28 29 30 -0.10323474 -2.17779616 -0.49153396 1.73084222 2.34907654 -1.20564015 31 32 33 34 35 36 -3.63724443 -0.47325979 -3.19842018 -0.96857276 0.50970332 -7.19855186 37 38 39 40 41 42 5.05468501 -1.07251658 -2.55183736 -2.87718350 -3.44538593 1.48418409 43 44 45 46 47 48 -5.03734387 -0.63994911 -2.54775716 -0.66067778 -4.87684158 -1.67511407 49 50 51 52 53 54 3.49211256 -1.64496564 -2.38628545 0.36383987 3.87935577 -0.80391647 55 56 57 58 59 60 -3.85203950 -1.00605819 0.77771891 -4.38203158 -2.23800791 2.18430951 61 62 63 64 65 66 4.36880367 0.36257336 0.33402935 -0.63315237 -1.25299478 -0.48897673 67 68 69 70 71 72 4.22162032 0.14529627 -0.69462167 1.39561328 -1.91119661 0.54708002 73 74 75 76 77 78 2.26304937 -1.34983571 -0.73501658 7.15227775 0.48656636 3.59481896 79 80 81 82 83 84 -0.25849439 -5.38477906 -0.47493769 -1.08035692 -3.79739847 -0.38784142 85 86 87 88 89 90 -0.92175935 0.58201091 0.69004214 -0.84092669 0.64224954 8.86530206 91 92 93 94 95 96 -0.80305113 1.17554081 1.46459179 3.00816423 -2.66608550 -0.32009984 97 98 99 100 101 102 3.16632197 -0.96783727 -0.45133555 -2.64994722 -1.68487424 3.54250722 103 104 105 106 107 108 1.73379256 -3.09673738 4.47339083 5.54482232 -0.94817037 3.91450676 109 110 111 112 113 114 1.01888594 8.55420700 2.32610819 2.70658548 0.03597930 1.19356101 115 116 117 118 119 120 -1.28548592 -1.04114656 -0.22981514 -0.23147187 -4.52790043 4.13678725 121 122 123 124 125 126 0.31386297 1.34969482 -0.41803474 -4.00579189 -2.01304020 -0.84726577 127 128 129 130 131 132 -3.34438062 -1.35367626 -1.78045780 -0.60411899 -1.56288149 5.20179899 133 134 135 136 137 138 -1.69001418 0.33069720 -0.74114439 1.05788562 7.24935394 -0.24846675 139 140 141 142 143 144 0.19571035 -3.45258249 -2.63886501 -4.23367897 2.02811306 0.70682945 145 146 147 148 149 150 -0.71735033 -1.82264696 -0.33786677 -1.39729180 -1.61657649 5.33833650 151 152 153 154 155 156 -0.87137886 5.45354153 -3.03224939 -0.40708285 5.45320363 3.49330230 157 158 159 160 161 162 1.17554081 0.24315878 -1.78045780 -2.67219530 5.60744513 1.69000949 > postscript(file="/var/wessaorg/rcomp/tmp/635mx1322167162.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 -2.35202835 NA 1 -0.09868999 -2.35202835 2 1.28989497 -0.09868999 3 -1.54517740 1.28989497 4 8.53781686 -1.54517740 5 -0.98424390 8.53781686 6 7.61955017 -0.98424390 7 -1.03826089 7.61955017 8 -2.74377895 -1.03826089 9 0.57819159 -2.74377895 10 -2.24749378 0.57819159 11 -6.01645481 -2.24749378 12 1.96681851 -6.01645481 13 0.28782632 1.96681851 14 -0.87572493 0.28782632 15 -0.22558284 -0.87572493 16 1.48719378 -0.22558284 17 1.00436776 1.48719378 18 -2.78515443 1.00436776 19 -1.24780935 -2.78515443 20 -6.36822898 -1.24780935 21 0.31377173 -6.36822898 22 -0.94604793 0.31377173 23 -0.11424487 -0.94604793 24 -0.10323474 -0.11424487 25 -2.17779616 -0.10323474 26 -0.49153396 -2.17779616 27 1.73084222 -0.49153396 28 2.34907654 1.73084222 29 -1.20564015 2.34907654 30 -3.63724443 -1.20564015 31 -0.47325979 -3.63724443 32 -3.19842018 -0.47325979 33 -0.96857276 -3.19842018 34 0.50970332 -0.96857276 35 -7.19855186 0.50970332 36 5.05468501 -7.19855186 37 -1.07251658 5.05468501 38 -2.55183736 -1.07251658 39 -2.87718350 -2.55183736 40 -3.44538593 -2.87718350 41 1.48418409 -3.44538593 42 -5.03734387 1.48418409 43 -0.63994911 -5.03734387 44 -2.54775716 -0.63994911 45 -0.66067778 -2.54775716 46 -4.87684158 -0.66067778 47 -1.67511407 -4.87684158 48 3.49211256 -1.67511407 49 -1.64496564 3.49211256 50 -2.38628545 -1.64496564 51 0.36383987 -2.38628545 52 3.87935577 0.36383987 53 -0.80391647 3.87935577 54 -3.85203950 -0.80391647 55 -1.00605819 -3.85203950 56 0.77771891 -1.00605819 57 -4.38203158 0.77771891 58 -2.23800791 -4.38203158 59 2.18430951 -2.23800791 60 4.36880367 2.18430951 61 0.36257336 4.36880367 62 0.33402935 0.36257336 63 -0.63315237 0.33402935 64 -1.25299478 -0.63315237 65 -0.48897673 -1.25299478 66 4.22162032 -0.48897673 67 0.14529627 4.22162032 68 -0.69462167 0.14529627 69 1.39561328 -0.69462167 70 -1.91119661 1.39561328 71 0.54708002 -1.91119661 72 2.26304937 0.54708002 73 -1.34983571 2.26304937 74 -0.73501658 -1.34983571 75 7.15227775 -0.73501658 76 0.48656636 7.15227775 77 3.59481896 0.48656636 78 -0.25849439 3.59481896 79 -5.38477906 -0.25849439 80 -0.47493769 -5.38477906 81 -1.08035692 -0.47493769 82 -3.79739847 -1.08035692 83 -0.38784142 -3.79739847 84 -0.92175935 -0.38784142 85 0.58201091 -0.92175935 86 0.69004214 0.58201091 87 -0.84092669 0.69004214 88 0.64224954 -0.84092669 89 8.86530206 0.64224954 90 -0.80305113 8.86530206 91 1.17554081 -0.80305113 92 1.46459179 1.17554081 93 3.00816423 1.46459179 94 -2.66608550 3.00816423 95 -0.32009984 -2.66608550 96 3.16632197 -0.32009984 97 -0.96783727 3.16632197 98 -0.45133555 -0.96783727 99 -2.64994722 -0.45133555 100 -1.68487424 -2.64994722 101 3.54250722 -1.68487424 102 1.73379256 3.54250722 103 -3.09673738 1.73379256 104 4.47339083 -3.09673738 105 5.54482232 4.47339083 106 -0.94817037 5.54482232 107 3.91450676 -0.94817037 108 1.01888594 3.91450676 109 8.55420700 1.01888594 110 2.32610819 8.55420700 111 2.70658548 2.32610819 112 0.03597930 2.70658548 113 1.19356101 0.03597930 114 -1.28548592 1.19356101 115 -1.04114656 -1.28548592 116 -0.22981514 -1.04114656 117 -0.23147187 -0.22981514 118 -4.52790043 -0.23147187 119 4.13678725 -4.52790043 120 0.31386297 4.13678725 121 1.34969482 0.31386297 122 -0.41803474 1.34969482 123 -4.00579189 -0.41803474 124 -2.01304020 -4.00579189 125 -0.84726577 -2.01304020 126 -3.34438062 -0.84726577 127 -1.35367626 -3.34438062 128 -1.78045780 -1.35367626 129 -0.60411899 -1.78045780 130 -1.56288149 -0.60411899 131 5.20179899 -1.56288149 132 -1.69001418 5.20179899 133 0.33069720 -1.69001418 134 -0.74114439 0.33069720 135 1.05788562 -0.74114439 136 7.24935394 1.05788562 137 -0.24846675 7.24935394 138 0.19571035 -0.24846675 139 -3.45258249 0.19571035 140 -2.63886501 -3.45258249 141 -4.23367897 -2.63886501 142 2.02811306 -4.23367897 143 0.70682945 2.02811306 144 -0.71735033 0.70682945 145 -1.82264696 -0.71735033 146 -0.33786677 -1.82264696 147 -1.39729180 -0.33786677 148 -1.61657649 -1.39729180 149 5.33833650 -1.61657649 150 -0.87137886 5.33833650 151 5.45354153 -0.87137886 152 -3.03224939 5.45354153 153 -0.40708285 -3.03224939 154 5.45320363 -0.40708285 155 3.49330230 5.45320363 156 1.17554081 3.49330230 157 0.24315878 1.17554081 158 -1.78045780 0.24315878 159 -2.67219530 -1.78045780 160 5.60744513 -2.67219530 161 1.69000949 5.60744513 162 NA 1.69000949 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -0.09868999 -2.35202835 [2,] 1.28989497 -0.09868999 [3,] -1.54517740 1.28989497 [4,] 8.53781686 -1.54517740 [5,] -0.98424390 8.53781686 [6,] 7.61955017 -0.98424390 [7,] -1.03826089 7.61955017 [8,] -2.74377895 -1.03826089 [9,] 0.57819159 -2.74377895 [10,] -2.24749378 0.57819159 [11,] -6.01645481 -2.24749378 [12,] 1.96681851 -6.01645481 [13,] 0.28782632 1.96681851 [14,] -0.87572493 0.28782632 [15,] -0.22558284 -0.87572493 [16,] 1.48719378 -0.22558284 [17,] 1.00436776 1.48719378 [18,] -2.78515443 1.00436776 [19,] -1.24780935 -2.78515443 [20,] -6.36822898 -1.24780935 [21,] 0.31377173 -6.36822898 [22,] -0.94604793 0.31377173 [23,] -0.11424487 -0.94604793 [24,] -0.10323474 -0.11424487 [25,] -2.17779616 -0.10323474 [26,] -0.49153396 -2.17779616 [27,] 1.73084222 -0.49153396 [28,] 2.34907654 1.73084222 [29,] -1.20564015 2.34907654 [30,] -3.63724443 -1.20564015 [31,] -0.47325979 -3.63724443 [32,] -3.19842018 -0.47325979 [33,] -0.96857276 -3.19842018 [34,] 0.50970332 -0.96857276 [35,] -7.19855186 0.50970332 [36,] 5.05468501 -7.19855186 [37,] -1.07251658 5.05468501 [38,] -2.55183736 -1.07251658 [39,] -2.87718350 -2.55183736 [40,] -3.44538593 -2.87718350 [41,] 1.48418409 -3.44538593 [42,] -5.03734387 1.48418409 [43,] -0.63994911 -5.03734387 [44,] -2.54775716 -0.63994911 [45,] -0.66067778 -2.54775716 [46,] -4.87684158 -0.66067778 [47,] -1.67511407 -4.87684158 [48,] 3.49211256 -1.67511407 [49,] -1.64496564 3.49211256 [50,] -2.38628545 -1.64496564 [51,] 0.36383987 -2.38628545 [52,] 3.87935577 0.36383987 [53,] -0.80391647 3.87935577 [54,] -3.85203950 -0.80391647 [55,] -1.00605819 -3.85203950 [56,] 0.77771891 -1.00605819 [57,] -4.38203158 0.77771891 [58,] -2.23800791 -4.38203158 [59,] 2.18430951 -2.23800791 [60,] 4.36880367 2.18430951 [61,] 0.36257336 4.36880367 [62,] 0.33402935 0.36257336 [63,] -0.63315237 0.33402935 [64,] -1.25299478 -0.63315237 [65,] -0.48897673 -1.25299478 [66,] 4.22162032 -0.48897673 [67,] 0.14529627 4.22162032 [68,] -0.69462167 0.14529627 [69,] 1.39561328 -0.69462167 [70,] -1.91119661 1.39561328 [71,] 0.54708002 -1.91119661 [72,] 2.26304937 0.54708002 [73,] -1.34983571 2.26304937 [74,] -0.73501658 -1.34983571 [75,] 7.15227775 -0.73501658 [76,] 0.48656636 7.15227775 [77,] 3.59481896 0.48656636 [78,] -0.25849439 3.59481896 [79,] -5.38477906 -0.25849439 [80,] -0.47493769 -5.38477906 [81,] -1.08035692 -0.47493769 [82,] -3.79739847 -1.08035692 [83,] -0.38784142 -3.79739847 [84,] -0.92175935 -0.38784142 [85,] 0.58201091 -0.92175935 [86,] 0.69004214 0.58201091 [87,] -0.84092669 0.69004214 [88,] 0.64224954 -0.84092669 [89,] 8.86530206 0.64224954 [90,] -0.80305113 8.86530206 [91,] 1.17554081 -0.80305113 [92,] 1.46459179 1.17554081 [93,] 3.00816423 1.46459179 [94,] -2.66608550 3.00816423 [95,] -0.32009984 -2.66608550 [96,] 3.16632197 -0.32009984 [97,] -0.96783727 3.16632197 [98,] -0.45133555 -0.96783727 [99,] -2.64994722 -0.45133555 [100,] -1.68487424 -2.64994722 [101,] 3.54250722 -1.68487424 [102,] 1.73379256 3.54250722 [103,] -3.09673738 1.73379256 [104,] 4.47339083 -3.09673738 [105,] 5.54482232 4.47339083 [106,] -0.94817037 5.54482232 [107,] 3.91450676 -0.94817037 [108,] 1.01888594 3.91450676 [109,] 8.55420700 1.01888594 [110,] 2.32610819 8.55420700 [111,] 2.70658548 2.32610819 [112,] 0.03597930 2.70658548 [113,] 1.19356101 0.03597930 [114,] -1.28548592 1.19356101 [115,] -1.04114656 -1.28548592 [116,] -0.22981514 -1.04114656 [117,] -0.23147187 -0.22981514 [118,] -4.52790043 -0.23147187 [119,] 4.13678725 -4.52790043 [120,] 0.31386297 4.13678725 [121,] 1.34969482 0.31386297 [122,] -0.41803474 1.34969482 [123,] -4.00579189 -0.41803474 [124,] -2.01304020 -4.00579189 [125,] -0.84726577 -2.01304020 [126,] -3.34438062 -0.84726577 [127,] -1.35367626 -3.34438062 [128,] -1.78045780 -1.35367626 [129,] -0.60411899 -1.78045780 [130,] -1.56288149 -0.60411899 [131,] 5.20179899 -1.56288149 [132,] -1.69001418 5.20179899 [133,] 0.33069720 -1.69001418 [134,] -0.74114439 0.33069720 [135,] 1.05788562 -0.74114439 [136,] 7.24935394 1.05788562 [137,] -0.24846675 7.24935394 [138,] 0.19571035 -0.24846675 [139,] -3.45258249 0.19571035 [140,] -2.63886501 -3.45258249 [141,] -4.23367897 -2.63886501 [142,] 2.02811306 -4.23367897 [143,] 0.70682945 2.02811306 [144,] -0.71735033 0.70682945 [145,] -1.82264696 -0.71735033 [146,] -0.33786677 -1.82264696 [147,] -1.39729180 -0.33786677 [148,] -1.61657649 -1.39729180 [149,] 5.33833650 -1.61657649 [150,] -0.87137886 5.33833650 [151,] 5.45354153 -0.87137886 [152,] -3.03224939 5.45354153 [153,] -0.40708285 -3.03224939 [154,] 5.45320363 -0.40708285 [155,] 3.49330230 5.45320363 [156,] 1.17554081 3.49330230 [157,] 0.24315878 1.17554081 [158,] -1.78045780 0.24315878 [159,] -2.67219530 -1.78045780 [160,] 5.60744513 -2.67219530 [161,] 1.69000949 5.60744513 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -0.09868999 -2.35202835 2 1.28989497 -0.09868999 3 -1.54517740 1.28989497 4 8.53781686 -1.54517740 5 -0.98424390 8.53781686 6 7.61955017 -0.98424390 7 -1.03826089 7.61955017 8 -2.74377895 -1.03826089 9 0.57819159 -2.74377895 10 -2.24749378 0.57819159 11 -6.01645481 -2.24749378 12 1.96681851 -6.01645481 13 0.28782632 1.96681851 14 -0.87572493 0.28782632 15 -0.22558284 -0.87572493 16 1.48719378 -0.22558284 17 1.00436776 1.48719378 18 -2.78515443 1.00436776 19 -1.24780935 -2.78515443 20 -6.36822898 -1.24780935 21 0.31377173 -6.36822898 22 -0.94604793 0.31377173 23 -0.11424487 -0.94604793 24 -0.10323474 -0.11424487 25 -2.17779616 -0.10323474 26 -0.49153396 -2.17779616 27 1.73084222 -0.49153396 28 2.34907654 1.73084222 29 -1.20564015 2.34907654 30 -3.63724443 -1.20564015 31 -0.47325979 -3.63724443 32 -3.19842018 -0.47325979 33 -0.96857276 -3.19842018 34 0.50970332 -0.96857276 35 -7.19855186 0.50970332 36 5.05468501 -7.19855186 37 -1.07251658 5.05468501 38 -2.55183736 -1.07251658 39 -2.87718350 -2.55183736 40 -3.44538593 -2.87718350 41 1.48418409 -3.44538593 42 -5.03734387 1.48418409 43 -0.63994911 -5.03734387 44 -2.54775716 -0.63994911 45 -0.66067778 -2.54775716 46 -4.87684158 -0.66067778 47 -1.67511407 -4.87684158 48 3.49211256 -1.67511407 49 -1.64496564 3.49211256 50 -2.38628545 -1.64496564 51 0.36383987 -2.38628545 52 3.87935577 0.36383987 53 -0.80391647 3.87935577 54 -3.85203950 -0.80391647 55 -1.00605819 -3.85203950 56 0.77771891 -1.00605819 57 -4.38203158 0.77771891 58 -2.23800791 -4.38203158 59 2.18430951 -2.23800791 60 4.36880367 2.18430951 61 0.36257336 4.36880367 62 0.33402935 0.36257336 63 -0.63315237 0.33402935 64 -1.25299478 -0.63315237 65 -0.48897673 -1.25299478 66 4.22162032 -0.48897673 67 0.14529627 4.22162032 68 -0.69462167 0.14529627 69 1.39561328 -0.69462167 70 -1.91119661 1.39561328 71 0.54708002 -1.91119661 72 2.26304937 0.54708002 73 -1.34983571 2.26304937 74 -0.73501658 -1.34983571 75 7.15227775 -0.73501658 76 0.48656636 7.15227775 77 3.59481896 0.48656636 78 -0.25849439 3.59481896 79 -5.38477906 -0.25849439 80 -0.47493769 -5.38477906 81 -1.08035692 -0.47493769 82 -3.79739847 -1.08035692 83 -0.38784142 -3.79739847 84 -0.92175935 -0.38784142 85 0.58201091 -0.92175935 86 0.69004214 0.58201091 87 -0.84092669 0.69004214 88 0.64224954 -0.84092669 89 8.86530206 0.64224954 90 -0.80305113 8.86530206 91 1.17554081 -0.80305113 92 1.46459179 1.17554081 93 3.00816423 1.46459179 94 -2.66608550 3.00816423 95 -0.32009984 -2.66608550 96 3.16632197 -0.32009984 97 -0.96783727 3.16632197 98 -0.45133555 -0.96783727 99 -2.64994722 -0.45133555 100 -1.68487424 -2.64994722 101 3.54250722 -1.68487424 102 1.73379256 3.54250722 103 -3.09673738 1.73379256 104 4.47339083 -3.09673738 105 5.54482232 4.47339083 106 -0.94817037 5.54482232 107 3.91450676 -0.94817037 108 1.01888594 3.91450676 109 8.55420700 1.01888594 110 2.32610819 8.55420700 111 2.70658548 2.32610819 112 0.03597930 2.70658548 113 1.19356101 0.03597930 114 -1.28548592 1.19356101 115 -1.04114656 -1.28548592 116 -0.22981514 -1.04114656 117 -0.23147187 -0.22981514 118 -4.52790043 -0.23147187 119 4.13678725 -4.52790043 120 0.31386297 4.13678725 121 1.34969482 0.31386297 122 -0.41803474 1.34969482 123 -4.00579189 -0.41803474 124 -2.01304020 -4.00579189 125 -0.84726577 -2.01304020 126 -3.34438062 -0.84726577 127 -1.35367626 -3.34438062 128 -1.78045780 -1.35367626 129 -0.60411899 -1.78045780 130 -1.56288149 -0.60411899 131 5.20179899 -1.56288149 132 -1.69001418 5.20179899 133 0.33069720 -1.69001418 134 -0.74114439 0.33069720 135 1.05788562 -0.74114439 136 7.24935394 1.05788562 137 -0.24846675 7.24935394 138 0.19571035 -0.24846675 139 -3.45258249 0.19571035 140 -2.63886501 -3.45258249 141 -4.23367897 -2.63886501 142 2.02811306 -4.23367897 143 0.70682945 2.02811306 144 -0.71735033 0.70682945 145 -1.82264696 -0.71735033 146 -0.33786677 -1.82264696 147 -1.39729180 -0.33786677 148 -1.61657649 -1.39729180 149 5.33833650 -1.61657649 150 -0.87137886 5.33833650 151 5.45354153 -0.87137886 152 -3.03224939 5.45354153 153 -0.40708285 -3.03224939 154 5.45320363 -0.40708285 155 3.49330230 5.45320363 156 1.17554081 3.49330230 157 0.24315878 1.17554081 158 -1.78045780 0.24315878 159 -2.67219530 -1.78045780 160 5.60744513 -2.67219530 161 1.69000949 5.60744513 > 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/7jhuu1322167162.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/8yxu81322167162.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/9ikxq1322167162.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/102mrn1322167162.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/11ooez1322167162.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/12buwt1322167162.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/13zg821322167163.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/14lv051322167163.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/15cu0b1322167163.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/16ruja1322167163.tab") + } > > try(system("convert tmp/19kpp1322167162.ps tmp/19kpp1322167162.png",intern=TRUE)) character(0) > try(system("convert tmp/28io11322167162.ps tmp/28io11322167162.png",intern=TRUE)) character(0) > try(system("convert tmp/3l2wq1322167162.ps tmp/3l2wq1322167162.png",intern=TRUE)) character(0) > try(system("convert tmp/4bmfx1322167162.ps tmp/4bmfx1322167162.png",intern=TRUE)) character(0) > try(system("convert tmp/5i5jf1322167162.ps tmp/5i5jf1322167162.png",intern=TRUE)) character(0) > try(system("convert tmp/635mx1322167162.ps tmp/635mx1322167162.png",intern=TRUE)) character(0) > try(system("convert tmp/7jhuu1322167162.ps tmp/7jhuu1322167162.png",intern=TRUE)) character(0) > try(system("convert tmp/8yxu81322167162.ps tmp/8yxu81322167162.png",intern=TRUE)) character(0) > try(system("convert tmp/9ikxq1322167162.ps tmp/9ikxq1322167162.png",intern=TRUE)) character(0) > try(system("convert tmp/102mrn1322167162.ps tmp/102mrn1322167162.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.050 0.481 5.573