R version 2.11.1 (2010-05-31) Copyright (C) 2010 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(1 + ,24 + ,14 + ,11 + ,12 + ,24 + ,26 + ,1 + ,25 + ,11 + ,7 + ,8 + ,25 + ,23 + ,1 + ,17 + ,6 + ,17 + ,8 + ,30 + ,25 + ,1 + ,18 + ,12 + ,10 + ,8 + ,19 + ,23 + ,1 + ,18 + ,8 + ,12 + ,9 + ,22 + ,19 + ,1 + ,16 + ,10 + ,12 + ,7 + ,22 + ,29 + ,1 + ,20 + ,10 + ,11 + ,4 + ,25 + ,25 + ,1 + ,16 + ,11 + ,11 + ,11 + ,23 + ,21 + ,1 + ,18 + ,16 + ,12 + ,7 + ,17 + ,22 + ,2 + ,17 + ,11 + ,13 + ,7 + ,21 + ,25 + ,2 + ,23 + ,13 + ,14 + ,12 + ,19 + ,24 + ,2 + ,30 + ,12 + ,16 + ,10 + ,19 + ,18 + ,2 + ,23 + ,8 + ,11 + ,10 + ,15 + ,22 + ,2 + ,18 + ,12 + ,10 + ,8 + ,16 + ,15 + ,2 + ,15 + ,11 + ,11 + ,8 + ,23 + ,22 + ,2 + ,12 + ,4 + ,15 + ,4 + ,27 + ,28 + ,2 + ,21 + ,9 + ,9 + ,9 + ,22 + ,20 + ,2 + ,15 + ,8 + ,11 + ,8 + ,14 + ,12 + ,2 + ,20 + ,8 + ,17 + ,7 + ,22 + ,24 + ,3 + ,31 + ,14 + ,17 + ,11 + ,23 + ,20 + ,3 + ,27 + ,15 + ,11 + ,9 + ,23 + ,21 + ,3 + ,34 + ,16 + ,18 + ,11 + ,21 + ,20 + ,3 + ,21 + ,9 + ,14 + ,13 + ,19 + ,21 + ,3 + ,31 + ,14 + ,10 + ,8 + ,18 + ,23 + ,3 + ,19 + ,11 + ,11 + ,8 + ,20 + ,28 + ,3 + ,16 + ,8 + ,15 + ,9 + ,23 + ,24 + ,3 + ,20 + ,9 + ,15 + ,6 + ,25 + ,24 + ,3 + ,21 + ,9 + ,13 + ,9 + ,19 + ,24 + ,3 + ,22 + ,9 + ,16 + ,9 + ,24 + ,23 + ,3 + ,17 + ,9 + ,13 + ,6 + ,22 + ,23 + ,3 + ,24 + ,10 + ,9 + ,6 + ,25 + ,29 + ,3 + ,25 + ,16 + ,18 + ,16 + ,26 + ,24 + ,3 + ,26 + ,11 + ,18 + ,5 + ,29 + ,18 + ,3 + ,25 + ,8 + ,12 + ,7 + ,32 + ,25 + ,3 + ,17 + ,9 + ,17 + ,9 + ,25 + ,21 + ,3 + ,32 + ,16 + ,9 + ,6 + ,29 + ,26 + ,3 + ,33 + ,11 + ,9 + ,6 + ,28 + ,22 + ,3 + ,13 + ,16 + ,12 + ,5 + ,17 + ,22 + ,3 + ,32 + ,12 + ,18 + ,12 + ,28 + ,22 + ,3 + ,25 + ,12 + ,12 + ,7 + ,29 + ,23 + ,3 + ,29 + ,14 + ,18 + ,10 + ,26 + ,30 + ,3 + ,22 + ,9 + ,14 + ,9 + ,25 + ,23 + ,3 + ,18 + ,10 + ,15 + ,8 + ,14 + ,17 + ,3 + ,17 + ,9 + ,16 + ,5 + ,25 + ,23 + ,3 + ,20 + ,10 + ,10 + ,8 + ,26 + ,23 + ,3 + ,15 + ,12 + ,11 + ,8 + ,20 + ,25 + ,3 + ,20 + ,14 + ,14 + ,10 + ,18 + ,24 + ,3 + ,33 + ,14 + ,9 + ,6 + ,32 + ,24 + ,3 + ,29 + ,10 + ,12 + ,8 + ,25 + ,23 + ,3 + ,23 + ,14 + ,17 + ,7 + ,25 + ,21 + ,3 + ,26 + ,16 + ,5 + ,4 + ,23 + ,24 + ,3 + ,18 + ,9 + ,12 + ,8 + ,21 + ,24 + ,3 + ,20 + ,10 + ,12 + ,8 + ,20 + ,28 + ,3 + ,11 + ,6 + ,6 + ,4 + ,15 + ,16 + ,3 + ,28 + ,8 + ,24 + ,20 + ,30 + ,20 + ,3 + ,26 + ,13 + ,12 + ,8 + ,24 + ,29 + ,3 + ,22 + ,10 + ,12 + ,8 + ,26 + ,27 + ,3 + ,17 + ,8 + ,14 + ,6 + ,24 + ,22 + ,3 + ,12 + ,7 + ,7 + ,4 + ,22 + ,28 + ,3 + ,14 + ,15 + ,13 + ,8 + ,14 + ,16 + ,3 + ,17 + ,9 + ,12 + ,9 + ,24 + ,25 + ,3 + ,21 + ,10 + ,13 + ,6 + ,24 + ,24 + ,3 + ,19 + ,12 + ,14 + ,7 + ,24 + ,28 + ,3 + ,18 + ,13 + ,8 + ,9 + ,24 + ,24 + ,3 + ,10 + ,10 + ,11 + ,5 + ,19 + ,23 + ,3 + ,29 + ,11 + ,9 + ,5 + ,31 + ,30 + ,3 + ,31 + ,8 + ,11 + ,8 + ,22 + ,24 + ,3 + ,19 + ,9 + ,13 + ,8 + ,27 + ,21 + ,3 + ,9 + ,13 + ,10 + ,6 + ,19 + ,25 + ,3 + ,20 + ,11 + ,11 + ,8 + ,25 + ,25 + ,3 + ,28 + ,8 + ,12 + ,7 + ,20 + ,22 + ,3 + ,19 + ,9 + ,9 + ,7 + ,21 + ,23 + ,3 + ,30 + ,9 + ,15 + ,9 + ,27 + ,26 + ,3 + ,29 + ,15 + ,18 + ,11 + ,23 + ,23 + ,3 + ,26 + ,9 + ,15 + ,6 + ,25 + ,25 + ,3 + ,23 + ,10 + ,12 + ,8 + ,20 + ,21 + ,3 + ,13 + ,14 + ,13 + ,6 + ,21 + ,25 + ,3 + ,21 + ,12 + ,14 + ,9 + ,22 + ,24 + ,3 + ,19 + ,12 + ,10 + ,8 + ,23 + ,29 + ,3 + ,28 + ,11 + ,13 + ,6 + ,25 + ,22 + ,3 + ,23 + ,14 + ,13 + ,10 + ,25 + ,27 + ,3 + ,18 + ,6 + ,11 + ,8 + ,17 + ,26 + ,3 + ,21 + ,12 + ,13 + ,8 + ,19 + ,22 + ,3 + ,20 + ,8 + ,16 + ,10 + ,25 + ,24 + ,4 + ,23 + ,14 + ,8 + ,5 + ,19 + ,27 + ,4 + ,21 + ,11 + ,16 + ,7 + ,20 + ,24 + ,4 + ,21 + ,10 + ,11 + ,5 + ,26 + ,24 + ,4 + ,15 + ,14 + ,9 + ,8 + ,23 + ,29 + ,4 + ,28 + ,12 + ,16 + ,14 + ,27 + ,22 + ,4 + ,19 + ,10 + ,12 + ,7 + ,17 + ,21 + ,4 + ,26 + ,14 + ,14 + ,8 + ,17 + ,24 + ,4 + ,10 + ,5 + ,8 + ,6 + ,19 + ,24 + ,4 + ,16 + ,11 + ,9 + ,5 + ,17 + ,23 + ,4 + ,22 + ,10 + ,15 + ,6 + ,22 + ,20 + ,4 + ,19 + ,9 + ,11 + ,10 + ,21 + ,27 + ,4 + ,31 + ,10 + ,21 + ,12 + ,32 + ,26 + ,4 + ,31 + ,16 + ,14 + ,9 + ,21 + ,25 + ,4 + ,29 + ,13 + ,18 + ,12 + ,21 + ,21 + ,4 + ,19 + ,9 + ,12 + ,7 + ,18 + ,21 + ,4 + ,22 + ,10 + ,13 + ,8 + ,18 + ,19 + ,4 + ,23 + ,10 + ,15 + ,10 + ,23 + ,21 + ,4 + ,15 + ,7 + ,12 + ,6 + ,19 + ,21 + ,4 + ,20 + ,9 + ,19 + ,10 + ,20 + ,16 + ,4 + ,18 + ,8 + ,15 + ,10 + ,21 + ,22 + ,4 + ,23 + ,14 + ,11 + ,10 + ,20 + ,29 + ,4 + ,25 + ,14 + ,11 + ,5 + ,17 + ,15 + ,4 + ,21 + ,8 + ,10 + ,7 + ,18 + ,17 + ,4 + ,24 + ,9 + ,13 + ,10 + ,19 + ,15 + ,4 + ,25 + ,14 + ,15 + ,11 + ,22 + ,21 + ,4 + ,17 + ,14 + ,12 + ,6 + ,15 + ,21 + ,4 + ,13 + ,8 + ,12 + ,7 + ,14 + ,19 + ,4 + ,28 + ,8 + ,16 + ,12 + ,18 + ,24 + ,4 + ,21 + ,8 + ,9 + ,11 + ,24 + ,20 + ,4 + ,25 + ,7 + ,18 + ,11 + ,35 + ,17 + ,4 + ,9 + ,6 + ,8 + ,11 + ,29 + ,23 + ,4 + ,16 + ,8 + ,13 + ,5 + ,21 + ,24 + ,4 + ,19 + ,6 + ,17 + ,8 + ,25 + ,14 + ,4 + ,17 + ,11 + ,9 + ,6 + ,20 + ,19 + ,4 + ,25 + ,14 + ,15 + ,9 + ,22 + ,24 + ,4 + ,20 + ,11 + ,8 + ,4 + ,13 + ,13 + ,4 + ,29 + ,11 + ,7 + ,4 + ,26 + ,22 + ,4 + ,14 + ,11 + ,12 + ,7 + ,17 + ,16 + ,4 + ,22 + ,14 + ,14 + ,11 + ,25 + ,19 + ,4 + ,15 + ,8 + ,6 + ,6 + ,20 + ,25 + ,4 + ,19 + ,20 + ,8 + ,7 + ,19 + ,25 + ,4 + ,20 + ,11 + ,17 + ,8 + ,21 + ,23 + ,4 + ,15 + ,8 + ,10 + ,4 + ,22 + ,24 + ,4 + ,20 + ,11 + ,11 + ,8 + ,24 + ,26 + ,4 + ,18 + ,10 + ,14 + ,9 + ,21 + ,26 + ,4 + ,33 + ,14 + ,11 + ,8 + ,26 + ,25 + ,4 + ,22 + ,11 + ,13 + ,11 + ,24 + ,18 + ,4 + ,16 + ,9 + ,12 + ,8 + ,16 + ,21 + ,4 + ,17 + ,9 + ,11 + ,5 + ,23 + ,26 + ,4 + ,16 + ,8 + ,9 + ,4 + ,18 + ,23 + ,4 + ,21 + ,10 + ,12 + ,8 + ,16 + ,23 + ,4 + ,26 + ,13 + ,20 + ,10 + ,26 + ,22 + ,4 + ,18 + ,13 + ,12 + ,6 + ,19 + ,20 + ,4 + ,18 + ,12 + ,13 + ,9 + ,21 + ,13 + ,4 + ,17 + ,8 + ,12 + ,9 + ,21 + ,24 + ,4 + ,22 + ,13 + ,12 + ,13 + ,22 + ,15 + ,4 + ,30 + ,14 + ,9 + ,9 + ,23 + ,14 + ,4 + ,30 + ,12 + ,15 + ,10 + ,29 + ,22 + ,4 + ,24 + ,14 + ,24 + ,20 + ,21 + ,10 + ,4 + ,21 + ,15 + ,7 + ,5 + ,21 + ,24 + ,4 + ,21 + ,13 + ,17 + ,11 + ,23 + ,22 + ,4 + ,29 + ,16 + ,11 + ,6 + ,27 + ,24 + ,4 + ,31 + ,9 + ,17 + ,9 + ,25 + ,19 + ,4 + ,20 + ,9 + ,11 + ,7 + ,21 + ,20 + ,4 + ,16 + ,9 + ,12 + ,9 + ,10 + ,13 + ,4 + ,22 + ,8 + ,14 + ,10 + ,20 + ,20 + ,4 + ,20 + ,7 + ,11 + ,9 + ,26 + ,22 + ,4 + ,28 + ,16 + ,16 + ,8 + ,24 + ,24 + ,4 + ,38 + ,11 + ,21 + ,7 + ,29 + ,29 + ,4 + ,22 + ,9 + ,14 + ,6 + ,19 + ,12 + ,4 + ,20 + ,11 + ,20 + ,13 + ,24 + ,20 + ,4 + ,17 + ,9 + ,13 + ,6 + ,19 + ,21 + ,4 + ,28 + ,14 + ,11 + ,8 + ,24 + ,24 + ,4 + ,22 + ,13 + ,15 + ,10 + ,22 + ,22 + ,4 + ,31 + ,16 + ,19 + ,16 + ,17 + ,20) + ,dim=c(7 + ,159) + ,dimnames=list(c('Week' + ,'Consern' + ,'Doubts' + ,'PExpect' + ,'PCritisism' + ,'PStandards' + ,'Organisation') + ,1:159)) > y <- array(NA,dim=c(7,159),dimnames=list(c('Week','Consern','Doubts','PExpect','PCritisism','PStandards','Organisation'),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 = '6' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x PStandards Week Consern Doubts PExpect PCritisism Organisation 1 24 1 24 14 11 12 26 2 25 1 25 11 7 8 23 3 30 1 17 6 17 8 25 4 19 1 18 12 10 8 23 5 22 1 18 8 12 9 19 6 22 1 16 10 12 7 29 7 25 1 20 10 11 4 25 8 23 1 16 11 11 11 21 9 17 1 18 16 12 7 22 10 21 2 17 11 13 7 25 11 19 2 23 13 14 12 24 12 19 2 30 12 16 10 18 13 15 2 23 8 11 10 22 14 16 2 18 12 10 8 15 15 23 2 15 11 11 8 22 16 27 2 12 4 15 4 28 17 22 2 21 9 9 9 20 18 14 2 15 8 11 8 12 19 22 2 20 8 17 7 24 20 23 3 31 14 17 11 20 21 23 3 27 15 11 9 21 22 21 3 34 16 18 11 20 23 19 3 21 9 14 13 21 24 18 3 31 14 10 8 23 25 20 3 19 11 11 8 28 26 23 3 16 8 15 9 24 27 25 3 20 9 15 6 24 28 19 3 21 9 13 9 24 29 24 3 22 9 16 9 23 30 22 3 17 9 13 6 23 31 25 3 24 10 9 6 29 32 26 3 25 16 18 16 24 33 29 3 26 11 18 5 18 34 32 3 25 8 12 7 25 35 25 3 17 9 17 9 21 36 29 3 32 16 9 6 26 37 28 3 33 11 9 6 22 38 17 3 13 16 12 5 22 39 28 3 32 12 18 12 22 40 29 3 25 12 12 7 23 41 26 3 29 14 18 10 30 42 25 3 22 9 14 9 23 43 14 3 18 10 15 8 17 44 25 3 17 9 16 5 23 45 26 3 20 10 10 8 23 46 20 3 15 12 11 8 25 47 18 3 20 14 14 10 24 48 32 3 33 14 9 6 24 49 25 3 29 10 12 8 23 50 25 3 23 14 17 7 21 51 23 3 26 16 5 4 24 52 21 3 18 9 12 8 24 53 20 3 20 10 12 8 28 54 15 3 11 6 6 4 16 55 30 3 28 8 24 20 20 56 24 3 26 13 12 8 29 57 26 3 22 10 12 8 27 58 24 3 17 8 14 6 22 59 22 3 12 7 7 4 28 60 14 3 14 15 13 8 16 61 24 3 17 9 12 9 25 62 24 3 21 10 13 6 24 63 24 3 19 12 14 7 28 64 24 3 18 13 8 9 24 65 19 3 10 10 11 5 23 66 31 3 29 11 9 5 30 67 22 3 31 8 11 8 24 68 27 3 19 9 13 8 21 69 19 3 9 13 10 6 25 70 25 3 20 11 11 8 25 71 20 3 28 8 12 7 22 72 21 3 19 9 9 7 23 73 27 3 30 9 15 9 26 74 23 3 29 15 18 11 23 75 25 3 26 9 15 6 25 76 20 3 23 10 12 8 21 77 21 3 13 14 13 6 25 78 22 3 21 12 14 9 24 79 23 3 19 12 10 8 29 80 25 3 28 11 13 6 22 81 25 3 23 14 13 10 27 82 17 3 18 6 11 8 26 83 19 3 21 12 13 8 22 84 25 3 20 8 16 10 24 85 19 4 23 14 8 5 27 86 20 4 21 11 16 7 24 87 26 4 21 10 11 5 24 88 23 4 15 14 9 8 29 89 27 4 28 12 16 14 22 90 17 4 19 10 12 7 21 91 17 4 26 14 14 8 24 92 19 4 10 5 8 6 24 93 17 4 16 11 9 5 23 94 22 4 22 10 15 6 20 95 21 4 19 9 11 10 27 96 32 4 31 10 21 12 26 97 21 4 31 16 14 9 25 98 21 4 29 13 18 12 21 99 18 4 19 9 12 7 21 100 18 4 22 10 13 8 19 101 23 4 23 10 15 10 21 102 19 4 15 7 12 6 21 103 20 4 20 9 19 10 16 104 21 4 18 8 15 10 22 105 20 4 23 14 11 10 29 106 17 4 25 14 11 5 15 107 18 4 21 8 10 7 17 108 19 4 24 9 13 10 15 109 22 4 25 14 15 11 21 110 15 4 17 14 12 6 21 111 14 4 13 8 12 7 19 112 18 4 28 8 16 12 24 113 24 4 21 8 9 11 20 114 35 4 25 7 18 11 17 115 29 4 9 6 8 11 23 116 21 4 16 8 13 5 24 117 25 4 19 6 17 8 14 118 20 4 17 11 9 6 19 119 22 4 25 14 15 9 24 120 13 4 20 11 8 4 13 121 26 4 29 11 7 4 22 122 17 4 14 11 12 7 16 123 25 4 22 14 14 11 19 124 20 4 15 8 6 6 25 125 19 4 19 20 8 7 25 126 21 4 20 11 17 8 23 127 22 4 15 8 10 4 24 128 24 4 20 11 11 8 26 129 21 4 18 10 14 9 26 130 26 4 33 14 11 8 25 131 24 4 22 11 13 11 18 132 16 4 16 9 12 8 21 133 23 4 17 9 11 5 26 134 18 4 16 8 9 4 23 135 16 4 21 10 12 8 23 136 26 4 26 13 20 10 22 137 19 4 18 13 12 6 20 138 21 4 18 12 13 9 13 139 21 4 17 8 12 9 24 140 22 4 22 13 12 13 15 141 23 4 30 14 9 9 14 142 29 4 30 12 15 10 22 143 21 4 24 14 24 20 10 144 21 4 21 15 7 5 24 145 23 4 21 13 17 11 22 146 27 4 29 16 11 6 24 147 25 4 31 9 17 9 19 148 21 4 20 9 11 7 20 149 10 4 16 9 12 9 13 150 20 4 22 8 14 10 20 151 26 4 20 7 11 9 22 152 24 4 28 16 16 8 24 153 29 4 38 11 21 7 29 154 19 4 22 9 14 6 12 155 24 4 20 11 20 13 20 156 19 4 17 9 13 6 21 157 24 4 28 14 11 8 24 158 22 4 22 13 15 10 22 159 17 4 31 16 19 16 20 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Week Consern Doubts PExpect 8.79625 -0.35103 0.33286 -0.35923 0.19286 PCritisism Organisation 0.01500 0.38646 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -8.6497 -2.2730 0.1529 2.0825 11.5947 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 8.79625 2.58999 3.396 0.000872 *** Week -0.35103 0.33822 -1.038 0.300986 Consern 0.33286 0.05571 5.974 1.58e-08 *** Doubts -0.35923 0.10714 -3.353 0.001010 ** PExpect 0.19286 0.10130 1.904 0.058813 . PCritisism 0.01500 0.12884 0.116 0.907501 Organisation 0.38646 0.07316 5.283 4.34e-07 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 3.408 on 152 degrees of freedom Multiple R-squared: 0.3715, Adjusted R-squared: 0.3467 F-statistic: 14.98 on 6 and 152 DF, p-value: 2.027e-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.29876690 0.59753379 0.7012331 [2,] 0.29286282 0.58572564 0.7071372 [3,] 0.23411408 0.46822816 0.7658859 [4,] 0.51772804 0.96454391 0.4822720 [5,] 0.48971989 0.97943979 0.5102801 [6,] 0.63342599 0.73314802 0.3665740 [7,] 0.54641036 0.90717927 0.4535896 [8,] 0.49858527 0.99717054 0.5014147 [9,] 0.48037633 0.96075265 0.5196237 [10,] 0.40165194 0.80330388 0.5983481 [11,] 0.52164896 0.95670209 0.4783510 [12,] 0.56616078 0.86767845 0.4338392 [13,] 0.50176644 0.99646711 0.4982336 [14,] 0.44390579 0.88781157 0.5560942 [15,] 0.46075035 0.92150070 0.5392497 [16,] 0.41048025 0.82096050 0.5895198 [17,] 0.36017316 0.72034632 0.6398268 [18,] 0.33394100 0.66788201 0.6660590 [19,] 0.32149875 0.64299750 0.6785013 [20,] 0.27952460 0.55904920 0.7204754 [21,] 0.22964202 0.45928405 0.7703580 [22,] 0.19188196 0.38376392 0.8081180 [23,] 0.23328444 0.46656888 0.7667156 [24,] 0.39401036 0.78802072 0.6059896 [25,] 0.64769106 0.70461788 0.3523089 [26,] 0.62707322 0.74585355 0.3729268 [27,] 0.68835450 0.62329099 0.3116455 [28,] 0.67727269 0.64545461 0.3227273 [29,] 0.63020517 0.73958966 0.3697948 [30,] 0.59596727 0.80806545 0.4040327 [31,] 0.67621398 0.64757204 0.3237860 [32,] 0.64675042 0.70649916 0.3532496 [33,] 0.60178513 0.79642974 0.3982149 [34,] 0.68802382 0.62395235 0.3119762 [35,] 0.65709047 0.68581907 0.3429095 [36,] 0.67984587 0.64030827 0.3201541 [37,] 0.63190849 0.73618302 0.3680915 [38,] 0.62630270 0.74739459 0.3736973 [39,] 0.72391806 0.55216388 0.2760819 [40,] 0.68339700 0.63320599 0.3166030 [41,] 0.66739394 0.66521213 0.3326061 [42,] 0.62637480 0.74725039 0.3736252 [43,] 0.58519058 0.82961884 0.4148094 [44,] 0.61855539 0.76288922 0.3814446 [45,] 0.58325714 0.83348572 0.4167429 [46,] 0.63560158 0.72879685 0.3643984 [47,] 0.60225320 0.79549361 0.3977468 [48,] 0.56152332 0.87695336 0.4384767 [49,] 0.52749309 0.94501382 0.4725069 [50,] 0.47924019 0.95848037 0.5207598 [51,] 0.44197626 0.88395251 0.5580237 [52,] 0.40860381 0.81720762 0.5913962 [53,] 0.36537018 0.73074036 0.6346298 [54,] 0.32218548 0.64437097 0.6778145 [55,] 0.35553378 0.71106756 0.6444662 [56,] 0.31241214 0.62482429 0.6875879 [57,] 0.32344574 0.64689147 0.6765543 [58,] 0.38638023 0.77276045 0.6136198 [59,] 0.46099881 0.92199761 0.5390012 [60,] 0.42244316 0.84488632 0.5775568 [61,] 0.40785967 0.81571934 0.5921403 [62,] 0.47120103 0.94240207 0.5287990 [63,] 0.42535832 0.85071665 0.5746417 [64,] 0.38375234 0.76750467 0.6162477 [65,] 0.34767507 0.69535014 0.6523249 [66,] 0.31513839 0.63027677 0.6848616 [67,] 0.29091553 0.58183105 0.7090845 [68,] 0.26811171 0.53622342 0.7318883 [69,] 0.23198031 0.46396063 0.7680197 [70,] 0.20001843 0.40003686 0.7999816 [71,] 0.17715626 0.35431252 0.8228437 [72,] 0.16599283 0.33198565 0.8340072 [73,] 0.24121645 0.48243289 0.7587836 [74,] 0.22502040 0.45004079 0.7749796 [75,] 0.19318478 0.38636956 0.8068152 [76,] 0.19024908 0.38049816 0.8097509 [77,] 0.18042949 0.36085898 0.8195705 [78,] 0.19146451 0.38292902 0.8085355 [79,] 0.18113832 0.36227664 0.8188617 [80,] 0.17203433 0.34406866 0.8279657 [81,] 0.17320338 0.34640676 0.8267966 [82,] 0.24037843 0.48075686 0.7596216 [83,] 0.20570865 0.41141730 0.7942913 [84,] 0.18530524 0.37061048 0.8146948 [85,] 0.15623007 0.31246014 0.8437699 [86,] 0.13948937 0.27897873 0.8605106 [87,] 0.14563497 0.29126995 0.8543650 [88,] 0.14336500 0.28673001 0.8566350 [89,] 0.13627700 0.27255400 0.8637230 [90,] 0.12573139 0.25146279 0.8742686 [91,] 0.11756289 0.23512578 0.8824371 [92,] 0.09655430 0.19310860 0.9034457 [93,] 0.07855383 0.15710766 0.9214462 [94,] 0.06247882 0.12495764 0.9375212 [95,] 0.04970549 0.09941099 0.9502945 [96,] 0.05086416 0.10172832 0.9491358 [97,] 0.04064119 0.08128237 0.9593588 [98,] 0.03492125 0.06984249 0.9650788 [99,] 0.03019078 0.06038156 0.9698092 [100,] 0.02303473 0.04606946 0.9769653 [101,] 0.02161853 0.04323706 0.9783815 [102,] 0.02614662 0.05229324 0.9738534 [103,] 0.11491111 0.22982221 0.8850889 [104,] 0.11105943 0.22211886 0.8889406 [105,] 0.52504665 0.94990670 0.4749533 [106,] 0.84543439 0.30913121 0.1545656 [107,] 0.81053064 0.37893872 0.1894694 [108,] 0.86896611 0.26206778 0.1310339 [109,] 0.84447164 0.31105673 0.1555284 [110,] 0.81506346 0.36987308 0.1849365 [111,] 0.84776468 0.30447063 0.1522353 [112,] 0.82546294 0.34907413 0.1745371 [113,] 0.78493349 0.43013302 0.2150665 [114,] 0.81884772 0.36230456 0.1811523 [115,] 0.77573655 0.44852690 0.2242635 [116,] 0.73694895 0.52610209 0.2630510 [117,] 0.68721332 0.62557337 0.3127867 [118,] 0.65056692 0.69886616 0.3494331 [119,] 0.60887904 0.78224191 0.3911210 [120,] 0.54898020 0.90203960 0.4510198 [121,] 0.48613354 0.97226707 0.5138665 [122,] 0.48512865 0.97025730 0.5148714 [123,] 0.48149607 0.96299214 0.5185039 [124,] 0.43123296 0.86246593 0.5687670 [125,] 0.38200738 0.76401476 0.6179926 [126,] 0.52732071 0.94535858 0.4726793 [127,] 0.48907893 0.97815787 0.5109211 [128,] 0.41582812 0.83165623 0.5841719 [129,] 0.42674166 0.85348331 0.5732583 [130,] 0.35494925 0.70989850 0.6450508 [131,] 0.31958093 0.63916186 0.6804191 [132,] 0.28576568 0.57153136 0.7142343 [133,] 0.33728639 0.67457277 0.6627136 [134,] 0.47898332 0.95796664 0.5210167 [135,] 0.40210252 0.80420505 0.5978975 [136,] 0.32104877 0.64209754 0.6789512 [137,] 0.30964152 0.61928305 0.6903585 [138,] 0.25613186 0.51226371 0.7438681 [139,] 0.16010925 0.32021849 0.8398908 [140,] 0.30481128 0.60962257 0.6951887 > postscript(file="/var/www/rcomp/tmp/1tl4h1290527232.ps",horizontal=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/rcomp/tmp/2tl4h1290527232.ps",horizontal=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/rcomp/tmp/3tl4h1290527232.ps",horizontal=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/rcomp/tmp/43cm21290527232.ps",horizontal=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/rcomp/tmp/53cm21290527232.ps",horizontal=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.24594711 1.82618847 4.99140275 -2.06312474 0.64508627 -1.80537478 7 8 9 10 11 12 1.64688144 2.77844804 -2.61044568 -1.07497688 -4.23504403 -4.96124377 13 14 15 16 17 18 -8.64972137 -1.62038595 3.12085681 2.57456959 0.54887246 -3.09220375 19 20 21 22 23 24 -2.53622667 -1.20539175 1.28595700 -3.67836432 -3.51083401 -5.96979533 25 26 27 28 29 30 -3.17834451 0.50196757 1.57474371 -4.41738769 0.05764288 0.34550535 31 32 33 34 35 36 -0.17264081 2.69655064 6.05125316 6.72831927 3.30201754 4.47926713 37 38 39 40 41 42 2.89609396 -0.21409849 1.76249908 5.93818227 -1.58217303 1.44335799 43 44 45 46 47 48 -5.72504298 2.78192791 4.25473881 -0.32827533 -3.49621107 7.20086700 49 50 51 52 53 54 -0.12672368 3.13101168 2.05078086 -1.21095245 -4.06329660 -1.64978912 55 56 57 58 59 60 3.15282840 -1.36922442 1.65744582 2.17987813 0.54615751 -1.82525193 61 62 63 64 65 66 1.72044908 0.98683173 0.61731178 3.98241742 0.43547515 4.15081999 67 68 69 70 71 72 -4.70451926 5.42272136 1.25097133 2.64818685 -5.11087101 -0.56378130 73 74 75 76 77 78 -0.57177830 -1.53268612 -0.80888526 -2.35663064 1.70018910 -0.53254409 79 80 81 82 83 84 -0.01271729 0.78896783 1.53867185 -6.86872417 -2.55176318 0.96267150 85 86 87 88 89 90 -3.07103789 -2.89647614 3.73856839 2.58107729 2.80069332 -3.65916582 91 92 93 94 95 96 -6.11235920 -0.83255376 -2.46571462 0.16513835 -2.18931204 3.60348987 97 98 99 100 101 102 -3.45965516 -3.14219436 -3.01839954 -3.09267295 0.38583253 -1.39042847 103 104 105 106 107 108 -0.81392866 -1.05479487 -3.49751484 -1.67776348 -2.11178355 -1.60176254 109 110 111 112 113 114 0.14205054 -3.54151407 -4.60754022 -8.37917921 2.86170090 11.59469807 115 116 117 118 119 120 10.17102867 -0.70131007 4.62986471 1.73228556 -0.98735118 -3.72466452 121 122 123 124 125 126 2.99426913 0.29669230 5.10641867 -0.41990565 1.15874536 -1.38500405 127 128 129 130 131 132 1.22511866 1.61274910 -1.67433088 0.74972367 3.60803913 -4.03481231 133 134 135 136 137 138 0.93784983 -2.52842055 -6.11281081 2.11419939 0.15285545 4.26102689 139 140 141 142 143 144 -0.90129427 3.64876583 3.37013066 4.38781017 1.85534090 1.30616721 145 146 147 148 149 150 1.34208092 4.21608891 -0.23407950 0.22806126 -6.95809507 -2.42045247 151 152 153 154 155 156 3.70667523 0.55467148 -2.45171816 0.09047466 2.12083929 -1.53054022 157 158 159 0.80049183 0.40993045 -6.59658928 > postscript(file="/var/www/rcomp/tmp/63cm21290527232.ps",horizontal=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.24594711 NA 1 1.82618847 0.24594711 2 4.99140275 1.82618847 3 -2.06312474 4.99140275 4 0.64508627 -2.06312474 5 -1.80537478 0.64508627 6 1.64688144 -1.80537478 7 2.77844804 1.64688144 8 -2.61044568 2.77844804 9 -1.07497688 -2.61044568 10 -4.23504403 -1.07497688 11 -4.96124377 -4.23504403 12 -8.64972137 -4.96124377 13 -1.62038595 -8.64972137 14 3.12085681 -1.62038595 15 2.57456959 3.12085681 16 0.54887246 2.57456959 17 -3.09220375 0.54887246 18 -2.53622667 -3.09220375 19 -1.20539175 -2.53622667 20 1.28595700 -1.20539175 21 -3.67836432 1.28595700 22 -3.51083401 -3.67836432 23 -5.96979533 -3.51083401 24 -3.17834451 -5.96979533 25 0.50196757 -3.17834451 26 1.57474371 0.50196757 27 -4.41738769 1.57474371 28 0.05764288 -4.41738769 29 0.34550535 0.05764288 30 -0.17264081 0.34550535 31 2.69655064 -0.17264081 32 6.05125316 2.69655064 33 6.72831927 6.05125316 34 3.30201754 6.72831927 35 4.47926713 3.30201754 36 2.89609396 4.47926713 37 -0.21409849 2.89609396 38 1.76249908 -0.21409849 39 5.93818227 1.76249908 40 -1.58217303 5.93818227 41 1.44335799 -1.58217303 42 -5.72504298 1.44335799 43 2.78192791 -5.72504298 44 4.25473881 2.78192791 45 -0.32827533 4.25473881 46 -3.49621107 -0.32827533 47 7.20086700 -3.49621107 48 -0.12672368 7.20086700 49 3.13101168 -0.12672368 50 2.05078086 3.13101168 51 -1.21095245 2.05078086 52 -4.06329660 -1.21095245 53 -1.64978912 -4.06329660 54 3.15282840 -1.64978912 55 -1.36922442 3.15282840 56 1.65744582 -1.36922442 57 2.17987813 1.65744582 58 0.54615751 2.17987813 59 -1.82525193 0.54615751 60 1.72044908 -1.82525193 61 0.98683173 1.72044908 62 0.61731178 0.98683173 63 3.98241742 0.61731178 64 0.43547515 3.98241742 65 4.15081999 0.43547515 66 -4.70451926 4.15081999 67 5.42272136 -4.70451926 68 1.25097133 5.42272136 69 2.64818685 1.25097133 70 -5.11087101 2.64818685 71 -0.56378130 -5.11087101 72 -0.57177830 -0.56378130 73 -1.53268612 -0.57177830 74 -0.80888526 -1.53268612 75 -2.35663064 -0.80888526 76 1.70018910 -2.35663064 77 -0.53254409 1.70018910 78 -0.01271729 -0.53254409 79 0.78896783 -0.01271729 80 1.53867185 0.78896783 81 -6.86872417 1.53867185 82 -2.55176318 -6.86872417 83 0.96267150 -2.55176318 84 -3.07103789 0.96267150 85 -2.89647614 -3.07103789 86 3.73856839 -2.89647614 87 2.58107729 3.73856839 88 2.80069332 2.58107729 89 -3.65916582 2.80069332 90 -6.11235920 -3.65916582 91 -0.83255376 -6.11235920 92 -2.46571462 -0.83255376 93 0.16513835 -2.46571462 94 -2.18931204 0.16513835 95 3.60348987 -2.18931204 96 -3.45965516 3.60348987 97 -3.14219436 -3.45965516 98 -3.01839954 -3.14219436 99 -3.09267295 -3.01839954 100 0.38583253 -3.09267295 101 -1.39042847 0.38583253 102 -0.81392866 -1.39042847 103 -1.05479487 -0.81392866 104 -3.49751484 -1.05479487 105 -1.67776348 -3.49751484 106 -2.11178355 -1.67776348 107 -1.60176254 -2.11178355 108 0.14205054 -1.60176254 109 -3.54151407 0.14205054 110 -4.60754022 -3.54151407 111 -8.37917921 -4.60754022 112 2.86170090 -8.37917921 113 11.59469807 2.86170090 114 10.17102867 11.59469807 115 -0.70131007 10.17102867 116 4.62986471 -0.70131007 117 1.73228556 4.62986471 118 -0.98735118 1.73228556 119 -3.72466452 -0.98735118 120 2.99426913 -3.72466452 121 0.29669230 2.99426913 122 5.10641867 0.29669230 123 -0.41990565 5.10641867 124 1.15874536 -0.41990565 125 -1.38500405 1.15874536 126 1.22511866 -1.38500405 127 1.61274910 1.22511866 128 -1.67433088 1.61274910 129 0.74972367 -1.67433088 130 3.60803913 0.74972367 131 -4.03481231 3.60803913 132 0.93784983 -4.03481231 133 -2.52842055 0.93784983 134 -6.11281081 -2.52842055 135 2.11419939 -6.11281081 136 0.15285545 2.11419939 137 4.26102689 0.15285545 138 -0.90129427 4.26102689 139 3.64876583 -0.90129427 140 3.37013066 3.64876583 141 4.38781017 3.37013066 142 1.85534090 4.38781017 143 1.30616721 1.85534090 144 1.34208092 1.30616721 145 4.21608891 1.34208092 146 -0.23407950 4.21608891 147 0.22806126 -0.23407950 148 -6.95809507 0.22806126 149 -2.42045247 -6.95809507 150 3.70667523 -2.42045247 151 0.55467148 3.70667523 152 -2.45171816 0.55467148 153 0.09047466 -2.45171816 154 2.12083929 0.09047466 155 -1.53054022 2.12083929 156 0.80049183 -1.53054022 157 0.40993045 0.80049183 158 -6.59658928 0.40993045 159 NA -6.59658928 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 1.82618847 0.24594711 [2,] 4.99140275 1.82618847 [3,] -2.06312474 4.99140275 [4,] 0.64508627 -2.06312474 [5,] -1.80537478 0.64508627 [6,] 1.64688144 -1.80537478 [7,] 2.77844804 1.64688144 [8,] -2.61044568 2.77844804 [9,] -1.07497688 -2.61044568 [10,] -4.23504403 -1.07497688 [11,] -4.96124377 -4.23504403 [12,] -8.64972137 -4.96124377 [13,] -1.62038595 -8.64972137 [14,] 3.12085681 -1.62038595 [15,] 2.57456959 3.12085681 [16,] 0.54887246 2.57456959 [17,] -3.09220375 0.54887246 [18,] -2.53622667 -3.09220375 [19,] -1.20539175 -2.53622667 [20,] 1.28595700 -1.20539175 [21,] -3.67836432 1.28595700 [22,] -3.51083401 -3.67836432 [23,] -5.96979533 -3.51083401 [24,] -3.17834451 -5.96979533 [25,] 0.50196757 -3.17834451 [26,] 1.57474371 0.50196757 [27,] -4.41738769 1.57474371 [28,] 0.05764288 -4.41738769 [29,] 0.34550535 0.05764288 [30,] -0.17264081 0.34550535 [31,] 2.69655064 -0.17264081 [32,] 6.05125316 2.69655064 [33,] 6.72831927 6.05125316 [34,] 3.30201754 6.72831927 [35,] 4.47926713 3.30201754 [36,] 2.89609396 4.47926713 [37,] -0.21409849 2.89609396 [38,] 1.76249908 -0.21409849 [39,] 5.93818227 1.76249908 [40,] -1.58217303 5.93818227 [41,] 1.44335799 -1.58217303 [42,] -5.72504298 1.44335799 [43,] 2.78192791 -5.72504298 [44,] 4.25473881 2.78192791 [45,] -0.32827533 4.25473881 [46,] -3.49621107 -0.32827533 [47,] 7.20086700 -3.49621107 [48,] -0.12672368 7.20086700 [49,] 3.13101168 -0.12672368 [50,] 2.05078086 3.13101168 [51,] -1.21095245 2.05078086 [52,] -4.06329660 -1.21095245 [53,] -1.64978912 -4.06329660 [54,] 3.15282840 -1.64978912 [55,] -1.36922442 3.15282840 [56,] 1.65744582 -1.36922442 [57,] 2.17987813 1.65744582 [58,] 0.54615751 2.17987813 [59,] -1.82525193 0.54615751 [60,] 1.72044908 -1.82525193 [61,] 0.98683173 1.72044908 [62,] 0.61731178 0.98683173 [63,] 3.98241742 0.61731178 [64,] 0.43547515 3.98241742 [65,] 4.15081999 0.43547515 [66,] -4.70451926 4.15081999 [67,] 5.42272136 -4.70451926 [68,] 1.25097133 5.42272136 [69,] 2.64818685 1.25097133 [70,] -5.11087101 2.64818685 [71,] -0.56378130 -5.11087101 [72,] -0.57177830 -0.56378130 [73,] -1.53268612 -0.57177830 [74,] -0.80888526 -1.53268612 [75,] -2.35663064 -0.80888526 [76,] 1.70018910 -2.35663064 [77,] -0.53254409 1.70018910 [78,] -0.01271729 -0.53254409 [79,] 0.78896783 -0.01271729 [80,] 1.53867185 0.78896783 [81,] -6.86872417 1.53867185 [82,] -2.55176318 -6.86872417 [83,] 0.96267150 -2.55176318 [84,] -3.07103789 0.96267150 [85,] -2.89647614 -3.07103789 [86,] 3.73856839 -2.89647614 [87,] 2.58107729 3.73856839 [88,] 2.80069332 2.58107729 [89,] -3.65916582 2.80069332 [90,] -6.11235920 -3.65916582 [91,] -0.83255376 -6.11235920 [92,] -2.46571462 -0.83255376 [93,] 0.16513835 -2.46571462 [94,] -2.18931204 0.16513835 [95,] 3.60348987 -2.18931204 [96,] -3.45965516 3.60348987 [97,] -3.14219436 -3.45965516 [98,] -3.01839954 -3.14219436 [99,] -3.09267295 -3.01839954 [100,] 0.38583253 -3.09267295 [101,] -1.39042847 0.38583253 [102,] -0.81392866 -1.39042847 [103,] -1.05479487 -0.81392866 [104,] -3.49751484 -1.05479487 [105,] -1.67776348 -3.49751484 [106,] -2.11178355 -1.67776348 [107,] -1.60176254 -2.11178355 [108,] 0.14205054 -1.60176254 [109,] -3.54151407 0.14205054 [110,] -4.60754022 -3.54151407 [111,] -8.37917921 -4.60754022 [112,] 2.86170090 -8.37917921 [113,] 11.59469807 2.86170090 [114,] 10.17102867 11.59469807 [115,] -0.70131007 10.17102867 [116,] 4.62986471 -0.70131007 [117,] 1.73228556 4.62986471 [118,] -0.98735118 1.73228556 [119,] -3.72466452 -0.98735118 [120,] 2.99426913 -3.72466452 [121,] 0.29669230 2.99426913 [122,] 5.10641867 0.29669230 [123,] -0.41990565 5.10641867 [124,] 1.15874536 -0.41990565 [125,] -1.38500405 1.15874536 [126,] 1.22511866 -1.38500405 [127,] 1.61274910 1.22511866 [128,] -1.67433088 1.61274910 [129,] 0.74972367 -1.67433088 [130,] 3.60803913 0.74972367 [131,] -4.03481231 3.60803913 [132,] 0.93784983 -4.03481231 [133,] -2.52842055 0.93784983 [134,] -6.11281081 -2.52842055 [135,] 2.11419939 -6.11281081 [136,] 0.15285545 2.11419939 [137,] 4.26102689 0.15285545 [138,] -0.90129427 4.26102689 [139,] 3.64876583 -0.90129427 [140,] 3.37013066 3.64876583 [141,] 4.38781017 3.37013066 [142,] 1.85534090 4.38781017 [143,] 1.30616721 1.85534090 [144,] 1.34208092 1.30616721 [145,] 4.21608891 1.34208092 [146,] -0.23407950 4.21608891 [147,] 0.22806126 -0.23407950 [148,] -6.95809507 0.22806126 [149,] -2.42045247 -6.95809507 [150,] 3.70667523 -2.42045247 [151,] 0.55467148 3.70667523 [152,] -2.45171816 0.55467148 [153,] 0.09047466 -2.45171816 [154,] 2.12083929 0.09047466 [155,] -1.53054022 2.12083929 [156,] 0.80049183 -1.53054022 [157,] 0.40993045 0.80049183 [158,] -6.59658928 0.40993045 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 1.82618847 0.24594711 2 4.99140275 1.82618847 3 -2.06312474 4.99140275 4 0.64508627 -2.06312474 5 -1.80537478 0.64508627 6 1.64688144 -1.80537478 7 2.77844804 1.64688144 8 -2.61044568 2.77844804 9 -1.07497688 -2.61044568 10 -4.23504403 -1.07497688 11 -4.96124377 -4.23504403 12 -8.64972137 -4.96124377 13 -1.62038595 -8.64972137 14 3.12085681 -1.62038595 15 2.57456959 3.12085681 16 0.54887246 2.57456959 17 -3.09220375 0.54887246 18 -2.53622667 -3.09220375 19 -1.20539175 -2.53622667 20 1.28595700 -1.20539175 21 -3.67836432 1.28595700 22 -3.51083401 -3.67836432 23 -5.96979533 -3.51083401 24 -3.17834451 -5.96979533 25 0.50196757 -3.17834451 26 1.57474371 0.50196757 27 -4.41738769 1.57474371 28 0.05764288 -4.41738769 29 0.34550535 0.05764288 30 -0.17264081 0.34550535 31 2.69655064 -0.17264081 32 6.05125316 2.69655064 33 6.72831927 6.05125316 34 3.30201754 6.72831927 35 4.47926713 3.30201754 36 2.89609396 4.47926713 37 -0.21409849 2.89609396 38 1.76249908 -0.21409849 39 5.93818227 1.76249908 40 -1.58217303 5.93818227 41 1.44335799 -1.58217303 42 -5.72504298 1.44335799 43 2.78192791 -5.72504298 44 4.25473881 2.78192791 45 -0.32827533 4.25473881 46 -3.49621107 -0.32827533 47 7.20086700 -3.49621107 48 -0.12672368 7.20086700 49 3.13101168 -0.12672368 50 2.05078086 3.13101168 51 -1.21095245 2.05078086 52 -4.06329660 -1.21095245 53 -1.64978912 -4.06329660 54 3.15282840 -1.64978912 55 -1.36922442 3.15282840 56 1.65744582 -1.36922442 57 2.17987813 1.65744582 58 0.54615751 2.17987813 59 -1.82525193 0.54615751 60 1.72044908 -1.82525193 61 0.98683173 1.72044908 62 0.61731178 0.98683173 63 3.98241742 0.61731178 64 0.43547515 3.98241742 65 4.15081999 0.43547515 66 -4.70451926 4.15081999 67 5.42272136 -4.70451926 68 1.25097133 5.42272136 69 2.64818685 1.25097133 70 -5.11087101 2.64818685 71 -0.56378130 -5.11087101 72 -0.57177830 -0.56378130 73 -1.53268612 -0.57177830 74 -0.80888526 -1.53268612 75 -2.35663064 -0.80888526 76 1.70018910 -2.35663064 77 -0.53254409 1.70018910 78 -0.01271729 -0.53254409 79 0.78896783 -0.01271729 80 1.53867185 0.78896783 81 -6.86872417 1.53867185 82 -2.55176318 -6.86872417 83 0.96267150 -2.55176318 84 -3.07103789 0.96267150 85 -2.89647614 -3.07103789 86 3.73856839 -2.89647614 87 2.58107729 3.73856839 88 2.80069332 2.58107729 89 -3.65916582 2.80069332 90 -6.11235920 -3.65916582 91 -0.83255376 -6.11235920 92 -2.46571462 -0.83255376 93 0.16513835 -2.46571462 94 -2.18931204 0.16513835 95 3.60348987 -2.18931204 96 -3.45965516 3.60348987 97 -3.14219436 -3.45965516 98 -3.01839954 -3.14219436 99 -3.09267295 -3.01839954 100 0.38583253 -3.09267295 101 -1.39042847 0.38583253 102 -0.81392866 -1.39042847 103 -1.05479487 -0.81392866 104 -3.49751484 -1.05479487 105 -1.67776348 -3.49751484 106 -2.11178355 -1.67776348 107 -1.60176254 -2.11178355 108 0.14205054 -1.60176254 109 -3.54151407 0.14205054 110 -4.60754022 -3.54151407 111 -8.37917921 -4.60754022 112 2.86170090 -8.37917921 113 11.59469807 2.86170090 114 10.17102867 11.59469807 115 -0.70131007 10.17102867 116 4.62986471 -0.70131007 117 1.73228556 4.62986471 118 -0.98735118 1.73228556 119 -3.72466452 -0.98735118 120 2.99426913 -3.72466452 121 0.29669230 2.99426913 122 5.10641867 0.29669230 123 -0.41990565 5.10641867 124 1.15874536 -0.41990565 125 -1.38500405 1.15874536 126 1.22511866 -1.38500405 127 1.61274910 1.22511866 128 -1.67433088 1.61274910 129 0.74972367 -1.67433088 130 3.60803913 0.74972367 131 -4.03481231 3.60803913 132 0.93784983 -4.03481231 133 -2.52842055 0.93784983 134 -6.11281081 -2.52842055 135 2.11419939 -6.11281081 136 0.15285545 2.11419939 137 4.26102689 0.15285545 138 -0.90129427 4.26102689 139 3.64876583 -0.90129427 140 3.37013066 3.64876583 141 4.38781017 3.37013066 142 1.85534090 4.38781017 143 1.30616721 1.85534090 144 1.34208092 1.30616721 145 4.21608891 1.34208092 146 -0.23407950 4.21608891 147 0.22806126 -0.23407950 148 -6.95809507 0.22806126 149 -2.42045247 -6.95809507 150 3.70667523 -2.42045247 151 0.55467148 3.70667523 152 -2.45171816 0.55467148 153 0.09047466 -2.45171816 154 2.12083929 0.09047466 155 -1.53054022 2.12083929 156 0.80049183 -1.53054022 157 0.40993045 0.80049183 158 -6.59658928 0.40993045 > 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/rcomp/tmp/7w43n1290527232.ps",horizontal=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/rcomp/tmp/87v2p1290527232.ps",horizontal=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/rcomp/tmp/97v2p1290527232.ps",horizontal=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/rcomp/tmp/10hm1s1290527232.ps",horizontal=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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/11350g1290527232.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/rcomp/tmp/12ony41290527232.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/rcomp/tmp/132fev1290527232.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/rcomp/tmp/146xv11290527232.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/rcomp/tmp/15ryb71290527232.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/rcomp/tmp/1658rx1290527232.tab") + } > > try(system("convert tmp/1tl4h1290527232.ps tmp/1tl4h1290527232.png",intern=TRUE)) character(0) > try(system("convert tmp/2tl4h1290527232.ps tmp/2tl4h1290527232.png",intern=TRUE)) character(0) > try(system("convert tmp/3tl4h1290527232.ps tmp/3tl4h1290527232.png",intern=TRUE)) character(0) > try(system("convert tmp/43cm21290527232.ps tmp/43cm21290527232.png",intern=TRUE)) character(0) > try(system("convert tmp/53cm21290527232.ps tmp/53cm21290527232.png",intern=TRUE)) character(0) > try(system("convert tmp/63cm21290527232.ps tmp/63cm21290527232.png",intern=TRUE)) character(0) > try(system("convert tmp/7w43n1290527232.ps tmp/7w43n1290527232.png",intern=TRUE)) character(0) > try(system("convert tmp/87v2p1290527232.ps tmp/87v2p1290527232.png",intern=TRUE)) character(0) > try(system("convert tmp/97v2p1290527232.ps tmp/97v2p1290527232.png",intern=TRUE)) character(0) > try(system("convert tmp/10hm1s1290527232.ps tmp/10hm1s1290527232.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.530 2.200 7.749