R version 2.8.0 (2008-10-20) Copyright (C) 2008 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. Natural language support but running in an English locale 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(2 + ,24 + ,14 + ,11 + ,12 + ,24 + ,26 + ,2 + ,25 + ,11 + ,7 + ,8 + ,25 + ,23 + ,2 + ,17 + ,6 + ,17 + ,8 + ,30 + ,25 + ,1 + ,18 + ,12 + ,10 + ,8 + ,19 + ,23 + ,2 + ,18 + ,8 + ,12 + ,9 + ,22 + ,19 + ,2 + ,16 + ,10 + ,12 + ,7 + ,22 + ,29 + ,2 + ,20 + ,10 + ,11 + ,4 + ,25 + ,25 + ,2 + ,16 + ,11 + ,11 + ,11 + ,23 + ,21 + ,2 + ,18 + ,16 + ,12 + ,7 + ,17 + ,22 + ,2 + ,17 + ,11 + ,13 + ,7 + ,21 + ,25 + ,1 + ,23 + ,13 + ,14 + ,12 + ,19 + ,24 + ,2 + ,30 + ,12 + ,16 + ,10 + ,19 + ,18 + ,1 + ,23 + ,8 + ,11 + ,10 + ,15 + ,22 + ,2 + ,18 + ,12 + ,10 + ,8 + ,16 + ,15 + ,2 + ,15 + ,11 + ,11 + ,8 + ,23 + ,22 + ,1 + ,12 + ,4 + ,15 + ,4 + ,27 + ,28 + ,1 + ,21 + ,9 + ,9 + ,9 + ,22 + ,20 + ,2 + ,15 + ,8 + ,11 + ,8 + ,14 + ,12 + ,1 + ,20 + ,8 + ,17 + ,7 + ,22 + ,24 + ,2 + ,31 + ,14 + ,17 + ,11 + ,23 + ,20 + ,1 + ,27 + ,15 + ,11 + ,9 + ,23 + ,21 + ,2 + ,34 + ,16 + ,18 + ,11 + ,21 + ,20 + ,2 + ,21 + ,9 + ,14 + ,13 + ,19 + ,21 + ,2 + ,31 + ,14 + ,10 + ,8 + ,18 + ,23 + ,1 + ,19 + ,11 + ,11 + ,8 + ,20 + ,28 + ,2 + ,16 + ,8 + ,15 + ,9 + ,23 + ,24 + ,1 + ,20 + ,9 + ,15 + ,6 + ,25 + ,24 + ,2 + ,21 + ,9 + ,13 + ,9 + ,19 + ,24 + ,2 + ,22 + ,9 + ,16 + ,9 + ,24 + ,23 + ,1 + ,17 + ,9 + ,13 + ,6 + ,22 + ,23 + ,2 + ,24 + ,10 + ,9 + ,6 + ,25 + ,29 + ,1 + ,25 + ,16 + ,18 + ,16 + ,26 + ,24 + ,2 + ,26 + ,11 + ,18 + ,5 + ,29 + ,18 + ,2 + ,25 + ,8 + ,12 + ,7 + ,32 + ,25 + ,1 + ,17 + ,9 + ,17 + ,9 + ,25 + ,21 + ,1 + ,32 + ,16 + ,9 + ,6 + ,29 + ,26 + ,1 + ,33 + ,11 + ,9 + ,6 + ,28 + ,22 + ,1 + ,13 + ,16 + ,12 + ,5 + ,17 + ,22 + ,2 + ,32 + ,12 + ,18 + ,12 + ,28 + ,22 + ,1 + ,25 + ,12 + ,12 + ,7 + ,29 + ,23 + ,1 + ,29 + ,14 + ,18 + ,10 + ,26 + ,30 + ,2 + ,22 + ,9 + ,14 + ,9 + ,25 + ,23 + ,1 + ,18 + ,10 + ,15 + ,8 + ,14 + ,17 + ,1 + ,17 + ,9 + ,16 + ,5 + ,25 + ,23 + ,2 + ,20 + ,10 + ,10 + ,8 + ,26 + ,23 + ,2 + ,15 + ,12 + ,11 + ,8 + ,20 + ,25 + ,2 + ,20 + ,14 + ,14 + ,10 + ,18 + ,24 + ,2 + ,33 + ,14 + ,9 + ,6 + ,32 + ,24 + ,2 + ,29 + ,10 + ,12 + ,8 + ,25 + ,23 + ,1 + ,23 + ,14 + ,17 + ,7 + ,25 + ,21 + ,2 + ,26 + ,16 + ,5 + ,4 + ,23 + ,24 + ,1 + ,18 + ,9 + ,12 + ,8 + ,21 + ,24 + ,1 + ,20 + ,10 + ,12 + ,8 + ,20 + ,28 + ,2 + ,11 + ,6 + ,6 + ,4 + ,15 + ,16 + ,1 + ,28 + ,8 + ,24 + ,20 + ,30 + ,20 + ,2 + ,26 + ,13 + ,12 + ,8 + ,24 + ,29 + ,2 + ,22 + ,10 + ,12 + ,8 + ,26 + ,27 + ,2 + ,17 + ,8 + ,14 + ,6 + ,24 + ,22 + ,1 + ,12 + ,7 + ,7 + ,4 + ,22 + ,28 + ,2 + ,14 + ,15 + ,13 + ,8 + ,14 + ,16 + ,1 + ,17 + ,9 + ,12 + ,9 + ,24 + ,25 + ,1 + ,21 + ,10 + ,13 + ,6 + ,24 + ,24 + ,2 + ,19 + ,12 + ,14 + ,7 + ,24 + ,28 + ,2 + ,18 + ,13 + ,8 + ,9 + ,24 + ,24 + ,2 + ,10 + ,10 + ,11 + ,5 + ,19 + ,23 + ,1 + ,29 + ,11 + ,9 + ,5 + ,31 + ,30 + ,2 + ,31 + ,8 + ,11 + ,8 + ,22 + ,24 + ,1 + ,19 + ,9 + ,13 + ,8 + ,27 + ,21 + ,2 + ,9 + ,13 + ,10 + ,6 + ,19 + ,25 + ,1 + ,20 + ,11 + ,11 + ,8 + ,25 + ,25 + ,1 + ,28 + ,8 + ,12 + ,7 + ,20 + ,22 + ,2 + ,19 + ,9 + ,9 + ,7 + ,21 + ,23 + ,2 + ,30 + ,9 + ,15 + ,9 + ,27 + ,26 + ,1 + ,29 + ,15 + ,18 + ,11 + ,23 + ,23 + ,1 + ,26 + ,9 + ,15 + ,6 + ,25 + ,25 + ,2 + ,23 + ,10 + ,12 + ,8 + ,20 + ,21 + ,2 + ,13 + ,14 + ,13 + ,6 + ,21 + ,25 + ,2 + ,21 + ,12 + ,14 + ,9 + ,22 + ,24 + ,1 + ,19 + ,12 + ,10 + ,8 + ,23 + ,29 + ,1 + ,28 + ,11 + ,13 + ,6 + ,25 + ,22 + ,1 + ,23 + ,14 + ,13 + ,10 + ,25 + ,27 + ,1 + ,18 + ,6 + ,11 + ,8 + ,17 + ,26 + ,2 + ,21 + ,12 + ,13 + ,8 + ,19 + ,22 + ,1 + ,20 + ,8 + ,16 + ,10 + ,25 + ,24 + ,2 + ,23 + ,14 + ,8 + ,5 + ,19 + ,27 + ,2 + ,21 + ,11 + ,16 + ,7 + ,20 + ,24 + ,1 + ,21 + ,10 + ,11 + ,5 + ,26 + ,24 + ,2 + ,15 + ,14 + ,9 + ,8 + ,23 + ,29 + ,2 + ,28 + ,12 + ,16 + ,14 + ,27 + ,22 + ,2 + ,19 + ,10 + ,12 + ,7 + ,17 + ,21 + ,2 + ,26 + ,14 + ,14 + ,8 + ,17 + ,24 + ,2 + ,10 + ,5 + ,8 + ,6 + ,19 + ,24 + ,2 + ,16 + ,11 + ,9 + ,5 + ,17 + ,23 + ,2 + ,22 + ,10 + ,15 + ,6 + ,22 + ,20 + ,2 + ,19 + ,9 + ,11 + ,10 + ,21 + ,27 + ,2 + ,31 + ,10 + ,21 + ,12 + ,32 + ,26 + ,2 + ,31 + ,16 + ,14 + ,9 + ,21 + ,25 + ,2 + ,29 + ,13 + ,18 + ,12 + ,21 + ,21 + ,1 + ,19 + ,9 + ,12 + ,7 + ,18 + ,21 + ,1 + ,22 + ,10 + ,13 + ,8 + ,18 + ,19 + ,2 + ,23 + ,10 + ,15 + ,10 + ,23 + ,21 + ,1 + ,15 + ,7 + ,12 + ,6 + ,19 + ,21 + ,2 + ,20 + ,9 + ,19 + ,10 + ,20 + ,16 + ,1 + ,18 + ,8 + ,15 + ,10 + ,21 + ,22 + ,2 + ,23 + ,14 + ,11 + ,10 + ,20 + ,29 + ,1 + ,25 + ,14 + ,11 + ,5 + ,17 + ,15 + ,2 + ,21 + ,8 + ,10 + ,7 + ,18 + ,17 + ,1 + ,24 + ,9 + ,13 + ,10 + ,19 + ,15 + ,1 + ,25 + ,14 + ,15 + ,11 + ,22 + ,21 + ,2 + ,17 + ,14 + ,12 + ,6 + ,15 + ,21 + ,2 + ,13 + ,8 + ,12 + ,7 + ,14 + ,19 + ,2 + ,28 + ,8 + ,16 + ,12 + ,18 + ,24 + ,2 + ,21 + ,8 + ,9 + ,11 + ,24 + ,20 + ,1 + ,25 + ,7 + ,18 + ,11 + ,35 + ,17 + ,2 + ,9 + ,6 + ,8 + ,11 + ,29 + ,23 + ,1 + ,16 + ,8 + ,13 + ,5 + ,21 + ,24 + ,2 + ,19 + ,6 + ,17 + ,8 + ,25 + ,14 + ,2 + ,17 + ,11 + ,9 + ,6 + ,20 + ,19 + ,2 + ,25 + ,14 + ,15 + ,9 + ,22 + ,24 + ,2 + ,20 + ,11 + ,8 + ,4 + ,13 + ,13 + ,2 + ,29 + ,11 + ,7 + ,4 + ,26 + ,22 + ,2 + ,14 + ,11 + ,12 + ,7 + ,17 + ,16 + ,2 + ,22 + ,14 + ,14 + ,11 + ,25 + ,19 + ,2 + ,15 + ,8 + ,6 + ,6 + ,20 + ,25 + ,2 + ,19 + ,20 + ,8 + ,7 + ,19 + ,25 + ,2 + ,20 + ,11 + ,17 + ,8 + ,21 + ,23 + ,1 + ,15 + ,8 + ,10 + ,4 + ,22 + ,24 + ,2 + ,20 + ,11 + ,11 + ,8 + ,24 + ,26 + ,2 + ,18 + ,10 + ,14 + ,9 + ,21 + ,26 + ,2 + ,33 + ,14 + ,11 + ,8 + ,26 + ,25 + ,1 + ,22 + ,11 + ,13 + ,11 + ,24 + ,18 + ,1 + ,16 + ,9 + ,12 + ,8 + ,16 + ,21 + ,2 + ,17 + ,9 + ,11 + ,5 + ,23 + ,26 + ,1 + ,16 + ,8 + ,9 + ,4 + ,18 + ,23 + ,1 + ,21 + ,10 + ,12 + ,8 + ,16 + ,23 + ,2 + ,26 + ,13 + ,20 + ,10 + ,26 + ,22 + ,1 + ,18 + ,13 + ,12 + ,6 + ,19 + ,20 + ,1 + ,18 + ,12 + ,13 + ,9 + ,21 + ,13 + ,2 + ,17 + ,8 + ,12 + ,9 + ,21 + ,24 + ,2 + ,22 + ,13 + ,12 + ,13 + ,22 + ,15 + ,1 + ,30 + ,14 + ,9 + ,9 + ,23 + ,14 + ,2 + ,30 + ,12 + ,15 + ,10 + ,29 + ,22 + ,1 + ,24 + ,14 + ,24 + ,20 + ,21 + ,10 + ,2 + ,21 + ,15 + ,7 + ,5 + ,21 + ,24 + ,1 + ,21 + ,13 + ,17 + ,11 + ,23 + ,22 + ,2 + ,29 + ,16 + ,11 + ,6 + ,27 + ,24 + ,2 + ,31 + ,9 + ,17 + ,9 + ,25 + ,19 + ,1 + ,20 + ,9 + ,11 + ,7 + ,21 + ,20 + ,1 + ,16 + ,9 + ,12 + ,9 + ,10 + ,13 + ,1 + ,22 + ,8 + ,14 + ,10 + ,20 + ,20 + ,2 + ,20 + ,7 + ,11 + ,9 + ,26 + ,22 + ,2 + ,28 + ,16 + ,16 + ,8 + ,24 + ,24 + ,1 + ,38 + ,11 + ,21 + ,7 + ,29 + ,29 + ,2 + ,22 + ,9 + ,14 + ,6 + ,19 + ,12 + ,2 + ,20 + ,11 + ,20 + ,13 + ,24 + ,20 + ,2 + ,17 + ,9 + ,13 + ,6 + ,19 + ,21 + ,2 + ,28 + ,14 + ,11 + ,8 + ,24 + ,24 + ,2 + ,22 + ,13 + ,15 + ,10 + ,22 + ,22 + ,2 + ,31 + ,16 + ,19 + ,16 + ,17 + ,20) + ,dim=c(7 + ,159) + ,dimnames=list(c('G' + ,'COM' + ,'DA' + ,'PE' + ,'PC' + ,'PS' + ,'O ') + ,1:159)) > y <- array(NA,dim=c(7,159),dimnames=list(c('G','COM','DA','PE','PC','PS','O '),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 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '2' > #'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 COM G DA PE PC PS O\r 1 24 2 14 11 12 24 26 2 25 2 11 7 8 25 23 3 17 2 6 17 8 30 25 4 18 1 12 10 8 19 23 5 18 2 8 12 9 22 19 6 16 2 10 12 7 22 29 7 20 2 10 11 4 25 25 8 16 2 11 11 11 23 21 9 18 2 16 12 7 17 22 10 17 2 11 13 7 21 25 11 23 1 13 14 12 19 24 12 30 2 12 16 10 19 18 13 23 1 8 11 10 15 22 14 18 2 12 10 8 16 15 15 15 2 11 11 8 23 22 16 12 1 4 15 4 27 28 17 21 1 9 9 9 22 20 18 15 2 8 11 8 14 12 19 20 1 8 17 7 22 24 20 31 2 14 17 11 23 20 21 27 1 15 11 9 23 21 22 34 2 16 18 11 21 20 23 21 2 9 14 13 19 21 24 31 2 14 10 8 18 23 25 19 1 11 11 8 20 28 26 16 2 8 15 9 23 24 27 20 1 9 15 6 25 24 28 21 2 9 13 9 19 24 29 22 2 9 16 9 24 23 30 17 1 9 13 6 22 23 31 24 2 10 9 6 25 29 32 25 1 16 18 16 26 24 33 26 2 11 18 5 29 18 34 25 2 8 12 7 32 25 35 17 1 9 17 9 25 21 36 32 1 16 9 6 29 26 37 33 1 11 9 6 28 22 38 13 1 16 12 5 17 22 39 32 2 12 18 12 28 22 40 25 1 12 12 7 29 23 41 29 1 14 18 10 26 30 42 22 2 9 14 9 25 23 43 18 1 10 15 8 14 17 44 17 1 9 16 5 25 23 45 20 2 10 10 8 26 23 46 15 2 12 11 8 20 25 47 20 2 14 14 10 18 24 48 33 2 14 9 6 32 24 49 29 2 10 12 8 25 23 50 23 1 14 17 7 25 21 51 26 2 16 5 4 23 24 52 18 1 9 12 8 21 24 53 20 1 10 12 8 20 28 54 11 2 6 6 4 15 16 55 28 1 8 24 20 30 20 56 26 2 13 12 8 24 29 57 22 2 10 12 8 26 27 58 17 2 8 14 6 24 22 59 12 1 7 7 4 22 28 60 14 2 15 13 8 14 16 61 17 1 9 12 9 24 25 62 21 1 10 13 6 24 24 63 19 2 12 14 7 24 28 64 18 2 13 8 9 24 24 65 10 2 10 11 5 19 23 66 29 1 11 9 5 31 30 67 31 2 8 11 8 22 24 68 19 1 9 13 8 27 21 69 9 2 13 10 6 19 25 70 20 1 11 11 8 25 25 71 28 1 8 12 7 20 22 72 19 2 9 9 7 21 23 73 30 2 9 15 9 27 26 74 29 1 15 18 11 23 23 75 26 1 9 15 6 25 25 76 23 2 10 12 8 20 21 77 13 2 14 13 6 21 25 78 21 2 12 14 9 22 24 79 19 1 12 10 8 23 29 80 28 1 11 13 6 25 22 81 23 1 14 13 10 25 27 82 18 1 6 11 8 17 26 83 21 2 12 13 8 19 22 84 20 1 8 16 10 25 24 85 23 2 14 8 5 19 27 86 21 2 11 16 7 20 24 87 21 1 10 11 5 26 24 88 15 2 14 9 8 23 29 89 28 2 12 16 14 27 22 90 19 2 10 12 7 17 21 91 26 2 14 14 8 17 24 92 10 2 5 8 6 19 24 93 16 2 11 9 5 17 23 94 22 2 10 15 6 22 20 95 19 2 9 11 10 21 27 96 31 2 10 21 12 32 26 97 31 2 16 14 9 21 25 98 29 2 13 18 12 21 21 99 19 1 9 12 7 18 21 100 22 1 10 13 8 18 19 101 23 2 10 15 10 23 21 102 15 1 7 12 6 19 21 103 20 2 9 19 10 20 16 104 18 1 8 15 10 21 22 105 23 2 14 11 10 20 29 106 25 1 14 11 5 17 15 107 21 2 8 10 7 18 17 108 24 1 9 13 10 19 15 109 25 1 14 15 11 22 21 110 17 2 14 12 6 15 21 111 13 2 8 12 7 14 19 112 28 2 8 16 12 18 24 113 21 2 8 9 11 24 20 114 25 1 7 18 11 35 17 115 9 2 6 8 11 29 23 116 16 1 8 13 5 21 24 117 19 2 6 17 8 25 14 118 17 2 11 9 6 20 19 119 25 2 14 15 9 22 24 120 20 2 11 8 4 13 13 121 29 2 11 7 4 26 22 122 14 2 11 12 7 17 16 123 22 2 14 14 11 25 19 124 15 2 8 6 6 20 25 125 19 2 20 8 7 19 25 126 20 2 11 17 8 21 23 127 15 1 8 10 4 22 24 128 20 2 11 11 8 24 26 129 18 2 10 14 9 21 26 130 33 2 14 11 8 26 25 131 22 1 11 13 11 24 18 132 16 1 9 12 8 16 21 133 17 2 9 11 5 23 26 134 16 1 8 9 4 18 23 135 21 1 10 12 8 16 23 136 26 2 13 20 10 26 22 137 18 1 13 12 6 19 20 138 18 1 12 13 9 21 13 139 17 2 8 12 9 21 24 140 22 2 13 12 13 22 15 141 30 1 14 9 9 23 14 142 30 2 12 15 10 29 22 143 24 1 14 24 20 21 10 144 21 2 15 7 5 21 24 145 21 1 13 17 11 23 22 146 29 2 16 11 6 27 24 147 31 2 9 17 9 25 19 148 20 1 9 11 7 21 20 149 16 1 9 12 9 10 13 150 22 1 8 14 10 20 20 151 20 2 7 11 9 26 22 152 28 2 16 16 8 24 24 153 38 1 11 21 7 29 29 154 22 2 9 14 6 19 12 155 20 2 11 20 13 24 20 156 17 2 9 13 6 19 21 157 28 2 14 11 8 24 24 158 22 2 13 15 10 22 22 159 31 2 16 19 16 17 20 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) G DA PE PC PS -1.7649 -0.1314 0.8128 0.2485 0.1903 0.5659 `O\r` -0.1157 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -11.6811 -2.5454 -0.4093 2.7864 12.5959 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -1.76494 3.27874 -0.538 0.5912 G -0.13139 0.74448 -0.176 0.8601 DA 0.81285 0.13166 6.174 5.80e-09 *** PE 0.24845 0.13412 1.852 0.0659 . PC 0.19033 0.16911 1.126 0.2621 PS 0.56590 0.09612 5.887 2.42e-08 *** `O\r` -0.11568 0.10335 -1.119 0.2648 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 4.492 on 152 degrees of freedom Multiple R-squared: 0.4073, Adjusted R-squared: 0.3839 F-statistic: 17.41 on 6 and 152 DF, p-value: 2.815e-15 > 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.2144658 0.42893166 0.78553417 [2,] 0.2663909 0.53278174 0.73360913 [3,] 0.7472689 0.50546225 0.25273112 [4,] 0.7532429 0.49351424 0.24675712 [5,] 0.7180392 0.56392151 0.28196075 [6,] 0.7175828 0.56483440 0.28241720 [7,] 0.6614078 0.67718434 0.33859217 [8,] 0.5736850 0.85262992 0.42631496 [9,] 0.5261676 0.94766478 0.47383239 [10,] 0.4452702 0.89054044 0.55472978 [11,] 0.4630583 0.92611655 0.53694173 [12,] 0.3839558 0.76791157 0.61604422 [13,] 0.3898463 0.77969250 0.61015375 [14,] 0.3177975 0.63559504 0.68220248 [15,] 0.6282750 0.74345003 0.37172502 [16,] 0.5588288 0.88234230 0.44117115 [17,] 0.5162503 0.96749941 0.48374970 [18,] 0.4490477 0.89809535 0.55095233 [19,] 0.4140437 0.82808734 0.58595633 [20,] 0.3540558 0.70811153 0.64594424 [21,] 0.3038982 0.60779644 0.69610178 [22,] 0.3801686 0.76033730 0.61983135 [23,] 0.4432964 0.88659277 0.55670361 [24,] 0.3971714 0.79434270 0.60282865 [25,] 0.4042855 0.80857094 0.59571453 [26,] 0.4086265 0.81725296 0.59137352 [27,] 0.4079787 0.81595731 0.59202134 [28,] 0.5855720 0.82885608 0.41442804 [29,] 0.7805943 0.43881139 0.21940569 [30,] 0.7749891 0.45002172 0.22501086 [31,] 0.7333678 0.53326436 0.26663218 [32,] 0.7101911 0.57961772 0.28980886 [33,] 0.6615039 0.67699228 0.33849614 [34,] 0.6143737 0.77125265 0.38562633 [35,] 0.5997505 0.80049906 0.40024953 [36,] 0.5659476 0.86810488 0.43405244 [37,] 0.5878941 0.82421172 0.41210586 [38,] 0.5463841 0.90723172 0.45361586 [39,] 0.5365914 0.92681718 0.46340859 [40,] 0.5998328 0.80033440 0.40016720 [41,] 0.5789092 0.84218168 0.42109084 [42,] 0.5432061 0.91358781 0.45679390 [43,] 0.4940078 0.98801561 0.50599220 [44,] 0.4561601 0.91232017 0.54383991 [45,] 0.4084775 0.81695501 0.59152250 [46,] 0.3641220 0.72824408 0.63587796 [47,] 0.3346956 0.66939111 0.66530445 [48,] 0.2904447 0.58088931 0.70955534 [49,] 0.2650276 0.53005517 0.73497241 [50,] 0.2441927 0.48838549 0.75580725 [51,] 0.3048603 0.60972053 0.69513974 [52,] 0.2922150 0.58442996 0.70778502 [53,] 0.2550569 0.51011388 0.74494306 [54,] 0.2419586 0.48391727 0.75804136 [55,] 0.2765487 0.55309732 0.72345134 [56,] 0.3513751 0.70275024 0.64862488 [57,] 0.3511078 0.70221562 0.64889219 [58,] 0.6841773 0.63164531 0.31582265 [59,] 0.6772180 0.64556410 0.32278205 [60,] 0.8491083 0.30178337 0.15089168 [61,] 0.8304067 0.33918662 0.16959331 [62,] 0.9312160 0.13756794 0.06878397 [63,] 0.9150520 0.16989609 0.08494805 [64,] 0.9386148 0.12277049 0.06138525 [65,] 0.9265155 0.14696907 0.07348454 [66,] 0.9272698 0.14546045 0.07273022 [67,] 0.9212959 0.15740820 0.07870410 [68,] 0.9693104 0.06137927 0.03068964 [69,] 0.9615954 0.07680928 0.03840464 [70,] 0.9544089 0.09118220 0.04559110 [71,] 0.9560883 0.08782338 0.04391169 [72,] 0.9486539 0.10269210 0.05134605 [73,] 0.9472900 0.10542005 0.05271002 [74,] 0.9339765 0.13204696 0.06602348 [75,] 0.9210433 0.15791340 0.07895670 [76,] 0.9125891 0.17482187 0.08741094 [77,] 0.8968603 0.20627938 0.10313969 [78,] 0.8755597 0.24888060 0.12444030 [79,] 0.9196765 0.16064708 0.08032354 [80,] 0.9030478 0.19390437 0.09695219 [81,] 0.8832504 0.23349920 0.11674960 [82,] 0.8858734 0.22825312 0.11412656 [83,] 0.8737780 0.25244393 0.12622196 [84,] 0.8512619 0.29747619 0.14873810 [85,] 0.8235989 0.35280220 0.17640110 [86,] 0.7905692 0.41886163 0.20943082 [87,] 0.7617144 0.47657110 0.23828555 [88,] 0.7815175 0.43696506 0.21848253 [89,] 0.7771351 0.44572985 0.22286493 [90,] 0.7416725 0.51665503 0.25832752 [91,] 0.7155676 0.56886470 0.28443235 [92,] 0.6733622 0.65327557 0.32663778 [93,] 0.6360667 0.72786659 0.36393329 [94,] 0.5956197 0.80876069 0.40438034 [95,] 0.5545065 0.89098701 0.44549350 [96,] 0.5084612 0.98307752 0.49153876 [97,] 0.4854425 0.97088500 0.51455750 [98,] 0.4845709 0.96914179 0.51542910 [99,] 0.4913362 0.98267248 0.50866376 [100,] 0.4410943 0.88218851 0.55890574 [101,] 0.4167834 0.83356689 0.58321656 [102,] 0.3769381 0.75387630 0.62306185 [103,] 0.6025866 0.79482688 0.39741344 [104,] 0.5965803 0.80683946 0.40341973 [105,] 0.5725362 0.85492752 0.42746376 [106,] 0.7721525 0.45569492 0.22784746 [107,] 0.7548822 0.49023559 0.24511780 [108,] 0.7364412 0.52711752 0.26355876 [109,] 0.7054290 0.58914197 0.29457098 [110,] 0.6558368 0.68832644 0.34416322 [111,] 0.6781286 0.64374278 0.32187139 [112,] 0.7363370 0.52732607 0.26366304 [113,] 0.7279613 0.54407739 0.27203869 [114,] 0.7289882 0.54202361 0.27101181 [115,] 0.6765521 0.64689580 0.32344790 [116,] 0.7190643 0.56187143 0.28093571 [117,] 0.6856991 0.62860174 0.31430087 [118,] 0.6825035 0.63499303 0.31749651 [119,] 0.6443443 0.71131146 0.35565573 [120,] 0.6123617 0.77527651 0.38763825 [121,] 0.6861137 0.62777264 0.31388632 [122,] 0.6334238 0.73315235 0.36657617 [123,] 0.5720686 0.85586273 0.42793137 [124,] 0.5622292 0.87554158 0.43777079 [125,] 0.5050842 0.98983165 0.49491582 [126,] 0.4553481 0.91069614 0.54465193 [127,] 0.4217537 0.84350747 0.57824626 [128,] 0.4385729 0.87714580 0.56142710 [129,] 0.5088202 0.98235964 0.49117982 [130,] 0.4332802 0.86656038 0.56671981 [131,] 0.3556699 0.71133985 0.64433008 [132,] 0.4246820 0.84936400 0.57531800 [133,] 0.3703252 0.74065036 0.62967482 [134,] 0.3047116 0.60942326 0.69528837 [135,] 0.2285587 0.45711742 0.77144129 [136,] 0.3682241 0.73644813 0.63177594 [137,] 0.2702763 0.54055257 0.72972372 [138,] 0.3937190 0.78743802 0.60628099 [139,] 0.3364928 0.67298567 0.66350716 [140,] 0.2529608 0.50592163 0.74703918 > postscript(file="/var/www/html/freestat/rcomp/tmp/1ntbm1292264454.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/freestat/rcomp/tmp/2ntbm1292264454.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/freestat/rcomp/tmp/3g3a71292264454.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/freestat/rcomp/tmp/4g3a71292264454.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/freestat/rcomp/tmp/5g3a71292264454.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.94299635 3.33775014 -5.68066888 -1.95645010 -1.42133490 -3.50952876 7 8 9 10 11 12 -0.85051001 -6.32663160 -4.36691141 -3.46766645 0.59123491 7.72513651 13 14 15 16 17 18 7.81374564 -1.05282575 -6.63994599 -5.88336757 1.49546584 -0.26513054 19 20 21 22 23 24 0.16409212 4.62841556 1.67124412 6.88606366 1.43664181 10.11514407 25 26 27 28 29 30 -0.37953525 -4.15417640 -1.65921838 2.79348223 0.10293635 -2.58029422 31 32 33 34 35 36 3.72846380 -5.56376641 -0.66625501 0.99443124 -6.07417816 4.10931907 37 38 39 40 41 42 9.27673312 -9.11763672 4.21719314 -0.92202716 1.89803940 0.03394252 43 44 45 46 47 48 0.56238240 -4.83302151 -2.16066048 -5.40804309 -2.14365328 4.93734290 49 50 51 52 53 54 6.90833334 -3.75775896 2.77922850 -1.03092460 1.18486119 -0.73899408 55 56 57 58 59 60 -1.03936097 2.72978720 -0.19483201 -3.13198923 -3.50478814 -6.98925024 61 62 63 64 65 66 -3.80327609 -0.40926107 -3.87961950 -5.04515239 -7.87680887 4.69483593 67 68 69 70 71 72 12.59587122 -4.02183186 -11.02587119 -2.55608876 10.30679198 0.92047871 73 74 75 76 77 78 7.00073965 1.78277062 4.45646539 3.50646799 -9.71588172 -1.59122161 79 80 81 82 83 84 -2.52594922 4.98062121 -2.64084494 4.15104723 0.31389942 -1.85615774 85 86 87 88 89 90 3.07988718 0.23719029 -0.85382138 -7.77180218 0.89933229 1.39450326 91 92 93 94 95 96 4.80291505 -3.14185043 -1.06095112 0.89429132 0.31530534 2.29666603 97 98 99 100 101 102 5.83896364 4.24996270 1.51005935 3.02705481 0.68273886 -1.23980766 103 104 105 106 107 108 -1.37894217 -1.57547022 1.04832462 3.94672965 4.48847382 4.43060112 109 110 111 112 113 114 -0.32448682 -2.53476087 -1.51346349 9.85587065 0.92724002 -3.19933936 115 116 117 118 119 120 -11.68105807 -1.89552632 -2.12368818 -2.41172148 0.53462560 4.48460017 121 122 123 124 125 126 7.41750172 -4.99676534 -4.87370917 -0.53370970 -6.40924670 -1.88318117 127 128 129 130 131 132 -2.52573289 -1.74311133 -2.16825415 7.57085480 -1.86788319 -0.54847372 133 134 135 136 137 138 -1.98050957 0.87063840 3.87004408 -1.58009444 -3.23258988 -5.18078257 139 140 141 142 143 144 -1.27701560 -2.70965448 5.17121407 2.77732052 -5.98019318 -0.96336145 145 146 147 148 149 150 -4.45876036 1.64423900 7.82584751 0.94512756 1.73112478 3.00751598 151 152 153 154 155 156 -0.27658229 0.71900589 11.34884546 2.72782550 -5.62496347 -0.98256724 157 158 159 3.58697190 -2.07422615 4.94954236 > postscript(file="/var/www/html/freestat/rcomp/tmp/6qcss1292264454.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.94299635 NA 1 3.33775014 -0.94299635 2 -5.68066888 3.33775014 3 -1.95645010 -5.68066888 4 -1.42133490 -1.95645010 5 -3.50952876 -1.42133490 6 -0.85051001 -3.50952876 7 -6.32663160 -0.85051001 8 -4.36691141 -6.32663160 9 -3.46766645 -4.36691141 10 0.59123491 -3.46766645 11 7.72513651 0.59123491 12 7.81374564 7.72513651 13 -1.05282575 7.81374564 14 -6.63994599 -1.05282575 15 -5.88336757 -6.63994599 16 1.49546584 -5.88336757 17 -0.26513054 1.49546584 18 0.16409212 -0.26513054 19 4.62841556 0.16409212 20 1.67124412 4.62841556 21 6.88606366 1.67124412 22 1.43664181 6.88606366 23 10.11514407 1.43664181 24 -0.37953525 10.11514407 25 -4.15417640 -0.37953525 26 -1.65921838 -4.15417640 27 2.79348223 -1.65921838 28 0.10293635 2.79348223 29 -2.58029422 0.10293635 30 3.72846380 -2.58029422 31 -5.56376641 3.72846380 32 -0.66625501 -5.56376641 33 0.99443124 -0.66625501 34 -6.07417816 0.99443124 35 4.10931907 -6.07417816 36 9.27673312 4.10931907 37 -9.11763672 9.27673312 38 4.21719314 -9.11763672 39 -0.92202716 4.21719314 40 1.89803940 -0.92202716 41 0.03394252 1.89803940 42 0.56238240 0.03394252 43 -4.83302151 0.56238240 44 -2.16066048 -4.83302151 45 -5.40804309 -2.16066048 46 -2.14365328 -5.40804309 47 4.93734290 -2.14365328 48 6.90833334 4.93734290 49 -3.75775896 6.90833334 50 2.77922850 -3.75775896 51 -1.03092460 2.77922850 52 1.18486119 -1.03092460 53 -0.73899408 1.18486119 54 -1.03936097 -0.73899408 55 2.72978720 -1.03936097 56 -0.19483201 2.72978720 57 -3.13198923 -0.19483201 58 -3.50478814 -3.13198923 59 -6.98925024 -3.50478814 60 -3.80327609 -6.98925024 61 -0.40926107 -3.80327609 62 -3.87961950 -0.40926107 63 -5.04515239 -3.87961950 64 -7.87680887 -5.04515239 65 4.69483593 -7.87680887 66 12.59587122 4.69483593 67 -4.02183186 12.59587122 68 -11.02587119 -4.02183186 69 -2.55608876 -11.02587119 70 10.30679198 -2.55608876 71 0.92047871 10.30679198 72 7.00073965 0.92047871 73 1.78277062 7.00073965 74 4.45646539 1.78277062 75 3.50646799 4.45646539 76 -9.71588172 3.50646799 77 -1.59122161 -9.71588172 78 -2.52594922 -1.59122161 79 4.98062121 -2.52594922 80 -2.64084494 4.98062121 81 4.15104723 -2.64084494 82 0.31389942 4.15104723 83 -1.85615774 0.31389942 84 3.07988718 -1.85615774 85 0.23719029 3.07988718 86 -0.85382138 0.23719029 87 -7.77180218 -0.85382138 88 0.89933229 -7.77180218 89 1.39450326 0.89933229 90 4.80291505 1.39450326 91 -3.14185043 4.80291505 92 -1.06095112 -3.14185043 93 0.89429132 -1.06095112 94 0.31530534 0.89429132 95 2.29666603 0.31530534 96 5.83896364 2.29666603 97 4.24996270 5.83896364 98 1.51005935 4.24996270 99 3.02705481 1.51005935 100 0.68273886 3.02705481 101 -1.23980766 0.68273886 102 -1.37894217 -1.23980766 103 -1.57547022 -1.37894217 104 1.04832462 -1.57547022 105 3.94672965 1.04832462 106 4.48847382 3.94672965 107 4.43060112 4.48847382 108 -0.32448682 4.43060112 109 -2.53476087 -0.32448682 110 -1.51346349 -2.53476087 111 9.85587065 -1.51346349 112 0.92724002 9.85587065 113 -3.19933936 0.92724002 114 -11.68105807 -3.19933936 115 -1.89552632 -11.68105807 116 -2.12368818 -1.89552632 117 -2.41172148 -2.12368818 118 0.53462560 -2.41172148 119 4.48460017 0.53462560 120 7.41750172 4.48460017 121 -4.99676534 7.41750172 122 -4.87370917 -4.99676534 123 -0.53370970 -4.87370917 124 -6.40924670 -0.53370970 125 -1.88318117 -6.40924670 126 -2.52573289 -1.88318117 127 -1.74311133 -2.52573289 128 -2.16825415 -1.74311133 129 7.57085480 -2.16825415 130 -1.86788319 7.57085480 131 -0.54847372 -1.86788319 132 -1.98050957 -0.54847372 133 0.87063840 -1.98050957 134 3.87004408 0.87063840 135 -1.58009444 3.87004408 136 -3.23258988 -1.58009444 137 -5.18078257 -3.23258988 138 -1.27701560 -5.18078257 139 -2.70965448 -1.27701560 140 5.17121407 -2.70965448 141 2.77732052 5.17121407 142 -5.98019318 2.77732052 143 -0.96336145 -5.98019318 144 -4.45876036 -0.96336145 145 1.64423900 -4.45876036 146 7.82584751 1.64423900 147 0.94512756 7.82584751 148 1.73112478 0.94512756 149 3.00751598 1.73112478 150 -0.27658229 3.00751598 151 0.71900589 -0.27658229 152 11.34884546 0.71900589 153 2.72782550 11.34884546 154 -5.62496347 2.72782550 155 -0.98256724 -5.62496347 156 3.58697190 -0.98256724 157 -2.07422615 3.58697190 158 4.94954236 -2.07422615 159 NA 4.94954236 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 3.33775014 -0.94299635 [2,] -5.68066888 3.33775014 [3,] -1.95645010 -5.68066888 [4,] -1.42133490 -1.95645010 [5,] -3.50952876 -1.42133490 [6,] -0.85051001 -3.50952876 [7,] -6.32663160 -0.85051001 [8,] -4.36691141 -6.32663160 [9,] -3.46766645 -4.36691141 [10,] 0.59123491 -3.46766645 [11,] 7.72513651 0.59123491 [12,] 7.81374564 7.72513651 [13,] -1.05282575 7.81374564 [14,] -6.63994599 -1.05282575 [15,] -5.88336757 -6.63994599 [16,] 1.49546584 -5.88336757 [17,] -0.26513054 1.49546584 [18,] 0.16409212 -0.26513054 [19,] 4.62841556 0.16409212 [20,] 1.67124412 4.62841556 [21,] 6.88606366 1.67124412 [22,] 1.43664181 6.88606366 [23,] 10.11514407 1.43664181 [24,] -0.37953525 10.11514407 [25,] -4.15417640 -0.37953525 [26,] -1.65921838 -4.15417640 [27,] 2.79348223 -1.65921838 [28,] 0.10293635 2.79348223 [29,] -2.58029422 0.10293635 [30,] 3.72846380 -2.58029422 [31,] -5.56376641 3.72846380 [32,] -0.66625501 -5.56376641 [33,] 0.99443124 -0.66625501 [34,] -6.07417816 0.99443124 [35,] 4.10931907 -6.07417816 [36,] 9.27673312 4.10931907 [37,] -9.11763672 9.27673312 [38,] 4.21719314 -9.11763672 [39,] -0.92202716 4.21719314 [40,] 1.89803940 -0.92202716 [41,] 0.03394252 1.89803940 [42,] 0.56238240 0.03394252 [43,] -4.83302151 0.56238240 [44,] -2.16066048 -4.83302151 [45,] -5.40804309 -2.16066048 [46,] -2.14365328 -5.40804309 [47,] 4.93734290 -2.14365328 [48,] 6.90833334 4.93734290 [49,] -3.75775896 6.90833334 [50,] 2.77922850 -3.75775896 [51,] -1.03092460 2.77922850 [52,] 1.18486119 -1.03092460 [53,] -0.73899408 1.18486119 [54,] -1.03936097 -0.73899408 [55,] 2.72978720 -1.03936097 [56,] -0.19483201 2.72978720 [57,] -3.13198923 -0.19483201 [58,] -3.50478814 -3.13198923 [59,] -6.98925024 -3.50478814 [60,] -3.80327609 -6.98925024 [61,] -0.40926107 -3.80327609 [62,] -3.87961950 -0.40926107 [63,] -5.04515239 -3.87961950 [64,] -7.87680887 -5.04515239 [65,] 4.69483593 -7.87680887 [66,] 12.59587122 4.69483593 [67,] -4.02183186 12.59587122 [68,] -11.02587119 -4.02183186 [69,] -2.55608876 -11.02587119 [70,] 10.30679198 -2.55608876 [71,] 0.92047871 10.30679198 [72,] 7.00073965 0.92047871 [73,] 1.78277062 7.00073965 [74,] 4.45646539 1.78277062 [75,] 3.50646799 4.45646539 [76,] -9.71588172 3.50646799 [77,] -1.59122161 -9.71588172 [78,] -2.52594922 -1.59122161 [79,] 4.98062121 -2.52594922 [80,] -2.64084494 4.98062121 [81,] 4.15104723 -2.64084494 [82,] 0.31389942 4.15104723 [83,] -1.85615774 0.31389942 [84,] 3.07988718 -1.85615774 [85,] 0.23719029 3.07988718 [86,] -0.85382138 0.23719029 [87,] -7.77180218 -0.85382138 [88,] 0.89933229 -7.77180218 [89,] 1.39450326 0.89933229 [90,] 4.80291505 1.39450326 [91,] -3.14185043 4.80291505 [92,] -1.06095112 -3.14185043 [93,] 0.89429132 -1.06095112 [94,] 0.31530534 0.89429132 [95,] 2.29666603 0.31530534 [96,] 5.83896364 2.29666603 [97,] 4.24996270 5.83896364 [98,] 1.51005935 4.24996270 [99,] 3.02705481 1.51005935 [100,] 0.68273886 3.02705481 [101,] -1.23980766 0.68273886 [102,] -1.37894217 -1.23980766 [103,] -1.57547022 -1.37894217 [104,] 1.04832462 -1.57547022 [105,] 3.94672965 1.04832462 [106,] 4.48847382 3.94672965 [107,] 4.43060112 4.48847382 [108,] -0.32448682 4.43060112 [109,] -2.53476087 -0.32448682 [110,] -1.51346349 -2.53476087 [111,] 9.85587065 -1.51346349 [112,] 0.92724002 9.85587065 [113,] -3.19933936 0.92724002 [114,] -11.68105807 -3.19933936 [115,] -1.89552632 -11.68105807 [116,] -2.12368818 -1.89552632 [117,] -2.41172148 -2.12368818 [118,] 0.53462560 -2.41172148 [119,] 4.48460017 0.53462560 [120,] 7.41750172 4.48460017 [121,] -4.99676534 7.41750172 [122,] -4.87370917 -4.99676534 [123,] -0.53370970 -4.87370917 [124,] -6.40924670 -0.53370970 [125,] -1.88318117 -6.40924670 [126,] -2.52573289 -1.88318117 [127,] -1.74311133 -2.52573289 [128,] -2.16825415 -1.74311133 [129,] 7.57085480 -2.16825415 [130,] -1.86788319 7.57085480 [131,] -0.54847372 -1.86788319 [132,] -1.98050957 -0.54847372 [133,] 0.87063840 -1.98050957 [134,] 3.87004408 0.87063840 [135,] -1.58009444 3.87004408 [136,] -3.23258988 -1.58009444 [137,] -5.18078257 -3.23258988 [138,] -1.27701560 -5.18078257 [139,] -2.70965448 -1.27701560 [140,] 5.17121407 -2.70965448 [141,] 2.77732052 5.17121407 [142,] -5.98019318 2.77732052 [143,] -0.96336145 -5.98019318 [144,] -4.45876036 -0.96336145 [145,] 1.64423900 -4.45876036 [146,] 7.82584751 1.64423900 [147,] 0.94512756 7.82584751 [148,] 1.73112478 0.94512756 [149,] 3.00751598 1.73112478 [150,] -0.27658229 3.00751598 [151,] 0.71900589 -0.27658229 [152,] 11.34884546 0.71900589 [153,] 2.72782550 11.34884546 [154,] -5.62496347 2.72782550 [155,] -0.98256724 -5.62496347 [156,] 3.58697190 -0.98256724 [157,] -2.07422615 3.58697190 [158,] 4.94954236 -2.07422615 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 3.33775014 -0.94299635 2 -5.68066888 3.33775014 3 -1.95645010 -5.68066888 4 -1.42133490 -1.95645010 5 -3.50952876 -1.42133490 6 -0.85051001 -3.50952876 7 -6.32663160 -0.85051001 8 -4.36691141 -6.32663160 9 -3.46766645 -4.36691141 10 0.59123491 -3.46766645 11 7.72513651 0.59123491 12 7.81374564 7.72513651 13 -1.05282575 7.81374564 14 -6.63994599 -1.05282575 15 -5.88336757 -6.63994599 16 1.49546584 -5.88336757 17 -0.26513054 1.49546584 18 0.16409212 -0.26513054 19 4.62841556 0.16409212 20 1.67124412 4.62841556 21 6.88606366 1.67124412 22 1.43664181 6.88606366 23 10.11514407 1.43664181 24 -0.37953525 10.11514407 25 -4.15417640 -0.37953525 26 -1.65921838 -4.15417640 27 2.79348223 -1.65921838 28 0.10293635 2.79348223 29 -2.58029422 0.10293635 30 3.72846380 -2.58029422 31 -5.56376641 3.72846380 32 -0.66625501 -5.56376641 33 0.99443124 -0.66625501 34 -6.07417816 0.99443124 35 4.10931907 -6.07417816 36 9.27673312 4.10931907 37 -9.11763672 9.27673312 38 4.21719314 -9.11763672 39 -0.92202716 4.21719314 40 1.89803940 -0.92202716 41 0.03394252 1.89803940 42 0.56238240 0.03394252 43 -4.83302151 0.56238240 44 -2.16066048 -4.83302151 45 -5.40804309 -2.16066048 46 -2.14365328 -5.40804309 47 4.93734290 -2.14365328 48 6.90833334 4.93734290 49 -3.75775896 6.90833334 50 2.77922850 -3.75775896 51 -1.03092460 2.77922850 52 1.18486119 -1.03092460 53 -0.73899408 1.18486119 54 -1.03936097 -0.73899408 55 2.72978720 -1.03936097 56 -0.19483201 2.72978720 57 -3.13198923 -0.19483201 58 -3.50478814 -3.13198923 59 -6.98925024 -3.50478814 60 -3.80327609 -6.98925024 61 -0.40926107 -3.80327609 62 -3.87961950 -0.40926107 63 -5.04515239 -3.87961950 64 -7.87680887 -5.04515239 65 4.69483593 -7.87680887 66 12.59587122 4.69483593 67 -4.02183186 12.59587122 68 -11.02587119 -4.02183186 69 -2.55608876 -11.02587119 70 10.30679198 -2.55608876 71 0.92047871 10.30679198 72 7.00073965 0.92047871 73 1.78277062 7.00073965 74 4.45646539 1.78277062 75 3.50646799 4.45646539 76 -9.71588172 3.50646799 77 -1.59122161 -9.71588172 78 -2.52594922 -1.59122161 79 4.98062121 -2.52594922 80 -2.64084494 4.98062121 81 4.15104723 -2.64084494 82 0.31389942 4.15104723 83 -1.85615774 0.31389942 84 3.07988718 -1.85615774 85 0.23719029 3.07988718 86 -0.85382138 0.23719029 87 -7.77180218 -0.85382138 88 0.89933229 -7.77180218 89 1.39450326 0.89933229 90 4.80291505 1.39450326 91 -3.14185043 4.80291505 92 -1.06095112 -3.14185043 93 0.89429132 -1.06095112 94 0.31530534 0.89429132 95 2.29666603 0.31530534 96 5.83896364 2.29666603 97 4.24996270 5.83896364 98 1.51005935 4.24996270 99 3.02705481 1.51005935 100 0.68273886 3.02705481 101 -1.23980766 0.68273886 102 -1.37894217 -1.23980766 103 -1.57547022 -1.37894217 104 1.04832462 -1.57547022 105 3.94672965 1.04832462 106 4.48847382 3.94672965 107 4.43060112 4.48847382 108 -0.32448682 4.43060112 109 -2.53476087 -0.32448682 110 -1.51346349 -2.53476087 111 9.85587065 -1.51346349 112 0.92724002 9.85587065 113 -3.19933936 0.92724002 114 -11.68105807 -3.19933936 115 -1.89552632 -11.68105807 116 -2.12368818 -1.89552632 117 -2.41172148 -2.12368818 118 0.53462560 -2.41172148 119 4.48460017 0.53462560 120 7.41750172 4.48460017 121 -4.99676534 7.41750172 122 -4.87370917 -4.99676534 123 -0.53370970 -4.87370917 124 -6.40924670 -0.53370970 125 -1.88318117 -6.40924670 126 -2.52573289 -1.88318117 127 -1.74311133 -2.52573289 128 -2.16825415 -1.74311133 129 7.57085480 -2.16825415 130 -1.86788319 7.57085480 131 -0.54847372 -1.86788319 132 -1.98050957 -0.54847372 133 0.87063840 -1.98050957 134 3.87004408 0.87063840 135 -1.58009444 3.87004408 136 -3.23258988 -1.58009444 137 -5.18078257 -3.23258988 138 -1.27701560 -5.18078257 139 -2.70965448 -1.27701560 140 5.17121407 -2.70965448 141 2.77732052 5.17121407 142 -5.98019318 2.77732052 143 -0.96336145 -5.98019318 144 -4.45876036 -0.96336145 145 1.64423900 -4.45876036 146 7.82584751 1.64423900 147 0.94512756 7.82584751 148 1.73112478 0.94512756 149 3.00751598 1.73112478 150 -0.27658229 3.00751598 151 0.71900589 -0.27658229 152 11.34884546 0.71900589 153 2.72782550 11.34884546 154 -5.62496347 2.72782550 155 -0.98256724 -5.62496347 156 3.58697190 -0.98256724 157 -2.07422615 3.58697190 158 4.94954236 -2.07422615 > 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/freestat/rcomp/tmp/71lrv1292264454.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/freestat/rcomp/tmp/81lrv1292264454.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/freestat/rcomp/tmp/91lrv1292264454.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/freestat/rcomp/tmp/10cc8g1292264454.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/11fv731292264454.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/freestat/rcomp/tmp/12iv5r1292264454.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/freestat/rcomp/tmp/13x53i1292264454.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/freestat/rcomp/tmp/14i61o1292264454.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/freestat/rcomp/tmp/15m60c1292264454.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/freestat/rcomp/tmp/167phi1292264454.tab") + } > > try(system("convert tmp/1ntbm1292264454.ps tmp/1ntbm1292264454.png",intern=TRUE)) character(0) > try(system("convert tmp/2ntbm1292264454.ps tmp/2ntbm1292264454.png",intern=TRUE)) character(0) > try(system("convert tmp/3g3a71292264454.ps tmp/3g3a71292264454.png",intern=TRUE)) character(0) > try(system("convert tmp/4g3a71292264454.ps tmp/4g3a71292264454.png",intern=TRUE)) character(0) > try(system("convert tmp/5g3a71292264454.ps tmp/5g3a71292264454.png",intern=TRUE)) character(0) > try(system("convert tmp/6qcss1292264454.ps tmp/6qcss1292264454.png",intern=TRUE)) character(0) > try(system("convert tmp/71lrv1292264454.ps tmp/71lrv1292264454.png",intern=TRUE)) character(0) > try(system("convert tmp/81lrv1292264454.ps tmp/81lrv1292264454.png",intern=TRUE)) character(0) > try(system("convert tmp/91lrv1292264454.ps tmp/91lrv1292264454.png",intern=TRUE)) character(0) > try(system("convert tmp/10cc8g1292264454.ps tmp/10cc8g1292264454.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.801 2.698 6.290