R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(24 + ,14 + ,11 + ,12 + ,24 + ,26 + ,10 + ,25 + ,11 + ,7 + ,8 + ,25 + ,23 + ,14 + ,17 + ,6 + ,17 + ,8 + ,30 + ,25 + ,18 + ,18 + ,12 + ,10 + ,8 + ,19 + ,23 + ,15 + ,18 + ,8 + ,12 + ,9 + ,22 + ,19 + ,18 + ,16 + ,10 + ,12 + ,7 + ,22 + ,29 + ,11 + ,20 + ,10 + ,11 + ,4 + ,25 + ,25 + ,17 + ,16 + ,11 + ,11 + ,11 + ,23 + ,21 + ,19 + ,18 + ,16 + ,12 + ,7 + ,17 + ,22 + ,7 + ,17 + ,11 + ,13 + ,7 + ,21 + ,25 + ,12 + ,23 + ,13 + ,14 + ,12 + ,19 + ,24 + ,13 + ,30 + ,12 + ,16 + ,10 + ,19 + ,18 + ,15 + ,23 + ,8 + ,11 + ,10 + ,15 + ,22 + ,14 + ,18 + ,12 + ,10 + ,8 + ,16 + ,15 + ,14 + ,15 + ,11 + ,11 + ,8 + ,23 + ,22 + ,16 + ,12 + ,4 + ,15 + ,4 + ,27 + ,28 + ,16 + ,21 + ,9 + ,9 + ,9 + ,22 + ,20 + ,12 + ,15 + ,8 + ,11 + ,8 + ,14 + ,12 + ,12 + ,20 + ,8 + ,17 + ,7 + ,22 + ,24 + ,13 + ,31 + ,14 + ,17 + ,11 + ,23 + ,20 + ,16 + ,27 + ,15 + ,11 + ,9 + ,23 + ,21 + ,9 + ,21 + ,9 + ,14 + ,13 + ,19 + ,21 + ,11 + ,31 + ,14 + ,10 + ,8 + ,18 + ,23 + ,12 + ,19 + ,11 + ,11 + ,8 + ,20 + ,28 + ,11 + ,16 + ,8 + ,15 + ,9 + ,23 + ,24 + ,14 + ,20 + ,9 + ,15 + ,6 + ,25 + ,24 + ,18 + ,21 + ,9 + ,13 + ,9 + ,19 + ,24 + ,11 + ,22 + ,9 + ,16 + ,9 + ,24 + ,23 + ,14 + ,17 + ,9 + ,13 + ,6 + ,22 + ,23 + ,17 + ,25 + ,16 + ,18 + ,16 + ,26 + ,24 + ,12 + ,26 + ,11 + ,18 + ,5 + ,29 + ,18 + ,14 + ,25 + ,8 + ,12 + ,7 + ,32 + ,25 + ,14 + ,17 + ,9 + ,17 + ,9 + ,25 + ,21 + ,15 + ,32 + ,16 + ,9 + ,6 + ,29 + ,26 + ,11 + ,33 + ,11 + ,9 + ,6 + ,28 + ,22 + ,15 + ,13 + ,16 + ,12 + ,5 + ,17 + ,22 + ,14 + ,32 + ,12 + ,18 + ,12 + ,28 + ,22 + ,11 + ,25 + ,12 + ,12 + ,7 + ,29 + ,23 + ,12 + ,29 + ,14 + ,18 + ,10 + ,26 + ,30 + ,17 + ,22 + ,9 + ,14 + ,9 + ,25 + ,23 + ,15 + ,18 + ,10 + ,15 + ,8 + ,14 + ,17 + ,9 + ,17 + ,9 + ,16 + ,5 + ,25 + ,23 + ,16 + ,20 + ,10 + ,10 + ,8 + ,26 + ,23 + ,13 + ,15 + ,12 + ,11 + ,8 + ,20 + ,25 + ,15 + ,20 + ,14 + ,14 + ,10 + ,18 + ,24 + ,11 + ,33 + ,14 + ,9 + ,6 + ,32 + ,24 + ,10 + ,29 + ,10 + ,12 + ,8 + ,25 + ,23 + ,16 + ,23 + ,14 + ,17 + ,7 + ,25 + ,21 + ,13 + ,26 + ,16 + ,5 + ,4 + ,23 + ,24 + ,9 + ,18 + ,9 + ,12 + ,8 + ,21 + ,24 + ,14 + ,20 + ,10 + ,12 + ,8 + ,20 + ,28 + ,16 + ,11 + ,6 + ,6 + ,4 + ,15 + ,16 + ,15 + ,28 + ,8 + ,24 + ,20 + ,30 + ,20 + ,14 + ,26 + ,13 + ,12 + ,8 + ,24 + ,29 + ,13 + ,22 + ,10 + ,12 + ,8 + ,26 + ,27 + ,14 + ,17 + ,8 + ,14 + ,6 + ,24 + ,22 + ,16 + ,12 + ,7 + ,7 + ,4 + ,22 + ,28 + ,15 + ,14 + ,15 + ,13 + ,8 + ,14 + ,16 + ,16 + ,17 + ,9 + ,12 + ,9 + ,24 + ,25 + ,15 + ,21 + ,10 + ,13 + ,6 + ,24 + ,24 + ,13 + ,19 + ,12 + ,14 + ,7 + ,24 + ,28 + ,11 + ,18 + ,13 + ,8 + ,9 + ,24 + ,24 + ,16 + ,10 + ,10 + ,11 + ,5 + ,19 + ,23 + ,17 + ,29 + ,11 + ,9 + ,5 + ,31 + ,30 + ,10 + ,31 + ,8 + ,11 + ,8 + ,22 + ,24 + ,17 + ,19 + ,9 + ,13 + ,8 + ,27 + ,21 + ,11 + ,9 + ,13 + ,10 + ,6 + ,19 + ,25 + ,14 + ,20 + ,11 + ,11 + ,8 + ,25 + ,25 + ,15 + ,28 + ,8 + ,12 + ,7 + ,20 + ,22 + ,16 + ,19 + ,9 + ,9 + ,7 + ,21 + ,23 + ,15 + ,30 + ,9 + ,15 + ,9 + ,27 + ,26 + ,16 + ,29 + ,15 + ,18 + ,11 + ,23 + ,23 + ,15 + ,26 + ,9 + ,15 + ,6 + ,25 + ,25 + ,14 + ,23 + ,10 + ,12 + ,8 + ,20 + ,21 + ,17 + ,21 + ,12 + ,14 + ,9 + ,22 + ,24 + ,12 + ,19 + ,12 + ,10 + ,8 + ,23 + ,29 + ,12 + ,28 + ,11 + ,13 + ,6 + ,25 + ,22 + ,9 + ,23 + ,14 + ,13 + ,10 + ,25 + ,27 + ,12 + ,18 + ,6 + ,11 + ,8 + ,17 + ,26 + ,17 + ,21 + ,12 + ,13 + ,8 + ,19 + ,22 + ,11 + ,20 + ,8 + ,16 + ,10 + ,25 + ,24 + ,16 + ,23 + ,14 + ,8 + ,5 + ,19 + ,27 + ,9 + ,21 + ,11 + ,16 + ,7 + ,20 + ,24 + ,15 + ,21 + ,10 + ,11 + ,5 + ,26 + ,24 + ,17 + ,15 + ,14 + ,9 + ,8 + ,23 + ,29 + ,17 + ,28 + ,12 + ,16 + ,14 + ,27 + ,22 + ,12 + ,19 + ,10 + ,12 + ,7 + ,17 + ,21 + ,15 + ,26 + ,14 + ,14 + ,8 + ,17 + ,24 + ,18 + ,16 + ,11 + ,9 + ,5 + ,17 + ,23 + ,13 + ,22 + ,10 + ,15 + ,6 + ,22 + ,20 + ,15 + ,19 + ,9 + ,11 + ,10 + ,21 + ,27 + ,16 + ,31 + ,10 + ,21 + ,12 + ,32 + ,26 + ,17 + ,31 + ,16 + ,14 + ,9 + ,21 + ,25 + ,15 + ,29 + ,13 + ,18 + ,12 + ,21 + ,21 + ,13 + ,19 + ,9 + ,12 + ,7 + ,18 + ,21 + ,12 + ,22 + ,10 + ,13 + ,8 + ,18 + ,19 + ,11 + ,23 + ,10 + ,15 + ,10 + ,23 + ,21 + ,15 + ,15 + ,7 + ,12 + ,6 + ,19 + ,21 + ,15 + ,20 + ,9 + ,19 + ,10 + ,20 + ,16 + ,15 + ,18 + ,8 + ,15 + ,10 + ,21 + ,22 + ,18 + ,23 + ,14 + ,11 + ,10 + ,20 + ,29 + ,16 + ,25 + ,14 + ,11 + ,5 + ,17 + ,15 + ,12 + ,21 + ,8 + ,10 + ,7 + ,18 + ,17 + ,16 + ,24 + ,9 + ,13 + ,10 + ,19 + ,15 + ,15 + ,25 + ,14 + ,15 + ,11 + ,22 + ,21 + ,15 + ,17 + ,14 + ,12 + ,6 + ,15 + ,21 + ,15 + ,13 + ,8 + ,12 + ,7 + ,14 + ,19 + ,17 + ,28 + ,8 + ,16 + ,12 + ,18 + ,24 + ,15 + ,21 + ,8 + ,9 + ,11 + ,24 + ,20 + ,13 + ,25 + ,7 + ,18 + ,11 + ,35 + ,17 + ,16 + ,9 + ,6 + ,8 + ,11 + ,29 + ,23 + ,13 + ,16 + ,8 + ,13 + ,5 + ,21 + ,24 + ,13 + ,17 + ,11 + ,9 + ,6 + ,20 + ,19 + ,15 + ,25 + ,14 + ,15 + ,9 + ,22 + ,24 + ,13 + ,20 + ,11 + ,8 + ,4 + ,13 + ,13 + ,16 + ,29 + ,11 + ,7 + ,4 + ,26 + ,22 + ,14 + ,14 + ,11 + ,12 + ,7 + ,17 + ,16 + ,15 + ,22 + ,14 + ,14 + ,11 + ,25 + ,19 + ,11 + ,15 + ,8 + ,6 + ,6 + ,20 + ,25 + ,15 + ,19 + ,20 + ,8 + ,7 + ,19 + ,25 + ,14 + ,20 + ,11 + ,17 + ,8 + ,21 + ,23 + ,14 + ,15 + ,8 + ,10 + ,4 + ,22 + ,24 + ,17 + ,20 + ,11 + ,11 + ,8 + ,24 + ,26 + ,15 + ,18 + ,10 + ,14 + ,9 + ,21 + ,26 + ,14 + ,33 + ,14 + ,11 + ,8 + ,26 + ,25 + ,15 + ,22 + ,11 + ,13 + ,11 + ,24 + ,18 + ,13 + ,16 + ,9 + ,12 + ,8 + ,16 + ,21 + ,15 + ,17 + ,9 + ,11 + ,5 + ,23 + ,26 + ,16 + ,16 + ,8 + ,9 + ,4 + ,18 + ,23 + ,12 + ,21 + ,10 + ,12 + ,8 + ,16 + ,23 + ,14 + ,26 + ,13 + ,20 + ,10 + ,26 + ,22 + ,12 + ,18 + ,13 + ,12 + ,6 + ,19 + ,20 + ,14 + ,18 + ,12 + ,13 + ,9 + ,21 + ,13 + ,14 + ,17 + ,8 + ,12 + ,9 + ,21 + ,24 + ,15 + ,22 + ,13 + ,12 + ,13 + ,22 + ,15 + ,13 + ,30 + ,14 + ,9 + ,9 + ,23 + ,14 + ,15 + ,30 + ,12 + ,15 + ,10 + ,29 + ,22 + ,16 + ,24 + ,14 + ,24 + ,20 + ,21 + ,10 + ,10 + ,21 + ,15 + ,7 + ,5 + ,21 + ,24 + ,8 + ,21 + ,13 + ,17 + ,11 + ,23 + ,22 + ,15 + ,29 + ,16 + ,11 + ,6 + ,27 + ,24 + ,14 + ,31 + ,9 + ,17 + ,9 + ,25 + ,19 + ,13 + ,20 + ,9 + ,11 + ,7 + ,21 + ,20 + ,15 + ,16 + ,9 + ,12 + ,9 + ,10 + ,13 + ,13 + ,22 + ,8 + ,14 + ,10 + ,20 + ,20 + ,14 + ,20 + ,7 + ,11 + ,9 + ,26 + ,22 + ,19 + ,28 + ,16 + ,16 + ,8 + ,24 + ,24 + ,17 + ,38 + ,11 + ,21 + ,7 + ,29 + ,29 + ,16 + ,22 + ,9 + ,14 + ,6 + ,19 + ,12 + ,16 + ,20 + ,11 + ,20 + ,13 + ,24 + ,20 + ,14 + ,17 + ,9 + ,13 + ,6 + ,19 + ,21 + ,12 + ,28 + ,14 + ,11 + ,8 + ,24 + ,24 + ,13 + ,22 + ,13 + ,15 + ,10 + ,22 + ,22 + ,14 + ,31 + ,16 + ,19 + ,16 + ,17 + ,20 + ,15) + ,dim=c(7 + ,159) + ,dimnames=list(c('CM' + ,'D' + ,'PE' + ,'PC' + ,'PS' + ,'O' + ,'H ') + ,1:159)) > y <- array(NA,dim=c(7,159),dimnames=list(c('CM','D','PE','PC','PS','O','H '),1:159)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '5' > #'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.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 PS CM D PE PC O H\r t 1 24 24 14 11 12 26 10 1 2 25 25 11 7 8 23 14 2 3 30 17 6 17 8 25 18 3 4 19 18 12 10 8 23 15 4 5 22 18 8 12 9 19 18 5 6 22 16 10 12 7 29 11 6 7 25 20 10 11 4 25 17 7 8 23 16 11 11 11 21 19 8 9 17 18 16 12 7 22 7 9 10 21 17 11 13 7 25 12 10 11 19 23 13 14 12 24 13 11 12 19 30 12 16 10 18 15 12 13 15 23 8 11 10 22 14 13 14 16 18 12 10 8 15 14 14 15 23 15 11 11 8 22 16 15 16 27 12 4 15 4 28 16 16 17 22 21 9 9 9 20 12 17 18 14 15 8 11 8 12 12 18 19 22 20 8 17 7 24 13 19 20 23 31 14 17 11 20 16 20 21 23 27 15 11 9 21 9 21 22 19 21 9 14 13 21 11 22 23 18 31 14 10 8 23 12 23 24 20 19 11 11 8 28 11 24 25 23 16 8 15 9 24 14 25 26 25 20 9 15 6 24 18 26 27 19 21 9 13 9 24 11 27 28 24 22 9 16 9 23 14 28 29 22 17 9 13 6 23 17 29 30 26 25 16 18 16 24 12 30 31 29 26 11 18 5 18 14 31 32 32 25 8 12 7 25 14 32 33 25 17 9 17 9 21 15 33 34 29 32 16 9 6 26 11 34 35 28 33 11 9 6 22 15 35 36 17 13 16 12 5 22 14 36 37 28 32 12 18 12 22 11 37 38 29 25 12 12 7 23 12 38 39 26 29 14 18 10 30 17 39 40 25 22 9 14 9 23 15 40 41 14 18 10 15 8 17 9 41 42 25 17 9 16 5 23 16 42 43 26 20 10 10 8 23 13 43 44 20 15 12 11 8 25 15 44 45 18 20 14 14 10 24 11 45 46 32 33 14 9 6 24 10 46 47 25 29 10 12 8 23 16 47 48 25 23 14 17 7 21 13 48 49 23 26 16 5 4 24 9 49 50 21 18 9 12 8 24 14 50 51 20 20 10 12 8 28 16 51 52 15 11 6 6 4 16 15 52 53 30 28 8 24 20 20 14 53 54 24 26 13 12 8 29 13 54 55 26 22 10 12 8 27 14 55 56 24 17 8 14 6 22 16 56 57 22 12 7 7 4 28 15 57 58 14 14 15 13 8 16 16 58 59 24 17 9 12 9 25 15 59 60 24 21 10 13 6 24 13 60 61 24 19 12 14 7 28 11 61 62 24 18 13 8 9 24 16 62 63 19 10 10 11 5 23 17 63 64 31 29 11 9 5 30 10 64 65 22 31 8 11 8 24 17 65 66 27 19 9 13 8 21 11 66 67 19 9 13 10 6 25 14 67 68 25 20 11 11 8 25 15 68 69 20 28 8 12 7 22 16 69 70 21 19 9 9 7 23 15 70 71 27 30 9 15 9 26 16 71 72 23 29 15 18 11 23 15 72 73 25 26 9 15 6 25 14 73 74 20 23 10 12 8 21 17 74 75 22 21 12 14 9 24 12 75 76 23 19 12 10 8 29 12 76 77 25 28 11 13 6 22 9 77 78 25 23 14 13 10 27 12 78 79 17 18 6 11 8 26 17 79 80 19 21 12 13 8 22 11 80 81 25 20 8 16 10 24 16 81 82 19 23 14 8 5 27 9 82 83 20 21 11 16 7 24 15 83 84 26 21 10 11 5 24 17 84 85 23 15 14 9 8 29 17 85 86 27 28 12 16 14 22 12 86 87 17 19 10 12 7 21 15 87 88 17 26 14 14 8 24 18 88 89 17 16 11 9 5 23 13 89 90 22 22 10 15 6 20 15 90 91 21 19 9 11 10 27 16 91 92 32 31 10 21 12 26 17 92 93 21 31 16 14 9 25 15 93 94 21 29 13 18 12 21 13 94 95 18 19 9 12 7 21 12 95 96 18 22 10 13 8 19 11 96 97 23 23 10 15 10 21 15 97 98 19 15 7 12 6 21 15 98 99 20 20 9 19 10 16 15 99 100 21 18 8 15 10 22 18 100 101 20 23 14 11 10 29 16 101 102 17 25 14 11 5 15 12 102 103 18 21 8 10 7 17 16 103 104 19 24 9 13 10 15 15 104 105 22 25 14 15 11 21 15 105 106 15 17 14 12 6 21 15 106 107 14 13 8 12 7 19 17 107 108 18 28 8 16 12 24 15 108 109 24 21 8 9 11 20 13 109 110 35 25 7 18 11 17 16 110 111 29 9 6 8 11 23 13 111 112 21 16 8 13 5 24 13 112 113 20 17 11 9 6 19 15 113 114 22 25 14 15 9 24 13 114 115 13 20 11 8 4 13 16 115 116 26 29 11 7 4 22 14 116 117 17 14 11 12 7 16 15 117 118 25 22 14 14 11 19 11 118 119 20 15 8 6 6 25 15 119 120 19 19 20 8 7 25 14 120 121 21 20 11 17 8 23 14 121 122 22 15 8 10 4 24 17 122 123 24 20 11 11 8 26 15 123 124 21 18 10 14 9 26 14 124 125 26 33 14 11 8 25 15 125 126 24 22 11 13 11 18 13 126 127 16 16 9 12 8 21 15 127 128 23 17 9 11 5 26 16 128 129 18 16 8 9 4 23 12 129 130 16 21 10 12 8 23 14 130 131 26 26 13 20 10 22 12 131 132 19 18 13 12 6 20 14 132 133 21 18 12 13 9 13 14 133 134 21 17 8 12 9 24 15 134 135 22 22 13 12 13 15 13 135 136 23 30 14 9 9 14 15 136 137 29 30 12 15 10 22 16 137 138 21 24 14 24 20 10 10 138 139 21 21 15 7 5 24 8 139 140 23 21 13 17 11 22 15 140 141 27 29 16 11 6 24 14 141 142 25 31 9 17 9 19 13 142 143 21 20 9 11 7 20 15 143 144 10 16 9 12 9 13 13 144 145 20 22 8 14 10 20 14 145 146 26 20 7 11 9 22 19 146 147 24 28 16 16 8 24 17 147 148 29 38 11 21 7 29 16 148 149 19 22 9 14 6 12 16 149 150 24 20 11 20 13 20 14 150 151 19 17 9 13 6 21 12 151 152 24 28 14 11 8 24 13 152 153 22 22 13 15 10 22 14 153 154 17 31 16 19 16 20 15 154 155 24 24 14 11 12 26 10 155 156 25 25 11 7 8 23 14 156 157 30 17 6 17 8 25 18 157 158 19 18 12 10 8 23 15 158 159 22 18 8 12 9 19 18 159 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) CM D PE PC O 6.967229 0.338739 -0.370734 0.173455 0.048156 0.414415 `H\r` t 0.019527 -0.002547 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -8.8030 -2.0823 0.1592 2.1454 11.4303 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 6.967229 3.106557 2.243 0.02637 * CM 0.338739 0.057193 5.923 2.06e-08 *** D -0.370734 0.116406 -3.185 0.00176 ** PE 0.173455 0.101683 1.706 0.09009 . PC 0.048156 0.128585 0.375 0.70855 O 0.414415 0.075193 5.511 1.50e-07 *** `H\r` 0.019527 0.127692 0.153 0.87867 t -0.002547 0.006168 -0.413 0.68018 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 3.435 on 151 degrees of freedom Multiple R-squared: 0.3777, Adjusted R-squared: 0.3488 F-statistic: 13.09 on 7 and 151 DF, p-value: 4.103e-13 > 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.42114635 0.84229270 0.5788536 [2,] 0.29539314 0.59078628 0.7046069 [3,] 0.22586032 0.45172064 0.7741397 [4,] 0.20543698 0.41087396 0.7945630 [5,] 0.34096278 0.68192556 0.6590372 [6,] 0.32048241 0.64096483 0.6795176 [7,] 0.48609786 0.97219572 0.5139021 [8,] 0.39474932 0.78949864 0.6052507 [9,] 0.31374779 0.62749559 0.6862522 [10,] 0.29878853 0.59757707 0.7012115 [11,] 0.39711396 0.79422792 0.6028860 [12,] 0.33110619 0.66221239 0.6688938 [13,] 0.36308831 0.72617661 0.6369117 [14,] 0.31728336 0.63456673 0.6827166 [15,] 0.26492314 0.52984627 0.7350769 [16,] 0.21098729 0.42197457 0.7890127 [17,] 0.18046326 0.36092653 0.8195367 [18,] 0.15673307 0.31346615 0.8432669 [19,] 0.11886035 0.23772070 0.8811396 [20,] 0.13572087 0.27144174 0.8642791 [21,] 0.30704327 0.61408653 0.6929567 [22,] 0.57958058 0.84083884 0.4204194 [23,] 0.54086279 0.91827443 0.4591372 [24,] 0.54666838 0.90666324 0.4533316 [25,] 0.49975639 0.99951278 0.5002436 [26,] 0.51699203 0.96601594 0.4830080 [27,] 0.48086557 0.96173114 0.5191344 [28,] 0.54313036 0.91373929 0.4568696 [29,] 0.59867096 0.80265808 0.4013290 [30,] 0.54545138 0.90909725 0.4545486 [31,] 0.60723677 0.78552646 0.3927632 [32,] 0.57265822 0.85468356 0.4273418 [33,] 0.56872347 0.86255306 0.4312765 [34,] 0.53847271 0.92305457 0.4615273 [35,] 0.53939818 0.92120363 0.4606018 [36,] 0.63953624 0.72092752 0.3604638 [37,] 0.62279966 0.75440068 0.3772003 [38,] 0.60564571 0.78870859 0.3943543 [39,] 0.56351164 0.87297672 0.4364884 [40,] 0.53094454 0.93811091 0.4690555 [41,] 0.60422941 0.79154118 0.3957706 [42,] 0.56694348 0.86611304 0.4330565 [43,] 0.60790667 0.78418666 0.3920933 [44,] 0.58226836 0.83546328 0.4177316 [45,] 0.53911091 0.92177818 0.4608891 [46,] 0.50756800 0.98486401 0.4924320 [47,] 0.45876020 0.91752039 0.5412398 [48,] 0.42045978 0.84091956 0.5795402 [49,] 0.38357097 0.76714193 0.6164290 [50,] 0.34354100 0.68708199 0.6564590 [51,] 0.30121527 0.60243055 0.6987847 [52,] 0.31339810 0.62679619 0.6866019 [53,] 0.27841900 0.55683801 0.7215810 [54,] 0.28288593 0.56577186 0.7171141 [55,] 0.38910991 0.77821982 0.6108901 [56,] 0.48120581 0.96241161 0.5187942 [57,] 0.44729234 0.89458469 0.5527077 [58,] 0.43242749 0.86485498 0.5675725 [59,] 0.51969619 0.96060762 0.4803038 [60,] 0.47541147 0.95082294 0.5245885 [61,] 0.43865517 0.87731035 0.5613448 [62,] 0.40819896 0.81639792 0.5918010 [63,] 0.37741968 0.75483937 0.6225803 [64,] 0.35030819 0.70061638 0.6496918 [65,] 0.30959978 0.61919957 0.6904002 [66,] 0.27142942 0.54285885 0.7285706 [67,] 0.24696821 0.49393642 0.7530318 [68,] 0.22640482 0.45280963 0.7735952 [69,] 0.32818971 0.65637942 0.6718103 [70,] 0.29759262 0.59518524 0.7024074 [71,] 0.26730233 0.53460466 0.7326977 [72,] 0.25578740 0.51157480 0.7442126 [73,] 0.24358042 0.48716084 0.7564196 [74,] 0.26390682 0.52781365 0.7360932 [75,] 0.25497335 0.50994670 0.7450267 [76,] 0.25456287 0.50912575 0.7454371 [77,] 0.24649713 0.49299425 0.7535029 [78,] 0.32020205 0.64040410 0.6797979 [79,] 0.28835551 0.57671103 0.7116445 [80,] 0.25548408 0.51096816 0.7445159 [81,] 0.22981508 0.45963016 0.7701849 [82,] 0.24700768 0.49401536 0.7529923 [83,] 0.23574924 0.47149847 0.7642508 [84,] 0.21464250 0.42928500 0.7853575 [85,] 0.19250482 0.38500963 0.8074952 [86,] 0.17317031 0.34634061 0.8268297 [87,] 0.14693890 0.29387781 0.8530611 [88,] 0.12140656 0.24281312 0.8785934 [89,] 0.09880766 0.19761533 0.9011923 [90,] 0.07983179 0.15966358 0.9201682 [91,] 0.08099425 0.16198851 0.9190057 [92,] 0.06444167 0.12888333 0.9355583 [93,] 0.05472643 0.10945286 0.9452736 [94,] 0.04676997 0.09353994 0.9532300 [95,] 0.03687755 0.07375510 0.9631225 [96,] 0.03467012 0.06934025 0.9653299 [97,] 0.04438080 0.08876161 0.9556192 [98,] 0.23046910 0.46093819 0.7695309 [99,] 0.23940205 0.47880409 0.7605980 [100,] 0.64630741 0.70738517 0.3536926 [101,] 0.88418739 0.23162522 0.1158126 [102,] 0.85572828 0.28854344 0.1442717 [103,] 0.83080922 0.33838157 0.1691908 [104,] 0.80024094 0.39951813 0.1997591 [105,] 0.82852949 0.34294102 0.1714705 [106,] 0.80852642 0.38294715 0.1914736 [107,] 0.76989940 0.46020120 0.2301006 [108,] 0.81990289 0.36019422 0.1800971 [109,] 0.78067127 0.43865745 0.2193287 [110,] 0.74167292 0.51665416 0.2583271 [111,] 0.69728774 0.60542452 0.3027123 [112,] 0.64657485 0.70685029 0.3534251 [113,] 0.59646733 0.80706535 0.4035327 [114,] 0.54767947 0.90464105 0.4523205 [115,] 0.48988037 0.97976074 0.5101196 [116,] 0.48969098 0.97938195 0.5103090 [117,] 0.52249410 0.95501179 0.4775059 [118,] 0.45883941 0.91767881 0.5411606 [119,] 0.42137464 0.84274928 0.5786254 [120,] 0.67599573 0.64800854 0.3240043 [121,] 0.62536132 0.74927735 0.3746387 [122,] 0.58536215 0.82927570 0.4146378 [123,] 0.56707461 0.86585079 0.4329254 [124,] 0.63467145 0.73065711 0.3653286 [125,] 0.57969789 0.84060422 0.4203021 [126,] 0.55496030 0.89007939 0.4450397 [127,] 0.52795320 0.94409360 0.4720468 [128,] 0.75773023 0.48453954 0.2422698 [129,] 0.68388508 0.63222984 0.3161149 [130,] 0.60493691 0.79012617 0.3950631 [131,] 0.65930376 0.68139249 0.3406962 [132,] 0.66395457 0.67209085 0.3360454 [133,] 0.56343070 0.87313861 0.4365693 [134,] 0.67150406 0.65699188 0.3284959 [135,] 0.68008070 0.63983859 0.3199193 [136,] 0.87728616 0.24542768 0.1227138 [137,] 0.84055949 0.31888102 0.1594405 [138,] 0.75673502 0.48652997 0.2432650 > postscript(file="/var/www/html/rcomp/tmp/1j36l1291898320.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/www/html/rcomp/tmp/2tdno1291898320.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/www/html/rcomp/tmp/3tdno1291898320.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/www/html/rcomp/tmp/4tdno1291898320.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/www/html/rcomp/tmp/5tdno1291898320.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 = 159 Frequency = 1 1 2 3 4 5 6 0.63991709 2.24310468 5.46041215 -1.54978348 1.17384433 -1.31581625 7 8 9 10 11 12 2.19019715 3.19995196 -1.78223634 -0.80895276 -4.11671798 -4.65923843 13 14 15 16 17 18 -8.53931285 -1.18946157 3.34515469 2.78109594 0.78203767 -2.53714547 19 20 21 22 23 24 -2.21337593 -1.30609906 1.28145022 -3.66001084 -6.10494572 -3.37573391 25 26 27 28 29 30 0.38793581 1.47262078 -4.52444206 -0.02516288 0.27733161 2.49948908 31 32 33 34 35 36 6.28677997 6.55937501 3.31711868 4.37185057 2.76154389 -0.06013802 37 38 39 40 41 42 1.70419137 5.92547805 -1.86919948 1.33278774 -5.46062167 2.85776530 43 44 45 46 47 48 4.16966984 -0.43395799 -3.50779251 7.17056895 -0.27428289 3.31192755 49 50 51 52 53 54 2.10050977 -1.28660565 -4.28751725 -1.49339166 2.96124601 -1.55594401 55 56 57 58 59 60 1.49866239 2.23586295 0.40490204 -1.58405380 1.59296174 1.03576752 61 62 63 64 65 66 0.61704275 3.83350702 0.50091394 4.02084053 -4.90786416 5.54378360 67 68 69 70 71 72 1.31709236 2.56274825 -5.15839905 -0.61098985 -0.73438555 -1.52259954 73 74 75 76 77 78 -0.77639819 -2.36376624 -0.48295032 -0.13302628 0.98556903 1.47073410 79 80 81 82 83 84 -7.03889041 -2.40024601 0.91496563 -3.35244404 -3.14248343 3.41386173 85 86 87 88 89 90 2.06214507 2.41503825 -3.88848507 -6.47106779 -2.66954051 0.04514635 91 92 93 94 95 96 -2.72606037 3.14638073 -3.81455031 -3.38829778 -3.18026010 -3.19644979 97 98 99 100 101 102 0.11720008 -1.56955337 -0.85396412 -1.39592504 -4.03070528 -1.58493716 103 104 105 106 107 108 -2.28163011 -1.74104076 -0.10512025 -3.63151654 -4.75679401 -8.80295472 109 110 111 112 113 114 2.52981982 11.43025002 9.78852590 -0.83138734 1.62330795 -1.19007501 115 116 117 118 119 120 -3.65108391 2.78558186 0.32444062 5.02460455 -0.76225847 0.95859921 121 122 123 124 125 126 -1.49461430 1.02323814 1.28843609 -1.95126519 0.41653815 3.48159831 127 128 129 130 131 132 -4.18926400 0.70086331 -2.61216624 -6.31388784 2.07668455 0.15918300 133 134 135 136 137 138 4.37398114 -1.17230717 3.56638068 3.31809750 4.15544467 1.97938760 139 140 141 142 143 144 1.27719294 1.20693451 4.08397320 -0.27968697 0.13256230 -6.83973987 145 146 147 148 149 150 -2.55585991 3.39548780 0.41583116 -2.69434932 0.29395484 2.06136092 151 152 153 154 155 156 -1.48543027 0.63248053 0.31590250 -6.79145106 1.03220570 2.63539328 157 158 159 5.85270076 -1.15749487 1.56613294 > postscript(file="/var/www/html/rcomp/tmp/6hjgl1291898320.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 = 159 Frequency = 1 lag(myerror, k = 1) myerror 0 0.63991709 NA 1 2.24310468 0.63991709 2 5.46041215 2.24310468 3 -1.54978348 5.46041215 4 1.17384433 -1.54978348 5 -1.31581625 1.17384433 6 2.19019715 -1.31581625 7 3.19995196 2.19019715 8 -1.78223634 3.19995196 9 -0.80895276 -1.78223634 10 -4.11671798 -0.80895276 11 -4.65923843 -4.11671798 12 -8.53931285 -4.65923843 13 -1.18946157 -8.53931285 14 3.34515469 -1.18946157 15 2.78109594 3.34515469 16 0.78203767 2.78109594 17 -2.53714547 0.78203767 18 -2.21337593 -2.53714547 19 -1.30609906 -2.21337593 20 1.28145022 -1.30609906 21 -3.66001084 1.28145022 22 -6.10494572 -3.66001084 23 -3.37573391 -6.10494572 24 0.38793581 -3.37573391 25 1.47262078 0.38793581 26 -4.52444206 1.47262078 27 -0.02516288 -4.52444206 28 0.27733161 -0.02516288 29 2.49948908 0.27733161 30 6.28677997 2.49948908 31 6.55937501 6.28677997 32 3.31711868 6.55937501 33 4.37185057 3.31711868 34 2.76154389 4.37185057 35 -0.06013802 2.76154389 36 1.70419137 -0.06013802 37 5.92547805 1.70419137 38 -1.86919948 5.92547805 39 1.33278774 -1.86919948 40 -5.46062167 1.33278774 41 2.85776530 -5.46062167 42 4.16966984 2.85776530 43 -0.43395799 4.16966984 44 -3.50779251 -0.43395799 45 7.17056895 -3.50779251 46 -0.27428289 7.17056895 47 3.31192755 -0.27428289 48 2.10050977 3.31192755 49 -1.28660565 2.10050977 50 -4.28751725 -1.28660565 51 -1.49339166 -4.28751725 52 2.96124601 -1.49339166 53 -1.55594401 2.96124601 54 1.49866239 -1.55594401 55 2.23586295 1.49866239 56 0.40490204 2.23586295 57 -1.58405380 0.40490204 58 1.59296174 -1.58405380 59 1.03576752 1.59296174 60 0.61704275 1.03576752 61 3.83350702 0.61704275 62 0.50091394 3.83350702 63 4.02084053 0.50091394 64 -4.90786416 4.02084053 65 5.54378360 -4.90786416 66 1.31709236 5.54378360 67 2.56274825 1.31709236 68 -5.15839905 2.56274825 69 -0.61098985 -5.15839905 70 -0.73438555 -0.61098985 71 -1.52259954 -0.73438555 72 -0.77639819 -1.52259954 73 -2.36376624 -0.77639819 74 -0.48295032 -2.36376624 75 -0.13302628 -0.48295032 76 0.98556903 -0.13302628 77 1.47073410 0.98556903 78 -7.03889041 1.47073410 79 -2.40024601 -7.03889041 80 0.91496563 -2.40024601 81 -3.35244404 0.91496563 82 -3.14248343 -3.35244404 83 3.41386173 -3.14248343 84 2.06214507 3.41386173 85 2.41503825 2.06214507 86 -3.88848507 2.41503825 87 -6.47106779 -3.88848507 88 -2.66954051 -6.47106779 89 0.04514635 -2.66954051 90 -2.72606037 0.04514635 91 3.14638073 -2.72606037 92 -3.81455031 3.14638073 93 -3.38829778 -3.81455031 94 -3.18026010 -3.38829778 95 -3.19644979 -3.18026010 96 0.11720008 -3.19644979 97 -1.56955337 0.11720008 98 -0.85396412 -1.56955337 99 -1.39592504 -0.85396412 100 -4.03070528 -1.39592504 101 -1.58493716 -4.03070528 102 -2.28163011 -1.58493716 103 -1.74104076 -2.28163011 104 -0.10512025 -1.74104076 105 -3.63151654 -0.10512025 106 -4.75679401 -3.63151654 107 -8.80295472 -4.75679401 108 2.52981982 -8.80295472 109 11.43025002 2.52981982 110 9.78852590 11.43025002 111 -0.83138734 9.78852590 112 1.62330795 -0.83138734 113 -1.19007501 1.62330795 114 -3.65108391 -1.19007501 115 2.78558186 -3.65108391 116 0.32444062 2.78558186 117 5.02460455 0.32444062 118 -0.76225847 5.02460455 119 0.95859921 -0.76225847 120 -1.49461430 0.95859921 121 1.02323814 -1.49461430 122 1.28843609 1.02323814 123 -1.95126519 1.28843609 124 0.41653815 -1.95126519 125 3.48159831 0.41653815 126 -4.18926400 3.48159831 127 0.70086331 -4.18926400 128 -2.61216624 0.70086331 129 -6.31388784 -2.61216624 130 2.07668455 -6.31388784 131 0.15918300 2.07668455 132 4.37398114 0.15918300 133 -1.17230717 4.37398114 134 3.56638068 -1.17230717 135 3.31809750 3.56638068 136 4.15544467 3.31809750 137 1.97938760 4.15544467 138 1.27719294 1.97938760 139 1.20693451 1.27719294 140 4.08397320 1.20693451 141 -0.27968697 4.08397320 142 0.13256230 -0.27968697 143 -6.83973987 0.13256230 144 -2.55585991 -6.83973987 145 3.39548780 -2.55585991 146 0.41583116 3.39548780 147 -2.69434932 0.41583116 148 0.29395484 -2.69434932 149 2.06136092 0.29395484 150 -1.48543027 2.06136092 151 0.63248053 -1.48543027 152 0.31590250 0.63248053 153 -6.79145106 0.31590250 154 1.03220570 -6.79145106 155 2.63539328 1.03220570 156 5.85270076 2.63539328 157 -1.15749487 5.85270076 158 1.56613294 -1.15749487 159 NA 1.56613294 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 2.24310468 0.63991709 [2,] 5.46041215 2.24310468 [3,] -1.54978348 5.46041215 [4,] 1.17384433 -1.54978348 [5,] -1.31581625 1.17384433 [6,] 2.19019715 -1.31581625 [7,] 3.19995196 2.19019715 [8,] -1.78223634 3.19995196 [9,] -0.80895276 -1.78223634 [10,] -4.11671798 -0.80895276 [11,] -4.65923843 -4.11671798 [12,] -8.53931285 -4.65923843 [13,] -1.18946157 -8.53931285 [14,] 3.34515469 -1.18946157 [15,] 2.78109594 3.34515469 [16,] 0.78203767 2.78109594 [17,] -2.53714547 0.78203767 [18,] -2.21337593 -2.53714547 [19,] -1.30609906 -2.21337593 [20,] 1.28145022 -1.30609906 [21,] -3.66001084 1.28145022 [22,] -6.10494572 -3.66001084 [23,] -3.37573391 -6.10494572 [24,] 0.38793581 -3.37573391 [25,] 1.47262078 0.38793581 [26,] -4.52444206 1.47262078 [27,] -0.02516288 -4.52444206 [28,] 0.27733161 -0.02516288 [29,] 2.49948908 0.27733161 [30,] 6.28677997 2.49948908 [31,] 6.55937501 6.28677997 [32,] 3.31711868 6.55937501 [33,] 4.37185057 3.31711868 [34,] 2.76154389 4.37185057 [35,] -0.06013802 2.76154389 [36,] 1.70419137 -0.06013802 [37,] 5.92547805 1.70419137 [38,] -1.86919948 5.92547805 [39,] 1.33278774 -1.86919948 [40,] -5.46062167 1.33278774 [41,] 2.85776530 -5.46062167 [42,] 4.16966984 2.85776530 [43,] -0.43395799 4.16966984 [44,] -3.50779251 -0.43395799 [45,] 7.17056895 -3.50779251 [46,] -0.27428289 7.17056895 [47,] 3.31192755 -0.27428289 [48,] 2.10050977 3.31192755 [49,] -1.28660565 2.10050977 [50,] -4.28751725 -1.28660565 [51,] -1.49339166 -4.28751725 [52,] 2.96124601 -1.49339166 [53,] -1.55594401 2.96124601 [54,] 1.49866239 -1.55594401 [55,] 2.23586295 1.49866239 [56,] 0.40490204 2.23586295 [57,] -1.58405380 0.40490204 [58,] 1.59296174 -1.58405380 [59,] 1.03576752 1.59296174 [60,] 0.61704275 1.03576752 [61,] 3.83350702 0.61704275 [62,] 0.50091394 3.83350702 [63,] 4.02084053 0.50091394 [64,] -4.90786416 4.02084053 [65,] 5.54378360 -4.90786416 [66,] 1.31709236 5.54378360 [67,] 2.56274825 1.31709236 [68,] -5.15839905 2.56274825 [69,] -0.61098985 -5.15839905 [70,] -0.73438555 -0.61098985 [71,] -1.52259954 -0.73438555 [72,] -0.77639819 -1.52259954 [73,] -2.36376624 -0.77639819 [74,] -0.48295032 -2.36376624 [75,] -0.13302628 -0.48295032 [76,] 0.98556903 -0.13302628 [77,] 1.47073410 0.98556903 [78,] -7.03889041 1.47073410 [79,] -2.40024601 -7.03889041 [80,] 0.91496563 -2.40024601 [81,] -3.35244404 0.91496563 [82,] -3.14248343 -3.35244404 [83,] 3.41386173 -3.14248343 [84,] 2.06214507 3.41386173 [85,] 2.41503825 2.06214507 [86,] -3.88848507 2.41503825 [87,] -6.47106779 -3.88848507 [88,] -2.66954051 -6.47106779 [89,] 0.04514635 -2.66954051 [90,] -2.72606037 0.04514635 [91,] 3.14638073 -2.72606037 [92,] -3.81455031 3.14638073 [93,] -3.38829778 -3.81455031 [94,] -3.18026010 -3.38829778 [95,] -3.19644979 -3.18026010 [96,] 0.11720008 -3.19644979 [97,] -1.56955337 0.11720008 [98,] -0.85396412 -1.56955337 [99,] -1.39592504 -0.85396412 [100,] -4.03070528 -1.39592504 [101,] -1.58493716 -4.03070528 [102,] -2.28163011 -1.58493716 [103,] -1.74104076 -2.28163011 [104,] -0.10512025 -1.74104076 [105,] -3.63151654 -0.10512025 [106,] -4.75679401 -3.63151654 [107,] -8.80295472 -4.75679401 [108,] 2.52981982 -8.80295472 [109,] 11.43025002 2.52981982 [110,] 9.78852590 11.43025002 [111,] -0.83138734 9.78852590 [112,] 1.62330795 -0.83138734 [113,] -1.19007501 1.62330795 [114,] -3.65108391 -1.19007501 [115,] 2.78558186 -3.65108391 [116,] 0.32444062 2.78558186 [117,] 5.02460455 0.32444062 [118,] -0.76225847 5.02460455 [119,] 0.95859921 -0.76225847 [120,] -1.49461430 0.95859921 [121,] 1.02323814 -1.49461430 [122,] 1.28843609 1.02323814 [123,] -1.95126519 1.28843609 [124,] 0.41653815 -1.95126519 [125,] 3.48159831 0.41653815 [126,] -4.18926400 3.48159831 [127,] 0.70086331 -4.18926400 [128,] -2.61216624 0.70086331 [129,] -6.31388784 -2.61216624 [130,] 2.07668455 -6.31388784 [131,] 0.15918300 2.07668455 [132,] 4.37398114 0.15918300 [133,] -1.17230717 4.37398114 [134,] 3.56638068 -1.17230717 [135,] 3.31809750 3.56638068 [136,] 4.15544467 3.31809750 [137,] 1.97938760 4.15544467 [138,] 1.27719294 1.97938760 [139,] 1.20693451 1.27719294 [140,] 4.08397320 1.20693451 [141,] -0.27968697 4.08397320 [142,] 0.13256230 -0.27968697 [143,] -6.83973987 0.13256230 [144,] -2.55585991 -6.83973987 [145,] 3.39548780 -2.55585991 [146,] 0.41583116 3.39548780 [147,] -2.69434932 0.41583116 [148,] 0.29395484 -2.69434932 [149,] 2.06136092 0.29395484 [150,] -1.48543027 2.06136092 [151,] 0.63248053 -1.48543027 [152,] 0.31590250 0.63248053 [153,] -6.79145106 0.31590250 [154,] 1.03220570 -6.79145106 [155,] 2.63539328 1.03220570 [156,] 5.85270076 2.63539328 [157,] -1.15749487 5.85270076 [158,] 1.56613294 -1.15749487 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 2.24310468 0.63991709 2 5.46041215 2.24310468 3 -1.54978348 5.46041215 4 1.17384433 -1.54978348 5 -1.31581625 1.17384433 6 2.19019715 -1.31581625 7 3.19995196 2.19019715 8 -1.78223634 3.19995196 9 -0.80895276 -1.78223634 10 -4.11671798 -0.80895276 11 -4.65923843 -4.11671798 12 -8.53931285 -4.65923843 13 -1.18946157 -8.53931285 14 3.34515469 -1.18946157 15 2.78109594 3.34515469 16 0.78203767 2.78109594 17 -2.53714547 0.78203767 18 -2.21337593 -2.53714547 19 -1.30609906 -2.21337593 20 1.28145022 -1.30609906 21 -3.66001084 1.28145022 22 -6.10494572 -3.66001084 23 -3.37573391 -6.10494572 24 0.38793581 -3.37573391 25 1.47262078 0.38793581 26 -4.52444206 1.47262078 27 -0.02516288 -4.52444206 28 0.27733161 -0.02516288 29 2.49948908 0.27733161 30 6.28677997 2.49948908 31 6.55937501 6.28677997 32 3.31711868 6.55937501 33 4.37185057 3.31711868 34 2.76154389 4.37185057 35 -0.06013802 2.76154389 36 1.70419137 -0.06013802 37 5.92547805 1.70419137 38 -1.86919948 5.92547805 39 1.33278774 -1.86919948 40 -5.46062167 1.33278774 41 2.85776530 -5.46062167 42 4.16966984 2.85776530 43 -0.43395799 4.16966984 44 -3.50779251 -0.43395799 45 7.17056895 -3.50779251 46 -0.27428289 7.17056895 47 3.31192755 -0.27428289 48 2.10050977 3.31192755 49 -1.28660565 2.10050977 50 -4.28751725 -1.28660565 51 -1.49339166 -4.28751725 52 2.96124601 -1.49339166 53 -1.55594401 2.96124601 54 1.49866239 -1.55594401 55 2.23586295 1.49866239 56 0.40490204 2.23586295 57 -1.58405380 0.40490204 58 1.59296174 -1.58405380 59 1.03576752 1.59296174 60 0.61704275 1.03576752 61 3.83350702 0.61704275 62 0.50091394 3.83350702 63 4.02084053 0.50091394 64 -4.90786416 4.02084053 65 5.54378360 -4.90786416 66 1.31709236 5.54378360 67 2.56274825 1.31709236 68 -5.15839905 2.56274825 69 -0.61098985 -5.15839905 70 -0.73438555 -0.61098985 71 -1.52259954 -0.73438555 72 -0.77639819 -1.52259954 73 -2.36376624 -0.77639819 74 -0.48295032 -2.36376624 75 -0.13302628 -0.48295032 76 0.98556903 -0.13302628 77 1.47073410 0.98556903 78 -7.03889041 1.47073410 79 -2.40024601 -7.03889041 80 0.91496563 -2.40024601 81 -3.35244404 0.91496563 82 -3.14248343 -3.35244404 83 3.41386173 -3.14248343 84 2.06214507 3.41386173 85 2.41503825 2.06214507 86 -3.88848507 2.41503825 87 -6.47106779 -3.88848507 88 -2.66954051 -6.47106779 89 0.04514635 -2.66954051 90 -2.72606037 0.04514635 91 3.14638073 -2.72606037 92 -3.81455031 3.14638073 93 -3.38829778 -3.81455031 94 -3.18026010 -3.38829778 95 -3.19644979 -3.18026010 96 0.11720008 -3.19644979 97 -1.56955337 0.11720008 98 -0.85396412 -1.56955337 99 -1.39592504 -0.85396412 100 -4.03070528 -1.39592504 101 -1.58493716 -4.03070528 102 -2.28163011 -1.58493716 103 -1.74104076 -2.28163011 104 -0.10512025 -1.74104076 105 -3.63151654 -0.10512025 106 -4.75679401 -3.63151654 107 -8.80295472 -4.75679401 108 2.52981982 -8.80295472 109 11.43025002 2.52981982 110 9.78852590 11.43025002 111 -0.83138734 9.78852590 112 1.62330795 -0.83138734 113 -1.19007501 1.62330795 114 -3.65108391 -1.19007501 115 2.78558186 -3.65108391 116 0.32444062 2.78558186 117 5.02460455 0.32444062 118 -0.76225847 5.02460455 119 0.95859921 -0.76225847 120 -1.49461430 0.95859921 121 1.02323814 -1.49461430 122 1.28843609 1.02323814 123 -1.95126519 1.28843609 124 0.41653815 -1.95126519 125 3.48159831 0.41653815 126 -4.18926400 3.48159831 127 0.70086331 -4.18926400 128 -2.61216624 0.70086331 129 -6.31388784 -2.61216624 130 2.07668455 -6.31388784 131 0.15918300 2.07668455 132 4.37398114 0.15918300 133 -1.17230717 4.37398114 134 3.56638068 -1.17230717 135 3.31809750 3.56638068 136 4.15544467 3.31809750 137 1.97938760 4.15544467 138 1.27719294 1.97938760 139 1.20693451 1.27719294 140 4.08397320 1.20693451 141 -0.27968697 4.08397320 142 0.13256230 -0.27968697 143 -6.83973987 0.13256230 144 -2.55585991 -6.83973987 145 3.39548780 -2.55585991 146 0.41583116 3.39548780 147 -2.69434932 0.41583116 148 0.29395484 -2.69434932 149 2.06136092 0.29395484 150 -1.48543027 2.06136092 151 0.63248053 -1.48543027 152 0.31590250 0.63248053 153 -6.79145106 0.31590250 154 1.03220570 -6.79145106 155 2.63539328 1.03220570 156 5.85270076 2.63539328 157 -1.15749487 5.85270076 158 1.56613294 -1.15749487 > 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/www/html/rcomp/tmp/7saf61291898320.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/www/html/rcomp/tmp/8saf61291898320.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/www/html/rcomp/tmp/921w91291898320.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/www/html/rcomp/tmp/1021w91291898320.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/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/www/html/rcomp/tmp/11o2ce1291898320.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/www/html/rcomp/tmp/12r2bl1291898320.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/www/html/rcomp/tmp/13g3qw1291898320.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/www/html/rcomp/tmp/148c7h1291898320.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/www/html/rcomp/tmp/15uvon1291898320.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/www/html/rcomp/tmp/16qn4e1291898320.tab") + } > > try(system("convert tmp/1j36l1291898320.ps tmp/1j36l1291898320.png",intern=TRUE)) character(0) > try(system("convert tmp/2tdno1291898320.ps tmp/2tdno1291898320.png",intern=TRUE)) character(0) > try(system("convert tmp/3tdno1291898320.ps tmp/3tdno1291898320.png",intern=TRUE)) character(0) > try(system("convert tmp/4tdno1291898320.ps tmp/4tdno1291898320.png",intern=TRUE)) character(0) > try(system("convert tmp/5tdno1291898320.ps tmp/5tdno1291898320.png",intern=TRUE)) character(0) > try(system("convert tmp/6hjgl1291898320.ps tmp/6hjgl1291898320.png",intern=TRUE)) character(0) > try(system("convert tmp/7saf61291898320.ps tmp/7saf61291898320.png",intern=TRUE)) character(0) > try(system("convert tmp/8saf61291898320.ps tmp/8saf61291898320.png",intern=TRUE)) character(0) > try(system("convert tmp/921w91291898320.ps tmp/921w91291898320.png",intern=TRUE)) character(0) > try(system("convert tmp/1021w91291898320.ps tmp/1021w91291898320.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.165 1.826 9.652