R version 2.12.0 (2010-10-15) Copyright (C) 2010 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(2 + ,41 + ,38 + ,13 + ,12 + ,14 + ,1 + ,2 + ,39 + ,32 + ,16 + ,11 + ,18 + ,1 + ,2 + ,30 + ,35 + ,19 + ,15 + ,11 + ,0 + ,1 + ,31 + ,33 + ,15 + ,6 + ,12 + ,0 + ,2 + ,34 + ,37 + ,14 + ,13 + ,16 + ,1 + ,2 + ,35 + ,29 + ,13 + ,10 + ,18 + ,1 + ,2 + ,39 + ,31 + ,19 + ,12 + ,14 + ,1 + ,2 + ,34 + ,36 + ,15 + ,14 + ,14 + ,0 + ,2 + ,36 + ,35 + ,14 + ,12 + ,15 + ,0 + ,2 + ,37 + ,38 + ,15 + ,6 + ,15 + ,1 + ,1 + ,38 + ,31 + ,16 + ,10 + ,17 + ,0 + ,2 + ,36 + ,34 + ,16 + ,12 + ,19 + ,0 + ,1 + ,38 + ,35 + ,16 + ,12 + ,10 + ,0 + ,2 + ,39 + ,38 + ,16 + ,11 + ,16 + ,0 + ,2 + ,33 + ,37 + ,17 + ,15 + ,18 + ,0 + ,1 + ,32 + ,33 + ,15 + ,12 + ,14 + ,1 + ,1 + ,36 + ,32 + ,15 + ,10 + ,14 + ,1 + ,2 + ,38 + ,38 + ,20 + ,12 + ,17 + ,1 + ,1 + ,39 + ,38 + ,18 + ,11 + ,14 + ,0 + ,2 + ,32 + ,32 + ,16 + ,12 + ,16 + ,0 + ,1 + ,32 + ,33 + ,16 + ,11 + ,18 + ,1 + ,2 + ,31 + ,31 + ,16 + ,12 + ,11 + ,1 + ,2 + ,39 + ,38 + ,19 + ,13 + ,14 + ,0 + ,2 + ,37 + ,39 + ,16 + ,11 + ,12 + ,1 + ,1 + ,39 + ,32 + ,17 + ,9 + ,17 + ,1 + ,2 + ,41 + ,32 + ,17 + ,13 + ,9 + ,1 + ,1 + ,36 + ,35 + ,16 + ,10 + ,16 + ,1 + ,2 + ,33 + ,37 + ,15 + ,14 + ,14 + ,0 + ,2 + ,33 + ,33 + ,16 + ,12 + ,15 + ,0 + ,1 + ,34 + ,33 + ,14 + ,10 + ,11 + ,1 + ,2 + ,31 + ,28 + ,15 + ,12 + ,16 + ,1 + ,1 + ,27 + ,32 + ,12 + ,8 + ,13 + ,1 + ,2 + ,37 + ,31 + ,14 + ,10 + ,17 + ,0 + ,2 + ,34 + ,37 + ,16 + ,12 + ,15 + ,0 + ,1 + ,34 + ,30 + ,14 + ,12 + ,14 + ,0 + ,1 + ,32 + ,33 + ,7 + ,7 + ,16 + ,1 + ,1 + ,29 + ,31 + ,10 + ,6 + ,9 + ,1 + ,1 + ,36 + ,33 + ,14 + ,12 + ,15 + ,0 + ,2 + ,29 + ,31 + ,16 + ,10 + ,17 + ,0 + ,1 + ,35 + ,33 + ,16 + ,10 + ,13 + ,1 + ,1 + ,37 + ,32 + ,16 + ,10 + ,15 + ,1 + ,2 + ,34 + ,33 + ,14 + ,12 + ,16 + ,1 + ,1 + ,38 + ,32 + ,20 + ,15 + ,16 + ,1 + ,1 + ,35 + ,33 + ,14 + ,10 + ,12 + ,1 + ,2 + ,38 + ,28 + ,14 + ,10 + ,12 + ,0 + ,2 + ,37 + ,35 + ,11 + ,12 + ,11 + ,0 + ,2 + ,38 + ,39 + ,14 + ,13 + ,15 + ,0 + ,2 + ,33 + ,34 + ,15 + ,11 + ,15 + ,1 + ,2 + ,36 + ,38 + ,16 + ,11 + ,17 + ,1 + ,1 + ,38 + ,32 + ,14 + ,12 + ,13 + ,0 + ,2 + ,32 + ,38 + ,16 + ,14 + ,16 + ,0 + ,1 + ,32 + ,30 + ,14 + ,10 + ,14 + ,1 + ,1 + ,32 + ,33 + ,12 + ,12 + ,11 + ,0 + ,2 + ,34 + ,38 + ,16 + ,13 + ,12 + ,0 + ,1 + ,32 + ,32 + ,9 + ,5 + ,12 + ,0 + ,2 + ,37 + ,32 + ,14 + ,6 + ,15 + ,0 + ,2 + ,39 + ,34 + ,16 + ,12 + ,16 + ,0 + ,2 + ,29 + ,34 + ,16 + ,12 + ,15 + ,0 + ,1 + ,37 + ,36 + ,15 + ,11 + ,12 + ,0 + ,2 + ,35 + ,34 + ,16 + ,10 + ,12 + ,0 + ,1 + ,30 + ,28 + ,12 + ,7 + ,8 + ,0 + ,1 + ,38 + ,34 + ,16 + ,12 + ,13 + ,1 + ,2 + ,34 + ,35 + ,16 + ,14 + ,11 + ,1 + ,2 + ,31 + ,35 + ,14 + ,11 + ,14 + ,1 + ,2 + ,34 + ,31 + ,16 + ,12 + ,15 + ,0 + ,1 + ,35 + ,37 + ,17 + ,13 + ,10 + ,0 + ,2 + ,36 + ,35 + ,18 + ,14 + ,11 + ,0 + ,1 + ,30 + ,27 + ,18 + ,11 + ,12 + ,0 + ,2 + ,39 + ,40 + ,12 + ,12 + ,15 + ,1 + ,1 + ,35 + ,37 + ,16 + ,12 + ,15 + ,1 + ,1 + ,38 + ,36 + ,10 + ,8 + ,14 + ,0 + ,2 + ,31 + ,38 + ,14 + ,11 + ,16 + ,0 + ,2 + ,34 + ,39 + ,18 + ,14 + ,15 + ,0 + ,1 + ,38 + ,41 + ,18 + ,14 + ,15 + ,0 + ,1 + ,34 + ,27 + ,16 + ,12 + ,13 + ,1 + ,2 + ,39 + ,30 + ,17 + ,9 + ,12 + ,1 + ,2 + ,37 + ,37 + ,16 + ,13 + ,17 + ,0 + ,2 + ,34 + ,31 + ,16 + ,11 + ,13 + ,1 + ,1 + ,28 + ,31 + ,13 + ,12 + ,15 + ,1 + ,1 + ,37 + ,27 + ,16 + ,12 + ,13 + ,1 + ,1 + ,33 + ,36 + ,16 + ,12 + ,15 + ,0 + ,1 + ,37 + ,38 + ,20 + ,12 + ,16 + ,0 + ,2 + ,35 + ,37 + ,16 + ,12 + ,15 + ,0 + ,1 + ,37 + ,33 + ,15 + ,12 + ,16 + ,1 + ,2 + ,32 + ,34 + ,15 + ,11 + ,15 + ,0 + ,2 + ,33 + ,31 + ,16 + ,10 + ,14 + ,0 + ,1 + ,38 + ,39 + ,14 + ,9 + ,15 + ,1 + ,2 + ,33 + ,34 + ,16 + ,12 + ,14 + ,1 + ,2 + ,29 + ,32 + ,16 + ,12 + ,13 + ,0 + ,2 + ,33 + ,33 + ,15 + ,12 + ,7 + ,0 + ,2 + ,31 + ,36 + ,12 + ,9 + ,17 + ,1 + ,2 + ,36 + ,32 + ,17 + ,15 + ,13 + ,1 + ,2 + ,35 + ,41 + ,16 + ,12 + ,15 + ,1 + ,2 + ,32 + ,28 + ,15 + ,12 + ,14 + ,0 + ,2 + ,29 + ,30 + ,13 + ,12 + ,13 + ,1 + ,2 + ,39 + ,36 + ,16 + ,10 + ,16 + ,1 + ,2 + ,37 + ,35 + ,16 + ,13 + ,12 + ,1 + ,2 + ,35 + ,31 + ,16 + ,9 + ,14 + ,1 + ,1 + ,37 + ,34 + ,16 + ,12 + ,17 + ,0 + ,1 + ,32 + ,36 + ,14 + ,10 + ,15 + ,0 + ,2 + ,38 + ,36 + ,16 + ,14 + ,17 + ,1 + ,1 + ,37 + ,35 + ,16 + ,11 + ,12 + ,0 + ,2 + ,36 + ,37 + ,20 + ,15 + ,16 + ,0 + ,1 + ,32 + ,28 + ,15 + ,11 + ,11 + ,0 + ,2 + ,33 + ,39 + ,16 + ,11 + ,15 + ,0 + ,1 + ,40 + ,32 + ,13 + ,12 + ,9 + ,1 + ,2 + ,38 + ,35 + ,17 + ,12 + ,16 + ,1 + ,1 + ,41 + ,39 + ,16 + ,12 + ,15 + ,0 + ,1 + ,36 + ,35 + ,16 + ,11 + ,10 + ,0 + ,2 + ,43 + ,42 + ,12 + ,7 + ,10 + ,1 + ,2 + ,30 + ,34 + ,16 + ,12 + ,15 + ,1 + ,2 + ,31 + ,33 + ,16 + ,14 + ,11 + ,1 + ,2 + ,32 + ,41 + ,17 + ,11 + ,13 + ,0 + ,1 + ,32 + ,33 + ,13 + ,11 + ,14 + ,0 + ,2 + ,37 + ,34 + ,12 + ,10 + ,18 + ,1 + ,1 + ,37 + ,32 + ,18 + ,13 + ,16 + ,0 + ,2 + ,33 + ,40 + ,14 + ,13 + ,14 + ,0 + ,2 + ,34 + ,40 + ,14 + ,8 + ,14 + ,0 + ,2 + ,33 + ,35 + ,13 + ,11 + ,14 + ,0 + ,2 + ,38 + ,36 + ,16 + ,12 + ,14 + ,0 + ,2 + ,33 + ,37 + ,13 + ,11 + ,12 + ,1 + ,2 + ,31 + ,27 + ,16 + ,13 + ,14 + ,1 + ,2 + ,38 + ,39 + ,13 + ,12 + ,15 + ,1 + ,2 + ,37 + ,38 + ,16 + ,14 + ,15 + ,0 + ,2 + ,33 + ,31 + ,15 + ,13 + ,15 + ,0 + ,2 + ,31 + ,33 + ,16 + ,15 + ,13 + ,1 + ,1 + ,39 + ,32 + ,15 + ,10 + ,17 + ,1 + ,2 + ,44 + ,39 + ,17 + ,11 + ,17 + ,0 + ,2 + ,33 + ,36 + ,15 + ,9 + ,19 + ,1 + ,2 + ,35 + ,33 + ,12 + ,11 + ,15 + ,1 + ,1 + ,32 + ,33 + ,16 + ,10 + ,13 + ,1 + ,1 + ,28 + ,32 + ,10 + ,11 + ,9 + ,1 + ,2 + ,40 + ,37 + ,16 + ,8 + ,15 + ,0 + ,1 + ,27 + ,30 + ,12 + ,11 + ,15 + ,0 + ,1 + ,37 + ,38 + ,14 + ,12 + ,15 + ,1 + ,2 + ,32 + ,29 + ,15 + ,12 + ,16 + ,1 + ,1 + ,28 + ,22 + ,13 + ,9 + ,11 + ,1 + ,1 + ,34 + ,35 + ,15 + ,11 + ,14 + ,0 + ,2 + ,30 + ,35 + ,11 + ,10 + ,11 + ,0 + ,2 + ,35 + ,34 + ,12 + ,8 + ,15 + ,0 + ,1 + ,31 + ,35 + ,8 + ,9 + ,13 + ,1 + ,2 + ,32 + ,34 + ,16 + ,8 + ,15 + ,1 + ,1 + ,30 + ,34 + ,15 + ,9 + ,16 + ,0 + ,2 + ,30 + ,35 + ,17 + ,15 + ,14 + ,0 + ,1 + ,31 + ,23 + ,16 + ,11 + ,15 + ,1 + ,2 + ,40 + ,31 + ,10 + ,8 + ,16 + ,1 + ,2 + ,32 + ,27 + ,18 + ,13 + ,16 + ,1 + ,1 + ,36 + ,36 + ,13 + ,12 + ,11 + ,1 + ,1 + ,32 + ,31 + ,16 + ,12 + ,12 + ,1 + ,1 + ,35 + ,32 + ,13 + ,9 + ,9 + ,0 + ,2 + ,38 + ,39 + ,10 + ,7 + ,16 + ,0 + ,2 + ,42 + ,37 + ,15 + ,13 + ,13 + ,0 + ,1 + ,34 + ,38 + ,16 + ,9 + ,16 + ,1 + ,2 + ,35 + ,39 + ,16 + ,6 + ,12 + ,1 + ,2 + ,35 + ,34 + ,14 + ,8 + ,9 + ,0 + ,2 + ,33 + ,31 + ,10 + ,8 + ,13 + ,0 + ,2 + ,36 + ,32 + ,17 + ,15 + ,13 + ,1 + ,2 + ,32 + ,37 + ,13 + ,6 + ,14 + ,0 + ,2 + ,33 + ,36 + ,15 + ,9 + ,19 + ,0 + ,2 + ,34 + ,32 + ,16 + ,11 + ,13 + ,0 + ,2 + ,32 + ,35 + ,12 + ,8 + ,12 + ,0 + ,2 + ,34 + ,36 + ,13 + ,8 + ,13 + ,0) + ,dim=c(7 + ,162) + ,dimnames=list(c('Gender' + ,'Connected' + ,'Separate' + ,'Learning' + ,'Software' + ,'Happiness' + ,'Population') + ,1:162)) > y <- array(NA,dim=c(7,162),dimnames=list(c('Gender','Connected','Separate','Learning','Software','Happiness','Population'),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 = '2' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo > 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 Connected Gender Separate Learning Software Happiness Population 1 41 2 38 13 12 14 1 2 39 2 32 16 11 18 1 3 30 2 35 19 15 11 0 4 31 1 33 15 6 12 0 5 34 2 37 14 13 16 1 6 35 2 29 13 10 18 1 7 39 2 31 19 12 14 1 8 34 2 36 15 14 14 0 9 36 2 35 14 12 15 0 10 37 2 38 15 6 15 1 11 38 1 31 16 10 17 0 12 36 2 34 16 12 19 0 13 38 1 35 16 12 10 0 14 39 2 38 16 11 16 0 15 33 2 37 17 15 18 0 16 32 1 33 15 12 14 1 17 36 1 32 15 10 14 1 18 38 2 38 20 12 17 1 19 39 1 38 18 11 14 0 20 32 2 32 16 12 16 0 21 32 1 33 16 11 18 1 22 31 2 31 16 12 11 1 23 39 2 38 19 13 14 0 24 37 2 39 16 11 12 1 25 39 1 32 17 9 17 1 26 41 2 32 17 13 9 1 27 36 1 35 16 10 16 1 28 33 2 37 15 14 14 0 29 33 2 33 16 12 15 0 30 34 1 33 14 10 11 1 31 31 2 28 15 12 16 1 32 27 1 32 12 8 13 1 33 37 2 31 14 10 17 0 34 34 2 37 16 12 15 0 35 34 1 30 14 12 14 0 36 32 1 33 7 7 16 1 37 29 1 31 10 6 9 1 38 36 1 33 14 12 15 0 39 29 2 31 16 10 17 0 40 35 1 33 16 10 13 1 41 37 1 32 16 10 15 1 42 34 2 33 14 12 16 1 43 38 1 32 20 15 16 1 44 35 1 33 14 10 12 1 45 38 2 28 14 10 12 0 46 37 2 35 11 12 11 0 47 38 2 39 14 13 15 0 48 33 2 34 15 11 15 1 49 36 2 38 16 11 17 1 50 38 1 32 14 12 13 0 51 32 2 38 16 14 16 0 52 32 1 30 14 10 14 1 53 32 1 33 12 12 11 0 54 34 2 38 16 13 12 0 55 32 1 32 9 5 12 0 56 37 2 32 14 6 15 0 57 39 2 34 16 12 16 0 58 29 2 34 16 12 15 0 59 37 1 36 15 11 12 0 60 35 2 34 16 10 12 0 61 30 1 28 12 7 8 0 62 38 1 34 16 12 13 1 63 34 2 35 16 14 11 1 64 31 2 35 14 11 14 1 65 34 2 31 16 12 15 0 66 35 1 37 17 13 10 0 67 36 2 35 18 14 11 0 68 30 1 27 18 11 12 0 69 39 2 40 12 12 15 1 70 35 1 37 16 12 15 1 71 38 1 36 10 8 14 0 72 31 2 38 14 11 16 0 73 34 2 39 18 14 15 0 74 38 1 41 18 14 15 0 75 34 1 27 16 12 13 1 76 39 2 30 17 9 12 1 77 37 2 37 16 13 17 0 78 34 2 31 16 11 13 1 79 28 1 31 13 12 15 1 80 37 1 27 16 12 13 1 81 33 1 36 16 12 15 0 82 37 1 38 20 12 16 0 83 35 2 37 16 12 15 0 84 37 1 33 15 12 16 1 85 32 2 34 15 11 15 0 86 33 2 31 16 10 14 0 87 38 1 39 14 9 15 1 88 33 2 34 16 12 14 1 89 29 2 32 16 12 13 0 90 33 2 33 15 12 7 0 91 31 2 36 12 9 17 1 92 36 2 32 17 15 13 1 93 35 2 41 16 12 15 1 94 32 2 28 15 12 14 0 95 29 2 30 13 12 13 1 96 39 2 36 16 10 16 1 97 37 2 35 16 13 12 1 98 35 2 31 16 9 14 1 99 37 1 34 16 12 17 0 100 32 1 36 14 10 15 0 101 38 2 36 16 14 17 1 102 37 1 35 16 11 12 0 103 36 2 37 20 15 16 0 104 32 1 28 15 11 11 0 105 33 2 39 16 11 15 0 106 40 1 32 13 12 9 1 107 38 2 35 17 12 16 1 108 41 1 39 16 12 15 0 109 36 1 35 16 11 10 0 110 43 2 42 12 7 10 1 111 30 2 34 16 12 15 1 112 31 2 33 16 14 11 1 113 32 2 41 17 11 13 0 114 32 1 33 13 11 14 0 115 37 2 34 12 10 18 1 116 37 1 32 18 13 16 0 117 33 2 40 14 13 14 0 118 34 2 40 14 8 14 0 119 33 2 35 13 11 14 0 120 38 2 36 16 12 14 0 121 33 2 37 13 11 12 1 122 31 2 27 16 13 14 1 123 38 2 39 13 12 15 1 124 37 2 38 16 14 15 0 125 33 2 31 15 13 15 0 126 31 2 33 16 15 13 1 127 39 1 32 15 10 17 1 128 44 2 39 17 11 17 0 129 33 2 36 15 9 19 1 130 35 2 33 12 11 15 1 131 32 1 33 16 10 13 1 132 28 1 32 10 11 9 1 133 40 2 37 16 8 15 0 134 27 1 30 12 11 15 0 135 37 1 38 14 12 15 1 136 32 2 29 15 12 16 1 137 28 1 22 13 9 11 1 138 34 1 35 15 11 14 0 139 30 2 35 11 10 11 0 140 35 2 34 12 8 15 0 141 31 1 35 8 9 13 1 142 32 2 34 16 8 15 1 143 30 1 34 15 9 16 0 144 30 2 35 17 15 14 0 145 31 1 23 16 11 15 1 146 40 2 31 10 8 16 1 147 32 2 27 18 13 16 1 148 36 1 36 13 12 11 1 149 32 1 31 16 12 12 1 150 35 1 32 13 9 9 0 151 38 2 39 10 7 16 0 152 42 2 37 15 13 13 0 153 34 1 38 16 9 16 1 154 35 2 39 16 6 12 1 155 35 2 34 14 8 9 0 156 33 2 31 10 8 13 0 157 36 2 32 17 15 13 1 158 32 2 37 13 6 14 0 159 33 2 36 15 9 19 0 160 34 2 32 16 11 13 0 161 32 2 35 12 8 12 0 162 34 2 36 13 8 13 0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Gender Separate Learning Software Happiness 17.77763 -0.28835 0.35851 0.34455 -0.12990 0.07486 Population 0.68519 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -6.7152 -2.3509 -0.1722 2.0842 7.3962 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 17.77763 3.00718 5.912 2.08e-08 *** Gender -0.28835 0.52905 -0.545 0.5865 Separate 0.35851 0.07259 4.939 2.02e-06 *** Learning 0.34455 0.13119 2.626 0.0095 ** Software -0.12990 0.13709 -0.948 0.3448 Happiness 0.07486 0.10885 0.688 0.4927 Population 0.68519 0.49946 1.372 0.1721 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 3.096 on 155 degrees of freedom Multiple R-squared: 0.19, Adjusted R-squared: 0.1586 F-statistic: 6.058 on 6 and 155 DF, p-value: 1.018e-05 > 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.85931009 0.28137982 0.14068991 [2,] 0.84682251 0.30635497 0.15317749 [3,] 0.75847389 0.48305222 0.24152611 [4,] 0.75258150 0.49483700 0.24741850 [5,] 0.74881316 0.50237367 0.25118684 [6,] 0.79108005 0.41783989 0.20891995 [7,] 0.86352860 0.27294280 0.13647140 [8,] 0.80795450 0.38409099 0.19204550 [9,] 0.74116707 0.51766585 0.25883293 [10,] 0.71850691 0.56298617 0.28149309 [11,] 0.68163435 0.63673129 0.31836565 [12,] 0.74734652 0.50530696 0.25265348 [13,] 0.73217331 0.53565337 0.26782669 [14,] 0.70464199 0.59071603 0.29535801 [15,] 0.63858329 0.72283341 0.36141671 [16,] 0.61605623 0.76788754 0.38394377 [17,] 0.79589068 0.40821865 0.20410932 [18,] 0.74713766 0.50572467 0.25286234 [19,] 0.70988089 0.58023822 0.29011911 [20,] 0.66465500 0.67069000 0.33534500 [21,] 0.61047485 0.77905031 0.38952515 [22,] 0.59138408 0.81723183 0.40861592 [23,] 0.76478191 0.47043618 0.23521809 [24,] 0.77652056 0.44695888 0.22347944 [25,] 0.74531869 0.50936261 0.25468131 [26,] 0.71702612 0.56594776 0.28297388 [27,] 0.66786156 0.66427688 0.33213844 [28,] 0.65891363 0.68217273 0.34108637 [29,] 0.64291749 0.71416503 0.35708251 [30,] 0.72693185 0.54613630 0.27306815 [31,] 0.67899716 0.64200568 0.32100284 [32,] 0.64331128 0.71337745 0.35668872 [33,] 0.59207756 0.81584489 0.40792244 [34,] 0.54967609 0.90064783 0.45032391 [35,] 0.49816049 0.99632097 0.50183951 [36,] 0.64990316 0.70019368 0.35009684 [37,] 0.68532545 0.62934909 0.31467455 [38,] 0.66527353 0.66945294 0.33472647 [39,] 0.64157953 0.71684094 0.35842047 [40,] 0.59574165 0.80851670 0.40425835 [41,] 0.63925182 0.72149636 0.36074818 [42,] 0.66716069 0.66567863 0.33283931 [43,] 0.63508156 0.72983688 0.36491844 [44,] 0.59300444 0.81399112 0.40699556 [45,] 0.55941595 0.88116809 0.44058405 [46,] 0.51010786 0.97978427 0.48989214 [47,] 0.50057040 0.99885921 0.49942960 [48,] 0.53556647 0.92886706 0.46443353 [49,] 0.65345442 0.69309117 0.34654558 [50,] 0.62466633 0.75066735 0.37533367 [51,] 0.57949539 0.84100922 0.42050461 [52,] 0.54855169 0.90289663 0.45144831 [53,] 0.53391991 0.93216019 0.46608009 [54,] 0.49204438 0.98408877 0.50795562 [55,] 0.51349994 0.97300013 0.48650006 [56,] 0.46910360 0.93820719 0.53089640 [57,] 0.42518254 0.85036509 0.57481746 [58,] 0.38349913 0.76699826 0.61650087 [59,] 0.39194031 0.78388062 0.60805969 [60,] 0.39122801 0.78245603 0.60877199 [61,] 0.35677759 0.71355518 0.64322241 [62,] 0.38672185 0.77344371 0.61327815 [63,] 0.43501555 0.87003109 0.56498445 [64,] 0.42204759 0.84409519 0.57795241 [65,] 0.37731862 0.75463723 0.62268138 [66,] 0.33902813 0.67805626 0.66097187 [67,] 0.39315158 0.78630316 0.60684842 [68,] 0.35789450 0.71578900 0.64210550 [69,] 0.31637363 0.63274727 0.68362637 [70,] 0.39869945 0.79739889 0.60130055 [71,] 0.43624966 0.87249932 0.56375034 [72,] 0.41702385 0.83404769 0.58297615 [73,] 0.37297094 0.74594189 0.62702906 [74,] 0.33101517 0.66203033 0.66898483 [75,] 0.31006593 0.62013186 0.68993407 [76,] 0.29094359 0.58188717 0.70905641 [77,] 0.25510199 0.51020398 0.74489801 [78,] 0.22420284 0.44840569 0.77579716 [79,] 0.20506127 0.41012254 0.79493873 [80,] 0.24393376 0.48786753 0.75606624 [81,] 0.20880760 0.41761519 0.79119240 [82,] 0.23021026 0.46042053 0.76978974 [83,] 0.20645685 0.41291370 0.79354315 [84,] 0.19707313 0.39414627 0.80292687 [85,] 0.16740748 0.33481497 0.83259252 [86,] 0.17481347 0.34962695 0.82518653 [87,] 0.16902016 0.33804033 0.83097984 [88,] 0.15047159 0.30094318 0.84952841 [89,] 0.12732800 0.25465600 0.87267200 [90,] 0.11426984 0.22853968 0.88573016 [91,] 0.11171087 0.22342174 0.88828913 [92,] 0.10014147 0.20028294 0.89985853 [93,] 0.08940739 0.17881479 0.91059261 [94,] 0.07198534 0.14397068 0.92801466 [95,] 0.05770282 0.11540564 0.94229718 [96,] 0.05862846 0.11725692 0.94137154 [97,] 0.14028048 0.28056096 0.85971952 [98,] 0.12708212 0.25416424 0.87291788 [99,] 0.15994661 0.31989322 0.84005339 [100,] 0.14694360 0.29388720 0.85305640 [101,] 0.27002466 0.54004932 0.72997534 [102,] 0.33247567 0.66495135 0.66752433 [103,] 0.31986421 0.63972842 0.68013579 [104,] 0.38943656 0.77887311 0.61056344 [105,] 0.34687691 0.69375382 0.65312309 [106,] 0.32447040 0.64894080 0.67552960 [107,] 0.31616655 0.63233311 0.68383345 [108,] 0.31953566 0.63907132 0.68046434 [109,] 0.30335164 0.60670328 0.69664836 [110,] 0.26711805 0.53423610 0.73288195 [111,] 0.25378426 0.50756852 0.74621574 [112,] 0.23254357 0.46508713 0.76745643 [113,] 0.19849060 0.39698120 0.80150940 [114,] 0.16955832 0.33911665 0.83044168 [115,] 0.13924237 0.27848475 0.86075763 [116,] 0.11070443 0.22140886 0.88929557 [117,] 0.11828544 0.23657088 0.88171456 [118,] 0.18903038 0.37806076 0.81096962 [119,] 0.39523353 0.79046706 0.60476647 [120,] 0.38746251 0.77492503 0.61253749 [121,] 0.33273744 0.66547489 0.66726256 [122,] 0.29403941 0.58807882 0.70596059 [123,] 0.35012389 0.70024778 0.64987611 [124,] 0.47347573 0.94695146 0.52652427 [125,] 0.53649975 0.92700050 0.46350025 [126,] 0.48574599 0.97149199 0.51425401 [127,] 0.43549613 0.87099226 0.56450387 [128,] 0.39911722 0.79823444 0.60088278 [129,] 0.34977600 0.69955200 0.65022400 [130,] 0.49018114 0.98036229 0.50981886 [131,] 0.42030957 0.84061913 0.57969043 [132,] 0.66462945 0.67074110 0.33537055 [133,] 0.62146380 0.75707240 0.37853620 [134,] 0.55986275 0.88027450 0.44013725 [135,] 0.75425679 0.49148642 0.24574321 [136,] 0.70670399 0.58659203 0.29329601 [137,] 0.95484659 0.09030682 0.04515341 [138,] 0.95149383 0.09701234 0.04850617 [139,] 0.95134442 0.09731115 0.04865558 [140,] 0.91434903 0.17130194 0.08565097 [141,] 0.86079603 0.27840793 0.13920397 [142,] 0.79591514 0.40816971 0.20408486 [143,] 0.95036184 0.09927631 0.04963816 > postscript(file="/var/www/rcomp/tmp/1sfth1323961823.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') > points(x[,1]-mysum$resid) > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/2xmhl1323961823.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/3xpqm1323961823.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/4ult31323961823.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/5n3t81323961823.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 5.52229897 4.21038932 -5.16996668 -3.60711890 -1.48354501 2.18964808 7 8 9 10 11 12 3.96459499 -0.50477067 1.86361754 -0.02107686 3.91069126 1.23361040 13 14 15 16 17 18 3.26045944 2.89423752 -2.72189192 -2.66259487 1.43610491 -0.11408630 19 20 21 22 23 24 2.06650953 -1.82480076 -3.43647129 -2.77719996 2.27012530 0.14996273 25 26 27 28 29 30 3.39254006 6.79936361 -0.13368184 -1.86328014 -1.10845361 -0.35328963 31 32 33 34 35 36 -1.73140960 -6.71521299 3.88813251 -1.54249153 1.44267044 -0.70547192 37 38 39 40 41 42 -3.62799659 2.29228537 -4.80095761 -0.19209300 2.01670322 -0.17941194 43 44 45 46 47 48 2.21319061 0.57185374 6.33794408 4.19667922 2.55948448 -1.93751470 49 50 51 52 53 54 -0.86581093 4.80050811 -3.71604793 -1.50233108 -0.71919801 -1.54652627 55 56 57 58 59 60 -0.31124393 3.15971689 4.45818028 -5.46696309 1.96687691 0.49779709 61 62 63 64 65 66 -1.35160497 2.70920722 -0.95142818 -3.87662249 0.60856535 -0.67119973 67 68 69 70 71 72 1.04467353 -2.84017295 3.07496845 -1.51603447 4.15017439 -4.41667237 73 74 75 76 77 78 -2.68879090 0.30583901 1.21877357 4.77219329 1.43770007 -0.05681806 79 80 81 82 83 84 -5.33134243 4.21877357 -2.47233318 -0.64238899 -0.54249153 2.18769187 85 86 87 88 89 90 -2.25232288 -0.57638772 1.06632213 -2.07729828 -4.60023088 -0.16505554 91 92 93 94 95 96 -4.03042144 1.75974680 -2.66172126 0.10349547 -3.53476857 2.79615981 97 98 99 100 101 102 1.84381035 0.60851561 2.09497253 -3.04305276 2.24092258 1.98084133 103 104 105 106 107 108 -0.60581383 -0.09019063 -3.38941533 6.75928785 2.06993393 4.45213839 109 110 111 112 113 114 1.13055459 6.08270838 -5.15215491 -3.23440922 -5.30126609 -1.41821779 115 116 117 118 119 120 2.74164574 2.32766285 -2.72416837 -2.37369262 -0.84688562 2.89087458 121 122 123 124 125 126 -2.09938314 -1.43782708 2.08893287 1.35880869 0.08301525 -3.25421763 127 128 129 130 131 132 4.21153502 7.11632636 -3.21376986 1.45462995 -3.19209300 -4.33698183 133 134 135 136 137 138 3.93788908 -5.07300093 0.81454616 -1.08991908 -2.19504516 -0.82432686 139 140 141 142 143 144 -3.06313047 1.39159774 -2.28265636 -3.67177430 -4.87534034 -4.70544645 145 146 147 148 149 150 -0.62680662 7.39616785 -1.27663045 1.17553668 -2.14040772 2.05476512 151 152 153 154 155 156 3.08337898 7.08167163 -3.33911513 -2.49956151 1.15164739 1.30592954 157 158 159 160 161 162 1.75974680 -3.21342882 -2.52857805 0.26986427 -1.74234186 -0.52025302 > postscript(file="/var/www/rcomp/tmp/67qow1323961823.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 5.52229897 NA 1 4.21038932 5.52229897 2 -5.16996668 4.21038932 3 -3.60711890 -5.16996668 4 -1.48354501 -3.60711890 5 2.18964808 -1.48354501 6 3.96459499 2.18964808 7 -0.50477067 3.96459499 8 1.86361754 -0.50477067 9 -0.02107686 1.86361754 10 3.91069126 -0.02107686 11 1.23361040 3.91069126 12 3.26045944 1.23361040 13 2.89423752 3.26045944 14 -2.72189192 2.89423752 15 -2.66259487 -2.72189192 16 1.43610491 -2.66259487 17 -0.11408630 1.43610491 18 2.06650953 -0.11408630 19 -1.82480076 2.06650953 20 -3.43647129 -1.82480076 21 -2.77719996 -3.43647129 22 2.27012530 -2.77719996 23 0.14996273 2.27012530 24 3.39254006 0.14996273 25 6.79936361 3.39254006 26 -0.13368184 6.79936361 27 -1.86328014 -0.13368184 28 -1.10845361 -1.86328014 29 -0.35328963 -1.10845361 30 -1.73140960 -0.35328963 31 -6.71521299 -1.73140960 32 3.88813251 -6.71521299 33 -1.54249153 3.88813251 34 1.44267044 -1.54249153 35 -0.70547192 1.44267044 36 -3.62799659 -0.70547192 37 2.29228537 -3.62799659 38 -4.80095761 2.29228537 39 -0.19209300 -4.80095761 40 2.01670322 -0.19209300 41 -0.17941194 2.01670322 42 2.21319061 -0.17941194 43 0.57185374 2.21319061 44 6.33794408 0.57185374 45 4.19667922 6.33794408 46 2.55948448 4.19667922 47 -1.93751470 2.55948448 48 -0.86581093 -1.93751470 49 4.80050811 -0.86581093 50 -3.71604793 4.80050811 51 -1.50233108 -3.71604793 52 -0.71919801 -1.50233108 53 -1.54652627 -0.71919801 54 -0.31124393 -1.54652627 55 3.15971689 -0.31124393 56 4.45818028 3.15971689 57 -5.46696309 4.45818028 58 1.96687691 -5.46696309 59 0.49779709 1.96687691 60 -1.35160497 0.49779709 61 2.70920722 -1.35160497 62 -0.95142818 2.70920722 63 -3.87662249 -0.95142818 64 0.60856535 -3.87662249 65 -0.67119973 0.60856535 66 1.04467353 -0.67119973 67 -2.84017295 1.04467353 68 3.07496845 -2.84017295 69 -1.51603447 3.07496845 70 4.15017439 -1.51603447 71 -4.41667237 4.15017439 72 -2.68879090 -4.41667237 73 0.30583901 -2.68879090 74 1.21877357 0.30583901 75 4.77219329 1.21877357 76 1.43770007 4.77219329 77 -0.05681806 1.43770007 78 -5.33134243 -0.05681806 79 4.21877357 -5.33134243 80 -2.47233318 4.21877357 81 -0.64238899 -2.47233318 82 -0.54249153 -0.64238899 83 2.18769187 -0.54249153 84 -2.25232288 2.18769187 85 -0.57638772 -2.25232288 86 1.06632213 -0.57638772 87 -2.07729828 1.06632213 88 -4.60023088 -2.07729828 89 -0.16505554 -4.60023088 90 -4.03042144 -0.16505554 91 1.75974680 -4.03042144 92 -2.66172126 1.75974680 93 0.10349547 -2.66172126 94 -3.53476857 0.10349547 95 2.79615981 -3.53476857 96 1.84381035 2.79615981 97 0.60851561 1.84381035 98 2.09497253 0.60851561 99 -3.04305276 2.09497253 100 2.24092258 -3.04305276 101 1.98084133 2.24092258 102 -0.60581383 1.98084133 103 -0.09019063 -0.60581383 104 -3.38941533 -0.09019063 105 6.75928785 -3.38941533 106 2.06993393 6.75928785 107 4.45213839 2.06993393 108 1.13055459 4.45213839 109 6.08270838 1.13055459 110 -5.15215491 6.08270838 111 -3.23440922 -5.15215491 112 -5.30126609 -3.23440922 113 -1.41821779 -5.30126609 114 2.74164574 -1.41821779 115 2.32766285 2.74164574 116 -2.72416837 2.32766285 117 -2.37369262 -2.72416837 118 -0.84688562 -2.37369262 119 2.89087458 -0.84688562 120 -2.09938314 2.89087458 121 -1.43782708 -2.09938314 122 2.08893287 -1.43782708 123 1.35880869 2.08893287 124 0.08301525 1.35880869 125 -3.25421763 0.08301525 126 4.21153502 -3.25421763 127 7.11632636 4.21153502 128 -3.21376986 7.11632636 129 1.45462995 -3.21376986 130 -3.19209300 1.45462995 131 -4.33698183 -3.19209300 132 3.93788908 -4.33698183 133 -5.07300093 3.93788908 134 0.81454616 -5.07300093 135 -1.08991908 0.81454616 136 -2.19504516 -1.08991908 137 -0.82432686 -2.19504516 138 -3.06313047 -0.82432686 139 1.39159774 -3.06313047 140 -2.28265636 1.39159774 141 -3.67177430 -2.28265636 142 -4.87534034 -3.67177430 143 -4.70544645 -4.87534034 144 -0.62680662 -4.70544645 145 7.39616785 -0.62680662 146 -1.27663045 7.39616785 147 1.17553668 -1.27663045 148 -2.14040772 1.17553668 149 2.05476512 -2.14040772 150 3.08337898 2.05476512 151 7.08167163 3.08337898 152 -3.33911513 7.08167163 153 -2.49956151 -3.33911513 154 1.15164739 -2.49956151 155 1.30592954 1.15164739 156 1.75974680 1.30592954 157 -3.21342882 1.75974680 158 -2.52857805 -3.21342882 159 0.26986427 -2.52857805 160 -1.74234186 0.26986427 161 -0.52025302 -1.74234186 162 NA -0.52025302 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 4.21038932 5.52229897 [2,] -5.16996668 4.21038932 [3,] -3.60711890 -5.16996668 [4,] -1.48354501 -3.60711890 [5,] 2.18964808 -1.48354501 [6,] 3.96459499 2.18964808 [7,] -0.50477067 3.96459499 [8,] 1.86361754 -0.50477067 [9,] -0.02107686 1.86361754 [10,] 3.91069126 -0.02107686 [11,] 1.23361040 3.91069126 [12,] 3.26045944 1.23361040 [13,] 2.89423752 3.26045944 [14,] -2.72189192 2.89423752 [15,] -2.66259487 -2.72189192 [16,] 1.43610491 -2.66259487 [17,] -0.11408630 1.43610491 [18,] 2.06650953 -0.11408630 [19,] -1.82480076 2.06650953 [20,] -3.43647129 -1.82480076 [21,] -2.77719996 -3.43647129 [22,] 2.27012530 -2.77719996 [23,] 0.14996273 2.27012530 [24,] 3.39254006 0.14996273 [25,] 6.79936361 3.39254006 [26,] -0.13368184 6.79936361 [27,] -1.86328014 -0.13368184 [28,] -1.10845361 -1.86328014 [29,] -0.35328963 -1.10845361 [30,] -1.73140960 -0.35328963 [31,] -6.71521299 -1.73140960 [32,] 3.88813251 -6.71521299 [33,] -1.54249153 3.88813251 [34,] 1.44267044 -1.54249153 [35,] -0.70547192 1.44267044 [36,] -3.62799659 -0.70547192 [37,] 2.29228537 -3.62799659 [38,] -4.80095761 2.29228537 [39,] -0.19209300 -4.80095761 [40,] 2.01670322 -0.19209300 [41,] -0.17941194 2.01670322 [42,] 2.21319061 -0.17941194 [43,] 0.57185374 2.21319061 [44,] 6.33794408 0.57185374 [45,] 4.19667922 6.33794408 [46,] 2.55948448 4.19667922 [47,] -1.93751470 2.55948448 [48,] -0.86581093 -1.93751470 [49,] 4.80050811 -0.86581093 [50,] -3.71604793 4.80050811 [51,] -1.50233108 -3.71604793 [52,] -0.71919801 -1.50233108 [53,] -1.54652627 -0.71919801 [54,] -0.31124393 -1.54652627 [55,] 3.15971689 -0.31124393 [56,] 4.45818028 3.15971689 [57,] -5.46696309 4.45818028 [58,] 1.96687691 -5.46696309 [59,] 0.49779709 1.96687691 [60,] -1.35160497 0.49779709 [61,] 2.70920722 -1.35160497 [62,] -0.95142818 2.70920722 [63,] -3.87662249 -0.95142818 [64,] 0.60856535 -3.87662249 [65,] -0.67119973 0.60856535 [66,] 1.04467353 -0.67119973 [67,] -2.84017295 1.04467353 [68,] 3.07496845 -2.84017295 [69,] -1.51603447 3.07496845 [70,] 4.15017439 -1.51603447 [71,] -4.41667237 4.15017439 [72,] -2.68879090 -4.41667237 [73,] 0.30583901 -2.68879090 [74,] 1.21877357 0.30583901 [75,] 4.77219329 1.21877357 [76,] 1.43770007 4.77219329 [77,] -0.05681806 1.43770007 [78,] -5.33134243 -0.05681806 [79,] 4.21877357 -5.33134243 [80,] -2.47233318 4.21877357 [81,] -0.64238899 -2.47233318 [82,] -0.54249153 -0.64238899 [83,] 2.18769187 -0.54249153 [84,] -2.25232288 2.18769187 [85,] -0.57638772 -2.25232288 [86,] 1.06632213 -0.57638772 [87,] -2.07729828 1.06632213 [88,] -4.60023088 -2.07729828 [89,] -0.16505554 -4.60023088 [90,] -4.03042144 -0.16505554 [91,] 1.75974680 -4.03042144 [92,] -2.66172126 1.75974680 [93,] 0.10349547 -2.66172126 [94,] -3.53476857 0.10349547 [95,] 2.79615981 -3.53476857 [96,] 1.84381035 2.79615981 [97,] 0.60851561 1.84381035 [98,] 2.09497253 0.60851561 [99,] -3.04305276 2.09497253 [100,] 2.24092258 -3.04305276 [101,] 1.98084133 2.24092258 [102,] -0.60581383 1.98084133 [103,] -0.09019063 -0.60581383 [104,] -3.38941533 -0.09019063 [105,] 6.75928785 -3.38941533 [106,] 2.06993393 6.75928785 [107,] 4.45213839 2.06993393 [108,] 1.13055459 4.45213839 [109,] 6.08270838 1.13055459 [110,] -5.15215491 6.08270838 [111,] -3.23440922 -5.15215491 [112,] -5.30126609 -3.23440922 [113,] -1.41821779 -5.30126609 [114,] 2.74164574 -1.41821779 [115,] 2.32766285 2.74164574 [116,] -2.72416837 2.32766285 [117,] -2.37369262 -2.72416837 [118,] -0.84688562 -2.37369262 [119,] 2.89087458 -0.84688562 [120,] -2.09938314 2.89087458 [121,] -1.43782708 -2.09938314 [122,] 2.08893287 -1.43782708 [123,] 1.35880869 2.08893287 [124,] 0.08301525 1.35880869 [125,] -3.25421763 0.08301525 [126,] 4.21153502 -3.25421763 [127,] 7.11632636 4.21153502 [128,] -3.21376986 7.11632636 [129,] 1.45462995 -3.21376986 [130,] -3.19209300 1.45462995 [131,] -4.33698183 -3.19209300 [132,] 3.93788908 -4.33698183 [133,] -5.07300093 3.93788908 [134,] 0.81454616 -5.07300093 [135,] -1.08991908 0.81454616 [136,] -2.19504516 -1.08991908 [137,] -0.82432686 -2.19504516 [138,] -3.06313047 -0.82432686 [139,] 1.39159774 -3.06313047 [140,] -2.28265636 1.39159774 [141,] -3.67177430 -2.28265636 [142,] -4.87534034 -3.67177430 [143,] -4.70544645 -4.87534034 [144,] -0.62680662 -4.70544645 [145,] 7.39616785 -0.62680662 [146,] -1.27663045 7.39616785 [147,] 1.17553668 -1.27663045 [148,] -2.14040772 1.17553668 [149,] 2.05476512 -2.14040772 [150,] 3.08337898 2.05476512 [151,] 7.08167163 3.08337898 [152,] -3.33911513 7.08167163 [153,] -2.49956151 -3.33911513 [154,] 1.15164739 -2.49956151 [155,] 1.30592954 1.15164739 [156,] 1.75974680 1.30592954 [157,] -3.21342882 1.75974680 [158,] -2.52857805 -3.21342882 [159,] 0.26986427 -2.52857805 [160,] -1.74234186 0.26986427 [161,] -0.52025302 -1.74234186 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 4.21038932 5.52229897 2 -5.16996668 4.21038932 3 -3.60711890 -5.16996668 4 -1.48354501 -3.60711890 5 2.18964808 -1.48354501 6 3.96459499 2.18964808 7 -0.50477067 3.96459499 8 1.86361754 -0.50477067 9 -0.02107686 1.86361754 10 3.91069126 -0.02107686 11 1.23361040 3.91069126 12 3.26045944 1.23361040 13 2.89423752 3.26045944 14 -2.72189192 2.89423752 15 -2.66259487 -2.72189192 16 1.43610491 -2.66259487 17 -0.11408630 1.43610491 18 2.06650953 -0.11408630 19 -1.82480076 2.06650953 20 -3.43647129 -1.82480076 21 -2.77719996 -3.43647129 22 2.27012530 -2.77719996 23 0.14996273 2.27012530 24 3.39254006 0.14996273 25 6.79936361 3.39254006 26 -0.13368184 6.79936361 27 -1.86328014 -0.13368184 28 -1.10845361 -1.86328014 29 -0.35328963 -1.10845361 30 -1.73140960 -0.35328963 31 -6.71521299 -1.73140960 32 3.88813251 -6.71521299 33 -1.54249153 3.88813251 34 1.44267044 -1.54249153 35 -0.70547192 1.44267044 36 -3.62799659 -0.70547192 37 2.29228537 -3.62799659 38 -4.80095761 2.29228537 39 -0.19209300 -4.80095761 40 2.01670322 -0.19209300 41 -0.17941194 2.01670322 42 2.21319061 -0.17941194 43 0.57185374 2.21319061 44 6.33794408 0.57185374 45 4.19667922 6.33794408 46 2.55948448 4.19667922 47 -1.93751470 2.55948448 48 -0.86581093 -1.93751470 49 4.80050811 -0.86581093 50 -3.71604793 4.80050811 51 -1.50233108 -3.71604793 52 -0.71919801 -1.50233108 53 -1.54652627 -0.71919801 54 -0.31124393 -1.54652627 55 3.15971689 -0.31124393 56 4.45818028 3.15971689 57 -5.46696309 4.45818028 58 1.96687691 -5.46696309 59 0.49779709 1.96687691 60 -1.35160497 0.49779709 61 2.70920722 -1.35160497 62 -0.95142818 2.70920722 63 -3.87662249 -0.95142818 64 0.60856535 -3.87662249 65 -0.67119973 0.60856535 66 1.04467353 -0.67119973 67 -2.84017295 1.04467353 68 3.07496845 -2.84017295 69 -1.51603447 3.07496845 70 4.15017439 -1.51603447 71 -4.41667237 4.15017439 72 -2.68879090 -4.41667237 73 0.30583901 -2.68879090 74 1.21877357 0.30583901 75 4.77219329 1.21877357 76 1.43770007 4.77219329 77 -0.05681806 1.43770007 78 -5.33134243 -0.05681806 79 4.21877357 -5.33134243 80 -2.47233318 4.21877357 81 -0.64238899 -2.47233318 82 -0.54249153 -0.64238899 83 2.18769187 -0.54249153 84 -2.25232288 2.18769187 85 -0.57638772 -2.25232288 86 1.06632213 -0.57638772 87 -2.07729828 1.06632213 88 -4.60023088 -2.07729828 89 -0.16505554 -4.60023088 90 -4.03042144 -0.16505554 91 1.75974680 -4.03042144 92 -2.66172126 1.75974680 93 0.10349547 -2.66172126 94 -3.53476857 0.10349547 95 2.79615981 -3.53476857 96 1.84381035 2.79615981 97 0.60851561 1.84381035 98 2.09497253 0.60851561 99 -3.04305276 2.09497253 100 2.24092258 -3.04305276 101 1.98084133 2.24092258 102 -0.60581383 1.98084133 103 -0.09019063 -0.60581383 104 -3.38941533 -0.09019063 105 6.75928785 -3.38941533 106 2.06993393 6.75928785 107 4.45213839 2.06993393 108 1.13055459 4.45213839 109 6.08270838 1.13055459 110 -5.15215491 6.08270838 111 -3.23440922 -5.15215491 112 -5.30126609 -3.23440922 113 -1.41821779 -5.30126609 114 2.74164574 -1.41821779 115 2.32766285 2.74164574 116 -2.72416837 2.32766285 117 -2.37369262 -2.72416837 118 -0.84688562 -2.37369262 119 2.89087458 -0.84688562 120 -2.09938314 2.89087458 121 -1.43782708 -2.09938314 122 2.08893287 -1.43782708 123 1.35880869 2.08893287 124 0.08301525 1.35880869 125 -3.25421763 0.08301525 126 4.21153502 -3.25421763 127 7.11632636 4.21153502 128 -3.21376986 7.11632636 129 1.45462995 -3.21376986 130 -3.19209300 1.45462995 131 -4.33698183 -3.19209300 132 3.93788908 -4.33698183 133 -5.07300093 3.93788908 134 0.81454616 -5.07300093 135 -1.08991908 0.81454616 136 -2.19504516 -1.08991908 137 -0.82432686 -2.19504516 138 -3.06313047 -0.82432686 139 1.39159774 -3.06313047 140 -2.28265636 1.39159774 141 -3.67177430 -2.28265636 142 -4.87534034 -3.67177430 143 -4.70544645 -4.87534034 144 -0.62680662 -4.70544645 145 7.39616785 -0.62680662 146 -1.27663045 7.39616785 147 1.17553668 -1.27663045 148 -2.14040772 1.17553668 149 2.05476512 -2.14040772 150 3.08337898 2.05476512 151 7.08167163 3.08337898 152 -3.33911513 7.08167163 153 -2.49956151 -3.33911513 154 1.15164739 -2.49956151 155 1.30592954 1.15164739 156 1.75974680 1.30592954 157 -3.21342882 1.75974680 158 -2.52857805 -3.21342882 159 0.26986427 -2.52857805 160 -1.74234186 0.26986427 161 -0.52025302 -1.74234186 > plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals') > lines(lowess(z)) > abline(lm(z)) > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/7zy1h1323961823.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/8fhj71323961823.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/9xdpv1323961823.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/rcomp/tmp/1007gx1323961823.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) > a<-table.row.end(a) > myeq <- colnames(x)[1] > myeq <- paste(myeq, '[t] = ', sep='') > for (i in 1:k){ + if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') + myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ') + if (rownames(mysum$coefficients)[i] != '(Intercept)') { + myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') + if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') + } + } > myeq <- paste(myeq, ' + e[t]') > a<-table.row.start(a) > a<-table.element(a, myeq) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/11w6jr1323961823.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Variable',header=TRUE) > a<-table.element(a,'Parameter',header=TRUE) > a<-table.element(a,'S.D.',header=TRUE) > a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE) > a<-table.element(a,'2-tail p-value',header=TRUE) > a<-table.element(a,'1-tail p-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:k){ + a<-table.row.start(a) + a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE) + a<-table.element(a,mysum$coefficients[i,1]) + a<-table.element(a, round(mysum$coefficients[i,2],6)) + a<-table.element(a, round(mysum$coefficients[i,3],4)) + a<-table.element(a, round(mysum$coefficients[i,4],6)) + a<-table.element(a, round(mysum$coefficients[i,4]/2,6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/12scug1323961823.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple R',1,TRUE) > a<-table.element(a, sqrt(mysum$r.squared)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'R-squared',1,TRUE) > a<-table.element(a, mysum$r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Adjusted R-squared',1,TRUE) > a<-table.element(a, mysum$adj.r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (value)',1,TRUE) > a<-table.element(a, mysum$fstatistic[1]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'p-value',1,TRUE) > a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3])) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Residual Standard Deviation',1,TRUE) > a<-table.element(a, mysum$sigma) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Sum Squared Residuals',1,TRUE) > a<-table.element(a, sum(myerror*myerror)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/13goon1323961823.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Time or Index', 1, TRUE) > a<-table.element(a, 'Actuals', 1, TRUE) > a<-table.element(a, 'Interpolation
Forecast', 1, TRUE) > a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE) > a<-table.row.end(a) > for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,i, 1, TRUE) + a<-table.element(a,x[i]) + a<-table.element(a,x[i]-mysum$resid[i]) + a<-table.element(a,mysum$resid[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/14ecke1323961823.tab") > if (n > n25) { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'p-values',header=TRUE) + a<-table.element(a,'Alternative Hypothesis',3,header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'breakpoint index',header=TRUE) + a<-table.element(a,'greater',header=TRUE) + a<-table.element(a,'2-sided',header=TRUE) + a<-table.element(a,'less',header=TRUE) + a<-table.row.end(a) + for (mypoint in kp3:nmkm3) { + a<-table.row.start(a) + a<-table.element(a,mypoint,header=TRUE) + a<-table.element(a,gqarr[mypoint-kp3+1,1]) + a<-table.element(a,gqarr[mypoint-kp3+1,2]) + a<-table.element(a,gqarr[mypoint-kp3+1,3]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/www/rcomp/tmp/15blvq1323961823.tab") + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Description',header=TRUE) + a<-table.element(a,'# significant tests',header=TRUE) + a<-table.element(a,'% significant tests',header=TRUE) + a<-table.element(a,'OK/NOK',header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'1% type I error level',header=TRUE) + a<-table.element(a,numsignificant1) + a<-table.element(a,numsignificant1/numgqtests) + if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'5% type I error level',header=TRUE) + a<-table.element(a,numsignificant5) + a<-table.element(a,numsignificant5/numgqtests) + if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'10% type I error level',header=TRUE) + a<-table.element(a,numsignificant10) + a<-table.element(a,numsignificant10/numgqtests) + if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/www/rcomp/tmp/163fx11323961823.tab") + } > > try(system("convert tmp/1sfth1323961823.ps tmp/1sfth1323961823.png",intern=TRUE)) character(0) > try(system("convert tmp/2xmhl1323961823.ps tmp/2xmhl1323961823.png",intern=TRUE)) character(0) > try(system("convert tmp/3xpqm1323961823.ps tmp/3xpqm1323961823.png",intern=TRUE)) character(0) > try(system("convert tmp/4ult31323961823.ps tmp/4ult31323961823.png",intern=TRUE)) character(0) > try(system("convert tmp/5n3t81323961823.ps tmp/5n3t81323961823.png",intern=TRUE)) character(0) > try(system("convert tmp/67qow1323961823.ps tmp/67qow1323961823.png",intern=TRUE)) character(0) > try(system("convert tmp/7zy1h1323961823.ps tmp/7zy1h1323961823.png",intern=TRUE)) character(0) > try(system("convert tmp/8fhj71323961823.ps tmp/8fhj71323961823.png",intern=TRUE)) character(0) > try(system("convert tmp/9xdpv1323961823.ps tmp/9xdpv1323961823.png",intern=TRUE)) character(0) > try(system("convert tmp/1007gx1323961823.ps tmp/1007gx1323961823.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.380 0.350 5.742