R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(9 + ,24 + ,14 + ,11 + ,12 + ,24 + ,26 + ,9 + ,25 + ,11 + ,7 + ,8 + ,25 + ,23 + ,9 + ,17 + ,6 + ,17 + ,8 + ,30 + ,25 + ,9 + ,18 + ,12 + ,10 + ,8 + ,19 + ,23 + ,9 + ,18 + ,8 + ,12 + ,9 + ,22 + ,19 + ,9 + ,16 + ,10 + ,12 + ,7 + ,22 + ,29 + ,10 + ,20 + ,10 + ,11 + ,4 + ,25 + ,25 + ,10 + ,16 + ,11 + ,11 + ,11 + ,23 + ,21 + ,10 + ,18 + ,16 + ,12 + ,7 + ,17 + ,22 + ,10 + ,17 + ,11 + ,13 + ,7 + ,21 + ,25 + ,10 + ,23 + ,13 + ,14 + ,12 + ,19 + ,24 + ,10 + ,30 + ,12 + ,16 + ,10 + ,19 + ,18 + ,10 + ,23 + ,8 + ,11 + ,10 + ,15 + ,22 + ,10 + ,18 + ,12 + ,10 + ,8 + ,16 + ,15 + ,10 + ,15 + ,11 + ,11 + ,8 + ,23 + ,22 + ,10 + ,12 + ,4 + ,15 + ,4 + ,27 + ,28 + ,10 + ,21 + ,9 + ,9 + ,9 + ,22 + ,20 + ,10 + ,15 + ,8 + ,11 + ,8 + ,14 + ,12 + ,10 + ,20 + ,8 + ,17 + ,7 + ,22 + ,24 + ,10 + ,31 + ,14 + ,17 + ,11 + ,23 + ,20 + ,10 + ,27 + ,15 + ,11 + ,9 + ,23 + ,21 + ,10 + ,34 + ,16 + ,18 + ,11 + ,21 + ,20 + ,10 + ,21 + ,9 + ,14 + ,13 + ,19 + ,21 + ,10 + ,31 + ,14 + ,10 + ,8 + ,18 + ,23 + ,10 + ,19 + ,11 + ,11 + ,8 + ,20 + ,28 + ,10 + ,16 + ,8 + ,15 + ,9 + ,23 + ,24 + ,10 + ,20 + ,9 + ,15 + ,6 + ,25 + ,24 + ,10 + ,21 + ,9 + ,13 + ,9 + ,19 + ,24 + ,10 + ,22 + ,9 + ,16 + ,9 + ,24 + ,23 + ,10 + ,17 + ,9 + ,13 + ,6 + ,22 + ,23 + ,10 + ,24 + ,10 + ,9 + ,6 + ,25 + ,29 + ,10 + ,25 + ,16 + ,18 + ,16 + ,26 + ,24 + ,10 + ,26 + ,11 + ,18 + ,5 + ,29 + ,18 + ,10 + ,25 + ,8 + ,12 + ,7 + ,32 + ,25 + ,10 + ,17 + ,9 + ,17 + ,9 + ,25 + ,21 + ,10 + ,32 + ,16 + ,9 + ,6 + ,29 + ,26 + ,10 + ,33 + ,11 + ,9 + ,6 + ,28 + ,22 + ,10 + ,13 + ,16 + ,12 + ,5 + ,17 + ,22 + ,10 + ,32 + ,12 + ,18 + ,12 + ,28 + ,22 + ,10 + ,25 + ,12 + ,12 + ,7 + ,29 + ,23 + ,10 + ,29 + ,14 + ,18 + ,10 + ,26 + ,30 + ,10 + ,22 + ,9 + ,14 + ,9 + ,25 + ,23 + ,10 + ,18 + ,10 + ,15 + ,8 + ,14 + ,17 + ,10 + ,17 + ,9 + ,16 + ,5 + ,25 + ,23 + ,10 + ,20 + ,10 + ,10 + ,8 + ,26 + ,23 + ,10 + ,15 + ,12 + ,11 + ,8 + ,20 + ,25 + ,10 + ,20 + ,14 + ,14 + ,10 + ,18 + ,24 + ,10 + ,33 + ,14 + ,9 + ,6 + ,32 + ,24 + ,10 + ,29 + ,10 + ,12 + ,8 + ,25 + ,23 + ,10 + ,23 + ,14 + ,17 + ,7 + ,25 + ,21 + ,10 + ,26 + ,16 + ,5 + ,4 + ,23 + ,24 + ,10 + ,18 + ,9 + ,12 + ,8 + ,21 + ,24 + ,10 + ,20 + ,10 + ,12 + ,8 + ,20 + ,28 + ,10 + ,11 + ,6 + ,6 + ,4 + ,15 + ,16 + ,10 + ,28 + ,8 + ,24 + ,20 + ,30 + ,20 + ,10 + ,26 + ,13 + ,12 + ,8 + ,24 + ,29 + ,10 + ,22 + ,10 + ,12 + ,8 + ,26 + ,27 + ,10 + ,17 + ,8 + ,14 + ,6 + ,24 + ,22 + ,10 + ,12 + ,7 + ,7 + ,4 + ,22 + ,28 + ,10 + ,14 + ,15 + ,13 + ,8 + ,14 + ,16 + ,10 + ,17 + ,9 + ,12 + ,9 + ,24 + ,25 + ,10 + ,21 + ,10 + ,13 + ,6 + ,24 + ,24 + ,10 + ,19 + ,12 + ,14 + ,7 + ,24 + ,28 + ,10 + ,18 + ,13 + ,8 + ,9 + ,24 + ,24 + ,10 + ,10 + ,10 + ,11 + ,5 + ,19 + ,23 + ,10 + ,29 + ,11 + ,9 + ,5 + ,31 + ,30 + ,10 + ,31 + ,8 + ,11 + ,8 + ,22 + ,24 + ,10 + ,19 + ,9 + ,13 + ,8 + ,27 + ,21 + ,10 + ,9 + ,13 + ,10 + ,6 + ,19 + ,25 + ,10 + ,20 + ,11 + ,11 + ,8 + ,25 + ,25 + ,10 + ,28 + ,8 + ,12 + ,7 + ,20 + ,22 + ,10 + ,19 + ,9 + ,9 + ,7 + ,21 + ,23 + ,10 + ,30 + ,9 + ,15 + ,9 + ,27 + ,26 + ,10 + ,29 + ,15 + ,18 + ,11 + ,23 + ,23 + ,10 + ,26 + ,9 + ,15 + ,6 + ,25 + ,25 + ,10 + ,23 + ,10 + ,12 + ,8 + ,20 + ,21 + ,10 + ,13 + ,14 + ,13 + ,6 + ,21 + ,25 + ,10 + ,21 + ,12 + ,14 + ,9 + ,22 + ,24 + ,10 + ,19 + ,12 + ,10 + ,8 + ,23 + ,29 + ,10 + ,28 + ,11 + ,13 + ,6 + ,25 + ,22 + ,10 + ,23 + ,14 + ,13 + ,10 + ,25 + ,27 + ,10 + ,18 + ,6 + ,11 + ,8 + ,17 + ,26 + ,10 + ,21 + ,12 + ,13 + ,8 + ,19 + ,22 + ,10 + ,20 + ,8 + ,16 + ,10 + ,25 + ,24 + ,10 + ,23 + ,14 + ,8 + ,5 + ,19 + ,27 + ,10 + ,21 + ,11 + ,16 + ,7 + ,20 + ,24 + ,10 + ,21 + ,10 + ,11 + ,5 + ,26 + ,24 + ,10 + ,15 + ,14 + ,9 + ,8 + ,23 + ,29 + ,10 + ,28 + ,12 + ,16 + ,14 + ,27 + ,22 + ,10 + ,19 + ,10 + ,12 + ,7 + ,17 + ,21 + ,10 + ,26 + ,14 + ,14 + ,8 + ,17 + ,24 + ,10 + ,10 + ,5 + ,8 + ,6 + ,19 + ,24 + ,10 + ,16 + ,11 + ,9 + ,5 + ,17 + ,23 + ,10 + ,22 + ,10 + ,15 + ,6 + ,22 + ,20 + ,10 + ,19 + ,9 + ,11 + ,10 + ,21 + ,27 + ,10 + ,31 + ,10 + ,21 + ,12 + ,32 + ,26 + ,10 + ,31 + ,16 + ,14 + ,9 + ,21 + ,25 + ,10 + ,29 + ,13 + ,18 + ,12 + ,21 + ,21 + ,10 + ,19 + ,9 + ,12 + ,7 + ,18 + ,21 + ,10 + ,22 + ,10 + ,13 + ,8 + ,18 + ,19 + ,10 + ,23 + ,10 + ,15 + ,10 + ,23 + ,21 + ,10 + ,15 + ,7 + ,12 + ,6 + ,19 + ,21 + ,10 + ,20 + ,9 + ,19 + ,10 + ,20 + ,16 + ,10 + ,18 + ,8 + ,15 + ,10 + ,21 + ,22 + ,10 + ,23 + ,14 + ,11 + ,10 + ,20 + ,29 + ,10 + ,25 + ,14 + ,11 + ,5 + ,17 + ,15 + ,10 + ,21 + ,8 + ,10 + ,7 + ,18 + ,17 + ,10 + ,24 + ,9 + ,13 + ,10 + ,19 + ,15 + ,10 + ,25 + ,14 + ,15 + ,11 + ,22 + ,21 + ,10 + ,17 + ,14 + ,12 + ,6 + ,15 + ,21 + ,10 + ,13 + ,8 + ,12 + ,7 + ,14 + ,19 + ,10 + ,28 + ,8 + ,16 + ,12 + ,18 + ,24 + ,10 + ,21 + ,8 + ,9 + ,11 + ,24 + ,20 + ,10 + ,25 + ,7 + ,18 + ,11 + ,35 + ,17 + ,10 + ,9 + ,6 + ,8 + ,11 + ,29 + ,23 + ,10 + ,16 + ,8 + ,13 + ,5 + ,21 + ,24 + ,10 + ,19 + ,6 + ,17 + ,8 + ,25 + ,14 + ,10 + ,17 + ,11 + ,9 + ,6 + ,20 + ,19 + ,10 + ,25 + ,14 + ,15 + ,9 + ,22 + ,24 + ,10 + ,20 + ,11 + ,8 + ,4 + ,13 + ,13 + ,10 + ,29 + ,11 + ,7 + ,4 + ,26 + ,22 + ,10 + ,14 + ,11 + ,12 + ,7 + ,17 + ,16 + ,10 + ,22 + ,14 + ,14 + ,11 + ,25 + ,19 + ,10 + ,15 + ,8 + ,6 + ,6 + ,20 + ,25 + ,10 + ,19 + ,20 + ,8 + ,7 + ,19 + ,25 + ,10 + ,20 + ,11 + ,17 + ,8 + ,21 + ,23 + ,10 + ,15 + ,8 + ,10 + ,4 + ,22 + ,24 + ,10 + ,20 + ,11 + ,11 + ,8 + ,24 + ,26 + ,10 + ,18 + ,10 + ,14 + ,9 + ,21 + ,26 + ,10 + ,33 + ,14 + ,11 + ,8 + ,26 + ,25 + ,10 + ,22 + ,11 + ,13 + ,11 + ,24 + ,18 + ,10 + ,16 + ,9 + ,12 + ,8 + ,16 + ,21 + ,10 + ,17 + ,9 + ,11 + ,5 + ,23 + ,26 + ,10 + ,16 + ,8 + ,9 + ,4 + ,18 + ,23 + ,10 + ,21 + ,10 + ,12 + ,8 + ,16 + ,23 + ,10 + ,26 + ,13 + ,20 + ,10 + ,26 + ,22 + ,10 + ,18 + ,13 + ,12 + ,6 + ,19 + ,20 + ,10 + ,18 + ,12 + ,13 + ,9 + ,21 + ,13 + ,10 + ,17 + ,8 + ,12 + ,9 + ,21 + ,24 + ,10 + ,22 + ,13 + ,12 + ,13 + ,22 + ,15 + ,10 + ,30 + ,14 + ,9 + ,9 + ,23 + ,14 + ,10 + ,30 + ,12 + ,15 + ,10 + ,29 + ,22 + ,10 + ,24 + ,14 + ,24 + ,20 + ,21 + ,10 + ,10 + ,21 + ,15 + ,7 + ,5 + ,21 + ,24 + ,10 + ,21 + ,13 + ,17 + ,11 + ,23 + ,22 + ,10 + ,29 + ,16 + ,11 + ,6 + ,27 + ,24 + ,10 + ,31 + ,9 + ,17 + ,9 + ,25 + ,19 + ,10 + ,20 + ,9 + ,11 + ,7 + ,21 + ,20 + ,10 + ,16 + ,9 + ,12 + ,9 + ,10 + ,13 + ,10 + ,22 + ,8 + ,14 + ,10 + ,20 + ,20 + ,10 + ,20 + ,7 + ,11 + ,9 + ,26 + ,22 + ,10 + ,28 + ,16 + ,16 + ,8 + ,24 + ,24 + ,10 + ,38 + ,11 + ,21 + ,7 + ,29 + ,29 + ,10 + ,22 + ,9 + ,14 + ,6 + ,19 + ,12 + ,10 + ,20 + ,11 + ,20 + ,13 + ,24 + ,20 + ,10 + ,17 + ,9 + ,13 + ,6 + ,19 + ,21 + ,10 + ,28 + ,14 + ,11 + ,8 + ,24 + ,24 + ,10 + ,22 + ,13 + ,15 + ,10 + ,22 + ,22 + ,10 + ,31 + ,16 + ,19 + ,16 + ,17 + ,20) + ,dim=c(7 + ,159) + ,dimnames=list(c('month' + ,'ConcernoverMistakes' + ,'Doubtsaboutactions' + ,'ParentalExpectations' + ,'ParentalCriticism' + ,'PersonalStandards' + ,'Organization ') + ,1:159)) > y <- array(NA,dim=c(7,159),dimnames=list(c('month','ConcernoverMistakes','Doubtsaboutactions','ParentalExpectations','ParentalCriticism','PersonalStandards','Organization '),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' > 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 PersonalStandards month ConcernoverMistakes Doubtsaboutactions 1 24 9 24 14 2 25 9 25 11 3 30 9 17 6 4 19 9 18 12 5 22 9 18 8 6 22 9 16 10 7 25 10 20 10 8 23 10 16 11 9 17 10 18 16 10 21 10 17 11 11 19 10 23 13 12 19 10 30 12 13 15 10 23 8 14 16 10 18 12 15 23 10 15 11 16 27 10 12 4 17 22 10 21 9 18 14 10 15 8 19 22 10 20 8 20 23 10 31 14 21 23 10 27 15 22 21 10 34 16 23 19 10 21 9 24 18 10 31 14 25 20 10 19 11 26 23 10 16 8 27 25 10 20 9 28 19 10 21 9 29 24 10 22 9 30 22 10 17 9 31 25 10 24 10 32 26 10 25 16 33 29 10 26 11 34 32 10 25 8 35 25 10 17 9 36 29 10 32 16 37 28 10 33 11 38 17 10 13 16 39 28 10 32 12 40 29 10 25 12 41 26 10 29 14 42 25 10 22 9 43 14 10 18 10 44 25 10 17 9 45 26 10 20 10 46 20 10 15 12 47 18 10 20 14 48 32 10 33 14 49 25 10 29 10 50 25 10 23 14 51 23 10 26 16 52 21 10 18 9 53 20 10 20 10 54 15 10 11 6 55 30 10 28 8 56 24 10 26 13 57 26 10 22 10 58 24 10 17 8 59 22 10 12 7 60 14 10 14 15 61 24 10 17 9 62 24 10 21 10 63 24 10 19 12 64 24 10 18 13 65 19 10 10 10 66 31 10 29 11 67 22 10 31 8 68 27 10 19 9 69 19 10 9 13 70 25 10 20 11 71 20 10 28 8 72 21 10 19 9 73 27 10 30 9 74 23 10 29 15 75 25 10 26 9 76 20 10 23 10 77 21 10 13 14 78 22 10 21 12 79 23 10 19 12 80 25 10 28 11 81 25 10 23 14 82 17 10 18 6 83 19 10 21 12 84 25 10 20 8 85 19 10 23 14 86 20 10 21 11 87 26 10 21 10 88 23 10 15 14 89 27 10 28 12 90 17 10 19 10 91 17 10 26 14 92 19 10 10 5 93 17 10 16 11 94 22 10 22 10 95 21 10 19 9 96 32 10 31 10 97 21 10 31 16 98 21 10 29 13 99 18 10 19 9 100 18 10 22 10 101 23 10 23 10 102 19 10 15 7 103 20 10 20 9 104 21 10 18 8 105 20 10 23 14 106 17 10 25 14 107 18 10 21 8 108 19 10 24 9 109 22 10 25 14 110 15 10 17 14 111 14 10 13 8 112 18 10 28 8 113 24 10 21 8 114 35 10 25 7 115 29 10 9 6 116 21 10 16 8 117 25 10 19 6 118 20 10 17 11 119 22 10 25 14 120 13 10 20 11 121 26 10 29 11 122 17 10 14 11 123 25 10 22 14 124 20 10 15 8 125 19 10 19 20 126 21 10 20 11 127 22 10 15 8 128 24 10 20 11 129 21 10 18 10 130 26 10 33 14 131 24 10 22 11 132 16 10 16 9 133 23 10 17 9 134 18 10 16 8 135 16 10 21 10 136 26 10 26 13 137 19 10 18 13 138 21 10 18 12 139 21 10 17 8 140 22 10 22 13 141 23 10 30 14 142 29 10 30 12 143 21 10 24 14 144 21 10 21 15 145 23 10 21 13 146 27 10 29 16 147 25 10 31 9 148 21 10 20 9 149 10 10 16 9 150 20 10 22 8 151 26 10 20 7 152 24 10 28 16 153 29 10 38 11 154 19 10 22 9 155 24 10 20 11 156 19 10 17 9 157 24 10 28 14 158 22 10 22 13 159 17 10 31 16 ParentalExpectations ParentalCriticism Organization\r 1 11 12 26 2 7 8 23 3 17 8 25 4 10 8 23 5 12 9 19 6 12 7 29 7 11 4 25 8 11 11 21 9 12 7 22 10 13 7 25 11 14 12 24 12 16 10 18 13 11 10 22 14 10 8 15 15 11 8 22 16 15 4 28 17 9 9 20 18 11 8 12 19 17 7 24 20 17 11 20 21 11 9 21 22 18 11 20 23 14 13 21 24 10 8 23 25 11 8 28 26 15 9 24 27 15 6 24 28 13 9 24 29 16 9 23 30 13 6 23 31 9 6 29 32 18 16 24 33 18 5 18 34 12 7 25 35 17 9 21 36 9 6 26 37 9 6 22 38 12 5 22 39 18 12 22 40 12 7 23 41 18 10 30 42 14 9 23 43 15 8 17 44 16 5 23 45 10 8 23 46 11 8 25 47 14 10 24 48 9 6 24 49 12 8 23 50 17 7 21 51 5 4 24 52 12 8 24 53 12 8 28 54 6 4 16 55 24 20 20 56 12 8 29 57 12 8 27 58 14 6 22 59 7 4 28 60 13 8 16 61 12 9 25 62 13 6 24 63 14 7 28 64 8 9 24 65 11 5 23 66 9 5 30 67 11 8 24 68 13 8 21 69 10 6 25 70 11 8 25 71 12 7 22 72 9 7 23 73 15 9 26 74 18 11 23 75 15 6 25 76 12 8 21 77 13 6 25 78 14 9 24 79 10 8 29 80 13 6 22 81 13 10 27 82 11 8 26 83 13 8 22 84 16 10 24 85 8 5 27 86 16 7 24 87 11 5 24 88 9 8 29 89 16 14 22 90 12 7 21 91 14 8 24 92 8 6 24 93 9 5 23 94 15 6 20 95 11 10 27 96 21 12 26 97 14 9 25 98 18 12 21 99 12 7 21 100 13 8 19 101 15 10 21 102 12 6 21 103 19 10 16 104 15 10 22 105 11 10 29 106 11 5 15 107 10 7 17 108 13 10 15 109 15 11 21 110 12 6 21 111 12 7 19 112 16 12 24 113 9 11 20 114 18 11 17 115 8 11 23 116 13 5 24 117 17 8 14 118 9 6 19 119 15 9 24 120 8 4 13 121 7 4 22 122 12 7 16 123 14 11 19 124 6 6 25 125 8 7 25 126 17 8 23 127 10 4 24 128 11 8 26 129 14 9 26 130 11 8 25 131 13 11 18 132 12 8 21 133 11 5 26 134 9 4 23 135 12 8 23 136 20 10 22 137 12 6 20 138 13 9 13 139 12 9 24 140 12 13 15 141 9 9 14 142 15 10 22 143 24 20 10 144 7 5 24 145 17 11 22 146 11 6 24 147 17 9 19 148 11 7 20 149 12 9 13 150 14 10 20 151 11 9 22 152 16 8 24 153 21 7 29 154 14 6 12 155 20 13 20 156 13 6 21 157 11 8 24 158 15 10 22 159 19 16 20 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) month ConcernoverMistakes 22.450345 -1.499330 0.330887 Doubtsaboutactions ParentalExpectations ParentalCriticism -0.356681 0.198030 0.006132 `Organization\r` 0.393046 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -8.5436 -2.3215 0.0417 2.0743 11.4538 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 22.450345 14.596982 1.538 0.12612 month -1.499330 1.442617 -1.039 0.30031 ConcernoverMistakes 0.330887 0.055592 5.952 1.76e-08 *** Doubtsaboutactions -0.356681 0.107249 -3.326 0.00111 ** ParentalExpectations 0.198030 0.101714 1.947 0.05339 . ParentalCriticism 0.006132 0.129654 0.047 0.96234 `Organization\r` 0.393046 0.072189 5.445 2.04e-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.024e-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.16771489 0.33542978 0.8322851 [2,] 0.47621099 0.95242198 0.5237890 [3,] 0.40577612 0.81155225 0.5942239 [4,] 0.83064315 0.33871370 0.1693569 [5,] 0.75348023 0.49303954 0.2465198 [6,] 0.73548793 0.52902414 0.2645121 [7,] 0.65377440 0.69245120 0.3462256 [8,] 0.59336664 0.81326673 0.4066334 [9,] 0.57694920 0.84610160 0.4230508 [10,] 0.50026696 0.99946608 0.4997330 [11,] 0.49653597 0.99307193 0.5034640 [12,] 0.49273799 0.98547599 0.5072620 [13,] 0.42290067 0.84580134 0.5770993 [14,] 0.36224280 0.72448560 0.6377572 [15,] 0.38040301 0.76080602 0.6195970 [16,] 0.34926013 0.69852026 0.6507399 [17,] 0.28830006 0.57660012 0.7116999 [18,] 0.24764433 0.49528865 0.7523557 [19,] 0.23927925 0.47855849 0.7607208 [20,] 0.19792421 0.39584842 0.8020758 [21,] 0.15417241 0.30834481 0.8458276 [22,] 0.12600524 0.25201047 0.8739948 [23,] 0.16102607 0.32205213 0.8389739 [24,] 0.26983064 0.53966127 0.7301694 [25,] 0.54834851 0.90330298 0.4516515 [26,] 0.52712914 0.94574173 0.4728709 [27,] 0.60426159 0.79147681 0.3957384 [28,] 0.59969999 0.80060002 0.4003000 [29,] 0.55294325 0.89411350 0.4470567 [30,] 0.52071143 0.95857714 0.4792886 [31,] 0.61443759 0.77112481 0.3855624 [32,] 0.57974371 0.84051258 0.4202563 [33,] 0.53628142 0.92743715 0.4637186 [34,] 0.62438002 0.75123996 0.3756200 [35,] 0.59512318 0.80975363 0.4048768 [36,] 0.63009427 0.73981146 0.3699057 [37,] 0.57886695 0.84226609 0.4211330 [38,] 0.56530286 0.86939427 0.4346971 [39,] 0.68091467 0.63817066 0.3190853 [40,] 0.63746549 0.72506902 0.3625345 [41,] 0.62363294 0.75273411 0.3763671 [42,] 0.58396652 0.83206696 0.4160335 [43,] 0.53925765 0.92148470 0.4607423 [44,] 0.56489085 0.87021830 0.4351091 [45,] 0.52700228 0.94599544 0.4729977 [46,] 0.59021603 0.81956794 0.4097840 [47,] 0.55295456 0.89409088 0.4470454 [48,] 0.51468462 0.97063077 0.4853154 [49,] 0.48384700 0.96769399 0.5161530 [50,] 0.43680002 0.87360005 0.5632000 [51,] 0.39552301 0.79104602 0.6044770 [52,] 0.36678563 0.73357126 0.6332144 [53,] 0.32732595 0.65465190 0.6726740 [54,] 0.28726970 0.57453939 0.7127303 [55,] 0.32790454 0.65580907 0.6720955 [56,] 0.28712450 0.57424900 0.7128755 [57,] 0.30139502 0.60279005 0.6986050 [58,] 0.35842445 0.71684891 0.6415755 [59,] 0.43759874 0.87519748 0.5624013 [60,] 0.40005351 0.80010701 0.5999465 [61,] 0.38555617 0.77111234 0.6144438 [62,] 0.44979259 0.89958518 0.5502074 [63,] 0.40391055 0.80782110 0.5960895 [64,] 0.36243747 0.72487494 0.6375625 [65,] 0.32738432 0.65476863 0.6726157 [66,] 0.29579562 0.59159125 0.7042044 [67,] 0.27163644 0.54327287 0.7283636 [68,] 0.24954790 0.49909581 0.7504521 [69,] 0.21446500 0.42893000 0.7855350 [70,] 0.18282753 0.36565506 0.8171725 [71,] 0.15719170 0.31438340 0.8428083 [72,] 0.13769955 0.27539910 0.8623005 [73,] 0.22131305 0.44262611 0.7786869 [74,] 0.20327996 0.40655991 0.7967200 [75,] 0.17628176 0.35256352 0.8237182 [76,] 0.17686720 0.35373440 0.8231328 [77,] 0.17269126 0.34538253 0.8273087 [78,] 0.17979878 0.35959757 0.8202012 [79,] 0.16863029 0.33726059 0.8313697 [80,] 0.15861980 0.31723960 0.8413802 [81,] 0.16228863 0.32457725 0.8377114 [82,] 0.23483617 0.46967235 0.7651638 [83,] 0.20139934 0.40279868 0.7986007 [84,] 0.18475720 0.36951440 0.8152428 [85,] 0.15599789 0.31199579 0.8440021 [86,] 0.14097332 0.28194664 0.8590267 [87,] 0.14432965 0.28865930 0.8556703 [88,] 0.14577416 0.29154832 0.8542258 [89,] 0.14181193 0.28362385 0.8581881 [90,] 0.13459831 0.26919662 0.8654017 [91,] 0.12941649 0.25883297 0.8705835 [92,] 0.10574605 0.21149211 0.8942539 [93,] 0.08759527 0.17519054 0.9124047 [94,] 0.07016834 0.14033668 0.9298317 [95,] 0.05644097 0.11288195 0.9435590 [96,] 0.05965099 0.11930197 0.9403490 [97,] 0.04872863 0.09745727 0.9512714 [98,] 0.04258511 0.08517022 0.9574149 [99,] 0.03694512 0.07389025 0.9630549 [100,] 0.02809448 0.05618896 0.9719055 [101,] 0.02761203 0.05522407 0.9723880 [102,] 0.03476231 0.06952462 0.9652377 [103,] 0.14803191 0.29606383 0.8519681 [104,] 0.13611495 0.27222990 0.8638850 [105,] 0.54910356 0.90179287 0.4508964 [106,] 0.85096246 0.29807509 0.1490375 [107,] 0.81754678 0.36490645 0.1824532 [108,] 0.87251335 0.25497330 0.1274866 [109,] 0.84745489 0.30509022 0.1525451 [110,] 0.81875423 0.36249154 0.1812458 [111,] 0.85218284 0.29563432 0.1478172 [112,] 0.82884302 0.34231395 0.1711570 [113,] 0.78841726 0.42316549 0.2115827 [114,] 0.81978161 0.36043677 0.1802184 [115,] 0.77700405 0.44599191 0.2229960 [116,] 0.73743720 0.52512559 0.2625628 [117,] 0.68854908 0.62290184 0.3114509 [118,] 0.65156836 0.69686329 0.3484316 [119,] 0.60927369 0.78145263 0.3907263 [120,] 0.55029231 0.89941537 0.4497077 [121,] 0.48701467 0.97402935 0.5129853 [122,] 0.48471272 0.96942545 0.5152873 [123,] 0.48259711 0.96519422 0.5174029 [124,] 0.43205686 0.86411373 0.5679431 [125,] 0.38380813 0.76761625 0.6161919 [126,] 0.53144857 0.93710287 0.4685514 [127,] 0.49216882 0.98433763 0.5078312 [128,] 0.41869256 0.83738513 0.5813074 [129,] 0.42816753 0.85633505 0.5718325 [130,] 0.35658334 0.71316669 0.6434167 [131,] 0.32035944 0.64071888 0.6796406 [132,] 0.28591318 0.57182637 0.7140868 [133,] 0.33650441 0.67300882 0.6634956 [134,] 0.47809411 0.95618823 0.5219059 [135,] 0.40099275 0.80198550 0.5990072 [136,] 0.31988414 0.63976829 0.6801159 [137,] 0.30794447 0.61588895 0.6920555 [138,] 0.25474242 0.50948484 0.7452576 [139,] 0.15909156 0.31818312 0.8409084 [140,] 0.30410696 0.60821391 0.6958930 > postscript(file="/var/wessaorg/rcomp/tmp/14oq61322182280.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') > points(x[,1]-mysum$resid) > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/2g3uq1322182280.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/33syy1322182280.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/4f3811322182280.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/57off1322182280.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.37524384 1.21961360 4.31691182 -2.70158580 0.04167893 -2.50137472 7 8 9 10 11 12 2.46301590 3.67250046 -1.77241462 -0.60209952 -3.70970798 -4.40812214 13 14 15 16 17 18 -8.10066624 -1.05789204 3.62873963 2.99876951 1.10607342 -2.51084836 19 20 21 22 23 24 -2.06388010 -1.01590110 1.47173023 -3.49323099 -3.30165368 -5.79042791 25 26 27 28 29 30 -3.05308234 0.64346444 1.69499409 -4.25822995 0.20983737 0.47676191 31 32 33 34 35 36 -0.04891937 2.88190947 6.19334748 6.87878992 3.45233417 4.62320572 37 38 39 40 41 42 3.08109533 -0.10571356 1.94959574 6.09160514 -1.47647966 1.60589803 43 44 45 46 47 48 -5.54749680 2.88880342 4.42260730 -0.19371587 -3.34810030 7.36504744 49 50 51 52 53 54 0.04856169 3.26268108 2.19900634 -1.06140548 -3.93868093 -1.45816206 55 56 57 58 59 60 3.39526959 -1.24700661 1.79259015 2.31509605 0.65305525 -1.65143652 61 62 63 64 65 66 1.87030373 1.11684857 0.71564022 4.15130752 0.55184662 4.26641257 67 68 69 70 71 72 -4.52159004 5.58881352 1.35858379 2.79516699 -4.93473519 -0.39902372 73 74 75 76 77 78 -0.41836659 -1.37461249 -0.68337474 -2.18002397 1.79762499 -0.38621713 79 80 81 82 83 84 0.10858352 0.94341012 1.67813182 -6.71950933 -2.39596328 1.11575276 85 86 87 88 89 90 -3.30105411 -3.12669385 3.51904171 2.34352481 2.65694028 -3.85034261 91 92 93 94 95 96 -6.32115863 -1.03664565 -2.68073499 -0.03791724 -2.38566390 3.40084782 97 98 99 100 101 102 -3.66141063 -3.30801605 -3.20702366 -3.26107605 0.21362007 -1.59070440 103 104 105 106 107 108 -0.97729304 -1.23835145 -3.71189856 -1.84037333 -2.25723643 -1.71961445 109 110 111 112 113 114 -0.02756266 -3.75571150 -4.79229037 -8.54360996 2.73712739 11.45376109 115 116 117 118 119 120 10.01330569 -0.93594495 4.47796769 1.55442737 -1.19443423 -3.86966589 121 122 123 124 125 126 2.81296983 0.12600210 4.94922035 -0.61802346 0.93640710 -1.60692393 127 128 129 130 131 132 0.99516573 1.40212147 -1.89300860 0.56367630 3.47025305 -4.22049450 133 134 135 136 137 138 0.69981850 -2.74464564 -6.30434057 1.90780442 -0.05023425 4.12797552 139 140 141 142 143 144 -1.09333180 3.54851704 3.26976679 4.21772613 1.78935991 1.09456825 145 146 147 148 149 150 1.15019900 4.00589776 -0.39399585 0.05316496 -7.08226286 -2.57777896 151 152 153 154 155 156 3.54144686 0.33436837 -2.70715576 -0.05220384 1.94745920 -1.73714706 157 158 159 0.61115790 0.22150492 -6.72926210 > postscript(file="/var/wessaorg/rcomp/tmp/6srdb1322182280.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.37524384 NA 1 1.21961360 -0.37524384 2 4.31691182 1.21961360 3 -2.70158580 4.31691182 4 0.04167893 -2.70158580 5 -2.50137472 0.04167893 6 2.46301590 -2.50137472 7 3.67250046 2.46301590 8 -1.77241462 3.67250046 9 -0.60209952 -1.77241462 10 -3.70970798 -0.60209952 11 -4.40812214 -3.70970798 12 -8.10066624 -4.40812214 13 -1.05789204 -8.10066624 14 3.62873963 -1.05789204 15 2.99876951 3.62873963 16 1.10607342 2.99876951 17 -2.51084836 1.10607342 18 -2.06388010 -2.51084836 19 -1.01590110 -2.06388010 20 1.47173023 -1.01590110 21 -3.49323099 1.47173023 22 -3.30165368 -3.49323099 23 -5.79042791 -3.30165368 24 -3.05308234 -5.79042791 25 0.64346444 -3.05308234 26 1.69499409 0.64346444 27 -4.25822995 1.69499409 28 0.20983737 -4.25822995 29 0.47676191 0.20983737 30 -0.04891937 0.47676191 31 2.88190947 -0.04891937 32 6.19334748 2.88190947 33 6.87878992 6.19334748 34 3.45233417 6.87878992 35 4.62320572 3.45233417 36 3.08109533 4.62320572 37 -0.10571356 3.08109533 38 1.94959574 -0.10571356 39 6.09160514 1.94959574 40 -1.47647966 6.09160514 41 1.60589803 -1.47647966 42 -5.54749680 1.60589803 43 2.88880342 -5.54749680 44 4.42260730 2.88880342 45 -0.19371587 4.42260730 46 -3.34810030 -0.19371587 47 7.36504744 -3.34810030 48 0.04856169 7.36504744 49 3.26268108 0.04856169 50 2.19900634 3.26268108 51 -1.06140548 2.19900634 52 -3.93868093 -1.06140548 53 -1.45816206 -3.93868093 54 3.39526959 -1.45816206 55 -1.24700661 3.39526959 56 1.79259015 -1.24700661 57 2.31509605 1.79259015 58 0.65305525 2.31509605 59 -1.65143652 0.65305525 60 1.87030373 -1.65143652 61 1.11684857 1.87030373 62 0.71564022 1.11684857 63 4.15130752 0.71564022 64 0.55184662 4.15130752 65 4.26641257 0.55184662 66 -4.52159004 4.26641257 67 5.58881352 -4.52159004 68 1.35858379 5.58881352 69 2.79516699 1.35858379 70 -4.93473519 2.79516699 71 -0.39902372 -4.93473519 72 -0.41836659 -0.39902372 73 -1.37461249 -0.41836659 74 -0.68337474 -1.37461249 75 -2.18002397 -0.68337474 76 1.79762499 -2.18002397 77 -0.38621713 1.79762499 78 0.10858352 -0.38621713 79 0.94341012 0.10858352 80 1.67813182 0.94341012 81 -6.71950933 1.67813182 82 -2.39596328 -6.71950933 83 1.11575276 -2.39596328 84 -3.30105411 1.11575276 85 -3.12669385 -3.30105411 86 3.51904171 -3.12669385 87 2.34352481 3.51904171 88 2.65694028 2.34352481 89 -3.85034261 2.65694028 90 -6.32115863 -3.85034261 91 -1.03664565 -6.32115863 92 -2.68073499 -1.03664565 93 -0.03791724 -2.68073499 94 -2.38566390 -0.03791724 95 3.40084782 -2.38566390 96 -3.66141063 3.40084782 97 -3.30801605 -3.66141063 98 -3.20702366 -3.30801605 99 -3.26107605 -3.20702366 100 0.21362007 -3.26107605 101 -1.59070440 0.21362007 102 -0.97729304 -1.59070440 103 -1.23835145 -0.97729304 104 -3.71189856 -1.23835145 105 -1.84037333 -3.71189856 106 -2.25723643 -1.84037333 107 -1.71961445 -2.25723643 108 -0.02756266 -1.71961445 109 -3.75571150 -0.02756266 110 -4.79229037 -3.75571150 111 -8.54360996 -4.79229037 112 2.73712739 -8.54360996 113 11.45376109 2.73712739 114 10.01330569 11.45376109 115 -0.93594495 10.01330569 116 4.47796769 -0.93594495 117 1.55442737 4.47796769 118 -1.19443423 1.55442737 119 -3.86966589 -1.19443423 120 2.81296983 -3.86966589 121 0.12600210 2.81296983 122 4.94922035 0.12600210 123 -0.61802346 4.94922035 124 0.93640710 -0.61802346 125 -1.60692393 0.93640710 126 0.99516573 -1.60692393 127 1.40212147 0.99516573 128 -1.89300860 1.40212147 129 0.56367630 -1.89300860 130 3.47025305 0.56367630 131 -4.22049450 3.47025305 132 0.69981850 -4.22049450 133 -2.74464564 0.69981850 134 -6.30434057 -2.74464564 135 1.90780442 -6.30434057 136 -0.05023425 1.90780442 137 4.12797552 -0.05023425 138 -1.09333180 4.12797552 139 3.54851704 -1.09333180 140 3.26976679 3.54851704 141 4.21772613 3.26976679 142 1.78935991 4.21772613 143 1.09456825 1.78935991 144 1.15019900 1.09456825 145 4.00589776 1.15019900 146 -0.39399585 4.00589776 147 0.05316496 -0.39399585 148 -7.08226286 0.05316496 149 -2.57777896 -7.08226286 150 3.54144686 -2.57777896 151 0.33436837 3.54144686 152 -2.70715576 0.33436837 153 -0.05220384 -2.70715576 154 1.94745920 -0.05220384 155 -1.73714706 1.94745920 156 0.61115790 -1.73714706 157 0.22150492 0.61115790 158 -6.72926210 0.22150492 159 NA -6.72926210 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 1.21961360 -0.37524384 [2,] 4.31691182 1.21961360 [3,] -2.70158580 4.31691182 [4,] 0.04167893 -2.70158580 [5,] -2.50137472 0.04167893 [6,] 2.46301590 -2.50137472 [7,] 3.67250046 2.46301590 [8,] -1.77241462 3.67250046 [9,] -0.60209952 -1.77241462 [10,] -3.70970798 -0.60209952 [11,] -4.40812214 -3.70970798 [12,] -8.10066624 -4.40812214 [13,] -1.05789204 -8.10066624 [14,] 3.62873963 -1.05789204 [15,] 2.99876951 3.62873963 [16,] 1.10607342 2.99876951 [17,] -2.51084836 1.10607342 [18,] -2.06388010 -2.51084836 [19,] -1.01590110 -2.06388010 [20,] 1.47173023 -1.01590110 [21,] -3.49323099 1.47173023 [22,] -3.30165368 -3.49323099 [23,] -5.79042791 -3.30165368 [24,] -3.05308234 -5.79042791 [25,] 0.64346444 -3.05308234 [26,] 1.69499409 0.64346444 [27,] -4.25822995 1.69499409 [28,] 0.20983737 -4.25822995 [29,] 0.47676191 0.20983737 [30,] -0.04891937 0.47676191 [31,] 2.88190947 -0.04891937 [32,] 6.19334748 2.88190947 [33,] 6.87878992 6.19334748 [34,] 3.45233417 6.87878992 [35,] 4.62320572 3.45233417 [36,] 3.08109533 4.62320572 [37,] -0.10571356 3.08109533 [38,] 1.94959574 -0.10571356 [39,] 6.09160514 1.94959574 [40,] -1.47647966 6.09160514 [41,] 1.60589803 -1.47647966 [42,] -5.54749680 1.60589803 [43,] 2.88880342 -5.54749680 [44,] 4.42260730 2.88880342 [45,] -0.19371587 4.42260730 [46,] -3.34810030 -0.19371587 [47,] 7.36504744 -3.34810030 [48,] 0.04856169 7.36504744 [49,] 3.26268108 0.04856169 [50,] 2.19900634 3.26268108 [51,] -1.06140548 2.19900634 [52,] -3.93868093 -1.06140548 [53,] -1.45816206 -3.93868093 [54,] 3.39526959 -1.45816206 [55,] -1.24700661 3.39526959 [56,] 1.79259015 -1.24700661 [57,] 2.31509605 1.79259015 [58,] 0.65305525 2.31509605 [59,] -1.65143652 0.65305525 [60,] 1.87030373 -1.65143652 [61,] 1.11684857 1.87030373 [62,] 0.71564022 1.11684857 [63,] 4.15130752 0.71564022 [64,] 0.55184662 4.15130752 [65,] 4.26641257 0.55184662 [66,] -4.52159004 4.26641257 [67,] 5.58881352 -4.52159004 [68,] 1.35858379 5.58881352 [69,] 2.79516699 1.35858379 [70,] -4.93473519 2.79516699 [71,] -0.39902372 -4.93473519 [72,] -0.41836659 -0.39902372 [73,] -1.37461249 -0.41836659 [74,] -0.68337474 -1.37461249 [75,] -2.18002397 -0.68337474 [76,] 1.79762499 -2.18002397 [77,] -0.38621713 1.79762499 [78,] 0.10858352 -0.38621713 [79,] 0.94341012 0.10858352 [80,] 1.67813182 0.94341012 [81,] -6.71950933 1.67813182 [82,] -2.39596328 -6.71950933 [83,] 1.11575276 -2.39596328 [84,] -3.30105411 1.11575276 [85,] -3.12669385 -3.30105411 [86,] 3.51904171 -3.12669385 [87,] 2.34352481 3.51904171 [88,] 2.65694028 2.34352481 [89,] -3.85034261 2.65694028 [90,] -6.32115863 -3.85034261 [91,] -1.03664565 -6.32115863 [92,] -2.68073499 -1.03664565 [93,] -0.03791724 -2.68073499 [94,] -2.38566390 -0.03791724 [95,] 3.40084782 -2.38566390 [96,] -3.66141063 3.40084782 [97,] -3.30801605 -3.66141063 [98,] -3.20702366 -3.30801605 [99,] -3.26107605 -3.20702366 [100,] 0.21362007 -3.26107605 [101,] -1.59070440 0.21362007 [102,] -0.97729304 -1.59070440 [103,] -1.23835145 -0.97729304 [104,] -3.71189856 -1.23835145 [105,] -1.84037333 -3.71189856 [106,] -2.25723643 -1.84037333 [107,] -1.71961445 -2.25723643 [108,] -0.02756266 -1.71961445 [109,] -3.75571150 -0.02756266 [110,] -4.79229037 -3.75571150 [111,] -8.54360996 -4.79229037 [112,] 2.73712739 -8.54360996 [113,] 11.45376109 2.73712739 [114,] 10.01330569 11.45376109 [115,] -0.93594495 10.01330569 [116,] 4.47796769 -0.93594495 [117,] 1.55442737 4.47796769 [118,] -1.19443423 1.55442737 [119,] -3.86966589 -1.19443423 [120,] 2.81296983 -3.86966589 [121,] 0.12600210 2.81296983 [122,] 4.94922035 0.12600210 [123,] -0.61802346 4.94922035 [124,] 0.93640710 -0.61802346 [125,] -1.60692393 0.93640710 [126,] 0.99516573 -1.60692393 [127,] 1.40212147 0.99516573 [128,] -1.89300860 1.40212147 [129,] 0.56367630 -1.89300860 [130,] 3.47025305 0.56367630 [131,] -4.22049450 3.47025305 [132,] 0.69981850 -4.22049450 [133,] -2.74464564 0.69981850 [134,] -6.30434057 -2.74464564 [135,] 1.90780442 -6.30434057 [136,] -0.05023425 1.90780442 [137,] 4.12797552 -0.05023425 [138,] -1.09333180 4.12797552 [139,] 3.54851704 -1.09333180 [140,] 3.26976679 3.54851704 [141,] 4.21772613 3.26976679 [142,] 1.78935991 4.21772613 [143,] 1.09456825 1.78935991 [144,] 1.15019900 1.09456825 [145,] 4.00589776 1.15019900 [146,] -0.39399585 4.00589776 [147,] 0.05316496 -0.39399585 [148,] -7.08226286 0.05316496 [149,] -2.57777896 -7.08226286 [150,] 3.54144686 -2.57777896 [151,] 0.33436837 3.54144686 [152,] -2.70715576 0.33436837 [153,] -0.05220384 -2.70715576 [154,] 1.94745920 -0.05220384 [155,] -1.73714706 1.94745920 [156,] 0.61115790 -1.73714706 [157,] 0.22150492 0.61115790 [158,] -6.72926210 0.22150492 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 1.21961360 -0.37524384 2 4.31691182 1.21961360 3 -2.70158580 4.31691182 4 0.04167893 -2.70158580 5 -2.50137472 0.04167893 6 2.46301590 -2.50137472 7 3.67250046 2.46301590 8 -1.77241462 3.67250046 9 -0.60209952 -1.77241462 10 -3.70970798 -0.60209952 11 -4.40812214 -3.70970798 12 -8.10066624 -4.40812214 13 -1.05789204 -8.10066624 14 3.62873963 -1.05789204 15 2.99876951 3.62873963 16 1.10607342 2.99876951 17 -2.51084836 1.10607342 18 -2.06388010 -2.51084836 19 -1.01590110 -2.06388010 20 1.47173023 -1.01590110 21 -3.49323099 1.47173023 22 -3.30165368 -3.49323099 23 -5.79042791 -3.30165368 24 -3.05308234 -5.79042791 25 0.64346444 -3.05308234 26 1.69499409 0.64346444 27 -4.25822995 1.69499409 28 0.20983737 -4.25822995 29 0.47676191 0.20983737 30 -0.04891937 0.47676191 31 2.88190947 -0.04891937 32 6.19334748 2.88190947 33 6.87878992 6.19334748 34 3.45233417 6.87878992 35 4.62320572 3.45233417 36 3.08109533 4.62320572 37 -0.10571356 3.08109533 38 1.94959574 -0.10571356 39 6.09160514 1.94959574 40 -1.47647966 6.09160514 41 1.60589803 -1.47647966 42 -5.54749680 1.60589803 43 2.88880342 -5.54749680 44 4.42260730 2.88880342 45 -0.19371587 4.42260730 46 -3.34810030 -0.19371587 47 7.36504744 -3.34810030 48 0.04856169 7.36504744 49 3.26268108 0.04856169 50 2.19900634 3.26268108 51 -1.06140548 2.19900634 52 -3.93868093 -1.06140548 53 -1.45816206 -3.93868093 54 3.39526959 -1.45816206 55 -1.24700661 3.39526959 56 1.79259015 -1.24700661 57 2.31509605 1.79259015 58 0.65305525 2.31509605 59 -1.65143652 0.65305525 60 1.87030373 -1.65143652 61 1.11684857 1.87030373 62 0.71564022 1.11684857 63 4.15130752 0.71564022 64 0.55184662 4.15130752 65 4.26641257 0.55184662 66 -4.52159004 4.26641257 67 5.58881352 -4.52159004 68 1.35858379 5.58881352 69 2.79516699 1.35858379 70 -4.93473519 2.79516699 71 -0.39902372 -4.93473519 72 -0.41836659 -0.39902372 73 -1.37461249 -0.41836659 74 -0.68337474 -1.37461249 75 -2.18002397 -0.68337474 76 1.79762499 -2.18002397 77 -0.38621713 1.79762499 78 0.10858352 -0.38621713 79 0.94341012 0.10858352 80 1.67813182 0.94341012 81 -6.71950933 1.67813182 82 -2.39596328 -6.71950933 83 1.11575276 -2.39596328 84 -3.30105411 1.11575276 85 -3.12669385 -3.30105411 86 3.51904171 -3.12669385 87 2.34352481 3.51904171 88 2.65694028 2.34352481 89 -3.85034261 2.65694028 90 -6.32115863 -3.85034261 91 -1.03664565 -6.32115863 92 -2.68073499 -1.03664565 93 -0.03791724 -2.68073499 94 -2.38566390 -0.03791724 95 3.40084782 -2.38566390 96 -3.66141063 3.40084782 97 -3.30801605 -3.66141063 98 -3.20702366 -3.30801605 99 -3.26107605 -3.20702366 100 0.21362007 -3.26107605 101 -1.59070440 0.21362007 102 -0.97729304 -1.59070440 103 -1.23835145 -0.97729304 104 -3.71189856 -1.23835145 105 -1.84037333 -3.71189856 106 -2.25723643 -1.84037333 107 -1.71961445 -2.25723643 108 -0.02756266 -1.71961445 109 -3.75571150 -0.02756266 110 -4.79229037 -3.75571150 111 -8.54360996 -4.79229037 112 2.73712739 -8.54360996 113 11.45376109 2.73712739 114 10.01330569 11.45376109 115 -0.93594495 10.01330569 116 4.47796769 -0.93594495 117 1.55442737 4.47796769 118 -1.19443423 1.55442737 119 -3.86966589 -1.19443423 120 2.81296983 -3.86966589 121 0.12600210 2.81296983 122 4.94922035 0.12600210 123 -0.61802346 4.94922035 124 0.93640710 -0.61802346 125 -1.60692393 0.93640710 126 0.99516573 -1.60692393 127 1.40212147 0.99516573 128 -1.89300860 1.40212147 129 0.56367630 -1.89300860 130 3.47025305 0.56367630 131 -4.22049450 3.47025305 132 0.69981850 -4.22049450 133 -2.74464564 0.69981850 134 -6.30434057 -2.74464564 135 1.90780442 -6.30434057 136 -0.05023425 1.90780442 137 4.12797552 -0.05023425 138 -1.09333180 4.12797552 139 3.54851704 -1.09333180 140 3.26976679 3.54851704 141 4.21772613 3.26976679 142 1.78935991 4.21772613 143 1.09456825 1.78935991 144 1.15019900 1.09456825 145 4.00589776 1.15019900 146 -0.39399585 4.00589776 147 0.05316496 -0.39399585 148 -7.08226286 0.05316496 149 -2.57777896 -7.08226286 150 3.54144686 -2.57777896 151 0.33436837 3.54144686 152 -2.70715576 0.33436837 153 -0.05220384 -2.70715576 154 1.94745920 -0.05220384 155 -1.73714706 1.94745920 156 0.61115790 -1.73714706 157 0.22150492 0.61115790 158 -6.72926210 0.22150492 > plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals') > lines(lowess(z)) > abline(lm(z)) > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/71rm21322182280.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/8ehpi1322182280.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/95fpm1322182280.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/wessaorg/rcomp/tmp/10ijcm1322182280.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) > a<-table.row.end(a) > myeq <- colnames(x)[1] > myeq <- paste(myeq, '[t] = ', sep='') > for (i in 1:k){ + if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') + myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ') + if (rownames(mysum$coefficients)[i] != '(Intercept)') { + myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') + if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') + } + } > myeq <- paste(myeq, ' + e[t]') > a<-table.row.start(a) > a<-table.element(a, myeq) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/11cbkr1322182280.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Variable',header=TRUE) > a<-table.element(a,'Parameter',header=TRUE) > a<-table.element(a,'S.D.',header=TRUE) > a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE) > a<-table.element(a,'2-tail p-value',header=TRUE) > a<-table.element(a,'1-tail p-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:k){ + a<-table.row.start(a) + a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE) + a<-table.element(a,mysum$coefficients[i,1]) + a<-table.element(a, round(mysum$coefficients[i,2],6)) + a<-table.element(a, round(mysum$coefficients[i,3],4)) + a<-table.element(a, round(mysum$coefficients[i,4],6)) + a<-table.element(a, round(mysum$coefficients[i,4]/2,6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/12fttm1322182280.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple R',1,TRUE) > a<-table.element(a, sqrt(mysum$r.squared)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'R-squared',1,TRUE) > a<-table.element(a, mysum$r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Adjusted R-squared',1,TRUE) > a<-table.element(a, mysum$adj.r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (value)',1,TRUE) > a<-table.element(a, mysum$fstatistic[1]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'p-value',1,TRUE) > a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3])) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Residual Standard Deviation',1,TRUE) > a<-table.element(a, mysum$sigma) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Sum Squared Residuals',1,TRUE) > a<-table.element(a, sum(myerror*myerror)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/13i82a1322182280.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Time or Index', 1, TRUE) > a<-table.element(a, 'Actuals', 1, TRUE) > a<-table.element(a, 'Interpolation
Forecast', 1, TRUE) > a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE) > a<-table.row.end(a) > for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,i, 1, TRUE) + a<-table.element(a,x[i]) + a<-table.element(a,x[i]-mysum$resid[i]) + a<-table.element(a,mysum$resid[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/140fm11322182280.tab") > if (n > n25) { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'p-values',header=TRUE) + a<-table.element(a,'Alternative Hypothesis',3,header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'breakpoint index',header=TRUE) + a<-table.element(a,'greater',header=TRUE) + a<-table.element(a,'2-sided',header=TRUE) + a<-table.element(a,'less',header=TRUE) + a<-table.row.end(a) + for (mypoint in kp3:nmkm3) { + a<-table.row.start(a) + a<-table.element(a,mypoint,header=TRUE) + a<-table.element(a,gqarr[mypoint-kp3+1,1]) + a<-table.element(a,gqarr[mypoint-kp3+1,2]) + a<-table.element(a,gqarr[mypoint-kp3+1,3]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/wessaorg/rcomp/tmp/15784l1322182280.tab") + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Description',header=TRUE) + a<-table.element(a,'# significant tests',header=TRUE) + a<-table.element(a,'% significant tests',header=TRUE) + a<-table.element(a,'OK/NOK',header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'1% type I error level',header=TRUE) + a<-table.element(a,numsignificant1) + a<-table.element(a,numsignificant1/numgqtests) + if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'5% type I error level',header=TRUE) + a<-table.element(a,numsignificant5) + a<-table.element(a,numsignificant5/numgqtests) + if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'10% type I error level',header=TRUE) + a<-table.element(a,numsignificant10) + a<-table.element(a,numsignificant10/numgqtests) + if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/wessaorg/rcomp/tmp/16pt3v1322182281.tab") + } > > try(system("convert tmp/14oq61322182280.ps tmp/14oq61322182280.png",intern=TRUE)) character(0) > try(system("convert tmp/2g3uq1322182280.ps tmp/2g3uq1322182280.png",intern=TRUE)) character(0) > try(system("convert tmp/33syy1322182280.ps tmp/33syy1322182280.png",intern=TRUE)) character(0) > try(system("convert tmp/4f3811322182280.ps tmp/4f3811322182280.png",intern=TRUE)) character(0) > try(system("convert tmp/57off1322182280.ps tmp/57off1322182280.png",intern=TRUE)) character(0) > try(system("convert tmp/6srdb1322182280.ps tmp/6srdb1322182280.png",intern=TRUE)) character(0) > try(system("convert tmp/71rm21322182280.ps tmp/71rm21322182280.png",intern=TRUE)) character(0) > try(system("convert tmp/8ehpi1322182280.ps tmp/8ehpi1322182280.png",intern=TRUE)) character(0) > try(system("convert tmp/95fpm1322182280.ps tmp/95fpm1322182280.png",intern=TRUE)) character(0) > try(system("convert tmp/10ijcm1322182280.ps tmp/10ijcm1322182280.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.860 0.638 5.518