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(41 + ,38 + ,13 + ,12 + ,14 + ,12 + ,53 + ,39 + ,32 + ,16 + ,11 + ,18 + ,11 + ,86 + ,30 + ,35 + ,19 + ,15 + ,11 + ,14 + ,66 + ,31 + ,33 + ,15 + ,6 + ,12 + ,12 + ,67 + ,34 + ,37 + ,14 + ,13 + ,16 + ,21 + ,76 + ,35 + ,29 + ,13 + ,10 + ,18 + ,12 + ,78 + ,39 + ,31 + ,19 + ,12 + ,14 + ,22 + ,53 + ,34 + ,36 + ,15 + ,14 + ,14 + ,11 + ,80 + ,36 + ,35 + ,14 + ,12 + ,15 + ,10 + ,74 + ,37 + ,38 + ,15 + ,6 + ,15 + ,13 + ,76 + ,38 + ,31 + ,16 + ,10 + ,17 + ,10 + ,79 + ,36 + ,34 + ,16 + ,12 + ,19 + ,8 + ,54 + ,38 + ,35 + ,16 + ,12 + ,10 + ,15 + ,67 + ,39 + ,38 + ,16 + ,11 + ,16 + ,14 + ,54 + ,33 + ,37 + ,17 + ,15 + ,18 + ,10 + ,87 + ,32 + ,33 + ,15 + ,12 + ,14 + ,14 + ,58 + ,36 + ,32 + ,15 + ,10 + ,14 + ,14 + ,75 + ,38 + ,38 + ,20 + ,12 + ,17 + ,11 + ,88 + ,39 + ,38 + ,18 + ,11 + ,14 + ,10 + ,64 + ,32 + ,32 + ,16 + ,12 + ,16 + ,13 + ,57 + ,32 + ,33 + ,16 + ,11 + ,18 + ,7 + ,66 + ,31 + ,31 + ,16 + ,12 + ,11 + ,14 + ,68 + ,39 + ,38 + ,19 + ,13 + ,14 + ,12 + ,54 + ,37 + ,39 + ,16 + ,11 + ,12 + ,14 + ,56 + ,39 + ,32 + ,17 + ,9 + ,17 + ,11 + ,86 + ,41 + ,32 + ,17 + ,13 + ,9 + ,9 + ,80 + ,36 + ,35 + ,16 + ,10 + ,16 + ,11 + ,76 + ,33 + ,37 + ,15 + ,14 + ,14 + ,15 + ,69 + ,33 + ,33 + ,16 + ,12 + ,15 + ,14 + ,78 + ,34 + ,33 + ,14 + ,10 + ,11 + ,13 + ,67 + ,31 + ,28 + ,15 + ,12 + ,16 + ,9 + ,80 + ,27 + ,32 + ,12 + ,8 + ,13 + ,15 + ,54 + ,37 + ,31 + ,14 + ,10 + ,17 + ,10 + ,71 + ,34 + ,37 + ,16 + ,12 + ,15 + ,11 + ,84 + ,34 + ,30 + ,14 + ,12 + ,14 + ,13 + ,74 + ,32 + ,33 + ,7 + ,7 + ,16 + ,8 + ,71 + ,29 + ,31 + ,10 + ,6 + ,9 + ,20 + ,63 + ,36 + ,33 + ,14 + ,12 + ,15 + ,12 + ,71 + ,29 + ,31 + ,16 + ,10 + ,17 + ,10 + ,76 + ,35 + ,33 + ,16 + ,10 + ,13 + ,10 + ,69 + ,37 + ,32 + ,16 + ,10 + ,15 + ,9 + ,74 + ,34 + ,33 + ,14 + ,12 + ,16 + ,14 + ,75 + ,38 + ,32 + ,20 + ,15 + ,16 + ,8 + ,54 + ,35 + ,33 + ,14 + ,10 + ,12 + ,14 + ,52 + ,38 + ,28 + ,14 + ,10 + ,12 + ,11 + ,69 + ,37 + ,35 + ,11 + ,12 + ,11 + ,13 + ,68 + ,38 + ,39 + ,14 + ,13 + ,15 + ,9 + ,65 + ,33 + ,34 + ,15 + ,11 + ,15 + ,11 + ,75 + ,36 + ,38 + ,16 + ,11 + ,17 + ,15 + ,74 + ,38 + ,32 + ,14 + ,12 + ,13 + ,11 + ,75 + ,32 + ,38 + ,16 + ,14 + ,16 + ,10 + ,72 + ,32 + ,30 + ,14 + ,10 + ,14 + ,14 + ,67 + ,32 + ,33 + ,12 + ,12 + ,11 + ,18 + ,63 + ,34 + ,38 + ,16 + ,13 + ,12 + ,14 + ,62 + ,32 + ,32 + ,9 + ,5 + ,12 + ,11 + ,63 + ,37 + ,32 + ,14 + ,6 + ,15 + ,12 + ,76 + ,39 + ,34 + ,16 + ,12 + ,16 + ,13 + ,74 + ,29 + ,34 + ,16 + ,12 + ,15 + ,9 + ,67 + ,37 + ,36 + ,15 + ,11 + ,12 + ,10 + ,73 + ,35 + ,34 + ,16 + ,10 + ,12 + ,15 + ,70 + ,30 + ,28 + ,12 + ,7 + ,8 + ,20 + ,53 + ,38 + ,34 + ,16 + ,12 + ,13 + ,12 + ,77 + ,34 + ,35 + ,16 + ,14 + ,11 + ,12 + ,77 + ,31 + ,35 + ,14 + ,11 + ,14 + ,14 + ,52 + ,34 + ,31 + ,16 + ,12 + ,15 + ,13 + ,54 + ,35 + ,37 + ,17 + ,13 + ,10 + ,11 + ,80 + ,36 + ,35 + ,18 + ,14 + ,11 + ,17 + ,66 + ,30 + ,27 + ,18 + ,11 + ,12 + ,12 + ,73 + ,39 + ,40 + ,12 + ,12 + ,15 + ,13 + ,63 + ,35 + ,37 + ,16 + ,12 + ,15 + ,14 + ,69 + ,38 + ,36 + ,10 + ,8 + ,14 + ,13 + ,67 + ,31 + ,38 + ,14 + ,11 + ,16 + ,15 + ,54 + ,34 + ,39 + ,18 + ,14 + ,15 + ,13 + ,81 + ,38 + ,41 + ,18 + ,14 + ,15 + ,10 + ,69 + ,34 + ,27 + ,16 + ,12 + ,13 + ,11 + ,84 + ,39 + ,30 + ,17 + ,9 + ,12 + ,19 + ,80 + ,37 + ,37 + ,16 + ,13 + ,17 + ,13 + ,70 + ,34 + ,31 + ,16 + ,11 + ,13 + ,17 + ,69 + ,28 + ,31 + ,13 + ,12 + ,15 + ,13 + ,77 + ,37 + ,27 + ,16 + ,12 + ,13 + ,9 + ,54 + ,33 + ,36 + ,16 + ,12 + ,15 + ,11 + ,79 + ,37 + ,38 + ,20 + ,12 + ,16 + ,10 + ,30 + ,35 + ,37 + ,16 + ,12 + ,15 + ,9 + ,71 + ,37 + ,33 + ,15 + ,12 + ,16 + ,12 + ,73 + ,32 + ,34 + ,15 + ,11 + ,15 + ,12 + ,72 + ,33 + ,31 + ,16 + ,10 + ,14 + ,13 + ,77 + ,38 + ,39 + ,14 + ,9 + ,15 + ,13 + ,75 + ,33 + ,34 + ,16 + ,12 + ,14 + ,12 + ,69 + ,29 + ,32 + ,16 + ,12 + ,13 + ,15 + ,54 + ,33 + ,33 + ,15 + ,12 + ,7 + ,22 + ,70 + ,31 + ,36 + ,12 + ,9 + ,17 + ,13 + ,73 + ,36 + ,32 + ,17 + ,15 + ,13 + ,15 + ,54 + ,35 + ,41 + ,16 + ,12 + ,15 + ,13 + ,77 + ,32 + ,28 + ,15 + ,12 + ,14 + ,15 + ,82 + ,29 + ,30 + ,13 + ,12 + ,13 + ,10 + ,80 + ,39 + ,36 + ,16 + ,10 + ,16 + ,11 + ,80 + ,37 + ,35 + ,16 + ,13 + ,12 + ,16 + ,69 + ,35 + ,31 + ,16 + ,9 + ,14 + ,11 + ,78 + ,37 + ,34 + ,16 + ,12 + ,17 + ,11 + ,81 + ,32 + ,36 + ,14 + ,10 + ,15 + ,10 + ,76 + ,38 + ,36 + ,16 + ,14 + ,17 + ,10 + ,76 + ,37 + ,35 + ,16 + ,11 + ,12 + ,16 + ,73 + ,36 + ,37 + ,20 + ,15 + ,16 + ,12 + ,85 + ,32 + ,28 + ,15 + ,11 + ,11 + ,11 + ,66 + ,33 + ,39 + ,16 + ,11 + ,15 + ,16 + ,79 + ,40 + ,32 + ,13 + ,12 + ,9 + ,19 + ,68 + ,38 + ,35 + ,17 + ,12 + ,16 + ,11 + ,76 + ,41 + ,39 + ,16 + ,12 + ,15 + ,16 + ,71 + ,36 + ,35 + ,16 + ,11 + ,10 + ,15 + ,54 + ,43 + ,42 + ,12 + ,7 + ,10 + ,24 + ,46 + ,30 + ,34 + ,16 + ,12 + ,15 + ,14 + ,82 + ,31 + ,33 + ,16 + ,14 + ,11 + ,15 + ,74 + ,32 + ,41 + ,17 + ,11 + ,13 + ,11 + ,88 + ,32 + ,33 + ,13 + ,11 + ,14 + ,15 + ,38 + ,37 + ,34 + ,12 + ,10 + ,18 + ,12 + ,76 + ,37 + ,32 + ,18 + ,13 + ,16 + ,10 + ,86 + ,33 + ,40 + ,14 + ,13 + ,14 + ,14 + ,54 + ,34 + ,40 + ,14 + ,8 + ,14 + ,13 + ,70 + ,33 + ,35 + ,13 + ,11 + ,14 + ,9 + ,69 + ,38 + ,36 + ,16 + ,12 + ,14 + ,15 + ,90 + ,33 + ,37 + ,13 + ,11 + ,12 + ,15 + ,54 + ,31 + ,27 + ,16 + ,13 + ,14 + ,14 + ,76 + ,38 + ,39 + ,13 + ,12 + ,15 + ,11 + ,89 + ,37 + ,38 + ,16 + ,14 + ,15 + ,8 + ,76 + ,33 + ,31 + ,15 + ,13 + ,15 + ,11 + ,73 + ,31 + ,33 + ,16 + ,15 + ,13 + ,11 + ,79 + ,39 + ,32 + ,15 + ,10 + ,17 + ,8 + ,90 + ,44 + ,39 + ,17 + ,11 + ,17 + ,10 + ,74 + ,33 + ,36 + ,15 + ,9 + ,19 + ,11 + ,81 + ,35 + ,33 + ,12 + ,11 + ,15 + ,13 + ,72 + ,32 + ,33 + ,16 + ,10 + ,13 + ,11 + ,71 + ,28 + ,32 + ,10 + ,11 + ,9 + ,20 + ,66 + ,40 + ,37 + ,16 + ,8 + ,15 + ,10 + ,77 + ,27 + ,30 + ,12 + ,11 + ,15 + ,15 + ,65 + ,37 + ,38 + ,14 + ,12 + ,15 + ,12 + ,74 + ,32 + ,29 + ,15 + ,12 + ,16 + ,14 + ,82 + ,28 + ,22 + ,13 + ,9 + ,11 + ,23 + ,54 + ,34 + ,35 + ,15 + ,11 + ,14 + ,14 + ,63 + ,30 + ,35 + ,11 + ,10 + ,11 + ,16 + ,54 + ,35 + ,34 + ,12 + ,8 + ,15 + ,11 + ,64 + ,31 + ,35 + ,8 + ,9 + ,13 + ,12 + ,69 + ,32 + ,34 + ,16 + ,8 + ,15 + ,10 + ,54 + ,30 + ,34 + ,15 + ,9 + ,16 + ,14 + ,84 + ,30 + ,35 + ,17 + ,15 + ,14 + ,12 + ,86 + ,31 + ,23 + ,16 + ,11 + ,15 + ,12 + ,77 + ,40 + ,31 + ,10 + ,8 + ,16 + ,11 + ,89 + ,32 + ,27 + ,18 + ,13 + ,16 + ,12 + ,76 + ,36 + ,36 + ,13 + ,12 + ,11 + ,13 + ,60 + ,32 + ,31 + ,16 + ,12 + ,12 + ,11 + ,75 + ,35 + ,32 + ,13 + ,9 + ,9 + ,19 + ,73 + ,38 + ,39 + ,10 + ,7 + ,16 + ,12 + ,85 + ,42 + ,37 + ,15 + ,13 + ,13 + ,17 + ,79 + ,34 + ,38 + ,16 + ,9 + ,16 + ,9 + ,71 + ,35 + ,39 + ,16 + ,6 + ,12 + ,12 + ,72 + ,35 + ,34 + ,14 + ,8 + ,9 + ,19 + ,69 + ,33 + ,31 + ,10 + ,8 + ,13 + ,18 + ,78 + ,36 + ,32 + ,17 + ,15 + ,13 + ,15 + ,54 + ,32 + ,37 + ,13 + ,6 + ,14 + ,14 + ,69 + ,33 + ,36 + ,15 + ,9 + ,19 + ,11 + ,81 + ,34 + ,32 + ,16 + ,11 + ,13 + ,9 + ,84 + ,32 + ,35 + ,12 + ,8 + ,12 + ,18 + ,84 + ,34 + ,36 + ,13 + ,8 + ,13 + ,16 + ,69) + ,dim=c(7 + ,162) + ,dimnames=list(c('Connected' + ,'Separate' + ,'Learning' + ,'Software' + ,'Happiness' + ,'Depression' + ,'Belonging') + ,1:162)) > y <- array(NA,dim=c(7,162),dimnames=list(c('Connected','Separate','Learning','Software','Happiness','Depression','Belonging'),1:162)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '5' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo > 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 Happiness Connected Separate Learning Software Depression Belonging 1 14 41 38 13 12 12 53 2 18 39 32 16 11 11 86 3 11 30 35 19 15 14 66 4 12 31 33 15 6 12 67 5 16 34 37 14 13 21 76 6 18 35 29 13 10 12 78 7 14 39 31 19 12 22 53 8 14 34 36 15 14 11 80 9 15 36 35 14 12 10 74 10 15 37 38 15 6 13 76 11 17 38 31 16 10 10 79 12 19 36 34 16 12 8 54 13 10 38 35 16 12 15 67 14 16 39 38 16 11 14 54 15 18 33 37 17 15 10 87 16 14 32 33 15 12 14 58 17 14 36 32 15 10 14 75 18 17 38 38 20 12 11 88 19 14 39 38 18 11 10 64 20 16 32 32 16 12 13 57 21 18 32 33 16 11 7 66 22 11 31 31 16 12 14 68 23 14 39 38 19 13 12 54 24 12 37 39 16 11 14 56 25 17 39 32 17 9 11 86 26 9 41 32 17 13 9 80 27 16 36 35 16 10 11 76 28 14 33 37 15 14 15 69 29 15 33 33 16 12 14 78 30 11 34 33 14 10 13 67 31 16 31 28 15 12 9 80 32 13 27 32 12 8 15 54 33 17 37 31 14 10 10 71 34 15 34 37 16 12 11 84 35 14 34 30 14 12 13 74 36 16 32 33 7 7 8 71 37 9 29 31 10 6 20 63 38 15 36 33 14 12 12 71 39 17 29 31 16 10 10 76 40 13 35 33 16 10 10 69 41 15 37 32 16 10 9 74 42 16 34 33 14 12 14 75 43 16 38 32 20 15 8 54 44 12 35 33 14 10 14 52 45 12 38 28 14 10 11 69 46 11 37 35 11 12 13 68 47 15 38 39 14 13 9 65 48 15 33 34 15 11 11 75 49 17 36 38 16 11 15 74 50 13 38 32 14 12 11 75 51 16 32 38 16 14 10 72 52 14 32 30 14 10 14 67 53 11 32 33 12 12 18 63 54 12 34 38 16 13 14 62 55 12 32 32 9 5 11 63 56 15 37 32 14 6 12 76 57 16 39 34 16 12 13 74 58 15 29 34 16 12 9 67 59 12 37 36 15 11 10 73 60 12 35 34 16 10 15 70 61 8 30 28 12 7 20 53 62 13 38 34 16 12 12 77 63 11 34 35 16 14 12 77 64 14 31 35 14 11 14 52 65 15 34 31 16 12 13 54 66 10 35 37 17 13 11 80 67 11 36 35 18 14 17 66 68 12 30 27 18 11 12 73 69 15 39 40 12 12 13 63 70 15 35 37 16 12 14 69 71 14 38 36 10 8 13 67 72 16 31 38 14 11 15 54 73 15 34 39 18 14 13 81 74 15 38 41 18 14 10 69 75 13 34 27 16 12 11 84 76 12 39 30 17 9 19 80 77 17 37 37 16 13 13 70 78 13 34 31 16 11 17 69 79 15 28 31 13 12 13 77 80 13 37 27 16 12 9 54 81 15 33 36 16 12 11 79 82 16 37 38 20 12 10 30 83 15 35 37 16 12 9 71 84 16 37 33 15 12 12 73 85 15 32 34 15 11 12 72 86 14 33 31 16 10 13 77 87 15 38 39 14 9 13 75 88 14 33 34 16 12 12 69 89 13 29 32 16 12 15 54 90 7 33 33 15 12 22 70 91 17 31 36 12 9 13 73 92 13 36 32 17 15 15 54 93 15 35 41 16 12 13 77 94 14 32 28 15 12 15 82 95 13 29 30 13 12 10 80 96 16 39 36 16 10 11 80 97 12 37 35 16 13 16 69 98 14 35 31 16 9 11 78 99 17 37 34 16 12 11 81 100 15 32 36 14 10 10 76 101 17 38 36 16 14 10 76 102 12 37 35 16 11 16 73 103 16 36 37 20 15 12 85 104 11 32 28 15 11 11 66 105 15 33 39 16 11 16 79 106 9 40 32 13 12 19 68 107 16 38 35 17 12 11 76 108 15 41 39 16 12 16 71 109 10 36 35 16 11 15 54 110 10 43 42 12 7 24 46 111 15 30 34 16 12 14 82 112 11 31 33 16 14 15 74 113 13 32 41 17 11 11 88 114 14 32 33 13 11 15 38 115 18 37 34 12 10 12 76 116 16 37 32 18 13 10 86 117 14 33 40 14 13 14 54 118 14 34 40 14 8 13 70 119 14 33 35 13 11 9 69 120 14 38 36 16 12 15 90 121 12 33 37 13 11 15 54 122 14 31 27 16 13 14 76 123 15 38 39 13 12 11 89 124 15 37 38 16 14 8 76 125 15 33 31 15 13 11 73 126 13 31 33 16 15 11 79 127 17 39 32 15 10 8 90 128 17 44 39 17 11 10 74 129 19 33 36 15 9 11 81 130 15 35 33 12 11 13 72 131 13 32 33 16 10 11 71 132 9 28 32 10 11 20 66 133 15 40 37 16 8 10 77 134 15 27 30 12 11 15 65 135 15 37 38 14 12 12 74 136 16 32 29 15 12 14 82 137 11 28 22 13 9 23 54 138 14 34 35 15 11 14 63 139 11 30 35 11 10 16 54 140 15 35 34 12 8 11 64 141 13 31 35 8 9 12 69 142 15 32 34 16 8 10 54 143 16 30 34 15 9 14 84 144 14 30 35 17 15 12 86 145 15 31 23 16 11 12 77 146 16 40 31 10 8 11 89 147 16 32 27 18 13 12 76 148 11 36 36 13 12 13 60 149 12 32 31 16 12 11 75 150 9 35 32 13 9 19 73 151 16 38 39 10 7 12 85 152 13 42 37 15 13 17 79 153 16 34 38 16 9 9 71 154 12 35 39 16 6 12 72 155 9 35 34 14 8 19 69 156 13 33 31 10 8 18 78 157 13 36 32 17 15 15 54 158 14 32 37 13 6 14 69 159 19 33 36 15 9 11 81 160 13 34 32 16 11 9 84 161 12 32 35 12 8 18 84 162 13 34 36 13 8 16 69 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Connected Separate Learning Software Depression 12.84615 0.01434 0.07185 0.06959 -0.04592 -0.35599 Belonging 0.03269 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -6.7305 -1.3665 0.2614 1.1389 4.6220 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 12.84615 2.55329 5.031 1.33e-06 *** Connected 0.01434 0.05018 0.286 0.7755 Separate 0.07185 0.04660 1.542 0.1252 Learning 0.06959 0.08430 0.826 0.4103 Software -0.04592 0.08570 -0.536 0.5929 Depression -0.35599 0.05172 -6.882 1.37e-10 *** Belonging 0.03269 0.01491 2.192 0.0299 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1.944 on 155 degrees of freedom Multiple R-squared: 0.3341, Adjusted R-squared: 0.3084 F-statistic: 12.96 on 6 and 155 DF, p-value: 7.52e-12 > 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.05917471 0.1183494211 0.9408252895 [2,] 0.01894939 0.0378987766 0.9810506117 [3,] 0.88561411 0.2287717855 0.1143858928 [4,] 0.98336555 0.0332688988 0.0166344494 [5,] 0.98384034 0.0323193266 0.0161596633 [6,] 0.98905812 0.0218837511 0.0109418756 [7,] 0.98102556 0.0379488753 0.0189744377 [8,] 0.97418851 0.0516229776 0.0258114888 [9,] 0.96211849 0.0757630164 0.0378815082 [10,] 0.94955789 0.1008842118 0.0504421059 [11,] 0.94966799 0.1006640222 0.0503320111 [12,] 0.94897615 0.1020476967 0.0510238483 [13,] 0.97013224 0.0597355226 0.0298677613 [14,] 0.95684211 0.0863157809 0.0431578904 [15,] 0.94684395 0.1063121004 0.0531560502 [16,] 0.92921236 0.1415752740 0.0707876370 [17,] 0.99954478 0.0009104431 0.0004552216 [18,] 0.99926038 0.0014792457 0.0007396228 [19,] 0.99878604 0.0024279121 0.0012139561 [20,] 0.99812211 0.0037557762 0.0018778881 [21,] 0.99910558 0.0017888372 0.0008944186 [22,] 0.99857961 0.0028407863 0.0014203931 [23,] 0.99780383 0.0043923334 0.0021961667 [24,] 0.99743275 0.0051344926 0.0025672463 [25,] 0.99610768 0.0077846347 0.0038923173 [26,] 0.99446673 0.0110665360 0.0055332680 [27,] 0.99193887 0.0161222534 0.0080611267 [28,] 0.99407469 0.0118506158 0.0059253079 [29,] 0.99156819 0.0168636195 0.0084318097 [30,] 0.99088339 0.0182332272 0.0091166136 [31,] 0.99105068 0.0178986371 0.0089493186 [32,] 0.98770814 0.0245837241 0.0122918620 [33,] 0.98735086 0.0252982820 0.0126491410 [34,] 0.98294311 0.0341137822 0.0170568911 [35,] 0.97881692 0.0423661545 0.0211830773 [36,] 0.98233644 0.0353271130 0.0176635565 [37,] 0.98702903 0.0259419464 0.0129709732 [38,] 0.98230367 0.0353926681 0.0176963340 [39,] 0.97602087 0.0479582600 0.0239791300 [40,] 0.98328730 0.0334254077 0.0167127038 [41,] 0.98179852 0.0364029553 0.0182014776 [42,] 0.97604087 0.0479182542 0.0239591271 [43,] 0.96902601 0.0619479790 0.0309739895 [44,] 0.96182300 0.0763540077 0.0381770038 [45,] 0.95924946 0.0815010714 0.0407505357 [46,] 0.95925053 0.0814989322 0.0407494661 [47,] 0.94779230 0.1044154015 0.0522077008 [48,] 0.94365814 0.1126837168 0.0563418584 [49,] 0.92890068 0.1421986398 0.0710993199 [50,] 0.95313793 0.0937241366 0.0468620683 [51,] 0.94884036 0.1023192799 0.0511596399 [52,] 0.95611013 0.0877797483 0.0438898742 [53,] 0.95376982 0.0924603589 0.0462301795 [54,] 0.97562539 0.0487492243 0.0243746122 [55,] 0.97042857 0.0591428543 0.0295714272 [56,] 0.96804187 0.0639162611 0.0319581306 [57,] 0.99489928 0.0102014304 0.0051007152 [58,] 0.99436102 0.0112779652 0.0056389826 [59,] 0.99482133 0.0103573430 0.0051786715 [60,] 0.99340506 0.0131898800 0.0065949400 [61,] 0.99186232 0.0162753666 0.0081376833 [62,] 0.98890482 0.0221903590 0.0110951795 [63,] 0.99301854 0.0139629281 0.0069814641 [64,] 0.99049091 0.0190181842 0.0095090921 [65,] 0.98741758 0.0251648499 0.0125824249 [66,] 0.98657702 0.0268459654 0.0134229827 [67,] 0.98206663 0.0358667414 0.0179333707 [68,] 0.98690360 0.0261928013 0.0130964007 [69,] 0.98298379 0.0340324127 0.0170162063 [70,] 0.97997050 0.0400590043 0.0200295022 [71,] 0.97884502 0.0423099630 0.0211549815 [72,] 0.97215477 0.0556904589 0.0278452294 [73,] 0.97009838 0.0598032403 0.0299016202 [74,] 0.96235927 0.0752814624 0.0376407312 [75,] 0.95904917 0.0819016515 0.0409508257 [76,] 0.94897065 0.1020587077 0.0510293538 [77,] 0.93548178 0.1290364384 0.0645182192 [78,] 0.92002461 0.1599507894 0.0799753947 [79,] 0.90137985 0.1972402928 0.0986201464 [80,] 0.88239204 0.2352159177 0.1176079588 [81,] 0.92707121 0.1458575895 0.0729287948 [82,] 0.94673407 0.1065318511 0.0532659256 [83,] 0.93394584 0.1321083287 0.0660541644 [84,] 0.91891882 0.1621623697 0.0810811848 [85,] 0.90294565 0.1941086975 0.0970543488 [86,] 0.90250434 0.1949913288 0.0974956644 [87,] 0.88233750 0.2353250019 0.1176625010 [88,] 0.86196162 0.2760767551 0.1380383776 [89,] 0.84323300 0.3135340039 0.1567670020 [90,] 0.83985117 0.3202976502 0.1601488251 [91,] 0.80929602 0.3814079641 0.1907039821 [92,] 0.80220613 0.3955877318 0.1977938659 [93,] 0.77862973 0.4427405361 0.2213702681 [94,] 0.75309354 0.4938129201 0.2469064600 [95,] 0.82391289 0.3521742114 0.1760871057 [96,] 0.82572319 0.3485536132 0.1742768066 [97,] 0.85646989 0.2870602275 0.1435301138 [98,] 0.83292033 0.3341593449 0.1670796725 [99,] 0.83786511 0.3242697739 0.1621348870 [100,] 0.87084462 0.2583107648 0.1291553824 [101,] 0.84743935 0.3051212922 0.1525606461 [102,] 0.83495051 0.3300989717 0.1650494859 [103,] 0.83241194 0.3351761219 0.1675880610 [104,] 0.84423745 0.3115250926 0.1557625463 [105,] 0.85259315 0.2948136987 0.1474068493 [106,] 0.91270276 0.1745944730 0.0872972365 [107,] 0.88967311 0.2206537767 0.1103268883 [108,] 0.88932471 0.2213505839 0.1106752919 [109,] 0.86254944 0.2749011298 0.1374505649 [110,] 0.84409955 0.3118009002 0.1559004501 [111,] 0.80824842 0.3835031614 0.1917515807 [112,] 0.77043730 0.4591254073 0.2295627036 [113,] 0.72804466 0.5439106782 0.2719553391 [114,] 0.67972994 0.6405401289 0.3202700644 [115,] 0.63694830 0.7261034050 0.3630517025 [116,] 0.58264564 0.8347087256 0.4173543628 [117,] 0.57948702 0.8410259613 0.4205129806 [118,] 0.52577955 0.9484409083 0.4742204541 [119,] 0.51985527 0.9602894549 0.4801447275 [120,] 0.67444422 0.6511115667 0.3255557833 [121,] 0.63736073 0.7252785380 0.3626392690 [122,] 0.63203663 0.7359267304 0.3679633652 [123,] 0.62942528 0.7411494440 0.3705747220 [124,] 0.56814843 0.8637031311 0.4318515656 [125,] 0.56655218 0.8668956338 0.4334478169 [126,] 0.51920491 0.9615901882 0.4807950941 [127,] 0.51677997 0.9664400617 0.4832200309 [128,] 0.51039445 0.9792111092 0.4896055546 [129,] 0.46894617 0.9378923443 0.5310538278 [130,] 0.39915975 0.7983194988 0.6008402506 [131,] 0.33887803 0.6777560655 0.6611219672 [132,] 0.29058123 0.5811624666 0.7094187667 [133,] 0.24176920 0.4835383965 0.7582308017 [134,] 0.23339982 0.4667996340 0.7666001830 [135,] 0.19108284 0.3821656802 0.8089171599 [136,] 0.15206887 0.3041377362 0.8479311319 [137,] 0.12100001 0.2420000122 0.8789999939 [138,] 0.20766897 0.4153379427 0.7923310286 [139,] 0.50703853 0.9859229401 0.4929614700 [140,] 0.55103413 0.8979317348 0.4489658674 [141,] 0.43446365 0.8689272982 0.5655363509 [142,] 0.35336434 0.7067286844 0.6466356578 [143,] 0.21913438 0.4382687520 0.7808656240 > postscript(file="/var/wessaorg/rcomp/tmp/1mj901322129983.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/28txi1322129983.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/39j6e1322129983.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/4y7le1322129983.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/5nd601322129983.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > qqline(mysum$resid) > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 162 Frequency = 1 1 2 3 4 5 6 0.02132883 2.79181906 -2.59813780 -2.34831133 4.62197307 3.84506499 7 8 9 10 11 12 3.69526863 -1.02044185 -0.15937918 0.26820626 1.70490696 3.71502838 13 14 15 16 17 18 -3.31851893 2.47459210 2.24399018 0.91899694 0.28600637 1.07721035 19 20 21 22 23 24 -1.41539054 2.59795734 2.05010601 -2.31940700 -0.35432279 -1.63395543 25 26 27 28 29 30 1.63039006 -6.73047248 0.90021227 0.70552457 1.18135382 -2.78207713 31 32 33 34 35 36 0.79359456 0.57437912 2.11991682 -0.38446642 0.29651948 0.68533327 37 38 39 40 41 42 -1.84933798 0.79435422 1.93200976 -2.06892872 -0.54516514 2.40425896 43 44 45 46 47 48 0.68943761 -0.95014715 -2.25750550 -2.70086881 -0.49136664 0.16327776 49 50 51 52 53 54 3.21988130 -1.64919664 0.70043440 0.81814480 -0.61171036 -1.62336455 55 56 57 58 59 60 -2.14439628 0.41293467 1.79822695 -0.25352967 -3.32839664 -1.39354245 61 62 63 64 65 66 -2.41452998 -1.64147630 -3.56414026 1.00941779 1.73919044 -5.29173832 67 68 69 70 71 72 -1.59253777 -2.07815777 1.00502196 1.15943363 0.13154733 3.08447171 73 74 75 76 77 78 0.23450230 -0.64228657 -1.66593311 -0.18190967 2.78800389 0.62692939 79 80 81 82 83 84 1.28223367 -1.44035174 -0.13484683 1.63132628 -0.68586265 1.64505118 85 86 87 88 89 90 0.63165793 -0.09007453 0.42204680 -0.30829953 0.45099946 -3.63968799 91 92 93 94 95 96 2.94253403 0.41879011 0.25455079 0.84979518 -1.82626324 0.65460133 97 98 99 100 101 102 -0.96764879 -0.90932484 1.88613488 -0.33108535 1.62736808 -1.19022658 103 104 105 106 107 108 0.76953562 -3.09709376 1.38360057 -2.53160092 0.89377744 1.57629516 109 110 111 112 113 114 -2.91084750 0.04586249 1.02177362 -2.21140645 -2.88945629 2.02196233 115 116 117 118 119 120 3.59208600 0.41715957 0.64793864 -0.47494267 -1.28524536 -0.14214015 121 122 123 124 125 126 -0.80275842 0.75243961 -0.54017434 -1.21397019 0.53604441 -1.75285661 127 128 129 130 131 132 0.61679740 1.18380169 3.73162220 1.22526129 -1.73529944 -1.77532068 133 134 135 136 137 138 -0.78135435 2.49629793 0.32269243 2.42195681 2.10277853 0.53726779 139 140 141 142 143 144 -1.16678221 0.56516907 -0.93248160 0.30068119 1.88824264 -0.82463216 145 146 147 148 149 150 1.20336176 1.03108468 1.88694417 -2.63608612 -2.63049948 -2.76108975 151 152 153 154 155 156 0.92574445 -0.08432486 0.11886916 -3.06980640 -2.88956539 0.98289026 157 158 159 160 161 162 0.41879011 0.13572274 3.73162220 -2.78308760 -0.62548488 -0.01729523 > postscript(file="/var/wessaorg/rcomp/tmp/6km6i1322129983.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 162 Frequency = 1 lag(myerror, k = 1) myerror 0 0.02132883 NA 1 2.79181906 0.02132883 2 -2.59813780 2.79181906 3 -2.34831133 -2.59813780 4 4.62197307 -2.34831133 5 3.84506499 4.62197307 6 3.69526863 3.84506499 7 -1.02044185 3.69526863 8 -0.15937918 -1.02044185 9 0.26820626 -0.15937918 10 1.70490696 0.26820626 11 3.71502838 1.70490696 12 -3.31851893 3.71502838 13 2.47459210 -3.31851893 14 2.24399018 2.47459210 15 0.91899694 2.24399018 16 0.28600637 0.91899694 17 1.07721035 0.28600637 18 -1.41539054 1.07721035 19 2.59795734 -1.41539054 20 2.05010601 2.59795734 21 -2.31940700 2.05010601 22 -0.35432279 -2.31940700 23 -1.63395543 -0.35432279 24 1.63039006 -1.63395543 25 -6.73047248 1.63039006 26 0.90021227 -6.73047248 27 0.70552457 0.90021227 28 1.18135382 0.70552457 29 -2.78207713 1.18135382 30 0.79359456 -2.78207713 31 0.57437912 0.79359456 32 2.11991682 0.57437912 33 -0.38446642 2.11991682 34 0.29651948 -0.38446642 35 0.68533327 0.29651948 36 -1.84933798 0.68533327 37 0.79435422 -1.84933798 38 1.93200976 0.79435422 39 -2.06892872 1.93200976 40 -0.54516514 -2.06892872 41 2.40425896 -0.54516514 42 0.68943761 2.40425896 43 -0.95014715 0.68943761 44 -2.25750550 -0.95014715 45 -2.70086881 -2.25750550 46 -0.49136664 -2.70086881 47 0.16327776 -0.49136664 48 3.21988130 0.16327776 49 -1.64919664 3.21988130 50 0.70043440 -1.64919664 51 0.81814480 0.70043440 52 -0.61171036 0.81814480 53 -1.62336455 -0.61171036 54 -2.14439628 -1.62336455 55 0.41293467 -2.14439628 56 1.79822695 0.41293467 57 -0.25352967 1.79822695 58 -3.32839664 -0.25352967 59 -1.39354245 -3.32839664 60 -2.41452998 -1.39354245 61 -1.64147630 -2.41452998 62 -3.56414026 -1.64147630 63 1.00941779 -3.56414026 64 1.73919044 1.00941779 65 -5.29173832 1.73919044 66 -1.59253777 -5.29173832 67 -2.07815777 -1.59253777 68 1.00502196 -2.07815777 69 1.15943363 1.00502196 70 0.13154733 1.15943363 71 3.08447171 0.13154733 72 0.23450230 3.08447171 73 -0.64228657 0.23450230 74 -1.66593311 -0.64228657 75 -0.18190967 -1.66593311 76 2.78800389 -0.18190967 77 0.62692939 2.78800389 78 1.28223367 0.62692939 79 -1.44035174 1.28223367 80 -0.13484683 -1.44035174 81 1.63132628 -0.13484683 82 -0.68586265 1.63132628 83 1.64505118 -0.68586265 84 0.63165793 1.64505118 85 -0.09007453 0.63165793 86 0.42204680 -0.09007453 87 -0.30829953 0.42204680 88 0.45099946 -0.30829953 89 -3.63968799 0.45099946 90 2.94253403 -3.63968799 91 0.41879011 2.94253403 92 0.25455079 0.41879011 93 0.84979518 0.25455079 94 -1.82626324 0.84979518 95 0.65460133 -1.82626324 96 -0.96764879 0.65460133 97 -0.90932484 -0.96764879 98 1.88613488 -0.90932484 99 -0.33108535 1.88613488 100 1.62736808 -0.33108535 101 -1.19022658 1.62736808 102 0.76953562 -1.19022658 103 -3.09709376 0.76953562 104 1.38360057 -3.09709376 105 -2.53160092 1.38360057 106 0.89377744 -2.53160092 107 1.57629516 0.89377744 108 -2.91084750 1.57629516 109 0.04586249 -2.91084750 110 1.02177362 0.04586249 111 -2.21140645 1.02177362 112 -2.88945629 -2.21140645 113 2.02196233 -2.88945629 114 3.59208600 2.02196233 115 0.41715957 3.59208600 116 0.64793864 0.41715957 117 -0.47494267 0.64793864 118 -1.28524536 -0.47494267 119 -0.14214015 -1.28524536 120 -0.80275842 -0.14214015 121 0.75243961 -0.80275842 122 -0.54017434 0.75243961 123 -1.21397019 -0.54017434 124 0.53604441 -1.21397019 125 -1.75285661 0.53604441 126 0.61679740 -1.75285661 127 1.18380169 0.61679740 128 3.73162220 1.18380169 129 1.22526129 3.73162220 130 -1.73529944 1.22526129 131 -1.77532068 -1.73529944 132 -0.78135435 -1.77532068 133 2.49629793 -0.78135435 134 0.32269243 2.49629793 135 2.42195681 0.32269243 136 2.10277853 2.42195681 137 0.53726779 2.10277853 138 -1.16678221 0.53726779 139 0.56516907 -1.16678221 140 -0.93248160 0.56516907 141 0.30068119 -0.93248160 142 1.88824264 0.30068119 143 -0.82463216 1.88824264 144 1.20336176 -0.82463216 145 1.03108468 1.20336176 146 1.88694417 1.03108468 147 -2.63608612 1.88694417 148 -2.63049948 -2.63608612 149 -2.76108975 -2.63049948 150 0.92574445 -2.76108975 151 -0.08432486 0.92574445 152 0.11886916 -0.08432486 153 -3.06980640 0.11886916 154 -2.88956539 -3.06980640 155 0.98289026 -2.88956539 156 0.41879011 0.98289026 157 0.13572274 0.41879011 158 3.73162220 0.13572274 159 -2.78308760 3.73162220 160 -0.62548488 -2.78308760 161 -0.01729523 -0.62548488 162 NA -0.01729523 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 2.79181906 0.02132883 [2,] -2.59813780 2.79181906 [3,] -2.34831133 -2.59813780 [4,] 4.62197307 -2.34831133 [5,] 3.84506499 4.62197307 [6,] 3.69526863 3.84506499 [7,] -1.02044185 3.69526863 [8,] -0.15937918 -1.02044185 [9,] 0.26820626 -0.15937918 [10,] 1.70490696 0.26820626 [11,] 3.71502838 1.70490696 [12,] -3.31851893 3.71502838 [13,] 2.47459210 -3.31851893 [14,] 2.24399018 2.47459210 [15,] 0.91899694 2.24399018 [16,] 0.28600637 0.91899694 [17,] 1.07721035 0.28600637 [18,] -1.41539054 1.07721035 [19,] 2.59795734 -1.41539054 [20,] 2.05010601 2.59795734 [21,] -2.31940700 2.05010601 [22,] -0.35432279 -2.31940700 [23,] -1.63395543 -0.35432279 [24,] 1.63039006 -1.63395543 [25,] -6.73047248 1.63039006 [26,] 0.90021227 -6.73047248 [27,] 0.70552457 0.90021227 [28,] 1.18135382 0.70552457 [29,] -2.78207713 1.18135382 [30,] 0.79359456 -2.78207713 [31,] 0.57437912 0.79359456 [32,] 2.11991682 0.57437912 [33,] -0.38446642 2.11991682 [34,] 0.29651948 -0.38446642 [35,] 0.68533327 0.29651948 [36,] -1.84933798 0.68533327 [37,] 0.79435422 -1.84933798 [38,] 1.93200976 0.79435422 [39,] -2.06892872 1.93200976 [40,] -0.54516514 -2.06892872 [41,] 2.40425896 -0.54516514 [42,] 0.68943761 2.40425896 [43,] -0.95014715 0.68943761 [44,] -2.25750550 -0.95014715 [45,] -2.70086881 -2.25750550 [46,] -0.49136664 -2.70086881 [47,] 0.16327776 -0.49136664 [48,] 3.21988130 0.16327776 [49,] -1.64919664 3.21988130 [50,] 0.70043440 -1.64919664 [51,] 0.81814480 0.70043440 [52,] -0.61171036 0.81814480 [53,] -1.62336455 -0.61171036 [54,] -2.14439628 -1.62336455 [55,] 0.41293467 -2.14439628 [56,] 1.79822695 0.41293467 [57,] -0.25352967 1.79822695 [58,] -3.32839664 -0.25352967 [59,] -1.39354245 -3.32839664 [60,] -2.41452998 -1.39354245 [61,] -1.64147630 -2.41452998 [62,] -3.56414026 -1.64147630 [63,] 1.00941779 -3.56414026 [64,] 1.73919044 1.00941779 [65,] -5.29173832 1.73919044 [66,] -1.59253777 -5.29173832 [67,] -2.07815777 -1.59253777 [68,] 1.00502196 -2.07815777 [69,] 1.15943363 1.00502196 [70,] 0.13154733 1.15943363 [71,] 3.08447171 0.13154733 [72,] 0.23450230 3.08447171 [73,] -0.64228657 0.23450230 [74,] -1.66593311 -0.64228657 [75,] -0.18190967 -1.66593311 [76,] 2.78800389 -0.18190967 [77,] 0.62692939 2.78800389 [78,] 1.28223367 0.62692939 [79,] -1.44035174 1.28223367 [80,] -0.13484683 -1.44035174 [81,] 1.63132628 -0.13484683 [82,] -0.68586265 1.63132628 [83,] 1.64505118 -0.68586265 [84,] 0.63165793 1.64505118 [85,] -0.09007453 0.63165793 [86,] 0.42204680 -0.09007453 [87,] -0.30829953 0.42204680 [88,] 0.45099946 -0.30829953 [89,] -3.63968799 0.45099946 [90,] 2.94253403 -3.63968799 [91,] 0.41879011 2.94253403 [92,] 0.25455079 0.41879011 [93,] 0.84979518 0.25455079 [94,] -1.82626324 0.84979518 [95,] 0.65460133 -1.82626324 [96,] -0.96764879 0.65460133 [97,] -0.90932484 -0.96764879 [98,] 1.88613488 -0.90932484 [99,] -0.33108535 1.88613488 [100,] 1.62736808 -0.33108535 [101,] -1.19022658 1.62736808 [102,] 0.76953562 -1.19022658 [103,] -3.09709376 0.76953562 [104,] 1.38360057 -3.09709376 [105,] -2.53160092 1.38360057 [106,] 0.89377744 -2.53160092 [107,] 1.57629516 0.89377744 [108,] -2.91084750 1.57629516 [109,] 0.04586249 -2.91084750 [110,] 1.02177362 0.04586249 [111,] -2.21140645 1.02177362 [112,] -2.88945629 -2.21140645 [113,] 2.02196233 -2.88945629 [114,] 3.59208600 2.02196233 [115,] 0.41715957 3.59208600 [116,] 0.64793864 0.41715957 [117,] -0.47494267 0.64793864 [118,] -1.28524536 -0.47494267 [119,] -0.14214015 -1.28524536 [120,] -0.80275842 -0.14214015 [121,] 0.75243961 -0.80275842 [122,] -0.54017434 0.75243961 [123,] -1.21397019 -0.54017434 [124,] 0.53604441 -1.21397019 [125,] -1.75285661 0.53604441 [126,] 0.61679740 -1.75285661 [127,] 1.18380169 0.61679740 [128,] 3.73162220 1.18380169 [129,] 1.22526129 3.73162220 [130,] -1.73529944 1.22526129 [131,] -1.77532068 -1.73529944 [132,] -0.78135435 -1.77532068 [133,] 2.49629793 -0.78135435 [134,] 0.32269243 2.49629793 [135,] 2.42195681 0.32269243 [136,] 2.10277853 2.42195681 [137,] 0.53726779 2.10277853 [138,] -1.16678221 0.53726779 [139,] 0.56516907 -1.16678221 [140,] -0.93248160 0.56516907 [141,] 0.30068119 -0.93248160 [142,] 1.88824264 0.30068119 [143,] -0.82463216 1.88824264 [144,] 1.20336176 -0.82463216 [145,] 1.03108468 1.20336176 [146,] 1.88694417 1.03108468 [147,] -2.63608612 1.88694417 [148,] -2.63049948 -2.63608612 [149,] -2.76108975 -2.63049948 [150,] 0.92574445 -2.76108975 [151,] -0.08432486 0.92574445 [152,] 0.11886916 -0.08432486 [153,] -3.06980640 0.11886916 [154,] -2.88956539 -3.06980640 [155,] 0.98289026 -2.88956539 [156,] 0.41879011 0.98289026 [157,] 0.13572274 0.41879011 [158,] 3.73162220 0.13572274 [159,] -2.78308760 3.73162220 [160,] -0.62548488 -2.78308760 [161,] -0.01729523 -0.62548488 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 2.79181906 0.02132883 2 -2.59813780 2.79181906 3 -2.34831133 -2.59813780 4 4.62197307 -2.34831133 5 3.84506499 4.62197307 6 3.69526863 3.84506499 7 -1.02044185 3.69526863 8 -0.15937918 -1.02044185 9 0.26820626 -0.15937918 10 1.70490696 0.26820626 11 3.71502838 1.70490696 12 -3.31851893 3.71502838 13 2.47459210 -3.31851893 14 2.24399018 2.47459210 15 0.91899694 2.24399018 16 0.28600637 0.91899694 17 1.07721035 0.28600637 18 -1.41539054 1.07721035 19 2.59795734 -1.41539054 20 2.05010601 2.59795734 21 -2.31940700 2.05010601 22 -0.35432279 -2.31940700 23 -1.63395543 -0.35432279 24 1.63039006 -1.63395543 25 -6.73047248 1.63039006 26 0.90021227 -6.73047248 27 0.70552457 0.90021227 28 1.18135382 0.70552457 29 -2.78207713 1.18135382 30 0.79359456 -2.78207713 31 0.57437912 0.79359456 32 2.11991682 0.57437912 33 -0.38446642 2.11991682 34 0.29651948 -0.38446642 35 0.68533327 0.29651948 36 -1.84933798 0.68533327 37 0.79435422 -1.84933798 38 1.93200976 0.79435422 39 -2.06892872 1.93200976 40 -0.54516514 -2.06892872 41 2.40425896 -0.54516514 42 0.68943761 2.40425896 43 -0.95014715 0.68943761 44 -2.25750550 -0.95014715 45 -2.70086881 -2.25750550 46 -0.49136664 -2.70086881 47 0.16327776 -0.49136664 48 3.21988130 0.16327776 49 -1.64919664 3.21988130 50 0.70043440 -1.64919664 51 0.81814480 0.70043440 52 -0.61171036 0.81814480 53 -1.62336455 -0.61171036 54 -2.14439628 -1.62336455 55 0.41293467 -2.14439628 56 1.79822695 0.41293467 57 -0.25352967 1.79822695 58 -3.32839664 -0.25352967 59 -1.39354245 -3.32839664 60 -2.41452998 -1.39354245 61 -1.64147630 -2.41452998 62 -3.56414026 -1.64147630 63 1.00941779 -3.56414026 64 1.73919044 1.00941779 65 -5.29173832 1.73919044 66 -1.59253777 -5.29173832 67 -2.07815777 -1.59253777 68 1.00502196 -2.07815777 69 1.15943363 1.00502196 70 0.13154733 1.15943363 71 3.08447171 0.13154733 72 0.23450230 3.08447171 73 -0.64228657 0.23450230 74 -1.66593311 -0.64228657 75 -0.18190967 -1.66593311 76 2.78800389 -0.18190967 77 0.62692939 2.78800389 78 1.28223367 0.62692939 79 -1.44035174 1.28223367 80 -0.13484683 -1.44035174 81 1.63132628 -0.13484683 82 -0.68586265 1.63132628 83 1.64505118 -0.68586265 84 0.63165793 1.64505118 85 -0.09007453 0.63165793 86 0.42204680 -0.09007453 87 -0.30829953 0.42204680 88 0.45099946 -0.30829953 89 -3.63968799 0.45099946 90 2.94253403 -3.63968799 91 0.41879011 2.94253403 92 0.25455079 0.41879011 93 0.84979518 0.25455079 94 -1.82626324 0.84979518 95 0.65460133 -1.82626324 96 -0.96764879 0.65460133 97 -0.90932484 -0.96764879 98 1.88613488 -0.90932484 99 -0.33108535 1.88613488 100 1.62736808 -0.33108535 101 -1.19022658 1.62736808 102 0.76953562 -1.19022658 103 -3.09709376 0.76953562 104 1.38360057 -3.09709376 105 -2.53160092 1.38360057 106 0.89377744 -2.53160092 107 1.57629516 0.89377744 108 -2.91084750 1.57629516 109 0.04586249 -2.91084750 110 1.02177362 0.04586249 111 -2.21140645 1.02177362 112 -2.88945629 -2.21140645 113 2.02196233 -2.88945629 114 3.59208600 2.02196233 115 0.41715957 3.59208600 116 0.64793864 0.41715957 117 -0.47494267 0.64793864 118 -1.28524536 -0.47494267 119 -0.14214015 -1.28524536 120 -0.80275842 -0.14214015 121 0.75243961 -0.80275842 122 -0.54017434 0.75243961 123 -1.21397019 -0.54017434 124 0.53604441 -1.21397019 125 -1.75285661 0.53604441 126 0.61679740 -1.75285661 127 1.18380169 0.61679740 128 3.73162220 1.18380169 129 1.22526129 3.73162220 130 -1.73529944 1.22526129 131 -1.77532068 -1.73529944 132 -0.78135435 -1.77532068 133 2.49629793 -0.78135435 134 0.32269243 2.49629793 135 2.42195681 0.32269243 136 2.10277853 2.42195681 137 0.53726779 2.10277853 138 -1.16678221 0.53726779 139 0.56516907 -1.16678221 140 -0.93248160 0.56516907 141 0.30068119 -0.93248160 142 1.88824264 0.30068119 143 -0.82463216 1.88824264 144 1.20336176 -0.82463216 145 1.03108468 1.20336176 146 1.88694417 1.03108468 147 -2.63608612 1.88694417 148 -2.63049948 -2.63608612 149 -2.76108975 -2.63049948 150 0.92574445 -2.76108975 151 -0.08432486 0.92574445 152 0.11886916 -0.08432486 153 -3.06980640 0.11886916 154 -2.88956539 -3.06980640 155 0.98289026 -2.88956539 156 0.41879011 0.98289026 157 0.13572274 0.41879011 158 3.73162220 0.13572274 159 -2.78308760 3.73162220 160 -0.62548488 -2.78308760 161 -0.01729523 -0.62548488 > 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/7nngo1322129983.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/88dsv1322129983.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/9w2v51322129983.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/10wtn61322129983.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/11cukb1322129983.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/1216qp1322129983.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/13jxq41322129983.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/14jxn71322129983.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/15k3ws1322129983.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/16gpnd1322129983.tab") + } > > try(system("convert tmp/1mj901322129983.ps tmp/1mj901322129983.png",intern=TRUE)) character(0) > try(system("convert tmp/28txi1322129983.ps tmp/28txi1322129983.png",intern=TRUE)) character(0) > try(system("convert tmp/39j6e1322129983.ps tmp/39j6e1322129983.png",intern=TRUE)) character(0) > try(system("convert tmp/4y7le1322129983.ps tmp/4y7le1322129983.png",intern=TRUE)) character(0) > try(system("convert tmp/5nd601322129983.ps tmp/5nd601322129983.png",intern=TRUE)) character(0) > try(system("convert tmp/6km6i1322129983.ps tmp/6km6i1322129983.png",intern=TRUE)) character(0) > try(system("convert tmp/7nngo1322129983.ps tmp/7nngo1322129983.png",intern=TRUE)) character(0) > try(system("convert tmp/88dsv1322129983.ps tmp/88dsv1322129983.png",intern=TRUE)) character(0) > try(system("convert tmp/9w2v51322129983.ps tmp/9w2v51322129983.png",intern=TRUE)) character(0) > try(system("convert tmp/10wtn61322129983.ps tmp/10wtn61322129983.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.298 0.517 5.868