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(162687 + ,0 + ,48 + ,21 + ,20465 + ,23975 + ,39 + ,201906 + ,1 + ,58 + ,20 + ,33629 + ,85634 + ,46 + ,7215 + ,0 + ,0 + ,0 + ,1423 + ,1929 + ,0 + ,146367 + ,0 + ,67 + ,27 + ,25629 + ,36294 + ,54 + ,257045 + ,0 + ,83 + ,31 + ,54002 + ,72255 + ,93 + ,524450 + ,1 + ,136 + ,36 + ,151036 + ,189748 + ,198 + ,188294 + ,1 + ,65 + ,23 + ,33287 + ,61834 + ,42 + ,195674 + ,0 + ,86 + ,30 + ,31172 + ,68167 + ,59 + ,177020 + ,0 + ,62 + ,30 + ,28113 + ,38462 + ,49 + ,325899 + ,1 + ,71 + ,27 + ,57803 + ,101219 + ,83 + ,121844 + ,2 + ,50 + ,24 + ,49830 + ,43270 + ,49 + ,203938 + ,0 + ,88 + ,30 + ,52143 + ,76183 + ,83 + ,113213 + ,0 + ,61 + ,22 + ,21055 + ,31476 + ,39 + ,220751 + ,4 + ,79 + ,28 + ,47007 + ,62157 + ,93 + ,172905 + ,4 + ,56 + ,18 + ,28735 + ,46261 + ,31 + ,156326 + ,3 + ,54 + ,22 + ,59147 + ,50063 + ,29 + ,145178 + ,0 + ,81 + ,37 + ,78950 + ,64483 + ,104 + ,89171 + ,5 + ,13 + ,15 + ,13497 + ,2341 + ,2 + ,172624 + ,0 + ,74 + ,34 + ,46154 + ,48149 + ,46 + ,39790 + ,0 + ,18 + ,18 + ,53249 + ,12743 + ,27 + ,87927 + ,0 + ,31 + ,15 + ,10726 + ,18743 + ,16 + ,241285 + ,0 + ,99 + ,30 + ,83700 + ,97057 + ,108 + ,195820 + ,1 + ,38 + ,25 + ,40400 + ,17675 + ,36 + ,146946 + ,1 + ,59 + ,34 + ,33797 + ,33106 + ,33 + ,159763 + ,1 + ,54 + ,21 + ,36205 + ,53311 + ,46 + ,207078 + ,0 + ,63 + ,21 + ,30165 + ,42754 + ,65 + ,212394 + ,0 + ,66 + ,25 + ,58534 + ,59056 + ,80 + ,201536 + ,0 + ,90 + ,31 + ,44663 + ,101621 + ,81 + ,394662 + ,0 + ,72 + ,31 + ,92556 + ,118120 + ,69 + ,217892 + ,0 + ,61 + ,20 + ,40078 + ,79572 + ,69 + ,182286 + ,0 + ,61 + ,28 + ,34711 + ,42744 + ,37 + ,181740 + ,2 + ,61 + ,22 + ,31076 + ,65931 + ,45 + ,137978 + ,4 + ,53 + ,17 + ,74608 + ,38575 + ,62 + ,255929 + ,0 + ,118 + ,25 + ,58092 + ,28795 + ,33 + ,236489 + ,1 + ,73 + ,25 + ,42009 + ,94440 + ,77 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,230761 + ,0 + ,54 + ,31 + ,36022 + ,38229 + ,34 + ,132807 + ,3 + ,54 + ,14 + ,23333 + ,31972 + ,44 + ,157118 + ,9 + ,46 + ,35 + ,53349 + ,40071 + ,43 + ,253254 + ,0 + ,83 + ,34 + ,92596 + ,132480 + ,117 + ,269329 + ,2 + ,106 + ,22 + ,49598 + ,62797 + ,125 + ,161273 + ,0 + ,44 + ,34 + ,44093 + ,40429 + ,49 + ,107181 + ,2 + ,27 + ,23 + ,84205 + ,45545 + ,76 + ,195891 + ,1 + ,64 + ,24 + ,63369 + ,57568 + ,81 + ,139667 + ,2 + ,71 + ,26 + ,60132 + ,39019 + ,111 + ,171101 + ,2 + ,44 + ,23 + ,37403 + ,53866 + ,61 + ,81407 + ,1 + ,23 + ,35 + ,24460 + ,38345 + ,56 + ,247563 + ,0 + ,78 + ,24 + ,46456 + ,50210 + ,54 + ,239807 + ,1 + ,60 + ,31 + ,66616 + ,80947 + ,47 + ,172743 + ,8 + ,73 + ,30 + ,41554 + ,43461 + ,55 + ,48188 + ,0 + ,12 + ,22 + ,22346 + ,14812 + ,14 + ,169355 + ,0 + ,104 + ,23 + ,30874 + ,37819 + ,44 + ,315622 + ,0 + ,83 + ,27 + ,68701 + ,102738 + ,115 + ,241518 + ,0 + ,57 + ,30 + ,35728 + ,54509 + ,57 + ,195583 + ,1 + ,67 + ,33 + ,29010 + ,62956 + ,48 + ,159913 + ,8 + ,44 + ,12 + ,23110 + ,55411 + ,40 + ,220241 + ,0 + ,53 + ,26 + ,38844 + ,50611 + ,51 + ,101694 + ,1 + ,26 + ,26 + ,27084 + ,26692 + ,32 + ,157258 + ,0 + ,67 + ,23 + ,35139 + ,60056 + ,36 + ,202536 + ,10 + ,36 + ,38 + ,57476 + ,25155 + ,47 + ,173505 + ,6 + ,56 + ,32 + ,33277 + ,42840 + ,51 + ,150518 + ,0 + ,52 + ,21 + ,31141 + ,39358 + ,37 + ,141491 + ,11 + ,54 + ,22 + ,61281 + ,47241 + ,52 + ,125612 + ,3 + ,57 + ,26 + ,25820 + ,49611 + ,42 + ,166049 + ,0 + ,27 + ,28 + ,23284 + ,41833 + ,11 + ,124197 + ,0 + ,58 + ,33 + ,35378 + ,48930 + ,47 + ,195043 + ,8 + ,76 + ,36 + ,74990 + ,110600 + ,59 + ,138708 + ,2 + ,93 + ,25 + ,29653 + ,52235 + ,82 + ,116552 + ,0 + ,59 + ,25 + ,64622 + ,53986 + ,49 + ,31970 + ,0 + ,5 + ,21 + ,4157 + ,4105 + ,6 + ,258158 + ,3 + ,57 + ,19 + ,29245 + ,59331 + ,83 + ,151184 + ,1 + ,42 + ,12 + ,50008 + ,47796 + ,56 + ,135926 + ,2 + ,88 + ,30 + ,52338 + ,38302 + ,114 + ,119629 + ,1 + ,53 + ,21 + ,13310 + ,14063 + ,46 + ,171518 + ,0 + ,81 + ,39 + ,92901 + ,54414 + ,46 + ,108949 + ,2 + ,35 + ,32 + ,10956 + ,9903 + ,2 + ,183471 + ,1 + ,102 + ,28 + ,34241 + ,53987 + ,51 + ,159966 + ,0 + ,71 + ,29 + ,75043 + ,88937 + ,96 + ,93786 + ,0 + ,28 + ,21 + ,21152 + ,21928 + ,20 + ,84971 + ,0 + ,34 + ,31 + ,42249 + ,29487 + ,57 + ,88882 + ,0 + ,54 + ,26 + ,42005 + ,35334 + ,49 + ,304603 + ,0 + ,49 + ,29 + ,41152 + ,57596 + ,51 + ,75101 + ,1 + ,30 + ,23 + ,14399 + ,29750 + ,40 + ,145043 + ,0 + ,57 + ,25 + ,28263 + ,41029 + ,40 + ,95827 + ,0 + ,54 + ,22 + ,17215 + ,12416 + ,36 + ,173924 + ,0 + ,38 + ,26 + ,48140 + ,51158 + ,64 + ,241957 + ,0 + ,63 + ,33 + ,62897 + ,79935 + ,117 + ,115367 + ,0 + ,58 + ,24 + ,22883 + ,26552 + ,40 + ,118408 + ,7 + ,46 + ,24 + ,41622 + ,25807 + ,46 + ,164078 + ,0 + ,46 + ,21 + ,40715 + ,50620 + ,61 + ,158931 + ,5 + ,51 + ,28 + ,65897 + ,61467 + ,59 + ,184139 + ,1 + ,87 + ,28 + ,76542 + ,65292 + ,94 + ,152856 + ,0 + ,39 + ,25 + ,37477 + ,55516 + ,36 + ,144014 + ,0 + ,28 + ,15 + ,53216 + ,42006 + ,51 + ,62535 + ,0 + ,26 + ,13 + ,40911 + ,26273 + ,39 + ,245196 + ,0 + ,52 + ,36 + ,57021 + ,90248 + ,62 + ,199841 + ,0 + ,96 + ,27 + ,73116 + ,61476 + ,79 + ,19349 + ,0 + ,13 + ,1 + ,3895 + ,9604 + ,14 + ,247280 + ,3 + ,43 + ,24 + ,46609 + ,45108 + ,45 + ,159408 + ,0 + ,42 + ,31 + ,29351 + ,47232 + ,43 + ,72128 + ,0 + ,30 + ,4 + ,2325 + ,3439 + ,8 + ,104253 + ,0 + ,59 + ,21 + ,31747 + ,30553 + ,41 + ,151090 + ,0 + ,73 + ,27 + ,32665 + ,24751 + ,25 + ,137382 + ,1 + ,39 + ,23 + ,19249 + ,34458 + ,22 + ,87448 + ,1 + ,36 + ,12 + ,15292 + ,24649 + ,18 + ,27676 + ,0 + ,2 + ,16 + ,5842 + ,2342 + ,3 + ,165507 + ,0 + ,102 + ,29 + ,33994 + ,52739 + ,54 + ,132148 + ,1 + ,30 + ,26 + ,13018 + ,6245 + ,6 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,95778 + ,0 + ,46 + ,25 + ,98177 + ,35381 + ,50 + ,109001 + ,0 + ,25 + ,21 + ,37941 + ,19595 + ,33 + ,158833 + ,0 + ,59 + ,24 + ,31032 + ,50848 + ,54 + ,147690 + ,1 + ,60 + ,21 + ,32683 + ,39443 + ,63 + ,89887 + ,0 + ,36 + ,21 + ,34545 + ,27023 + ,56 + ,3616 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,199005 + ,0 + ,45 + ,23 + ,27525 + ,61022 + ,49 + ,160930 + ,0 + ,79 + ,33 + ,66856 + ,63528 + ,90 + ,177948 + ,2 + ,30 + ,32 + ,28549 + ,34835 + ,51 + ,136061 + ,0 + ,43 + ,23 + ,38610 + ,37172 + ,29 + ,43410 + ,0 + ,7 + ,1 + ,2781 + ,13 + ,1 + ,184277 + ,1 + ,80 + ,29 + ,41211 + ,62548 + ,68 + ,108858 + ,0 + ,32 + ,20 + ,22698 + ,31334 + ,29 + ,141744 + ,8 + ,81 + ,33 + ,41194 + ,20839 + ,27 + ,60493 + ,3 + ,3 + ,12 + ,32689 + ,5084 + ,4 + ,19764 + ,1 + ,10 + ,2 + ,5752 + ,9927 + ,10 + ,177559 + ,3 + ,47 + ,21 + ,26757 + ,53229 + ,47 + ,140281 + ,0 + ,35 + ,28 + ,22527 + ,29877 + ,44 + ,164249 + ,0 + ,54 + ,35 + ,44810 + ,37310 + ,53 + ,11796 + ,0 + ,1 + ,2 + ,0 + ,0 + ,0 + ,10674 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,151322 + ,0 + ,46 + ,18 + ,100674 + ,50067 + ,40 + ,6836 + ,0 + ,0 + ,1 + ,0 + ,0 + ,0 + ,174712 + ,6 + ,51 + ,21 + ,57786 + ,47708 + ,57 + ,5118 + ,0 + ,5 + ,0 + ,0 + ,0 + ,0 + ,40248 + ,1 + ,8 + ,4 + ,5444 + ,6012 + ,6 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,127628 + ,0 + ,38 + ,29 + ,28470 + ,27749 + ,24 + ,88837 + ,0 + ,21 + ,26 + ,61849 + ,47555 + ,34 + ,7131 + ,1 + ,0 + ,0 + ,0 + ,0 + ,0 + ,9056 + ,0 + ,0 + ,4 + ,2179 + ,1336 + ,10 + ,87957 + ,1 + ,18 + ,19 + ,8019 + ,11017 + ,16 + ,144470 + ,0 + ,53 + ,22 + ,39644 + ,55184 + ,93 + ,111408 + ,1 + ,17 + ,22 + ,23494 + ,43485 + ,28) + ,dim=c(7 + ,144) + ,dimnames=list(c('timeRFC' + ,'compshared' + ,'blogged' + ,'reviewedcomp' + ,'characters' + ,'seconds' + ,'inclhyperlinks') + ,1:144)) > y <- array(NA,dim=c(7,144),dimnames=list(c('timeRFC','compshared','blogged','reviewedcomp','characters','seconds','inclhyperlinks'),1:144)) > 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 = '1' > 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 timeRFC compshared blogged reviewedcomp characters seconds inclhyperlinks 1 162687 0 48 21 20465 23975 39 2 201906 1 58 20 33629 85634 46 3 7215 0 0 0 1423 1929 0 4 146367 0 67 27 25629 36294 54 5 257045 0 83 31 54002 72255 93 6 524450 1 136 36 151036 189748 198 7 188294 1 65 23 33287 61834 42 8 195674 0 86 30 31172 68167 59 9 177020 0 62 30 28113 38462 49 10 325899 1 71 27 57803 101219 83 11 121844 2 50 24 49830 43270 49 12 203938 0 88 30 52143 76183 83 13 113213 0 61 22 21055 31476 39 14 220751 4 79 28 47007 62157 93 15 172905 4 56 18 28735 46261 31 16 156326 3 54 22 59147 50063 29 17 145178 0 81 37 78950 64483 104 18 89171 5 13 15 13497 2341 2 19 172624 0 74 34 46154 48149 46 20 39790 0 18 18 53249 12743 27 21 87927 0 31 15 10726 18743 16 22 241285 0 99 30 83700 97057 108 23 195820 1 38 25 40400 17675 36 24 146946 1 59 34 33797 33106 33 25 159763 1 54 21 36205 53311 46 26 207078 0 63 21 30165 42754 65 27 212394 0 66 25 58534 59056 80 28 201536 0 90 31 44663 101621 81 29 394662 0 72 31 92556 118120 69 30 217892 0 61 20 40078 79572 69 31 182286 0 61 28 34711 42744 37 32 181740 2 61 22 31076 65931 45 33 137978 4 53 17 74608 38575 62 34 255929 0 118 25 58092 28795 33 35 236489 1 73 25 42009 94440 77 36 0 0 0 0 0 0 0 37 230761 0 54 31 36022 38229 34 38 132807 3 54 14 23333 31972 44 39 157118 9 46 35 53349 40071 43 40 253254 0 83 34 92596 132480 117 41 269329 2 106 22 49598 62797 125 42 161273 0 44 34 44093 40429 49 43 107181 2 27 23 84205 45545 76 44 195891 1 64 24 63369 57568 81 45 139667 2 71 26 60132 39019 111 46 171101 2 44 23 37403 53866 61 47 81407 1 23 35 24460 38345 56 48 247563 0 78 24 46456 50210 54 49 239807 1 60 31 66616 80947 47 50 172743 8 73 30 41554 43461 55 51 48188 0 12 22 22346 14812 14 52 169355 0 104 23 30874 37819 44 53 315622 0 83 27 68701 102738 115 54 241518 0 57 30 35728 54509 57 55 195583 1 67 33 29010 62956 48 56 159913 8 44 12 23110 55411 40 57 220241 0 53 26 38844 50611 51 58 101694 1 26 26 27084 26692 32 59 157258 0 67 23 35139 60056 36 60 202536 10 36 38 57476 25155 47 61 173505 6 56 32 33277 42840 51 62 150518 0 52 21 31141 39358 37 63 141491 11 54 22 61281 47241 52 64 125612 3 57 26 25820 49611 42 65 166049 0 27 28 23284 41833 11 66 124197 0 58 33 35378 48930 47 67 195043 8 76 36 74990 110600 59 68 138708 2 93 25 29653 52235 82 69 116552 0 59 25 64622 53986 49 70 31970 0 5 21 4157 4105 6 71 258158 3 57 19 29245 59331 83 72 151184 1 42 12 50008 47796 56 73 135926 2 88 30 52338 38302 114 74 119629 1 53 21 13310 14063 46 75 171518 0 81 39 92901 54414 46 76 108949 2 35 32 10956 9903 2 77 183471 1 102 28 34241 53987 51 78 159966 0 71 29 75043 88937 96 79 93786 0 28 21 21152 21928 20 80 84971 0 34 31 42249 29487 57 81 88882 0 54 26 42005 35334 49 82 304603 0 49 29 41152 57596 51 83 75101 1 30 23 14399 29750 40 84 145043 0 57 25 28263 41029 40 85 95827 0 54 22 17215 12416 36 86 173924 0 38 26 48140 51158 64 87 241957 0 63 33 62897 79935 117 88 115367 0 58 24 22883 26552 40 89 118408 7 46 24 41622 25807 46 90 164078 0 46 21 40715 50620 61 91 158931 5 51 28 65897 61467 59 92 184139 1 87 28 76542 65292 94 93 152856 0 39 25 37477 55516 36 94 144014 0 28 15 53216 42006 51 95 62535 0 26 13 40911 26273 39 96 245196 0 52 36 57021 90248 62 97 199841 0 96 27 73116 61476 79 98 19349 0 13 1 3895 9604 14 99 247280 3 43 24 46609 45108 45 100 159408 0 42 31 29351 47232 43 101 72128 0 30 4 2325 3439 8 102 104253 0 59 21 31747 30553 41 103 151090 0 73 27 32665 24751 25 104 137382 1 39 23 19249 34458 22 105 87448 1 36 12 15292 24649 18 106 27676 0 2 16 5842 2342 3 107 165507 0 102 29 33994 52739 54 108 132148 1 30 26 13018 6245 6 109 0 0 0 0 0 0 0 110 95778 0 46 25 98177 35381 50 111 109001 0 25 21 37941 19595 33 112 158833 0 59 24 31032 50848 54 113 147690 1 60 21 32683 39443 63 114 89887 0 36 21 34545 27023 56 115 3616 0 0 0 0 0 0 116 0 0 0 0 0 0 0 117 199005 0 45 23 27525 61022 49 118 160930 0 79 33 66856 63528 90 119 177948 2 30 32 28549 34835 51 120 136061 0 43 23 38610 37172 29 121 43410 0 7 1 2781 13 1 122 184277 1 80 29 41211 62548 68 123 108858 0 32 20 22698 31334 29 124 141744 8 81 33 41194 20839 27 125 60493 3 3 12 32689 5084 4 126 19764 1 10 2 5752 9927 10 127 177559 3 47 21 26757 53229 47 128 140281 0 35 28 22527 29877 44 129 164249 0 54 35 44810 37310 53 130 11796 0 1 2 0 0 0 131 10674 0 0 0 0 0 0 132 151322 0 46 18 100674 50067 40 133 6836 0 0 1 0 0 0 134 174712 6 51 21 57786 47708 57 135 5118 0 5 0 0 0 0 136 40248 1 8 4 5444 6012 6 137 0 0 0 0 0 0 0 138 127628 0 38 29 28470 27749 24 139 88837 0 21 26 61849 47555 34 140 7131 1 0 0 0 0 0 141 9056 0 0 4 2179 1336 10 142 87957 1 18 19 8019 11017 16 143 144470 0 53 22 39644 55184 93 144 111408 1 17 22 23494 43485 28 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) compshared blogged reviewedcomp characters 1.537e+04 1.234e+03 7.289e+02 1.278e+03 -9.199e-02 seconds inclhyperlinks 1.628e+00 -2.288e+01 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -103418 -21820 -6511 16828 127631 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1.537e+04 8.162e+03 1.883 0.061820 . compshared 1.234e+03 1.475e+03 0.836 0.404359 blogged 7.289e+02 1.999e+02 3.646 0.000377 *** reviewedcomp 1.278e+03 4.774e+02 2.678 0.008310 ** characters -9.199e-02 2.182e-01 -0.422 0.674014 seconds 1.628e+00 2.090e-01 7.789 1.5e-12 *** inclhyperlinks -2.288e+01 2.056e+02 -0.111 0.911545 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 38220 on 137 degrees of freedom Multiple R-squared: 0.7859, Adjusted R-squared: 0.7765 F-statistic: 83.81 on 6 and 137 DF, p-value: < 2.2e-16 > 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.3029745 6.059490e-01 6.970255e-01 [2,] 0.4199218 8.398436e-01 5.800782e-01 [3,] 0.4250234 8.500468e-01 5.749766e-01 [4,] 0.3048920 6.097839e-01 6.951080e-01 [5,] 0.2043245 4.086490e-01 7.956755e-01 [6,] 0.3557246 7.114491e-01 6.442754e-01 [7,] 0.2687489 5.374979e-01 7.312511e-01 [8,] 0.5710463 8.579075e-01 4.289537e-01 [9,] 0.5167519 9.664963e-01 4.832481e-01 [10,] 0.4550763 9.101526e-01 5.449237e-01 [11,] 0.3747470 7.494941e-01 6.252530e-01 [12,] 0.3004026 6.008053e-01 6.995974e-01 [13,] 0.2584315 5.168630e-01 7.415685e-01 [14,] 0.6868259 6.263482e-01 3.131741e-01 [15,] 0.6198839 7.602322e-01 3.801161e-01 [16,] 0.5547690 8.904620e-01 4.452310e-01 [17,] 0.6129857 7.740286e-01 3.870143e-01 [18,] 0.5672852 8.654296e-01 4.327148e-01 [19,] 0.7554412 4.891175e-01 2.445588e-01 [20,] 0.9303215 1.393571e-01 6.967854e-02 [21,] 0.9091621 1.816758e-01 9.083789e-02 [22,] 0.8944087 2.111826e-01 1.055913e-01 [23,] 0.8703364 2.593272e-01 1.296636e-01 [24,] 0.8374934 3.250132e-01 1.625066e-01 [25,] 0.9422555 1.154890e-01 5.774448e-02 [26,] 0.9246383 1.507234e-01 7.536172e-02 [27,] 0.9065355 1.869290e-01 9.346448e-02 [28,] 0.9534642 9.307159e-02 4.653580e-02 [29,] 0.9387431 1.225138e-01 6.125691e-02 [30,] 0.9228557 1.542887e-01 7.714435e-02 [31,] 0.9604762 7.904751e-02 3.952376e-02 [32,] 0.9669172 6.616565e-02 3.308283e-02 [33,] 0.9570191 8.596182e-02 4.298091e-02 [34,] 0.9506820 9.863601e-02 4.931801e-02 [35,] 0.9378759 1.242482e-01 6.212411e-02 [36,] 0.9239660 1.520680e-01 7.603400e-02 [37,] 0.9061487 1.877026e-01 9.385130e-02 [38,] 0.9153649 1.692702e-01 8.463512e-02 [39,] 0.9464734 1.070532e-01 5.352662e-02 [40,] 0.9344173 1.311653e-01 6.558265e-02 [41,] 0.9188661 1.622678e-01 8.113392e-02 [42,] 0.9071653 1.856693e-01 9.283467e-02 [43,] 0.9101898 1.796204e-01 8.981021e-02 [44,] 0.9303824 1.392353e-01 6.961764e-02 [45,] 0.9601755 7.964906e-02 3.982453e-02 [46,] 0.9482193 1.035614e-01 5.178068e-02 [47,] 0.9338013 1.323975e-01 6.619873e-02 [48,] 0.9539648 9.207042e-02 4.603521e-02 [49,] 0.9419568 1.160864e-01 5.804321e-02 [50,] 0.9384158 1.231684e-01 6.158420e-02 [51,] 0.9560950 8.780991e-02 4.390496e-02 [52,] 0.9432812 1.134375e-01 5.671876e-02 [53,] 0.9303578 1.392844e-01 6.964220e-02 [54,] 0.9258875 1.482250e-01 7.411252e-02 [55,] 0.9301806 1.396387e-01 6.981937e-02 [56,] 0.9235486 1.529029e-01 7.645143e-02 [57,] 0.9366161 1.267677e-01 6.338386e-02 [58,] 0.9918350 1.632998e-02 8.164988e-03 [59,] 0.9945736 1.085285e-02 5.426427e-03 [60,] 0.9966194 6.761197e-03 3.380598e-03 [61,] 0.9958574 8.285297e-03 4.142649e-03 [62,] 0.9991677 1.664622e-03 8.323111e-04 [63,] 0.9989835 2.032954e-03 1.016477e-03 [64,] 0.9988524 2.295220e-03 1.147610e-03 [65,] 0.9985403 2.919497e-03 1.459749e-03 [66,] 0.9983332 3.333681e-03 1.666840e-03 [67,] 0.9976596 4.680851e-03 2.340425e-03 [68,] 0.9969232 6.153695e-03 3.076848e-03 [69,] 0.9992067 1.586590e-03 7.932952e-04 [70,] 0.9987878 2.424414e-03 1.212207e-03 [71,] 0.9988544 2.291272e-03 1.145636e-03 [72,] 0.9992283 1.543354e-03 7.716770e-04 [73,] 0.9999992 1.684354e-06 8.421769e-07 [74,] 0.9999996 8.663388e-07 4.331694e-07 [75,] 0.9999992 1.694982e-06 8.474908e-07 [76,] 0.9999984 3.280979e-06 1.640490e-06 [77,] 0.9999975 5.067469e-06 2.533734e-06 [78,] 0.9999966 6.864361e-06 3.432180e-06 [79,] 0.9999938 1.234159e-05 6.170797e-06 [80,] 0.9999905 1.901503e-05 9.507513e-06 [81,] 0.9999858 2.841409e-05 1.420704e-05 [82,] 0.9999894 2.110670e-05 1.055335e-05 [83,] 0.9999829 3.412314e-05 1.706157e-05 [84,] 0.9999710 5.792617e-05 2.896309e-05 [85,] 0.9999747 5.066096e-05 2.533048e-05 [86,] 0.9999629 7.427362e-05 3.713681e-05 [87,] 0.9999332 1.336252e-04 6.681260e-05 [88,] 0.9999013 1.973552e-04 9.867759e-05 [89,] 0.9998441 3.118444e-04 1.559222e-04 [90,] 0.9999995 1.040977e-06 5.204887e-07 [91,] 0.9999989 2.220751e-06 1.110375e-06 [92,] 0.9999994 1.295960e-06 6.479801e-07 [93,] 0.9999988 2.321013e-06 1.160506e-06 [94,] 0.9999984 3.203038e-06 1.601519e-06 [95,] 0.9999966 6.853474e-06 3.426737e-06 [96,] 0.9999927 1.456264e-05 7.281321e-06 [97,] 0.9999921 1.585517e-05 7.927583e-06 [98,] 0.9999883 2.332843e-05 1.166421e-05 [99,] 0.9999939 1.229390e-05 6.146950e-06 [100,] 0.9999878 2.436696e-05 1.218348e-05 [101,] 0.9999805 3.909718e-05 1.954859e-05 [102,] 0.9999737 5.256722e-05 2.628361e-05 [103,] 0.9999435 1.130527e-04 5.652634e-05 [104,] 0.9999038 1.924030e-04 9.620149e-05 [105,] 0.9998161 3.677512e-04 1.838756e-04 [106,] 0.9996365 7.269629e-04 3.634815e-04 [107,] 0.9993326 1.334864e-03 6.674320e-04 [108,] 0.9995353 9.294859e-04 4.647430e-04 [109,] 0.9997528 4.944749e-04 2.472374e-04 [110,] 0.9998383 3.234685e-04 1.617342e-04 [111,] 0.9996729 6.541917e-04 3.270959e-04 [112,] 0.9997150 5.699797e-04 2.849899e-04 [113,] 0.9994398 1.120322e-03 5.601608e-04 [114,] 0.9987229 2.554119e-03 1.277060e-03 [115,] 0.9999895 2.090337e-05 1.045168e-05 [116,] 0.9999804 3.923237e-05 1.961618e-05 [117,] 0.9999763 4.734410e-05 2.367205e-05 [118,] 0.9999150 1.700558e-04 8.502789e-05 [119,] 0.9999294 1.411130e-04 7.055649e-05 [120,] 0.9997220 5.559427e-04 2.779714e-04 [121,] 0.9989464 2.107185e-03 1.053593e-03 [122,] 0.9965346 6.930785e-03 3.465392e-03 [123,] 0.9999549 9.015088e-05 4.507544e-05 [124,] 0.9996563 6.874137e-04 3.437069e-04 [125,] 0.9979430 4.113958e-03 2.056979e-03 > postscript(file="/var/wessaorg/rcomp/tmp/1xwky1324652057.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/28xlf1324652057.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/387mc1324652057.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/4cpmx1324652057.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/5g3rc1324652057.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 = 144 Frequency = 1 1 2 3 4 5 49226.58667 -17803.58282 -11164.05784 -7849.90089 31012.19297 6 7 8 9 10 72217.88921 -1731.89299 -27490.27358 19197.05294 65463.34078 11 12 13 14 15 -27857.34423 -31255.22296 -23158.63032 12330.35837 16812.32795 16 17 18 19 20 -5626.57548 -71868.87230 36456.84009 -13238.55862 -26941.14111 21 22 23 24 25 1624.23926 -32432.55267 95322.51207 -6161.66885 -5453.07037 26 27 28 29 30 53600.22954 28030.14593 -78538.50329 104980.31746 8217.16673 31 32 33 34 35 21110.59298 -12129.64277 2792.09299 81807.82319 -13402.09572 36 37 38 39 40 -15369.70386 78254.64190 7581.49017 -6971.60414 -70556.32092 41 42 43 44 45 51294.08909 9724.66537 -24400.16222 15919.93322 -18612.09789 46 47 48 49 50 8933.53341 -55599.40516 68425.20265 15263.88978 -9730.70600 51 52 53 54 55 -25792.02895 -8946.92818 46934.72070 62099.96140 -10768.22306 56 57 58 59 60 96.99299 55347.57443 -7330.40288 -30064.63931 65419.88524 61 62 63 64 65 3491.08394 10035.94885 -25013.45660 -45673.89165 29493.85930 66 67 68 69 70 -50964.20547 -103417.96242 -59310.89524 -54605.03953 -20055.26160 71 72 73 74 75 81251.18016 16697.86039 -39339.80915 16928.33048 -31737.86626 76 77 78 79 80 9621.01300 -26849.37231 -79915.50839 -2135.14546 -37626.57131 81 82 83 84 85 -51625.54369 127631.11174 -38965.75342 -7113.94566 -4835.88321 86 87 88 89 90 20226.52493 16810.60658 -13167.88893 -6940.74388 11065.67184 91 92 93 94 95 -28230.26609 -28775.95635 -9007.95972 26737.26324 -26521.38202 96 97 98 99 100 5644.62116 -11568.42591 -21731.08954 98067.59787 584.72886 101 102 103 104 105 24575.25575 -26850.37673 11274.45154 9125.04562 -9046.18846 106 107 108 109 110 -12813.71172 -42780.73543 51605.18409 -15369.70386 -32505.82629 111 112 113 114 115 20906.48366 -8912.83517 741.37351 -18104.04079 -11753.70386 116 117 118 119 120 -15369.70386 25743.03393 -49423.34440 44416.80417 3644.99088 121 122 123 124 125 21916.92482 -24192.08308 -3664.45056 -14243.38889 18716.50952 126 127 128 129 130 -22087.85928 14265.47799 18043.30752 9367.94530 -6859.57991 131 132 133 134 135 -4695.70386 8080.76808 -9812.18143 16873.18146 -13896.30837 136 137 138 139 140 3550.49125 -15369.70386 5478.42167 -46028.64525 -9472.25608 141 142 143 144 -13173.26939 17111.04668 -21719.47675 -13701.67877 > postscript(file="/var/wessaorg/rcomp/tmp/6q7vx1324652057.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 = 144 Frequency = 1 lag(myerror, k = 1) myerror 0 49226.58667 NA 1 -17803.58282 49226.58667 2 -11164.05784 -17803.58282 3 -7849.90089 -11164.05784 4 31012.19297 -7849.90089 5 72217.88921 31012.19297 6 -1731.89299 72217.88921 7 -27490.27358 -1731.89299 8 19197.05294 -27490.27358 9 65463.34078 19197.05294 10 -27857.34423 65463.34078 11 -31255.22296 -27857.34423 12 -23158.63032 -31255.22296 13 12330.35837 -23158.63032 14 16812.32795 12330.35837 15 -5626.57548 16812.32795 16 -71868.87230 -5626.57548 17 36456.84009 -71868.87230 18 -13238.55862 36456.84009 19 -26941.14111 -13238.55862 20 1624.23926 -26941.14111 21 -32432.55267 1624.23926 22 95322.51207 -32432.55267 23 -6161.66885 95322.51207 24 -5453.07037 -6161.66885 25 53600.22954 -5453.07037 26 28030.14593 53600.22954 27 -78538.50329 28030.14593 28 104980.31746 -78538.50329 29 8217.16673 104980.31746 30 21110.59298 8217.16673 31 -12129.64277 21110.59298 32 2792.09299 -12129.64277 33 81807.82319 2792.09299 34 -13402.09572 81807.82319 35 -15369.70386 -13402.09572 36 78254.64190 -15369.70386 37 7581.49017 78254.64190 38 -6971.60414 7581.49017 39 -70556.32092 -6971.60414 40 51294.08909 -70556.32092 41 9724.66537 51294.08909 42 -24400.16222 9724.66537 43 15919.93322 -24400.16222 44 -18612.09789 15919.93322 45 8933.53341 -18612.09789 46 -55599.40516 8933.53341 47 68425.20265 -55599.40516 48 15263.88978 68425.20265 49 -9730.70600 15263.88978 50 -25792.02895 -9730.70600 51 -8946.92818 -25792.02895 52 46934.72070 -8946.92818 53 62099.96140 46934.72070 54 -10768.22306 62099.96140 55 96.99299 -10768.22306 56 55347.57443 96.99299 57 -7330.40288 55347.57443 58 -30064.63931 -7330.40288 59 65419.88524 -30064.63931 60 3491.08394 65419.88524 61 10035.94885 3491.08394 62 -25013.45660 10035.94885 63 -45673.89165 -25013.45660 64 29493.85930 -45673.89165 65 -50964.20547 29493.85930 66 -103417.96242 -50964.20547 67 -59310.89524 -103417.96242 68 -54605.03953 -59310.89524 69 -20055.26160 -54605.03953 70 81251.18016 -20055.26160 71 16697.86039 81251.18016 72 -39339.80915 16697.86039 73 16928.33048 -39339.80915 74 -31737.86626 16928.33048 75 9621.01300 -31737.86626 76 -26849.37231 9621.01300 77 -79915.50839 -26849.37231 78 -2135.14546 -79915.50839 79 -37626.57131 -2135.14546 80 -51625.54369 -37626.57131 81 127631.11174 -51625.54369 82 -38965.75342 127631.11174 83 -7113.94566 -38965.75342 84 -4835.88321 -7113.94566 85 20226.52493 -4835.88321 86 16810.60658 20226.52493 87 -13167.88893 16810.60658 88 -6940.74388 -13167.88893 89 11065.67184 -6940.74388 90 -28230.26609 11065.67184 91 -28775.95635 -28230.26609 92 -9007.95972 -28775.95635 93 26737.26324 -9007.95972 94 -26521.38202 26737.26324 95 5644.62116 -26521.38202 96 -11568.42591 5644.62116 97 -21731.08954 -11568.42591 98 98067.59787 -21731.08954 99 584.72886 98067.59787 100 24575.25575 584.72886 101 -26850.37673 24575.25575 102 11274.45154 -26850.37673 103 9125.04562 11274.45154 104 -9046.18846 9125.04562 105 -12813.71172 -9046.18846 106 -42780.73543 -12813.71172 107 51605.18409 -42780.73543 108 -15369.70386 51605.18409 109 -32505.82629 -15369.70386 110 20906.48366 -32505.82629 111 -8912.83517 20906.48366 112 741.37351 -8912.83517 113 -18104.04079 741.37351 114 -11753.70386 -18104.04079 115 -15369.70386 -11753.70386 116 25743.03393 -15369.70386 117 -49423.34440 25743.03393 118 44416.80417 -49423.34440 119 3644.99088 44416.80417 120 21916.92482 3644.99088 121 -24192.08308 21916.92482 122 -3664.45056 -24192.08308 123 -14243.38889 -3664.45056 124 18716.50952 -14243.38889 125 -22087.85928 18716.50952 126 14265.47799 -22087.85928 127 18043.30752 14265.47799 128 9367.94530 18043.30752 129 -6859.57991 9367.94530 130 -4695.70386 -6859.57991 131 8080.76808 -4695.70386 132 -9812.18143 8080.76808 133 16873.18146 -9812.18143 134 -13896.30837 16873.18146 135 3550.49125 -13896.30837 136 -15369.70386 3550.49125 137 5478.42167 -15369.70386 138 -46028.64525 5478.42167 139 -9472.25608 -46028.64525 140 -13173.26939 -9472.25608 141 17111.04668 -13173.26939 142 -21719.47675 17111.04668 143 -13701.67877 -21719.47675 144 NA -13701.67877 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -17803.58282 49226.58667 [2,] -11164.05784 -17803.58282 [3,] -7849.90089 -11164.05784 [4,] 31012.19297 -7849.90089 [5,] 72217.88921 31012.19297 [6,] -1731.89299 72217.88921 [7,] -27490.27358 -1731.89299 [8,] 19197.05294 -27490.27358 [9,] 65463.34078 19197.05294 [10,] -27857.34423 65463.34078 [11,] -31255.22296 -27857.34423 [12,] -23158.63032 -31255.22296 [13,] 12330.35837 -23158.63032 [14,] 16812.32795 12330.35837 [15,] -5626.57548 16812.32795 [16,] -71868.87230 -5626.57548 [17,] 36456.84009 -71868.87230 [18,] -13238.55862 36456.84009 [19,] -26941.14111 -13238.55862 [20,] 1624.23926 -26941.14111 [21,] -32432.55267 1624.23926 [22,] 95322.51207 -32432.55267 [23,] -6161.66885 95322.51207 [24,] -5453.07037 -6161.66885 [25,] 53600.22954 -5453.07037 [26,] 28030.14593 53600.22954 [27,] -78538.50329 28030.14593 [28,] 104980.31746 -78538.50329 [29,] 8217.16673 104980.31746 [30,] 21110.59298 8217.16673 [31,] -12129.64277 21110.59298 [32,] 2792.09299 -12129.64277 [33,] 81807.82319 2792.09299 [34,] -13402.09572 81807.82319 [35,] -15369.70386 -13402.09572 [36,] 78254.64190 -15369.70386 [37,] 7581.49017 78254.64190 [38,] -6971.60414 7581.49017 [39,] -70556.32092 -6971.60414 [40,] 51294.08909 -70556.32092 [41,] 9724.66537 51294.08909 [42,] -24400.16222 9724.66537 [43,] 15919.93322 -24400.16222 [44,] -18612.09789 15919.93322 [45,] 8933.53341 -18612.09789 [46,] -55599.40516 8933.53341 [47,] 68425.20265 -55599.40516 [48,] 15263.88978 68425.20265 [49,] -9730.70600 15263.88978 [50,] -25792.02895 -9730.70600 [51,] -8946.92818 -25792.02895 [52,] 46934.72070 -8946.92818 [53,] 62099.96140 46934.72070 [54,] -10768.22306 62099.96140 [55,] 96.99299 -10768.22306 [56,] 55347.57443 96.99299 [57,] -7330.40288 55347.57443 [58,] -30064.63931 -7330.40288 [59,] 65419.88524 -30064.63931 [60,] 3491.08394 65419.88524 [61,] 10035.94885 3491.08394 [62,] -25013.45660 10035.94885 [63,] -45673.89165 -25013.45660 [64,] 29493.85930 -45673.89165 [65,] -50964.20547 29493.85930 [66,] -103417.96242 -50964.20547 [67,] -59310.89524 -103417.96242 [68,] -54605.03953 -59310.89524 [69,] -20055.26160 -54605.03953 [70,] 81251.18016 -20055.26160 [71,] 16697.86039 81251.18016 [72,] -39339.80915 16697.86039 [73,] 16928.33048 -39339.80915 [74,] -31737.86626 16928.33048 [75,] 9621.01300 -31737.86626 [76,] -26849.37231 9621.01300 [77,] -79915.50839 -26849.37231 [78,] -2135.14546 -79915.50839 [79,] -37626.57131 -2135.14546 [80,] -51625.54369 -37626.57131 [81,] 127631.11174 -51625.54369 [82,] -38965.75342 127631.11174 [83,] -7113.94566 -38965.75342 [84,] -4835.88321 -7113.94566 [85,] 20226.52493 -4835.88321 [86,] 16810.60658 20226.52493 [87,] -13167.88893 16810.60658 [88,] -6940.74388 -13167.88893 [89,] 11065.67184 -6940.74388 [90,] -28230.26609 11065.67184 [91,] -28775.95635 -28230.26609 [92,] -9007.95972 -28775.95635 [93,] 26737.26324 -9007.95972 [94,] -26521.38202 26737.26324 [95,] 5644.62116 -26521.38202 [96,] -11568.42591 5644.62116 [97,] -21731.08954 -11568.42591 [98,] 98067.59787 -21731.08954 [99,] 584.72886 98067.59787 [100,] 24575.25575 584.72886 [101,] -26850.37673 24575.25575 [102,] 11274.45154 -26850.37673 [103,] 9125.04562 11274.45154 [104,] -9046.18846 9125.04562 [105,] -12813.71172 -9046.18846 [106,] -42780.73543 -12813.71172 [107,] 51605.18409 -42780.73543 [108,] -15369.70386 51605.18409 [109,] -32505.82629 -15369.70386 [110,] 20906.48366 -32505.82629 [111,] -8912.83517 20906.48366 [112,] 741.37351 -8912.83517 [113,] -18104.04079 741.37351 [114,] -11753.70386 -18104.04079 [115,] -15369.70386 -11753.70386 [116,] 25743.03393 -15369.70386 [117,] -49423.34440 25743.03393 [118,] 44416.80417 -49423.34440 [119,] 3644.99088 44416.80417 [120,] 21916.92482 3644.99088 [121,] -24192.08308 21916.92482 [122,] -3664.45056 -24192.08308 [123,] -14243.38889 -3664.45056 [124,] 18716.50952 -14243.38889 [125,] -22087.85928 18716.50952 [126,] 14265.47799 -22087.85928 [127,] 18043.30752 14265.47799 [128,] 9367.94530 18043.30752 [129,] -6859.57991 9367.94530 [130,] -4695.70386 -6859.57991 [131,] 8080.76808 -4695.70386 [132,] -9812.18143 8080.76808 [133,] 16873.18146 -9812.18143 [134,] -13896.30837 16873.18146 [135,] 3550.49125 -13896.30837 [136,] -15369.70386 3550.49125 [137,] 5478.42167 -15369.70386 [138,] -46028.64525 5478.42167 [139,] -9472.25608 -46028.64525 [140,] -13173.26939 -9472.25608 [141,] 17111.04668 -13173.26939 [142,] -21719.47675 17111.04668 [143,] -13701.67877 -21719.47675 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -17803.58282 49226.58667 2 -11164.05784 -17803.58282 3 -7849.90089 -11164.05784 4 31012.19297 -7849.90089 5 72217.88921 31012.19297 6 -1731.89299 72217.88921 7 -27490.27358 -1731.89299 8 19197.05294 -27490.27358 9 65463.34078 19197.05294 10 -27857.34423 65463.34078 11 -31255.22296 -27857.34423 12 -23158.63032 -31255.22296 13 12330.35837 -23158.63032 14 16812.32795 12330.35837 15 -5626.57548 16812.32795 16 -71868.87230 -5626.57548 17 36456.84009 -71868.87230 18 -13238.55862 36456.84009 19 -26941.14111 -13238.55862 20 1624.23926 -26941.14111 21 -32432.55267 1624.23926 22 95322.51207 -32432.55267 23 -6161.66885 95322.51207 24 -5453.07037 -6161.66885 25 53600.22954 -5453.07037 26 28030.14593 53600.22954 27 -78538.50329 28030.14593 28 104980.31746 -78538.50329 29 8217.16673 104980.31746 30 21110.59298 8217.16673 31 -12129.64277 21110.59298 32 2792.09299 -12129.64277 33 81807.82319 2792.09299 34 -13402.09572 81807.82319 35 -15369.70386 -13402.09572 36 78254.64190 -15369.70386 37 7581.49017 78254.64190 38 -6971.60414 7581.49017 39 -70556.32092 -6971.60414 40 51294.08909 -70556.32092 41 9724.66537 51294.08909 42 -24400.16222 9724.66537 43 15919.93322 -24400.16222 44 -18612.09789 15919.93322 45 8933.53341 -18612.09789 46 -55599.40516 8933.53341 47 68425.20265 -55599.40516 48 15263.88978 68425.20265 49 -9730.70600 15263.88978 50 -25792.02895 -9730.70600 51 -8946.92818 -25792.02895 52 46934.72070 -8946.92818 53 62099.96140 46934.72070 54 -10768.22306 62099.96140 55 96.99299 -10768.22306 56 55347.57443 96.99299 57 -7330.40288 55347.57443 58 -30064.63931 -7330.40288 59 65419.88524 -30064.63931 60 3491.08394 65419.88524 61 10035.94885 3491.08394 62 -25013.45660 10035.94885 63 -45673.89165 -25013.45660 64 29493.85930 -45673.89165 65 -50964.20547 29493.85930 66 -103417.96242 -50964.20547 67 -59310.89524 -103417.96242 68 -54605.03953 -59310.89524 69 -20055.26160 -54605.03953 70 81251.18016 -20055.26160 71 16697.86039 81251.18016 72 -39339.80915 16697.86039 73 16928.33048 -39339.80915 74 -31737.86626 16928.33048 75 9621.01300 -31737.86626 76 -26849.37231 9621.01300 77 -79915.50839 -26849.37231 78 -2135.14546 -79915.50839 79 -37626.57131 -2135.14546 80 -51625.54369 -37626.57131 81 127631.11174 -51625.54369 82 -38965.75342 127631.11174 83 -7113.94566 -38965.75342 84 -4835.88321 -7113.94566 85 20226.52493 -4835.88321 86 16810.60658 20226.52493 87 -13167.88893 16810.60658 88 -6940.74388 -13167.88893 89 11065.67184 -6940.74388 90 -28230.26609 11065.67184 91 -28775.95635 -28230.26609 92 -9007.95972 -28775.95635 93 26737.26324 -9007.95972 94 -26521.38202 26737.26324 95 5644.62116 -26521.38202 96 -11568.42591 5644.62116 97 -21731.08954 -11568.42591 98 98067.59787 -21731.08954 99 584.72886 98067.59787 100 24575.25575 584.72886 101 -26850.37673 24575.25575 102 11274.45154 -26850.37673 103 9125.04562 11274.45154 104 -9046.18846 9125.04562 105 -12813.71172 -9046.18846 106 -42780.73543 -12813.71172 107 51605.18409 -42780.73543 108 -15369.70386 51605.18409 109 -32505.82629 -15369.70386 110 20906.48366 -32505.82629 111 -8912.83517 20906.48366 112 741.37351 -8912.83517 113 -18104.04079 741.37351 114 -11753.70386 -18104.04079 115 -15369.70386 -11753.70386 116 25743.03393 -15369.70386 117 -49423.34440 25743.03393 118 44416.80417 -49423.34440 119 3644.99088 44416.80417 120 21916.92482 3644.99088 121 -24192.08308 21916.92482 122 -3664.45056 -24192.08308 123 -14243.38889 -3664.45056 124 18716.50952 -14243.38889 125 -22087.85928 18716.50952 126 14265.47799 -22087.85928 127 18043.30752 14265.47799 128 9367.94530 18043.30752 129 -6859.57991 9367.94530 130 -4695.70386 -6859.57991 131 8080.76808 -4695.70386 132 -9812.18143 8080.76808 133 16873.18146 -9812.18143 134 -13896.30837 16873.18146 135 3550.49125 -13896.30837 136 -15369.70386 3550.49125 137 5478.42167 -15369.70386 138 -46028.64525 5478.42167 139 -9472.25608 -46028.64525 140 -13173.26939 -9472.25608 141 17111.04668 -13173.26939 142 -21719.47675 17111.04668 143 -13701.67877 -21719.47675 > 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/7fhi51324652057.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/8uwsr1324652057.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/9tcq11324652057.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/10abhi1324652057.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/11i3vv1324652057.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/12shs91324652057.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/13ljlb1324652057.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/14rg871324652057.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/15yrcs1324652057.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/16n5kg1324652057.tab") + } > > try(system("convert tmp/1xwky1324652057.ps tmp/1xwky1324652057.png",intern=TRUE)) character(0) > try(system("convert tmp/28xlf1324652057.ps tmp/28xlf1324652057.png",intern=TRUE)) character(0) > try(system("convert tmp/387mc1324652057.ps tmp/387mc1324652057.png",intern=TRUE)) character(0) > try(system("convert tmp/4cpmx1324652057.ps tmp/4cpmx1324652057.png",intern=TRUE)) character(0) > try(system("convert tmp/5g3rc1324652057.ps tmp/5g3rc1324652057.png",intern=TRUE)) character(0) > try(system("convert tmp/6q7vx1324652057.ps tmp/6q7vx1324652057.png",intern=TRUE)) character(0) > try(system("convert tmp/7fhi51324652057.ps tmp/7fhi51324652057.png",intern=TRUE)) character(0) > try(system("convert tmp/8uwsr1324652057.ps tmp/8uwsr1324652057.png",intern=TRUE)) character(0) > try(system("convert tmp/9tcq11324652057.ps tmp/9tcq11324652057.png",intern=TRUE)) character(0) > try(system("convert tmp/10abhi1324652057.ps tmp/10abhi1324652057.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.535 0.555 5.099