R version 2.8.0 (2008-10-20) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(205597 + ,0 + ,205471 + ,0 + ,211064 + ,0 + ,212856 + ,0 + ,217036 + ,0 + ,219302 + ,0 + ,219759 + ,0 + ,221388 + ,0 + ,220834 + ,0 + ,221788 + ,0 + ,222358 + ,0 + ,222972 + ,0 + ,224164 + ,0 + ,224915 + ,0 + ,226294 + ,0 + ,224690 + ,0 + ,227021 + ,0 + ,229284 + ,0 + ,229189 + ,0 + ,230032 + ,0 + ,229389 + ,0 + ,231053 + ,0 + ,232560 + ,0 + ,232681 + ,0 + ,231555 + ,0 + ,231428 + ,0 + ,232141 + ,0 + ,234939 + ,0 + ,235424 + ,0 + ,235471 + ,0 + ,236355 + ,0 + ,238693 + ,0 + ,236958 + ,0 + ,237060 + ,0 + ,239282 + ,0 + ,238252 + ,0 + ,241552 + ,0 + ,236230 + ,0 + ,238909 + ,0 + ,240723 + ,0 + ,242120 + ,0 + ,242100 + ,0 + ,243276 + ,0 + ,244677 + ,0 + ,243494 + ,0 + ,244902 + ,0 + ,245247 + ,0 + ,245578 + ,0 + ,243052 + ,0 + ,238121 + ,0 + ,241863 + ,0 + ,241203 + ,0 + ,243634 + ,0 + ,242351 + ,0 + ,245180 + ,0 + ,246126 + ,0 + ,244424 + ,0 + ,245166 + ,0 + ,247258 + ,0 + ,245094 + ,0 + ,246020 + ,0 + ,243082 + ,0 + ,245555 + ,0 + ,243685 + ,0 + ,247277 + ,0 + ,245029 + ,0 + ,246169 + ,0 + ,246778 + ,0 + ,244577 + ,0 + ,246048 + ,0 + ,245775 + ,0 + ,245328 + ,0 + ,245477 + ,0 + ,241903 + ,0 + ,243219 + ,0 + ,248088 + ,0 + ,248521 + ,0 + ,247389 + ,0 + ,249057 + ,0 + ,248916 + ,0 + ,249193 + ,0 + ,250768 + ,1 + ,253106 + ,1 + ,249829 + ,1 + ,249447 + ,1 + ,246755 + ,1 + ,250785 + ,1 + ,250140 + ,1 + ,255755 + ,1 + ,254671 + ,1 + ,253919 + ,1 + ,253741 + ,1 + ,252729 + ,1 + ,253810 + ,1 + ,256653 + ,1 + ,255231 + ,1 + ,258405 + ,1 + ,251061 + ,1 + ,254811 + ,1 + ,254895 + ,1 + ,258325 + ,1 + ,257608 + ,1 + ,258759 + ,1 + ,258621 + ,1 + ,257852 + ,1 + ,260560 + ,1 + ,262358 + ,1 + ,260812 + ,1 + ,261165 + ,1 + ,257164 + ,1 + ,260720 + ,1 + ,259581 + ,1 + ,264743 + ,1 + ,261845 + ,1 + ,262262 + ,1 + ,261631 + ,1 + ,258953 + ,1 + ,259966 + ,1 + ,262850 + ,1 + ,262204 + ,1 + ,263418 + ,1 + ,262752 + ,1 + ,266433 + ,1 + ,267722 + ,1 + ,266003 + ,1 + ,262971 + ,1 + ,265521 + ,1 + ,264676 + ,1 + ,270223 + ,1 + ,269508 + ,1 + ,268457 + ,1 + ,265814 + ,1 + ,266680 + ,1 + ,263018 + ,1 + ,269285 + ,1 + ,269829 + ,1 + ,270911 + ,1 + ,266844 + ,1 + ,271244 + ,1 + ,269907 + ,1 + ,271296 + ,1 + ,270157 + ,1 + ,271322 + ,1 + ,267179 + ,1 + ,264101 + ,1 + ,265518 + ,1 + ,269419 + ,1 + ,268714 + ,1 + ,272482 + ,1 + ,268351 + ,1 + ,268175 + ,1 + ,270674 + ,1 + ,272764 + ,1 + ,272599 + ,1 + ,270333 + ,1 + ,270846 + ,1 + ,270491 + ,1 + ,269160 + ,1 + ,274027 + ,1 + ,273784 + ,1 + ,276663 + ,1 + ,274525 + ,1 + ,271344 + ,1 + ,271115 + ,1 + ,270798 + ,1 + ,273911 + ,1 + ,273985 + ,1 + ,271917 + ,1 + ,273338 + ,1 + ,270601 + ,1 + ,273547 + ,1 + ,275363 + ,1 + ,281229 + ,1 + ,277793 + ,1 + ,279913 + ,1 + ,282500 + ,1 + ,280041 + ,1 + ,282166 + ,1 + ,290304 + ,1 + ,283519 + ,1 + ,287816 + ,1 + ,285226 + ,1 + ,287595 + ,1 + ,289741 + ,1 + ,289148 + ,1 + ,288301 + ,1 + ,290155 + ,1 + ,289648 + ,1 + ,288225 + ,1 + ,289351 + ,1 + ,294735 + ,1 + ,305333 + ,1) + ,dim=c(2 + ,192) + ,dimnames=list(c('Brutoschuld' + ,'Dummy') + ,1:192)) > y <- array(NA,dim=c(2,192),dimnames=list(c('Brutoschuld','Dummy'),1:192)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'Linear Trend' > par2 = 'Include Monthly Dummies' > par1 = '1' > #'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 Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.numeric > 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 Brutoschuld Dummy M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t 1 205597 0 1 0 0 0 0 0 0 0 0 0 0 1 2 205471 0 0 1 0 0 0 0 0 0 0 0 0 2 3 211064 0 0 0 1 0 0 0 0 0 0 0 0 3 4 212856 0 0 0 0 1 0 0 0 0 0 0 0 4 5 217036 0 0 0 0 0 1 0 0 0 0 0 0 5 6 219302 0 0 0 0 0 0 1 0 0 0 0 0 6 7 219759 0 0 0 0 0 0 0 1 0 0 0 0 7 8 221388 0 0 0 0 0 0 0 0 1 0 0 0 8 9 220834 0 0 0 0 0 0 0 0 0 1 0 0 9 10 221788 0 0 0 0 0 0 0 0 0 0 1 0 10 11 222358 0 0 0 0 0 0 0 0 0 0 0 1 11 12 222972 0 0 0 0 0 0 0 0 0 0 0 0 12 13 224164 0 1 0 0 0 0 0 0 0 0 0 0 13 14 224915 0 0 1 0 0 0 0 0 0 0 0 0 14 15 226294 0 0 0 1 0 0 0 0 0 0 0 0 15 16 224690 0 0 0 0 1 0 0 0 0 0 0 0 16 17 227021 0 0 0 0 0 1 0 0 0 0 0 0 17 18 229284 0 0 0 0 0 0 1 0 0 0 0 0 18 19 229189 0 0 0 0 0 0 0 1 0 0 0 0 19 20 230032 0 0 0 0 0 0 0 0 1 0 0 0 20 21 229389 0 0 0 0 0 0 0 0 0 1 0 0 21 22 231053 0 0 0 0 0 0 0 0 0 0 1 0 22 23 232560 0 0 0 0 0 0 0 0 0 0 0 1 23 24 232681 0 0 0 0 0 0 0 0 0 0 0 0 24 25 231555 0 1 0 0 0 0 0 0 0 0 0 0 25 26 231428 0 0 1 0 0 0 0 0 0 0 0 0 26 27 232141 0 0 0 1 0 0 0 0 0 0 0 0 27 28 234939 0 0 0 0 1 0 0 0 0 0 0 0 28 29 235424 0 0 0 0 0 1 0 0 0 0 0 0 29 30 235471 0 0 0 0 0 0 1 0 0 0 0 0 30 31 236355 0 0 0 0 0 0 0 1 0 0 0 0 31 32 238693 0 0 0 0 0 0 0 0 1 0 0 0 32 33 236958 0 0 0 0 0 0 0 0 0 1 0 0 33 34 237060 0 0 0 0 0 0 0 0 0 0 1 0 34 35 239282 0 0 0 0 0 0 0 0 0 0 0 1 35 36 238252 0 0 0 0 0 0 0 0 0 0 0 0 36 37 241552 0 1 0 0 0 0 0 0 0 0 0 0 37 38 236230 0 0 1 0 0 0 0 0 0 0 0 0 38 39 238909 0 0 0 1 0 0 0 0 0 0 0 0 39 40 240723 0 0 0 0 1 0 0 0 0 0 0 0 40 41 242120 0 0 0 0 0 1 0 0 0 0 0 0 41 42 242100 0 0 0 0 0 0 1 0 0 0 0 0 42 43 243276 0 0 0 0 0 0 0 1 0 0 0 0 43 44 244677 0 0 0 0 0 0 0 0 1 0 0 0 44 45 243494 0 0 0 0 0 0 0 0 0 1 0 0 45 46 244902 0 0 0 0 0 0 0 0 0 0 1 0 46 47 245247 0 0 0 0 0 0 0 0 0 0 0 1 47 48 245578 0 0 0 0 0 0 0 0 0 0 0 0 48 49 243052 0 1 0 0 0 0 0 0 0 0 0 0 49 50 238121 0 0 1 0 0 0 0 0 0 0 0 0 50 51 241863 0 0 0 1 0 0 0 0 0 0 0 0 51 52 241203 0 0 0 0 1 0 0 0 0 0 0 0 52 53 243634 0 0 0 0 0 1 0 0 0 0 0 0 53 54 242351 0 0 0 0 0 0 1 0 0 0 0 0 54 55 245180 0 0 0 0 0 0 0 1 0 0 0 0 55 56 246126 0 0 0 0 0 0 0 0 1 0 0 0 56 57 244424 0 0 0 0 0 0 0 0 0 1 0 0 57 58 245166 0 0 0 0 0 0 0 0 0 0 1 0 58 59 247258 0 0 0 0 0 0 0 0 0 0 0 1 59 60 245094 0 0 0 0 0 0 0 0 0 0 0 0 60 61 246020 0 1 0 0 0 0 0 0 0 0 0 0 61 62 243082 0 0 1 0 0 0 0 0 0 0 0 0 62 63 245555 0 0 0 1 0 0 0 0 0 0 0 0 63 64 243685 0 0 0 0 1 0 0 0 0 0 0 0 64 65 247277 0 0 0 0 0 1 0 0 0 0 0 0 65 66 245029 0 0 0 0 0 0 1 0 0 0 0 0 66 67 246169 0 0 0 0 0 0 0 1 0 0 0 0 67 68 246778 0 0 0 0 0 0 0 0 1 0 0 0 68 69 244577 0 0 0 0 0 0 0 0 0 1 0 0 69 70 246048 0 0 0 0 0 0 0 0 0 0 1 0 70 71 245775 0 0 0 0 0 0 0 0 0 0 0 1 71 72 245328 0 0 0 0 0 0 0 0 0 0 0 0 72 73 245477 0 1 0 0 0 0 0 0 0 0 0 0 73 74 241903 0 0 1 0 0 0 0 0 0 0 0 0 74 75 243219 0 0 0 1 0 0 0 0 0 0 0 0 75 76 248088 0 0 0 0 1 0 0 0 0 0 0 0 76 77 248521 0 0 0 0 0 1 0 0 0 0 0 0 77 78 247389 0 0 0 0 0 0 1 0 0 0 0 0 78 79 249057 0 0 0 0 0 0 0 1 0 0 0 0 79 80 248916 0 0 0 0 0 0 0 0 1 0 0 0 80 81 249193 0 0 0 0 0 0 0 0 0 1 0 0 81 82 250768 1 0 0 0 0 0 0 0 0 0 1 0 82 83 253106 1 0 0 0 0 0 0 0 0 0 0 1 83 84 249829 1 0 0 0 0 0 0 0 0 0 0 0 84 85 249447 1 1 0 0 0 0 0 0 0 0 0 0 85 86 246755 1 0 1 0 0 0 0 0 0 0 0 0 86 87 250785 1 0 0 1 0 0 0 0 0 0 0 0 87 88 250140 1 0 0 0 1 0 0 0 0 0 0 0 88 89 255755 1 0 0 0 0 1 0 0 0 0 0 0 89 90 254671 1 0 0 0 0 0 1 0 0 0 0 0 90 91 253919 1 0 0 0 0 0 0 1 0 0 0 0 91 92 253741 1 0 0 0 0 0 0 0 1 0 0 0 92 93 252729 1 0 0 0 0 0 0 0 0 1 0 0 93 94 253810 1 0 0 0 0 0 0 0 0 0 1 0 94 95 256653 1 0 0 0 0 0 0 0 0 0 0 1 95 96 255231 1 0 0 0 0 0 0 0 0 0 0 0 96 97 258405 1 1 0 0 0 0 0 0 0 0 0 0 97 98 251061 1 0 1 0 0 0 0 0 0 0 0 0 98 99 254811 1 0 0 1 0 0 0 0 0 0 0 0 99 100 254895 1 0 0 0 1 0 0 0 0 0 0 0 100 101 258325 1 0 0 0 0 1 0 0 0 0 0 0 101 102 257608 1 0 0 0 0 0 1 0 0 0 0 0 102 103 258759 1 0 0 0 0 0 0 1 0 0 0 0 103 104 258621 1 0 0 0 0 0 0 0 1 0 0 0 104 105 257852 1 0 0 0 0 0 0 0 0 1 0 0 105 106 260560 1 0 0 0 0 0 0 0 0 0 1 0 106 107 262358 1 0 0 0 0 0 0 0 0 0 0 1 107 108 260812 1 0 0 0 0 0 0 0 0 0 0 0 108 109 261165 1 1 0 0 0 0 0 0 0 0 0 0 109 110 257164 1 0 1 0 0 0 0 0 0 0 0 0 110 111 260720 1 0 0 1 0 0 0 0 0 0 0 0 111 112 259581 1 0 0 0 1 0 0 0 0 0 0 0 112 113 264743 1 0 0 0 0 1 0 0 0 0 0 0 113 114 261845 1 0 0 0 0 0 1 0 0 0 0 0 114 115 262262 1 0 0 0 0 0 0 1 0 0 0 0 115 116 261631 1 0 0 0 0 0 0 0 1 0 0 0 116 117 258953 1 0 0 0 0 0 0 0 0 1 0 0 117 118 259966 1 0 0 0 0 0 0 0 0 0 1 0 118 119 262850 1 0 0 0 0 0 0 0 0 0 0 1 119 120 262204 1 0 0 0 0 0 0 0 0 0 0 0 120 121 263418 1 1 0 0 0 0 0 0 0 0 0 0 121 122 262752 1 0 1 0 0 0 0 0 0 0 0 0 122 123 266433 1 0 0 1 0 0 0 0 0 0 0 0 123 124 267722 1 0 0 0 1 0 0 0 0 0 0 0 124 125 266003 1 0 0 0 0 1 0 0 0 0 0 0 125 126 262971 1 0 0 0 0 0 1 0 0 0 0 0 126 127 265521 1 0 0 0 0 0 0 1 0 0 0 0 127 128 264676 1 0 0 0 0 0 0 0 1 0 0 0 128 129 270223 1 0 0 0 0 0 0 0 0 1 0 0 129 130 269508 1 0 0 0 0 0 0 0 0 0 1 0 130 131 268457 1 0 0 0 0 0 0 0 0 0 0 1 131 132 265814 1 0 0 0 0 0 0 0 0 0 0 0 132 133 266680 1 1 0 0 0 0 0 0 0 0 0 0 133 134 263018 1 0 1 0 0 0 0 0 0 0 0 0 134 135 269285 1 0 0 1 0 0 0 0 0 0 0 0 135 136 269829 1 0 0 0 1 0 0 0 0 0 0 0 136 137 270911 1 0 0 0 0 1 0 0 0 0 0 0 137 138 266844 1 0 0 0 0 0 1 0 0 0 0 0 138 139 271244 1 0 0 0 0 0 0 1 0 0 0 0 139 140 269907 1 0 0 0 0 0 0 0 1 0 0 0 140 141 271296 1 0 0 0 0 0 0 0 0 1 0 0 141 142 270157 1 0 0 0 0 0 0 0 0 0 1 0 142 143 271322 1 0 0 0 0 0 0 0 0 0 0 1 143 144 267179 1 0 0 0 0 0 0 0 0 0 0 0 144 145 264101 1 1 0 0 0 0 0 0 0 0 0 0 145 146 265518 1 0 1 0 0 0 0 0 0 0 0 0 146 147 269419 1 0 0 1 0 0 0 0 0 0 0 0 147 148 268714 1 0 0 0 1 0 0 0 0 0 0 0 148 149 272482 1 0 0 0 0 1 0 0 0 0 0 0 149 150 268351 1 0 0 0 0 0 1 0 0 0 0 0 150 151 268175 1 0 0 0 0 0 0 1 0 0 0 0 151 152 270674 1 0 0 0 0 0 0 0 1 0 0 0 152 153 272764 1 0 0 0 0 0 0 0 0 1 0 0 153 154 272599 1 0 0 0 0 0 0 0 0 0 1 0 154 155 270333 1 0 0 0 0 0 0 0 0 0 0 1 155 156 270846 1 0 0 0 0 0 0 0 0 0 0 0 156 157 270491 1 1 0 0 0 0 0 0 0 0 0 0 157 158 269160 1 0 1 0 0 0 0 0 0 0 0 0 158 159 274027 1 0 0 1 0 0 0 0 0 0 0 0 159 160 273784 1 0 0 0 1 0 0 0 0 0 0 0 160 161 276663 1 0 0 0 0 1 0 0 0 0 0 0 161 162 274525 1 0 0 0 0 0 1 0 0 0 0 0 162 163 271344 1 0 0 0 0 0 0 1 0 0 0 0 163 164 271115 1 0 0 0 0 0 0 0 1 0 0 0 164 165 270798 1 0 0 0 0 0 0 0 0 1 0 0 165 166 273911 1 0 0 0 0 0 0 0 0 0 1 0 166 167 273985 1 0 0 0 0 0 0 0 0 0 0 1 167 168 271917 1 0 0 0 0 0 0 0 0 0 0 0 168 169 273338 1 1 0 0 0 0 0 0 0 0 0 0 169 170 270601 1 0 1 0 0 0 0 0 0 0 0 0 170 171 273547 1 0 0 1 0 0 0 0 0 0 0 0 171 172 275363 1 0 0 0 1 0 0 0 0 0 0 0 172 173 281229 1 0 0 0 0 1 0 0 0 0 0 0 173 174 277793 1 0 0 0 0 0 1 0 0 0 0 0 174 175 279913 1 0 0 0 0 0 0 1 0 0 0 0 175 176 282500 1 0 0 0 0 0 0 0 1 0 0 0 176 177 280041 1 0 0 0 0 0 0 0 0 1 0 0 177 178 282166 1 0 0 0 0 0 0 0 0 0 1 0 178 179 290304 1 0 0 0 0 0 0 0 0 0 0 1 179 180 283519 1 0 0 0 0 0 0 0 0 0 0 0 180 181 287816 1 1 0 0 0 0 0 0 0 0 0 0 181 182 285226 1 0 1 0 0 0 0 0 0 0 0 0 182 183 287595 1 0 0 1 0 0 0 0 0 0 0 0 183 184 289741 1 0 0 0 1 0 0 0 0 0 0 0 184 185 289148 1 0 0 0 0 1 0 0 0 0 0 0 185 186 288301 1 0 0 0 0 0 1 0 0 0 0 0 186 187 290155 1 0 0 0 0 0 0 1 0 0 0 0 187 188 289648 1 0 0 0 0 0 0 0 1 0 0 0 188 189 288225 1 0 0 0 0 0 0 0 0 1 0 0 189 190 289351 1 0 0 0 0 0 0 0 0 0 1 0 190 191 294735 1 0 0 0 0 0 0 0 0 0 0 1 191 192 305333 1 0 0 0 0 0 0 0 0 0 0 0 192 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Dummy M1 M2 M3 M4 222966.5 -2730.3 -1889.4 -4738.3 -1766.4 -1480.4 M5 M6 M7 M8 M9 M10 684.0 -1076.5 -405.7 -209.7 -1027.4 -147.2 M11 t 1231.5 356.9 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -15837.0 -2075.5 519.2 2530.5 16575.9 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 222966.51 1164.43 191.481 < 2e-16 *** Dummy -2730.28 1149.74 -2.375 0.01863 * M1 -1889.40 1438.33 -1.314 0.19067 M2 -4738.35 1438.00 -3.295 0.00119 ** M3 -1766.35 1437.75 -1.229 0.22086 M4 -1480.36 1437.56 -1.030 0.30452 M5 683.95 1437.45 0.476 0.63479 M6 -1076.49 1437.42 -0.749 0.45490 M7 -405.74 1437.45 -0.282 0.77807 M8 -209.75 1437.56 -0.146 0.88416 M9 -1027.44 1437.75 -0.715 0.47578 M10 -147.24 1437.08 -0.102 0.91851 M11 1231.50 1436.97 0.857 0.39259 t 356.88 10.25 34.820 < 2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 4064 on 178 degrees of freedom Multiple R-squared: 0.9583, Adjusted R-squared: 0.9553 F-statistic: 314.8 on 13 and 178 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.62718628 0.74562743 0.37281372 [2,] 0.60427627 0.79144746 0.39572373 [3,] 0.57818018 0.84363963 0.42181982 [4,] 0.56278891 0.87442218 0.43721109 [5,] 0.53104243 0.93791513 0.46895757 [6,] 0.46493777 0.92987554 0.53506223 [7,] 0.37940075 0.75880149 0.62059925 [8,] 0.30708067 0.61416133 0.69291933 [9,] 0.23159280 0.46318561 0.76840720 [10,] 0.17140139 0.34280279 0.82859861 [11,] 0.16396901 0.32793802 0.83603099 [12,] 0.11617953 0.23235905 0.88382047 [13,] 0.10354947 0.20709893 0.89645053 [14,] 0.12981778 0.25963557 0.87018222 [15,] 0.12703218 0.25406436 0.87296782 [16,] 0.10473355 0.20946711 0.89526645 [17,] 0.09544078 0.19088155 0.90455922 [18,] 0.10049169 0.20098338 0.89950831 [19,] 0.08532889 0.17065778 0.91467111 [20,] 0.08545532 0.17091063 0.91454468 [21,] 0.07333361 0.14666722 0.92666639 [22,] 0.07103734 0.14207468 0.92896266 [23,] 0.06370204 0.12740409 0.93629796 [24,] 0.05163793 0.10327587 0.94836207 [25,] 0.04447048 0.08894095 0.95552952 [26,] 0.04958000 0.09916001 0.95042000 [27,] 0.04693130 0.09386260 0.95306870 [28,] 0.04681114 0.09362228 0.95318886 [29,] 0.04561392 0.09122785 0.95438608 [30,] 0.04182376 0.08364753 0.95817624 [31,] 0.04112426 0.08224853 0.95887574 [32,] 0.03989091 0.07978181 0.96010909 [33,] 0.04251378 0.08502757 0.95748622 [34,] 0.08683205 0.17366409 0.91316795 [35,] 0.11123703 0.22247405 0.88876297 [36,] 0.17200702 0.34401404 0.82799298 [37,] 0.21818008 0.43636017 0.78181992 [38,] 0.34003743 0.68007486 0.65996257 [39,] 0.38086980 0.76173960 0.61913020 [40,] 0.43680505 0.87361009 0.56319495 [41,] 0.49190216 0.98380432 0.50809784 [42,] 0.54165438 0.91669125 0.45834562 [43,] 0.55916208 0.88167584 0.44083792 [44,] 0.61986066 0.76027868 0.38013934 [45,] 0.61558064 0.76883872 0.38441936 [46,] 0.62374551 0.75250898 0.37625449 [47,] 0.62615919 0.74768162 0.37384081 [48,] 0.67114177 0.65771646 0.32885823 [49,] 0.67659573 0.64680855 0.32340427 [50,] 0.73679723 0.52640554 0.26320277 [51,] 0.77869824 0.44260353 0.22130176 [52,] 0.82447510 0.35104981 0.17552490 [53,] 0.86705253 0.26589494 0.13294747 [54,] 0.89026095 0.21947811 0.10973905 [55,] 0.92170500 0.15659001 0.07829500 [56,] 0.94136832 0.11726336 0.05863168 [57,] 0.94283215 0.11433571 0.05716785 [58,] 0.94951213 0.10097575 0.05048787 [59,] 0.96285400 0.07429199 0.03714600 [60,] 0.95659554 0.08680893 0.04340446 [61,] 0.95497344 0.09005312 0.04502656 [62,] 0.95613231 0.08773538 0.04386769 [63,] 0.95416404 0.09167192 0.04583596 [64,] 0.95614120 0.08771760 0.04385880 [65,] 0.95200751 0.09598499 0.04799249 [66,] 0.93990568 0.12018864 0.06009432 [67,] 0.92603900 0.14792201 0.07396100 [68,] 0.91170541 0.17658919 0.08829459 [69,] 0.89271033 0.21457933 0.10728967 [70,] 0.87108830 0.25782340 0.12891170 [71,] 0.84733324 0.30533352 0.15266676 [72,] 0.82242925 0.35514150 0.17757075 [73,] 0.79970928 0.40058144 0.20029072 [74,] 0.77678947 0.44642107 0.22321053 [75,] 0.74373679 0.51252643 0.25626321 [76,] 0.71026358 0.57947284 0.28973642 [77,] 0.67356812 0.65286376 0.32643188 [78,] 0.63701032 0.72597937 0.36298968 [79,] 0.59504981 0.80990038 0.40495019 [80,] 0.55243339 0.89513322 0.44756661 [81,] 0.55633033 0.88733934 0.44366967 [82,] 0.51385477 0.97229047 0.48614523 [83,] 0.46990625 0.93981249 0.53009375 [84,] 0.42786392 0.85572784 0.57213608 [85,] 0.38480406 0.76960811 0.61519594 [86,] 0.34952629 0.69905259 0.65047371 [87,] 0.31578824 0.63157648 0.68421176 [88,] 0.28370691 0.56741381 0.71629309 [89,] 0.24923648 0.49847297 0.75076352 [90,] 0.22440090 0.44880179 0.77559910 [91,] 0.20053670 0.40107340 0.79946330 [92,] 0.17507231 0.35014461 0.82492769 [93,] 0.16749815 0.33499631 0.83250185 [94,] 0.14617900 0.29235799 0.85382100 [95,] 0.12602673 0.25205346 0.87397327 [96,] 0.10486197 0.20972394 0.89513803 [97,] 0.09438206 0.18876412 0.90561794 [98,] 0.08498437 0.16996875 0.91501563 [99,] 0.07455909 0.14911818 0.92544091 [100,] 0.06543169 0.13086339 0.93456831 [101,] 0.05915228 0.11830456 0.94084772 [102,] 0.05502910 0.11005820 0.94497090 [103,] 0.04707347 0.09414694 0.95292653 [104,] 0.03935196 0.07870392 0.96064804 [105,] 0.03504109 0.07008217 0.96495891 [106,] 0.03436921 0.06873842 0.96563079 [107,] 0.03386283 0.06772565 0.96613717 [108,] 0.03663094 0.07326187 0.96336906 [109,] 0.02986822 0.05973644 0.97013178 [110,] 0.02656590 0.05313180 0.97343410 [111,] 0.02360754 0.04721507 0.97639246 [112,] 0.02077531 0.04155062 0.97922469 [113,] 0.02963128 0.05926256 0.97036872 [114,] 0.03449517 0.06899034 0.96550483 [115,] 0.03097027 0.06194054 0.96902973 [116,] 0.02655419 0.05310839 0.97344581 [117,] 0.02813749 0.05627498 0.97186251 [118,] 0.02553071 0.05106143 0.97446929 [119,] 0.02924752 0.05849505 0.97075248 [120,] 0.03434611 0.06869222 0.96565389 [121,] 0.03429752 0.06859504 0.96570248 [122,] 0.03415708 0.06831416 0.96584292 [123,] 0.05400611 0.10801222 0.94599389 [124,] 0.06705427 0.13410854 0.93294573 [125,] 0.11468074 0.22936149 0.88531926 [126,] 0.14977772 0.29955545 0.85022228 [127,] 0.17193618 0.34387236 0.82806382 [128,] 0.16428392 0.32856784 0.83571608 [129,] 0.17005134 0.34010268 0.82994866 [130,] 0.17161525 0.34323050 0.82838475 [131,] 0.18113332 0.36226664 0.81886668 [132,] 0.17441184 0.34882369 0.82558816 [133,] 0.17806671 0.35613342 0.82193329 [134,] 0.17456833 0.34913667 0.82543167 [135,] 0.17641475 0.35282950 0.82358525 [136,] 0.19155232 0.38310463 0.80844768 [137,] 0.31755049 0.63510097 0.68244951 [138,] 0.42614155 0.85228309 0.57385845 [139,] 0.40264279 0.80528558 0.59735721 [140,] 0.36413057 0.72826114 0.63586943 [141,] 0.34099675 0.68199351 0.65900325 [142,] 0.34351144 0.68702288 0.65648856 [143,] 0.43156625 0.86313251 0.56843375 [144,] 0.46712310 0.93424620 0.53287690 [145,] 0.53811640 0.92376721 0.46188360 [146,] 0.65158521 0.69682957 0.34841479 [147,] 0.62380053 0.75239894 0.37619947 [148,] 0.57963631 0.84072739 0.42036369 [149,] 0.56829924 0.86340152 0.43170076 [150,] 0.62155526 0.75688947 0.37844474 [151,] 0.54742676 0.90514647 0.45257324 [152,] 0.57491090 0.85017819 0.42508910 [153,] 0.51931164 0.96137673 0.48068836 [154,] 0.47071161 0.94142321 0.52928839 [155,] 0.41345613 0.82691226 0.58654387 [156,] 0.36962620 0.73925240 0.63037380 [157,] 0.26894830 0.53789660 0.73105170 [158,] 0.17114523 0.34229046 0.82885477 [159,] 0.09315373 0.18630745 0.90684627 > postscript(file="/var/www/html/freestat/rcomp/tmp/1g1yf1229455842.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') > points(x[,1]-mysum$resid) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/2n3g51229455842.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/3n6jd1229455842.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/4mify1229455842.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/5173n1229455842.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > qqline(mysum$resid) > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 192 Frequency = 1 1 2 3 4 5 6 -15836.99042 -13470.92792 -11206.80292 -10057.67792 -8398.86542 -4729.30292 7 8 9 10 11 12 -5299.92792 -4223.80292 -4316.99042 -4600.07024 -5765.69524 -4277.07024 13 14 15 16 17 18 -1552.54582 1690.51668 -259.35832 -2506.23332 -2696.42082 970.14168 19 20 21 22 23 24 -152.48332 137.64168 -44.54582 382.37435 153.74935 1149.37435 25 26 27 28 29 30 1555.89878 3920.96128 1305.08628 3460.21128 1424.02378 2874.58628 31 32 33 34 35 36 2730.96128 4516.08628 3241.89878 2106.81895 2593.19395 2437.81895 37 38 39 40 41 42 7270.34337 4440.40587 3790.53087 4961.65587 3837.46837 5221.03087 43 44 45 46 47 48 5369.40587 6217.53087 5495.34337 5666.26355 4275.63855 5481.26355 49 50 51 52 53 54 4487.78797 2048.85047 2461.97547 1159.10047 1068.91297 1189.47547 55 56 57 58 59 60 2990.85047 3383.97547 2142.78797 1647.70814 2004.08314 714.70814 61 62 63 64 65 66 3173.23257 2727.29507 1871.42007 -641.45493 429.35757 -415.07993 67 68 69 70 71 72 -302.70493 -246.57993 -1986.76743 -1752.84726 -3761.47226 -3333.84726 73 74 75 76 77 78 -1652.32284 -2734.26034 -4747.13534 -521.01034 -2609.19784 -2337.63534 79 80 81 82 83 84 -1697.26034 -2391.13534 -1653.32284 1414.87456 2017.24956 -385.12544 85 86 87 88 89 90 765.39899 565.46149 1266.58649 -21.28851 3072.52399 3392.08649 91 92 93 94 95 96 1612.46149 881.58649 330.39899 174.31916 1281.69416 734.31916 97 98 99 100 101 102 5440.84358 588.90608 1010.03108 451.15608 1359.96858 2046.53108 103 104 105 106 107 108 2169.90608 1479.03108 1170.84358 2641.76376 2704.13876 2032.76376 109 110 111 112 113 114 3918.28818 2409.35068 2636.47568 854.60068 3495.41318 2000.97568 115 116 117 118 119 120 1390.35068 206.47568 -2010.71182 -2234.79164 -1086.41664 -857.79164 121 122 123 124 125 126 1888.73278 3714.79528 4066.92028 4713.04528 472.85778 -1155.57972 127 128 129 130 131 132 366.79528 -1031.07972 4976.73278 3024.65295 238.02795 -1530.34705 133 134 135 136 137 138 868.17738 -301.76012 2636.36488 2537.48988 1098.30238 -1565.13512 139 140 141 142 143 144 1807.23988 -82.63512 1767.17738 -608.90245 -1179.52745 -4447.90245 145 146 147 148 149 150 -5993.37803 -2084.31553 -1512.19053 -2860.06553 -1613.25303 -4340.69053 151 152 153 154 155 156 -5544.31553 -3598.19053 -1047.37803 -2449.45785 -6451.08285 -5063.45785 157 158 159 160 161 162 -3885.93343 -2724.87093 -1186.74593 -2072.62093 -1714.80843 -2449.24593 163 164 165 166 167 168 -6657.87093 -7439.74593 -7295.93343 -5420.01326 -7081.63826 -8275.01326 169 170 171 172 173 174 -5321.48883 -5566.42633 -5949.30133 -4776.17633 -1431.36383 -3463.80133 175 176 177 178 179 180 -2371.42633 -337.30133 -2335.48883 -1447.56866 4954.80634 -955.56866 181 182 183 184 185 186 4873.95576 4776.01826 3816.14326 5319.26826 2205.08076 2761.64326 187 188 189 190 191 192 3588.01826 2528.14326 1565.95576 1454.87594 5103.25094 16575.87594 > postscript(file="/var/www/html/freestat/rcomp/tmp/6iaez1229455842.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 192 Frequency = 1 lag(myerror, k = 1) myerror 0 -15836.99042 NA 1 -13470.92792 -15836.99042 2 -11206.80292 -13470.92792 3 -10057.67792 -11206.80292 4 -8398.86542 -10057.67792 5 -4729.30292 -8398.86542 6 -5299.92792 -4729.30292 7 -4223.80292 -5299.92792 8 -4316.99042 -4223.80292 9 -4600.07024 -4316.99042 10 -5765.69524 -4600.07024 11 -4277.07024 -5765.69524 12 -1552.54582 -4277.07024 13 1690.51668 -1552.54582 14 -259.35832 1690.51668 15 -2506.23332 -259.35832 16 -2696.42082 -2506.23332 17 970.14168 -2696.42082 18 -152.48332 970.14168 19 137.64168 -152.48332 20 -44.54582 137.64168 21 382.37435 -44.54582 22 153.74935 382.37435 23 1149.37435 153.74935 24 1555.89878 1149.37435 25 3920.96128 1555.89878 26 1305.08628 3920.96128 27 3460.21128 1305.08628 28 1424.02378 3460.21128 29 2874.58628 1424.02378 30 2730.96128 2874.58628 31 4516.08628 2730.96128 32 3241.89878 4516.08628 33 2106.81895 3241.89878 34 2593.19395 2106.81895 35 2437.81895 2593.19395 36 7270.34337 2437.81895 37 4440.40587 7270.34337 38 3790.53087 4440.40587 39 4961.65587 3790.53087 40 3837.46837 4961.65587 41 5221.03087 3837.46837 42 5369.40587 5221.03087 43 6217.53087 5369.40587 44 5495.34337 6217.53087 45 5666.26355 5495.34337 46 4275.63855 5666.26355 47 5481.26355 4275.63855 48 4487.78797 5481.26355 49 2048.85047 4487.78797 50 2461.97547 2048.85047 51 1159.10047 2461.97547 52 1068.91297 1159.10047 53 1189.47547 1068.91297 54 2990.85047 1189.47547 55 3383.97547 2990.85047 56 2142.78797 3383.97547 57 1647.70814 2142.78797 58 2004.08314 1647.70814 59 714.70814 2004.08314 60 3173.23257 714.70814 61 2727.29507 3173.23257 62 1871.42007 2727.29507 63 -641.45493 1871.42007 64 429.35757 -641.45493 65 -415.07993 429.35757 66 -302.70493 -415.07993 67 -246.57993 -302.70493 68 -1986.76743 -246.57993 69 -1752.84726 -1986.76743 70 -3761.47226 -1752.84726 71 -3333.84726 -3761.47226 72 -1652.32284 -3333.84726 73 -2734.26034 -1652.32284 74 -4747.13534 -2734.26034 75 -521.01034 -4747.13534 76 -2609.19784 -521.01034 77 -2337.63534 -2609.19784 78 -1697.26034 -2337.63534 79 -2391.13534 -1697.26034 80 -1653.32284 -2391.13534 81 1414.87456 -1653.32284 82 2017.24956 1414.87456 83 -385.12544 2017.24956 84 765.39899 -385.12544 85 565.46149 765.39899 86 1266.58649 565.46149 87 -21.28851 1266.58649 88 3072.52399 -21.28851 89 3392.08649 3072.52399 90 1612.46149 3392.08649 91 881.58649 1612.46149 92 330.39899 881.58649 93 174.31916 330.39899 94 1281.69416 174.31916 95 734.31916 1281.69416 96 5440.84358 734.31916 97 588.90608 5440.84358 98 1010.03108 588.90608 99 451.15608 1010.03108 100 1359.96858 451.15608 101 2046.53108 1359.96858 102 2169.90608 2046.53108 103 1479.03108 2169.90608 104 1170.84358 1479.03108 105 2641.76376 1170.84358 106 2704.13876 2641.76376 107 2032.76376 2704.13876 108 3918.28818 2032.76376 109 2409.35068 3918.28818 110 2636.47568 2409.35068 111 854.60068 2636.47568 112 3495.41318 854.60068 113 2000.97568 3495.41318 114 1390.35068 2000.97568 115 206.47568 1390.35068 116 -2010.71182 206.47568 117 -2234.79164 -2010.71182 118 -1086.41664 -2234.79164 119 -857.79164 -1086.41664 120 1888.73278 -857.79164 121 3714.79528 1888.73278 122 4066.92028 3714.79528 123 4713.04528 4066.92028 124 472.85778 4713.04528 125 -1155.57972 472.85778 126 366.79528 -1155.57972 127 -1031.07972 366.79528 128 4976.73278 -1031.07972 129 3024.65295 4976.73278 130 238.02795 3024.65295 131 -1530.34705 238.02795 132 868.17738 -1530.34705 133 -301.76012 868.17738 134 2636.36488 -301.76012 135 2537.48988 2636.36488 136 1098.30238 2537.48988 137 -1565.13512 1098.30238 138 1807.23988 -1565.13512 139 -82.63512 1807.23988 140 1767.17738 -82.63512 141 -608.90245 1767.17738 142 -1179.52745 -608.90245 143 -4447.90245 -1179.52745 144 -5993.37803 -4447.90245 145 -2084.31553 -5993.37803 146 -1512.19053 -2084.31553 147 -2860.06553 -1512.19053 148 -1613.25303 -2860.06553 149 -4340.69053 -1613.25303 150 -5544.31553 -4340.69053 151 -3598.19053 -5544.31553 152 -1047.37803 -3598.19053 153 -2449.45785 -1047.37803 154 -6451.08285 -2449.45785 155 -5063.45785 -6451.08285 156 -3885.93343 -5063.45785 157 -2724.87093 -3885.93343 158 -1186.74593 -2724.87093 159 -2072.62093 -1186.74593 160 -1714.80843 -2072.62093 161 -2449.24593 -1714.80843 162 -6657.87093 -2449.24593 163 -7439.74593 -6657.87093 164 -7295.93343 -7439.74593 165 -5420.01326 -7295.93343 166 -7081.63826 -5420.01326 167 -8275.01326 -7081.63826 168 -5321.48883 -8275.01326 169 -5566.42633 -5321.48883 170 -5949.30133 -5566.42633 171 -4776.17633 -5949.30133 172 -1431.36383 -4776.17633 173 -3463.80133 -1431.36383 174 -2371.42633 -3463.80133 175 -337.30133 -2371.42633 176 -2335.48883 -337.30133 177 -1447.56866 -2335.48883 178 4954.80634 -1447.56866 179 -955.56866 4954.80634 180 4873.95576 -955.56866 181 4776.01826 4873.95576 182 3816.14326 4776.01826 183 5319.26826 3816.14326 184 2205.08076 5319.26826 185 2761.64326 2205.08076 186 3588.01826 2761.64326 187 2528.14326 3588.01826 188 1565.95576 2528.14326 189 1454.87594 1565.95576 190 5103.25094 1454.87594 191 16575.87594 5103.25094 192 NA 16575.87594 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -13470.92792 -15836.99042 [2,] -11206.80292 -13470.92792 [3,] -10057.67792 -11206.80292 [4,] -8398.86542 -10057.67792 [5,] -4729.30292 -8398.86542 [6,] -5299.92792 -4729.30292 [7,] -4223.80292 -5299.92792 [8,] -4316.99042 -4223.80292 [9,] -4600.07024 -4316.99042 [10,] -5765.69524 -4600.07024 [11,] -4277.07024 -5765.69524 [12,] -1552.54582 -4277.07024 [13,] 1690.51668 -1552.54582 [14,] -259.35832 1690.51668 [15,] -2506.23332 -259.35832 [16,] -2696.42082 -2506.23332 [17,] 970.14168 -2696.42082 [18,] -152.48332 970.14168 [19,] 137.64168 -152.48332 [20,] -44.54582 137.64168 [21,] 382.37435 -44.54582 [22,] 153.74935 382.37435 [23,] 1149.37435 153.74935 [24,] 1555.89878 1149.37435 [25,] 3920.96128 1555.89878 [26,] 1305.08628 3920.96128 [27,] 3460.21128 1305.08628 [28,] 1424.02378 3460.21128 [29,] 2874.58628 1424.02378 [30,] 2730.96128 2874.58628 [31,] 4516.08628 2730.96128 [32,] 3241.89878 4516.08628 [33,] 2106.81895 3241.89878 [34,] 2593.19395 2106.81895 [35,] 2437.81895 2593.19395 [36,] 7270.34337 2437.81895 [37,] 4440.40587 7270.34337 [38,] 3790.53087 4440.40587 [39,] 4961.65587 3790.53087 [40,] 3837.46837 4961.65587 [41,] 5221.03087 3837.46837 [42,] 5369.40587 5221.03087 [43,] 6217.53087 5369.40587 [44,] 5495.34337 6217.53087 [45,] 5666.26355 5495.34337 [46,] 4275.63855 5666.26355 [47,] 5481.26355 4275.63855 [48,] 4487.78797 5481.26355 [49,] 2048.85047 4487.78797 [50,] 2461.97547 2048.85047 [51,] 1159.10047 2461.97547 [52,] 1068.91297 1159.10047 [53,] 1189.47547 1068.91297 [54,] 2990.85047 1189.47547 [55,] 3383.97547 2990.85047 [56,] 2142.78797 3383.97547 [57,] 1647.70814 2142.78797 [58,] 2004.08314 1647.70814 [59,] 714.70814 2004.08314 [60,] 3173.23257 714.70814 [61,] 2727.29507 3173.23257 [62,] 1871.42007 2727.29507 [63,] -641.45493 1871.42007 [64,] 429.35757 -641.45493 [65,] -415.07993 429.35757 [66,] -302.70493 -415.07993 [67,] -246.57993 -302.70493 [68,] -1986.76743 -246.57993 [69,] -1752.84726 -1986.76743 [70,] -3761.47226 -1752.84726 [71,] -3333.84726 -3761.47226 [72,] -1652.32284 -3333.84726 [73,] -2734.26034 -1652.32284 [74,] -4747.13534 -2734.26034 [75,] -521.01034 -4747.13534 [76,] -2609.19784 -521.01034 [77,] -2337.63534 -2609.19784 [78,] -1697.26034 -2337.63534 [79,] -2391.13534 -1697.26034 [80,] -1653.32284 -2391.13534 [81,] 1414.87456 -1653.32284 [82,] 2017.24956 1414.87456 [83,] -385.12544 2017.24956 [84,] 765.39899 -385.12544 [85,] 565.46149 765.39899 [86,] 1266.58649 565.46149 [87,] -21.28851 1266.58649 [88,] 3072.52399 -21.28851 [89,] 3392.08649 3072.52399 [90,] 1612.46149 3392.08649 [91,] 881.58649 1612.46149 [92,] 330.39899 881.58649 [93,] 174.31916 330.39899 [94,] 1281.69416 174.31916 [95,] 734.31916 1281.69416 [96,] 5440.84358 734.31916 [97,] 588.90608 5440.84358 [98,] 1010.03108 588.90608 [99,] 451.15608 1010.03108 [100,] 1359.96858 451.15608 [101,] 2046.53108 1359.96858 [102,] 2169.90608 2046.53108 [103,] 1479.03108 2169.90608 [104,] 1170.84358 1479.03108 [105,] 2641.76376 1170.84358 [106,] 2704.13876 2641.76376 [107,] 2032.76376 2704.13876 [108,] 3918.28818 2032.76376 [109,] 2409.35068 3918.28818 [110,] 2636.47568 2409.35068 [111,] 854.60068 2636.47568 [112,] 3495.41318 854.60068 [113,] 2000.97568 3495.41318 [114,] 1390.35068 2000.97568 [115,] 206.47568 1390.35068 [116,] -2010.71182 206.47568 [117,] -2234.79164 -2010.71182 [118,] -1086.41664 -2234.79164 [119,] -857.79164 -1086.41664 [120,] 1888.73278 -857.79164 [121,] 3714.79528 1888.73278 [122,] 4066.92028 3714.79528 [123,] 4713.04528 4066.92028 [124,] 472.85778 4713.04528 [125,] -1155.57972 472.85778 [126,] 366.79528 -1155.57972 [127,] -1031.07972 366.79528 [128,] 4976.73278 -1031.07972 [129,] 3024.65295 4976.73278 [130,] 238.02795 3024.65295 [131,] -1530.34705 238.02795 [132,] 868.17738 -1530.34705 [133,] -301.76012 868.17738 [134,] 2636.36488 -301.76012 [135,] 2537.48988 2636.36488 [136,] 1098.30238 2537.48988 [137,] -1565.13512 1098.30238 [138,] 1807.23988 -1565.13512 [139,] -82.63512 1807.23988 [140,] 1767.17738 -82.63512 [141,] -608.90245 1767.17738 [142,] -1179.52745 -608.90245 [143,] -4447.90245 -1179.52745 [144,] -5993.37803 -4447.90245 [145,] -2084.31553 -5993.37803 [146,] -1512.19053 -2084.31553 [147,] -2860.06553 -1512.19053 [148,] -1613.25303 -2860.06553 [149,] -4340.69053 -1613.25303 [150,] -5544.31553 -4340.69053 [151,] -3598.19053 -5544.31553 [152,] -1047.37803 -3598.19053 [153,] -2449.45785 -1047.37803 [154,] -6451.08285 -2449.45785 [155,] -5063.45785 -6451.08285 [156,] -3885.93343 -5063.45785 [157,] -2724.87093 -3885.93343 [158,] -1186.74593 -2724.87093 [159,] -2072.62093 -1186.74593 [160,] -1714.80843 -2072.62093 [161,] -2449.24593 -1714.80843 [162,] -6657.87093 -2449.24593 [163,] -7439.74593 -6657.87093 [164,] -7295.93343 -7439.74593 [165,] -5420.01326 -7295.93343 [166,] -7081.63826 -5420.01326 [167,] -8275.01326 -7081.63826 [168,] -5321.48883 -8275.01326 [169,] -5566.42633 -5321.48883 [170,] -5949.30133 -5566.42633 [171,] -4776.17633 -5949.30133 [172,] -1431.36383 -4776.17633 [173,] -3463.80133 -1431.36383 [174,] -2371.42633 -3463.80133 [175,] -337.30133 -2371.42633 [176,] -2335.48883 -337.30133 [177,] -1447.56866 -2335.48883 [178,] 4954.80634 -1447.56866 [179,] -955.56866 4954.80634 [180,] 4873.95576 -955.56866 [181,] 4776.01826 4873.95576 [182,] 3816.14326 4776.01826 [183,] 5319.26826 3816.14326 [184,] 2205.08076 5319.26826 [185,] 2761.64326 2205.08076 [186,] 3588.01826 2761.64326 [187,] 2528.14326 3588.01826 [188,] 1565.95576 2528.14326 [189,] 1454.87594 1565.95576 [190,] 5103.25094 1454.87594 [191,] 16575.87594 5103.25094 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -13470.92792 -15836.99042 2 -11206.80292 -13470.92792 3 -10057.67792 -11206.80292 4 -8398.86542 -10057.67792 5 -4729.30292 -8398.86542 6 -5299.92792 -4729.30292 7 -4223.80292 -5299.92792 8 -4316.99042 -4223.80292 9 -4600.07024 -4316.99042 10 -5765.69524 -4600.07024 11 -4277.07024 -5765.69524 12 -1552.54582 -4277.07024 13 1690.51668 -1552.54582 14 -259.35832 1690.51668 15 -2506.23332 -259.35832 16 -2696.42082 -2506.23332 17 970.14168 -2696.42082 18 -152.48332 970.14168 19 137.64168 -152.48332 20 -44.54582 137.64168 21 382.37435 -44.54582 22 153.74935 382.37435 23 1149.37435 153.74935 24 1555.89878 1149.37435 25 3920.96128 1555.89878 26 1305.08628 3920.96128 27 3460.21128 1305.08628 28 1424.02378 3460.21128 29 2874.58628 1424.02378 30 2730.96128 2874.58628 31 4516.08628 2730.96128 32 3241.89878 4516.08628 33 2106.81895 3241.89878 34 2593.19395 2106.81895 35 2437.81895 2593.19395 36 7270.34337 2437.81895 37 4440.40587 7270.34337 38 3790.53087 4440.40587 39 4961.65587 3790.53087 40 3837.46837 4961.65587 41 5221.03087 3837.46837 42 5369.40587 5221.03087 43 6217.53087 5369.40587 44 5495.34337 6217.53087 45 5666.26355 5495.34337 46 4275.63855 5666.26355 47 5481.26355 4275.63855 48 4487.78797 5481.26355 49 2048.85047 4487.78797 50 2461.97547 2048.85047 51 1159.10047 2461.97547 52 1068.91297 1159.10047 53 1189.47547 1068.91297 54 2990.85047 1189.47547 55 3383.97547 2990.85047 56 2142.78797 3383.97547 57 1647.70814 2142.78797 58 2004.08314 1647.70814 59 714.70814 2004.08314 60 3173.23257 714.70814 61 2727.29507 3173.23257 62 1871.42007 2727.29507 63 -641.45493 1871.42007 64 429.35757 -641.45493 65 -415.07993 429.35757 66 -302.70493 -415.07993 67 -246.57993 -302.70493 68 -1986.76743 -246.57993 69 -1752.84726 -1986.76743 70 -3761.47226 -1752.84726 71 -3333.84726 -3761.47226 72 -1652.32284 -3333.84726 73 -2734.26034 -1652.32284 74 -4747.13534 -2734.26034 75 -521.01034 -4747.13534 76 -2609.19784 -521.01034 77 -2337.63534 -2609.19784 78 -1697.26034 -2337.63534 79 -2391.13534 -1697.26034 80 -1653.32284 -2391.13534 81 1414.87456 -1653.32284 82 2017.24956 1414.87456 83 -385.12544 2017.24956 84 765.39899 -385.12544 85 565.46149 765.39899 86 1266.58649 565.46149 87 -21.28851 1266.58649 88 3072.52399 -21.28851 89 3392.08649 3072.52399 90 1612.46149 3392.08649 91 881.58649 1612.46149 92 330.39899 881.58649 93 174.31916 330.39899 94 1281.69416 174.31916 95 734.31916 1281.69416 96 5440.84358 734.31916 97 588.90608 5440.84358 98 1010.03108 588.90608 99 451.15608 1010.03108 100 1359.96858 451.15608 101 2046.53108 1359.96858 102 2169.90608 2046.53108 103 1479.03108 2169.90608 104 1170.84358 1479.03108 105 2641.76376 1170.84358 106 2704.13876 2641.76376 107 2032.76376 2704.13876 108 3918.28818 2032.76376 109 2409.35068 3918.28818 110 2636.47568 2409.35068 111 854.60068 2636.47568 112 3495.41318 854.60068 113 2000.97568 3495.41318 114 1390.35068 2000.97568 115 206.47568 1390.35068 116 -2010.71182 206.47568 117 -2234.79164 -2010.71182 118 -1086.41664 -2234.79164 119 -857.79164 -1086.41664 120 1888.73278 -857.79164 121 3714.79528 1888.73278 122 4066.92028 3714.79528 123 4713.04528 4066.92028 124 472.85778 4713.04528 125 -1155.57972 472.85778 126 366.79528 -1155.57972 127 -1031.07972 366.79528 128 4976.73278 -1031.07972 129 3024.65295 4976.73278 130 238.02795 3024.65295 131 -1530.34705 238.02795 132 868.17738 -1530.34705 133 -301.76012 868.17738 134 2636.36488 -301.76012 135 2537.48988 2636.36488 136 1098.30238 2537.48988 137 -1565.13512 1098.30238 138 1807.23988 -1565.13512 139 -82.63512 1807.23988 140 1767.17738 -82.63512 141 -608.90245 1767.17738 142 -1179.52745 -608.90245 143 -4447.90245 -1179.52745 144 -5993.37803 -4447.90245 145 -2084.31553 -5993.37803 146 -1512.19053 -2084.31553 147 -2860.06553 -1512.19053 148 -1613.25303 -2860.06553 149 -4340.69053 -1613.25303 150 -5544.31553 -4340.69053 151 -3598.19053 -5544.31553 152 -1047.37803 -3598.19053 153 -2449.45785 -1047.37803 154 -6451.08285 -2449.45785 155 -5063.45785 -6451.08285 156 -3885.93343 -5063.45785 157 -2724.87093 -3885.93343 158 -1186.74593 -2724.87093 159 -2072.62093 -1186.74593 160 -1714.80843 -2072.62093 161 -2449.24593 -1714.80843 162 -6657.87093 -2449.24593 163 -7439.74593 -6657.87093 164 -7295.93343 -7439.74593 165 -5420.01326 -7295.93343 166 -7081.63826 -5420.01326 167 -8275.01326 -7081.63826 168 -5321.48883 -8275.01326 169 -5566.42633 -5321.48883 170 -5949.30133 -5566.42633 171 -4776.17633 -5949.30133 172 -1431.36383 -4776.17633 173 -3463.80133 -1431.36383 174 -2371.42633 -3463.80133 175 -337.30133 -2371.42633 176 -2335.48883 -337.30133 177 -1447.56866 -2335.48883 178 4954.80634 -1447.56866 179 -955.56866 4954.80634 180 4873.95576 -955.56866 181 4776.01826 4873.95576 182 3816.14326 4776.01826 183 5319.26826 3816.14326 184 2205.08076 5319.26826 185 2761.64326 2205.08076 186 3588.01826 2761.64326 187 2528.14326 3588.01826 188 1565.95576 2528.14326 189 1454.87594 1565.95576 190 5103.25094 1454.87594 191 16575.87594 5103.25094 > 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/html/freestat/rcomp/tmp/7y0v11229455842.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/8n84w1229455842.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/9erdk1229455842.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/html/freestat/rcomp/tmp/10zaga1229455842.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/html/freestat/rcomp/tmp/11hnnv1229455842.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/html/freestat/rcomp/tmp/12yg371229455842.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/html/freestat/rcomp/tmp/13mvie1229455843.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/html/freestat/rcomp/tmp/145fn81229455843.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/html/freestat/rcomp/tmp/15ssy71229455843.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/html/freestat/rcomp/tmp/16mr271229455843.tab") + } > > system("convert tmp/1g1yf1229455842.ps tmp/1g1yf1229455842.png") > system("convert tmp/2n3g51229455842.ps tmp/2n3g51229455842.png") > system("convert tmp/3n6jd1229455842.ps tmp/3n6jd1229455842.png") > system("convert tmp/4mify1229455842.ps tmp/4mify1229455842.png") > system("convert tmp/5173n1229455842.ps tmp/5173n1229455842.png") > system("convert tmp/6iaez1229455842.ps tmp/6iaez1229455842.png") > system("convert tmp/7y0v11229455842.ps tmp/7y0v11229455842.png") > system("convert tmp/8n84w1229455842.ps tmp/8n84w1229455842.png") > system("convert tmp/9erdk1229455842.ps tmp/9erdk1229455842.png") > system("convert tmp/10zaga1229455842.ps tmp/10zaga1229455842.png") > > > proc.time() user system elapsed 6.175 2.674 6.613