R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-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(4 + ,5 + ,7 + ,0 + ,12 + ,14 + ,16 + ,17 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,16 + ,18 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,16 + ,18 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,16 + ,18 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,16 + ,18 + ,4 + ,5 + ,8 + ,0 + ,12 + ,14 + ,15 + ,17 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,16 + ,18 + ,4 + ,6 + ,7 + ,0 + ,12 + ,14 + ,16 + ,18 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,16 + ,17 + ,4 + ,5 + ,8 + ,0 + ,12 + ,14 + ,16 + ,18 + ,4 + ,5 + ,7 + ,0 + ,12 + ,14 + ,16 + ,18 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,16 + ,18 + ,4 + ,6 + ,8 + ,0 + ,11 + ,14 + ,15 + ,18 + ,4 + ,5 + ,7 + ,0 + ,12 + ,14 + ,16 + ,18 + ,4 + ,6 + ,8 + ,0 + ,11 + ,14 + ,15 + ,17 + ,4 + ,6 + ,7 + ,0 + ,11 + ,14 + ,15 + ,17 + ,4 + ,5 + ,7 + ,0 + ,11 + ,13 + ,15 + ,18 + ,4 + ,5 + ,7 + ,0 + ,12 + ,14 + ,16 + ,18 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,16 + ,17 + ,4 + ,6 + ,7 + ,0 + ,11 + ,13 + ,15 + ,17 + ,4 + ,5 + ,8 + ,0 + ,12 + ,14 + ,15 + ,18 + ,4 + ,5 + ,8 + ,0 + ,11 + ,14 + ,15 + ,17 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,15 + ,17 + ,4 + ,5 + ,8 + ,0 + ,12 + ,14 + ,15 + ,17 + ,4 + ,6 + ,7 + ,0 + ,11 + ,14 + ,16 + ,17 + ,4 + ,6 + ,8 + ,0 + ,11 + ,14 + ,15 + ,18 + ,4 + ,5 + ,8 + ,0 + ,12 + ,14 + ,16 + ,17 + ,4 + ,6 + ,8 + ,0 + ,11 + ,14 + ,16 + ,18 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,16 + ,17 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,15 + ,18 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,16 + ,18 + ,4 + ,5 + ,8 + ,0 + ,12 + ,14 + ,16 + ,18 + ,4 + ,5 + ,8 + ,0 + ,12 + ,14 + ,15 + ,18 + ,4 + ,6 + ,7 + ,0 + ,12 + ,14 + ,16 + ,17 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,16 + ,18 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,16 + ,18 + ,4 + ,5 + ,7 + ,0 + ,11 + ,14 + ,15 + ,18 + ,4 + ,6 + ,8 + ,0 + ,11 + ,14 + ,16 + ,17 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,15 + ,17 + ,4 + ,6 + ,7 + ,0 + ,12 + ,14 + ,15 + ,18 + ,4 + ,6 + ,8 + ,0 + ,11 + ,13 + ,15 + ,17 + ,4 + ,6 + ,8 + ,0 + ,11 + ,14 + ,16 + ,17 + ,4 + ,5 + ,8 + ,0 + ,12 + ,14 + ,15 + ,17 + ,4 + ,5 + ,7 + ,0 + ,12 + ,14 + ,16 + ,18 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,15 + ,18 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,15 + ,17 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,16 + ,18 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,16 + ,17 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,15 + ,17 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,16 + ,18 + ,4 + ,6 + ,7 + ,0 + ,11 + ,14 + ,16 + ,18 + ,4 + ,5 + ,7 + ,0 + ,11 + ,13 + ,15 + ,18 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,16 + ,17 + ,4 + ,6 + ,8 + ,0 + ,11 + ,13 + ,16 + ,18 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,16 + ,18 + ,4 + ,6 + ,7 + ,0 + ,11 + ,14 + ,16 + ,17 + ,4 + ,6 + ,8 + ,0 + ,11 + ,14 + ,15 + ,17 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,16 + ,17 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,16 + ,17 + ,4 + ,5 + ,7 + ,0 + ,11 + ,13 + ,15 + ,17 + ,4 + ,5 + ,7 + ,0 + ,12 + ,14 + ,16 + ,17 + ,4 + ,6 + ,8 + ,0 + ,11 + ,14 + ,15 + ,18 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,16 + ,18 + ,4 + ,5 + ,7 + ,0 + ,12 + ,14 + ,16 + ,17 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,16 + ,18 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,16 + ,18 + ,4 + ,6 + ,7 + ,0 + ,11 + ,13 + ,15 + ,18 + ,4 + ,5 + ,8 + ,0 + ,12 + ,14 + ,16 + ,18 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,16 + ,17 + ,4 + ,6 + ,8 + ,0 + ,11 + ,14 + ,16 + ,18 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,16 + ,18 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,16 + ,17 + ,4 + ,6 + ,8 + ,0 + ,11 + ,14 + ,16 + ,17 + ,4 + ,5 + ,8 + ,0 + ,11 + ,14 + ,16 + ,18 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,16 + ,17 + ,4 + ,6 + ,7 + ,0 + ,12 + ,14 + ,15 + ,17 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,16 + ,17 + ,4 + ,6 + ,8 + ,0 + ,11 + ,14 + ,15 + ,17 + ,4 + ,6 + ,7 + ,0 + ,11 + ,13 + ,16 + ,17 + ,4 + ,6 + ,7 + ,0 + ,12 + ,14 + ,15 + ,18 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,16 + ,18 + ,4 + ,5 + ,8 + ,0 + ,11 + ,14 + ,16 + ,17 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,16 + ,18 + ,4 + ,6 + ,8 + ,0 + ,11 + ,13 + ,16 + ,18 + ,4 + ,6 + ,8 + ,0 + ,12 + ,14 + ,15 + ,17 + ,4 + ,5 + ,8 + ,0 + ,12 + ,14 + ,16 + ,18 + ,2 + ,5 + ,0 + ,10 + ,12 + ,14 + ,16 + ,17 + ,2 + ,5 + ,0 + ,9 + ,11 + ,14 + ,16 + ,17 + ,2 + ,6 + ,0 + ,10 + ,12 + ,14 + ,16 + ,18 + ,2 + ,6 + ,0 + ,10 + ,12 + ,14 + ,16 + ,17 + ,2 + ,6 + ,0 + ,10 + ,12 + ,14 + ,15 + ,18 + ,2 + ,5 + ,0 + ,9 + ,12 + ,14 + ,16 + ,18 + ,2 + ,5 + ,0 + ,10 + ,12 + ,14 + ,15 + ,18 + ,2 + ,6 + ,0 + ,10 + ,12 + ,14 + ,16 + ,18 + ,2 + ,6 + ,0 + ,9 + ,12 + ,14 + ,16 + ,18 + ,2 + ,6 + ,0 + ,10 + ,12 + ,14 + ,16 + ,17 + ,2 + ,5 + ,0 + ,9 + ,12 + ,14 + ,16 + ,18 + ,2 + ,6 + ,0 + ,10 + ,12 + ,14 + ,16 + ,18 + ,2 + ,5 + ,0 + ,10 + ,12 + ,14 + ,16 + ,18 + ,2 + ,6 + ,0 + ,10 + ,12 + ,14 + ,16 + ,17 + ,2 + ,5 + ,0 + ,10 + ,12 + ,14 + ,16 + ,17 + ,2 + ,6 + ,0 + ,10 + ,12 + ,14 + ,16 + ,18 + ,2 + ,6 + ,0 + ,10 + ,12 + ,14 + ,16 + ,18 + ,2 + ,6 + ,0 + ,10 + ,12 + ,14 + ,16 + ,18 + ,2 + ,6 + ,0 + ,9 + ,11 + ,14 + ,16 + ,18 + ,2 + ,6 + ,0 + ,10 + ,12 + ,14 + ,16 + ,18 + ,2 + ,6 + ,0 + ,10 + ,12 + ,14 + ,16 + ,18 + ,2 + ,5 + ,0 + ,9 + ,11 + ,14 + ,16 + ,18 + ,2 + ,6 + ,0 + ,10 + ,12 + ,14 + ,16 + ,18 + ,2 + ,5 + ,0 + ,10 + ,12 + ,14 + ,16 + ,18 + ,2 + ,5 + ,0 + ,9 + ,11 + ,14 + ,15 + ,18 + ,2 + ,6 + ,0 + ,9 + ,12 + ,14 + ,16 + ,18 + ,2 + ,6 + ,0 + ,10 + ,11 + ,14 + ,16 + ,18 + ,2 + ,5 + ,0 + ,9 + ,11 + ,14 + ,16 + ,18 + ,2 + ,5 + ,0 + ,10 + ,12 + ,14 + ,16 + ,18 + ,2 + ,6 + ,0 + ,10 + ,12 + ,14 + ,16 + ,18 + ,2 + ,5 + ,0 + ,10 + ,12 + ,14 + ,16 + ,17 + ,2 + ,5 + ,0 + ,10 + ,12 + ,14 + ,16 + ,18 + ,2 + ,6 + ,0 + ,10 + ,12 + ,14 + ,16 + ,18 + ,2 + ,6 + ,0 + ,10 + ,12 + ,14 + ,16 + ,17 + ,2 + ,5 + ,0 + ,10 + ,12 + ,14 + ,16 + ,18 + ,2 + ,6 + ,0 + ,10 + ,12 + ,14 + ,16 + ,18 + ,2 + ,5 + ,0 + ,9 + ,11 + ,14 + ,16 + ,18 + ,2 + ,6 + ,0 + ,10 + ,11 + ,14 + ,15 + ,17 + ,2 + ,6 + ,0 + ,10 + ,12 + ,14 + ,16 + ,17 + ,2 + ,6 + ,0 + ,9 + ,12 + ,14 + ,16 + ,18 + ,2 + ,6 + ,0 + ,10 + ,12 + ,14 + ,15 + ,18 + ,2 + ,6 + ,0 + ,10 + ,12 + ,14 + ,16 + ,17 + ,2 + ,6 + ,0 + ,10 + ,12 + ,14 + ,16 + ,18 + ,2 + ,6 + ,0 + ,10 + ,12 + ,14 + ,16 + ,17 + ,2 + ,5 + ,0 + ,10 + ,12 + ,14 + ,16 + ,18 + ,2 + ,5 + ,0 + ,10 + ,12 + ,14 + ,16 + ,17 + ,2 + ,5 + ,0 + ,10 + ,11 + ,14 + ,16 + ,18 + ,2 + ,6 + ,0 + ,10 + ,12 + ,14 + ,16 + ,18 + ,2 + ,6 + ,0 + ,10 + ,12 + ,14 + ,16 + ,18 + ,2 + ,6 + ,0 + ,10 + ,12 + ,14 + ,16 + ,18 + ,2 + ,5 + ,0 + ,10 + ,11 + ,14 + ,15 + ,17 + ,2 + ,5 + ,0 + ,9 + ,11 + ,14 + ,15 + ,17 + ,2 + ,6 + ,0 + ,9 + ,12 + ,14 + ,16 + ,18 + ,2 + ,6 + ,0 + ,10 + ,12 + ,14 + ,16 + ,18 + ,2 + ,6 + ,0 + ,10 + ,11 + ,13 + ,16 + ,17 + ,2 + ,6 + ,0 + ,9 + ,11 + ,14 + ,16 + ,17 + ,2 + ,5 + ,0 + ,10 + ,12 + ,14 + ,16 + ,18 + ,2 + ,6 + ,0 + ,10 + ,12 + ,14 + ,15 + ,17 + ,2 + ,6 + ,0 + ,10 + ,12 + ,14 + ,15 + ,18 + ,2 + ,6 + ,0 + ,9 + ,12 + ,14 + ,16 + ,17 + ,2 + ,6 + ,0 + ,9 + ,11 + ,14 + ,16 + ,18 + ,2 + ,6 + ,0 + ,9 + ,12 + ,14 + ,16 + ,18 + ,2 + ,5 + ,0 + ,10 + ,12 + ,14 + ,16 + ,18 + ,2 + ,6 + ,0 + ,10 + ,12 + ,14 + ,15 + ,17 + ,2 + ,6 + ,0 + ,10 + ,12 + ,14 + ,16 + ,17 + ,2 + ,5 + ,0 + ,10 + ,11 + ,13 + ,16 + ,18 + ,2 + ,5 + ,0 + ,10 + ,11 + ,13 + ,15 + ,18 + ,2 + ,5 + ,0 + ,10 + ,11 + ,14 + ,16 + ,18) + ,dim=c(8 + ,154) + ,dimnames=list(c('Weeks' + ,'Uselimit' + ,'T40' + ,'T20' + ,'Used' + ,'CorrectAnalysis' + ,'Useful' + ,'Outcome') + ,1:154)) > y <- array(NA,dim=c(8,154),dimnames=list(c('Weeks','Uselimit','T40','T20','Used','CorrectAnalysis','Useful','Outcome'),1:154)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '6' > par3 <- 'No Linear Trend' > par2 <- 'Do not include Seasonal Dummies' > par1 <- '6' > #'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, 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 CorrectAnalysis Weeks Uselimit T40 T20 Used Useful Outcome 1 14 4 5 7 0 12 16 17 2 14 4 6 8 0 12 16 18 3 14 4 6 8 0 12 16 18 4 14 4 6 8 0 12 16 18 5 14 4 6 8 0 12 16 18 6 14 4 5 8 0 12 15 17 7 14 4 6 8 0 12 16 18 8 14 4 6 7 0 12 16 18 9 14 4 6 8 0 12 16 17 10 14 4 5 8 0 12 16 18 11 14 4 5 7 0 12 16 18 12 14 4 6 8 0 12 16 18 13 14 4 6 8 0 11 15 18 14 14 4 5 7 0 12 16 18 15 14 4 6 8 0 11 15 17 16 14 4 6 7 0 11 15 17 17 13 4 5 7 0 11 15 18 18 14 4 5 7 0 12 16 18 19 14 4 6 8 0 12 16 17 20 13 4 6 7 0 11 15 17 21 14 4 5 8 0 12 15 18 22 14 4 5 8 0 11 15 17 23 14 4 6 8 0 12 15 17 24 14 4 5 8 0 12 15 17 25 14 4 6 7 0 11 16 17 26 14 4 6 8 0 11 15 18 27 14 4 5 8 0 12 16 17 28 14 4 6 8 0 11 16 18 29 14 4 6 8 0 12 16 17 30 14 4 6 8 0 12 15 18 31 14 4 6 8 0 12 16 18 32 14 4 5 8 0 12 16 18 33 14 4 5 8 0 12 15 18 34 14 4 6 7 0 12 16 17 35 14 4 6 8 0 12 16 18 36 14 4 6 8 0 12 16 18 37 14 4 5 7 0 11 15 18 38 14 4 6 8 0 11 16 17 39 14 4 6 8 0 12 15 17 40 14 4 6 7 0 12 15 18 41 13 4 6 8 0 11 15 17 42 14 4 6 8 0 11 16 17 43 14 4 5 8 0 12 15 17 44 14 4 5 7 0 12 16 18 45 14 4 6 8 0 12 15 18 46 14 4 6 8 0 12 15 17 47 14 4 6 8 0 12 16 18 48 14 4 6 8 0 12 16 17 49 14 4 6 8 0 12 15 17 50 14 4 6 8 0 12 16 18 51 14 4 6 7 0 11 16 18 52 13 4 5 7 0 11 15 18 53 14 4 6 8 0 12 16 17 54 13 4 6 8 0 11 16 18 55 14 4 6 8 0 12 16 18 56 14 4 6 7 0 11 16 17 57 14 4 6 8 0 11 15 17 58 14 4 6 8 0 12 16 17 59 14 4 6 8 0 12 16 17 60 13 4 5 7 0 11 15 17 61 14 4 5 7 0 12 16 17 62 14 4 6 8 0 11 15 18 63 14 4 6 8 0 12 16 18 64 14 4 5 7 0 12 16 17 65 14 4 6 8 0 12 16 18 66 14 4 6 8 0 12 16 18 67 13 4 6 7 0 11 15 18 68 14 4 5 8 0 12 16 18 69 14 4 6 8 0 12 16 17 70 14 4 6 8 0 11 16 18 71 14 4 6 8 0 12 16 18 72 14 4 6 8 0 12 16 17 73 14 4 6 8 0 11 16 17 74 14 4 5 8 0 11 16 18 75 14 4 6 8 0 12 16 17 76 14 4 6 7 0 12 15 17 77 14 4 6 8 0 12 16 17 78 14 4 6 8 0 11 15 17 79 13 4 6 7 0 11 16 17 80 14 4 6 7 0 12 15 18 81 14 4 6 8 0 12 16 18 82 14 4 5 8 0 11 16 17 83 14 4 6 8 0 12 16 18 84 13 4 6 8 0 11 16 18 85 14 4 6 8 0 12 15 17 86 14 4 5 8 0 12 16 18 87 14 2 5 0 10 12 16 17 88 14 2 5 0 9 11 16 17 89 14 2 6 0 10 12 16 18 90 14 2 6 0 10 12 16 17 91 14 2 6 0 10 12 15 18 92 14 2 5 0 9 12 16 18 93 14 2 5 0 10 12 15 18 94 14 2 6 0 10 12 16 18 95 14 2 6 0 9 12 16 18 96 14 2 6 0 10 12 16 17 97 14 2 5 0 9 12 16 18 98 14 2 6 0 10 12 16 18 99 14 2 5 0 10 12 16 18 100 14 2 6 0 10 12 16 17 101 14 2 5 0 10 12 16 17 102 14 2 6 0 10 12 16 18 103 14 2 6 0 10 12 16 18 104 14 2 6 0 10 12 16 18 105 14 2 6 0 9 11 16 18 106 14 2 6 0 10 12 16 18 107 14 2 6 0 10 12 16 18 108 14 2 5 0 9 11 16 18 109 14 2 6 0 10 12 16 18 110 14 2 5 0 10 12 16 18 111 14 2 5 0 9 11 15 18 112 14 2 6 0 9 12 16 18 113 14 2 6 0 10 11 16 18 114 14 2 5 0 9 11 16 18 115 14 2 5 0 10 12 16 18 116 14 2 6 0 10 12 16 18 117 14 2 5 0 10 12 16 17 118 14 2 5 0 10 12 16 18 119 14 2 6 0 10 12 16 18 120 14 2 6 0 10 12 16 17 121 14 2 5 0 10 12 16 18 122 14 2 6 0 10 12 16 18 123 14 2 5 0 9 11 16 18 124 14 2 6 0 10 11 15 17 125 14 2 6 0 10 12 16 17 126 14 2 6 0 9 12 16 18 127 14 2 6 0 10 12 15 18 128 14 2 6 0 10 12 16 17 129 14 2 6 0 10 12 16 18 130 14 2 6 0 10 12 16 17 131 14 2 5 0 10 12 16 18 132 14 2 5 0 10 12 16 17 133 14 2 5 0 10 11 16 18 134 14 2 6 0 10 12 16 18 135 14 2 6 0 10 12 16 18 136 14 2 6 0 10 12 16 18 137 14 2 5 0 10 11 15 17 138 14 2 5 0 9 11 15 17 139 14 2 6 0 9 12 16 18 140 14 2 6 0 10 12 16 18 141 13 2 6 0 10 11 16 17 142 14 2 6 0 9 11 16 17 143 14 2 5 0 10 12 16 18 144 14 2 6 0 10 12 15 17 145 14 2 6 0 10 12 15 18 146 14 2 6 0 9 12 16 17 147 14 2 6 0 9 11 16 18 148 14 2 6 0 9 12 16 18 149 14 2 5 0 10 12 16 18 150 14 2 6 0 10 12 15 17 151 14 2 6 0 10 12 16 17 152 13 2 5 0 10 11 16 18 153 13 2 5 0 10 11 15 18 154 14 2 5 0 10 11 16 18 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Weeks Uselimit T40 T20 Used 15.210802 -1.390392 -0.008643 0.156530 -0.157197 0.263764 Useful Outcome 0.040381 -0.035707 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -0.75439 -0.02136 0.01663 0.11807 0.43388 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 15.210802 1.712634 8.882 2.22e-15 *** Weeks -1.390392 0.393317 -3.535 0.000547 *** Uselimit -0.008643 0.041496 -0.208 0.835293 T40 0.156530 0.058477 2.677 0.008284 ** T20 -0.157197 0.067800 -2.319 0.021808 * Used 0.263764 0.044810 5.886 2.60e-08 *** Useful 0.040381 0.045562 0.886 0.376919 Outcome -0.035707 0.039538 -0.903 0.367957 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.2329 on 146 degrees of freedom Multiple R-squared: 0.284, Adjusted R-squared: 0.2497 F-statistic: 8.274 on 7 and 146 DF, p-value: 1.741e-08 > 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,] 1.085853e-43 2.171706e-43 1.000000000 [2,] 9.250790e-58 1.850158e-57 1.000000000 [3,] 5.443487e-73 1.088697e-72 1.000000000 [4,] 4.450895e-84 8.901789e-84 1.000000000 [5,] 7.441472e-98 1.488294e-97 1.000000000 [6,] 0.000000e+00 0.000000e+00 1.000000000 [7,] 5.523334e-01 8.953332e-01 0.447666618 [8,] 4.988084e-01 9.976169e-01 0.501191566 [9,] 4.590339e-01 9.180677e-01 0.540966136 [10,] 8.982567e-01 2.034866e-01 0.101743287 [11,] 8.583044e-01 2.833911e-01 0.141695557 [12,] 8.473366e-01 3.053268e-01 0.152663402 [13,] 7.976022e-01 4.047956e-01 0.202397825 [14,] 7.415485e-01 5.169030e-01 0.258451476 [15,] 7.445445e-01 5.109111e-01 0.255455549 [16,] 7.466036e-01 5.067928e-01 0.253396381 [17,] 7.091238e-01 5.817525e-01 0.290876245 [18,] 6.616193e-01 6.767614e-01 0.338380689 [19,] 6.103462e-01 7.793075e-01 0.389653767 [20,] 5.525277e-01 8.949447e-01 0.447472327 [21,] 4.910989e-01 9.821978e-01 0.508901124 [22,] 4.308112e-01 8.616223e-01 0.569188827 [23,] 3.730625e-01 7.461250e-01 0.626937483 [24,] 3.256478e-01 6.512956e-01 0.674352213 [25,] 2.741575e-01 5.483150e-01 0.725842476 [26,] 2.271280e-01 4.542561e-01 0.772871966 [27,] 3.078687e-01 6.157374e-01 0.692131291 [28,] 2.686946e-01 5.373892e-01 0.731305399 [29,] 2.228095e-01 4.456190e-01 0.777190522 [30,] 2.155303e-01 4.310606e-01 0.784469710 [31,] 7.569087e-01 4.861826e-01 0.243091321 [32,] 7.325202e-01 5.349596e-01 0.267479777 [33,] 6.871915e-01 6.256170e-01 0.312808480 [34,] 6.517965e-01 6.964071e-01 0.348203537 [35,] 6.020677e-01 7.958646e-01 0.397932286 [36,] 5.516443e-01 8.967114e-01 0.448355677 [37,] 5.001761e-01 9.996477e-01 0.499823866 [38,] 4.488655e-01 8.977309e-01 0.551134526 [39,] 3.991408e-01 7.982816e-01 0.600859218 [40,] 3.505868e-01 7.011736e-01 0.649413185 [41,] 4.301764e-01 8.603527e-01 0.569823646 [42,] 7.010427e-01 5.979147e-01 0.298957334 [43,] 6.593232e-01 6.813537e-01 0.340676837 [44,] 9.475304e-01 1.049391e-01 0.052469562 [45,] 9.328011e-01 1.343978e-01 0.067198907 [46,] 9.612015e-01 7.759710e-02 0.038798549 [47,] 9.608454e-01 7.830922e-02 0.039154610 [48,] 9.504103e-01 9.917937e-02 0.049589685 [49,] 9.378469e-01 1.243061e-01 0.062153067 [50,] 9.823656e-01 3.526879e-02 0.017634393 [51,] 9.796658e-01 4.066843e-02 0.020334214 [52,] 9.812269e-01 3.754629e-02 0.018773144 [53,] 9.750305e-01 4.993902e-02 0.024969511 [54,] 9.739697e-01 5.206063e-02 0.026030313 [55,] 9.658799e-01 6.824023e-02 0.034120117 [56,] 9.558213e-01 8.835742e-02 0.044178709 [57,] 9.835133e-01 3.297331e-02 0.016486654 [58,] 9.779496e-01 4.410090e-02 0.022050449 [59,] 9.713953e-01 5.720935e-02 0.028604676 [60,] 9.721837e-01 5.563254e-02 0.027816272 [61,] 9.636559e-01 7.268820e-02 0.036344098 [62,] 9.537002e-01 9.259956e-02 0.046299779 [63,] 9.532316e-01 9.353687e-02 0.046768435 [64,] 9.564051e-01 8.718987e-02 0.043594934 [65,] 9.447984e-01 1.104032e-01 0.055201604 [66,] 9.428792e-01 1.142416e-01 0.057120794 [67,] 9.286201e-01 1.427597e-01 0.071379865 [68,] 9.346838e-01 1.306323e-01 0.065316157 [69,] 9.839702e-01 3.205961e-02 0.016029805 [70,] 9.800563e-01 3.988733e-02 0.019943664 [71,] 9.746383e-01 5.072341e-02 0.025361703 [72,] 9.806368e-01 3.872648e-02 0.019363240 [73,] 9.787859e-01 4.242825e-02 0.021214123 [74,] 9.980798e-01 3.840490e-03 0.001920245 [75,] 9.971721e-01 5.655837e-03 0.002827918 [76,] 9.958918e-01 8.216377e-03 0.004108188 [77,] 9.941021e-01 1.179583e-02 0.005897913 [78,] 9.920758e-01 1.584831e-02 0.007924157 [79,] 9.889565e-01 2.208709e-02 0.011043545 [80,] 9.847468e-01 3.050633e-02 0.015253167 [81,] 9.794112e-01 4.117751e-02 0.020588755 [82,] 9.749280e-01 5.014406e-02 0.025072030 [83,] 9.666798e-01 6.664043e-02 0.033320213 [84,] 9.561895e-01 8.762104e-02 0.043810518 [85,] 9.468636e-01 1.062729e-01 0.053136442 [86,] 9.317005e-01 1.365989e-01 0.068299452 [87,] 9.197239e-01 1.605523e-01 0.080276148 [88,] 8.989071e-01 2.021859e-01 0.101092942 [89,] 8.741146e-01 2.517707e-01 0.125885361 [90,] 8.455327e-01 3.089347e-01 0.154467332 [91,] 8.127447e-01 3.745106e-01 0.187255313 [92,] 7.758857e-01 4.482285e-01 0.224114251 [93,] 7.350834e-01 5.298333e-01 0.264916628 [94,] 6.906625e-01 6.186750e-01 0.309337521 [95,] 6.604521e-01 6.790959e-01 0.339547947 [96,] 6.111543e-01 7.776915e-01 0.388845750 [97,] 5.598492e-01 8.803015e-01 0.440150760 [98,] 5.206753e-01 9.586493e-01 0.479324663 [99,] 4.675849e-01 9.351698e-01 0.532415075 [100,] 4.138453e-01 8.276906e-01 0.586154689 [101,] 3.761258e-01 7.522515e-01 0.623874228 [102,] 3.398021e-01 6.796043e-01 0.660197873 [103,] 3.871091e-01 7.742182e-01 0.612890889 [104,] 3.512369e-01 7.024738e-01 0.648763114 [105,] 2.999937e-01 5.999873e-01 0.700006327 [106,] 2.541315e-01 5.082629e-01 0.745868547 [107,] 2.106759e-01 4.213517e-01 0.789324128 [108,] 1.710331e-01 3.420661e-01 0.828966930 [109,] 1.379845e-01 2.759691e-01 0.862015452 [110,] 1.079359e-01 2.158717e-01 0.892064138 [111,] 8.266694e-02 1.653339e-01 0.917333059 [112,] 6.312687e-02 1.262537e-01 0.936873126 [113,] 5.275081e-02 1.055016e-01 0.947249185 [114,] 6.742503e-02 1.348501e-01 0.932574969 [115,] 4.927693e-02 9.855385e-02 0.950723074 [116,] 3.923076e-02 7.846151e-02 0.960769244 [117,] 2.780694e-02 5.561388e-02 0.972193062 [118,] 1.890541e-02 3.781083e-02 0.981094585 [119,] 1.284483e-02 2.568967e-02 0.987155165 [120,] 8.264031e-03 1.652806e-02 0.991735969 [121,] 5.062650e-03 1.012530e-02 0.994937350 [122,] 3.067285e-03 6.134570e-03 0.996932715 [123,] 6.080312e-03 1.216062e-02 0.993919688 [124,] 3.847261e-03 7.694521e-03 0.996152739 [125,] 2.430701e-03 4.861402e-03 0.997569299 [126,] 1.575970e-03 3.151940e-03 0.998424030 [127,] 2.878698e-03 5.757397e-03 0.997121302 [128,] 2.313758e-03 4.627516e-03 0.997686242 [129,] 1.803268e-03 3.606536e-03 0.998196732 [130,] 8.144158e-04 1.628832e-03 0.999185584 [131,] 1.260926e-02 2.521853e-02 0.987390736 [132,] 9.378334e-03 1.875667e-02 0.990621666 [133,] 4.354695e-03 8.709390e-03 0.995645305 > postscript(file="/var/wessaorg/rcomp/tmp/1ywj01355774603.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/2y4ff1355774603.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/3m4d51355774603.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/406cn1355774603.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/5nlt71355774603.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 = 154 Frequency = 1 1 2 3 4 5 6 0.09402503 -0.01815461 -0.01815461 -0.01815461 -0.01815461 -0.02212414 7 8 9 10 11 12 -0.01815461 0.13837554 -0.05386193 -0.02679780 0.12973235 -0.01815461 13 14 15 16 17 18 0.28599077 0.12973235 0.25028345 0.40681360 -0.56612227 0.12973235 19 20 21 22 23 24 -0.05386193 -0.59318640 0.01358318 0.24164026 -0.01348096 -0.02212414 25 26 27 28 29 30 0.36643262 0.28599077 -0.06250512 0.24560979 -0.05386193 0.02222636 31 32 33 34 35 36 -0.01815461 -0.02679780 0.01358318 0.10266822 -0.01815461 -0.01815461 37 38 39 40 41 42 0.43387773 0.20990247 -0.01348096 0.17875652 -0.74971655 0.20990247 43 44 45 46 47 48 -0.02212414 0.12973235 0.02222636 -0.01348096 -0.01815461 -0.05386193 49 50 51 52 53 54 -0.01348096 -0.01815461 0.40213994 -0.56612227 -0.05386193 -0.75439021 55 56 57 58 59 60 -0.01815461 0.36643262 0.25028345 -0.05386193 -0.05386193 -0.60182959 61 62 63 64 65 66 0.09402503 0.28599077 -0.01815461 0.09402503 -0.01815461 -0.01815461 67 68 69 70 71 72 -0.55747908 -0.02679780 -0.05386193 0.24560979 -0.01815461 -0.05386193 73 74 75 76 77 78 0.20990247 0.23696660 -0.05386193 0.14304920 -0.05386193 0.25028345 79 80 81 82 83 84 -0.63356738 0.17875652 -0.01815461 0.20125928 -0.01815461 -0.75439021 85 86 87 88 89 90 -0.01348096 -0.02679780 -0.01907486 0.08749232 0.02527564 -0.01043168 91 92 93 94 95 96 0.06565662 -0.14056476 0.05701343 0.02527564 -0.13192158 -0.01043168 97 98 99 100 101 102 -0.14056476 0.02527564 0.01663246 -0.01043168 -0.01907486 0.02527564 103 104 105 106 107 108 0.02527564 0.02527564 0.13184283 0.02527564 0.02527564 0.12319964 109 110 111 112 113 114 0.02527564 0.01663246 0.16358062 -0.13192158 0.28904005 0.12319964 115 116 117 118 119 120 0.01663246 0.02527564 -0.01907486 0.01663246 0.02527564 -0.01043168 121 122 123 124 125 126 0.01663246 0.02527564 0.12319964 0.29371370 -0.01043168 -0.13192158 127 128 129 130 131 132 0.06565662 -0.01043168 0.02527564 -0.01043168 0.01663246 -0.01907486 133 134 135 136 137 138 0.28039686 0.02527564 0.02527564 0.02527564 0.28507052 0.12787330 139 140 141 142 143 144 -0.13192158 0.02527564 -0.74666727 0.09613551 0.01663246 0.02994930 145 146 147 148 149 150 0.06565662 -0.16762890 0.13184283 -0.13192158 0.01663246 0.02994930 151 152 153 154 -0.01043168 -0.71960314 -0.67922217 0.28039686 > postscript(file="/var/wessaorg/rcomp/tmp/6fppl1355774603.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 = 154 Frequency = 1 lag(myerror, k = 1) myerror 0 0.09402503 NA 1 -0.01815461 0.09402503 2 -0.01815461 -0.01815461 3 -0.01815461 -0.01815461 4 -0.01815461 -0.01815461 5 -0.02212414 -0.01815461 6 -0.01815461 -0.02212414 7 0.13837554 -0.01815461 8 -0.05386193 0.13837554 9 -0.02679780 -0.05386193 10 0.12973235 -0.02679780 11 -0.01815461 0.12973235 12 0.28599077 -0.01815461 13 0.12973235 0.28599077 14 0.25028345 0.12973235 15 0.40681360 0.25028345 16 -0.56612227 0.40681360 17 0.12973235 -0.56612227 18 -0.05386193 0.12973235 19 -0.59318640 -0.05386193 20 0.01358318 -0.59318640 21 0.24164026 0.01358318 22 -0.01348096 0.24164026 23 -0.02212414 -0.01348096 24 0.36643262 -0.02212414 25 0.28599077 0.36643262 26 -0.06250512 0.28599077 27 0.24560979 -0.06250512 28 -0.05386193 0.24560979 29 0.02222636 -0.05386193 30 -0.01815461 0.02222636 31 -0.02679780 -0.01815461 32 0.01358318 -0.02679780 33 0.10266822 0.01358318 34 -0.01815461 0.10266822 35 -0.01815461 -0.01815461 36 0.43387773 -0.01815461 37 0.20990247 0.43387773 38 -0.01348096 0.20990247 39 0.17875652 -0.01348096 40 -0.74971655 0.17875652 41 0.20990247 -0.74971655 42 -0.02212414 0.20990247 43 0.12973235 -0.02212414 44 0.02222636 0.12973235 45 -0.01348096 0.02222636 46 -0.01815461 -0.01348096 47 -0.05386193 -0.01815461 48 -0.01348096 -0.05386193 49 -0.01815461 -0.01348096 50 0.40213994 -0.01815461 51 -0.56612227 0.40213994 52 -0.05386193 -0.56612227 53 -0.75439021 -0.05386193 54 -0.01815461 -0.75439021 55 0.36643262 -0.01815461 56 0.25028345 0.36643262 57 -0.05386193 0.25028345 58 -0.05386193 -0.05386193 59 -0.60182959 -0.05386193 60 0.09402503 -0.60182959 61 0.28599077 0.09402503 62 -0.01815461 0.28599077 63 0.09402503 -0.01815461 64 -0.01815461 0.09402503 65 -0.01815461 -0.01815461 66 -0.55747908 -0.01815461 67 -0.02679780 -0.55747908 68 -0.05386193 -0.02679780 69 0.24560979 -0.05386193 70 -0.01815461 0.24560979 71 -0.05386193 -0.01815461 72 0.20990247 -0.05386193 73 0.23696660 0.20990247 74 -0.05386193 0.23696660 75 0.14304920 -0.05386193 76 -0.05386193 0.14304920 77 0.25028345 -0.05386193 78 -0.63356738 0.25028345 79 0.17875652 -0.63356738 80 -0.01815461 0.17875652 81 0.20125928 -0.01815461 82 -0.01815461 0.20125928 83 -0.75439021 -0.01815461 84 -0.01348096 -0.75439021 85 -0.02679780 -0.01348096 86 -0.01907486 -0.02679780 87 0.08749232 -0.01907486 88 0.02527564 0.08749232 89 -0.01043168 0.02527564 90 0.06565662 -0.01043168 91 -0.14056476 0.06565662 92 0.05701343 -0.14056476 93 0.02527564 0.05701343 94 -0.13192158 0.02527564 95 -0.01043168 -0.13192158 96 -0.14056476 -0.01043168 97 0.02527564 -0.14056476 98 0.01663246 0.02527564 99 -0.01043168 0.01663246 100 -0.01907486 -0.01043168 101 0.02527564 -0.01907486 102 0.02527564 0.02527564 103 0.02527564 0.02527564 104 0.13184283 0.02527564 105 0.02527564 0.13184283 106 0.02527564 0.02527564 107 0.12319964 0.02527564 108 0.02527564 0.12319964 109 0.01663246 0.02527564 110 0.16358062 0.01663246 111 -0.13192158 0.16358062 112 0.28904005 -0.13192158 113 0.12319964 0.28904005 114 0.01663246 0.12319964 115 0.02527564 0.01663246 116 -0.01907486 0.02527564 117 0.01663246 -0.01907486 118 0.02527564 0.01663246 119 -0.01043168 0.02527564 120 0.01663246 -0.01043168 121 0.02527564 0.01663246 122 0.12319964 0.02527564 123 0.29371370 0.12319964 124 -0.01043168 0.29371370 125 -0.13192158 -0.01043168 126 0.06565662 -0.13192158 127 -0.01043168 0.06565662 128 0.02527564 -0.01043168 129 -0.01043168 0.02527564 130 0.01663246 -0.01043168 131 -0.01907486 0.01663246 132 0.28039686 -0.01907486 133 0.02527564 0.28039686 134 0.02527564 0.02527564 135 0.02527564 0.02527564 136 0.28507052 0.02527564 137 0.12787330 0.28507052 138 -0.13192158 0.12787330 139 0.02527564 -0.13192158 140 -0.74666727 0.02527564 141 0.09613551 -0.74666727 142 0.01663246 0.09613551 143 0.02994930 0.01663246 144 0.06565662 0.02994930 145 -0.16762890 0.06565662 146 0.13184283 -0.16762890 147 -0.13192158 0.13184283 148 0.01663246 -0.13192158 149 0.02994930 0.01663246 150 -0.01043168 0.02994930 151 -0.71960314 -0.01043168 152 -0.67922217 -0.71960314 153 0.28039686 -0.67922217 154 NA 0.28039686 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -0.01815461 0.09402503 [2,] -0.01815461 -0.01815461 [3,] -0.01815461 -0.01815461 [4,] -0.01815461 -0.01815461 [5,] -0.02212414 -0.01815461 [6,] -0.01815461 -0.02212414 [7,] 0.13837554 -0.01815461 [8,] -0.05386193 0.13837554 [9,] -0.02679780 -0.05386193 [10,] 0.12973235 -0.02679780 [11,] -0.01815461 0.12973235 [12,] 0.28599077 -0.01815461 [13,] 0.12973235 0.28599077 [14,] 0.25028345 0.12973235 [15,] 0.40681360 0.25028345 [16,] -0.56612227 0.40681360 [17,] 0.12973235 -0.56612227 [18,] -0.05386193 0.12973235 [19,] -0.59318640 -0.05386193 [20,] 0.01358318 -0.59318640 [21,] 0.24164026 0.01358318 [22,] -0.01348096 0.24164026 [23,] -0.02212414 -0.01348096 [24,] 0.36643262 -0.02212414 [25,] 0.28599077 0.36643262 [26,] -0.06250512 0.28599077 [27,] 0.24560979 -0.06250512 [28,] -0.05386193 0.24560979 [29,] 0.02222636 -0.05386193 [30,] -0.01815461 0.02222636 [31,] -0.02679780 -0.01815461 [32,] 0.01358318 -0.02679780 [33,] 0.10266822 0.01358318 [34,] -0.01815461 0.10266822 [35,] -0.01815461 -0.01815461 [36,] 0.43387773 -0.01815461 [37,] 0.20990247 0.43387773 [38,] -0.01348096 0.20990247 [39,] 0.17875652 -0.01348096 [40,] -0.74971655 0.17875652 [41,] 0.20990247 -0.74971655 [42,] -0.02212414 0.20990247 [43,] 0.12973235 -0.02212414 [44,] 0.02222636 0.12973235 [45,] -0.01348096 0.02222636 [46,] -0.01815461 -0.01348096 [47,] -0.05386193 -0.01815461 [48,] -0.01348096 -0.05386193 [49,] -0.01815461 -0.01348096 [50,] 0.40213994 -0.01815461 [51,] -0.56612227 0.40213994 [52,] -0.05386193 -0.56612227 [53,] -0.75439021 -0.05386193 [54,] -0.01815461 -0.75439021 [55,] 0.36643262 -0.01815461 [56,] 0.25028345 0.36643262 [57,] -0.05386193 0.25028345 [58,] -0.05386193 -0.05386193 [59,] -0.60182959 -0.05386193 [60,] 0.09402503 -0.60182959 [61,] 0.28599077 0.09402503 [62,] -0.01815461 0.28599077 [63,] 0.09402503 -0.01815461 [64,] -0.01815461 0.09402503 [65,] -0.01815461 -0.01815461 [66,] -0.55747908 -0.01815461 [67,] -0.02679780 -0.55747908 [68,] -0.05386193 -0.02679780 [69,] 0.24560979 -0.05386193 [70,] -0.01815461 0.24560979 [71,] -0.05386193 -0.01815461 [72,] 0.20990247 -0.05386193 [73,] 0.23696660 0.20990247 [74,] -0.05386193 0.23696660 [75,] 0.14304920 -0.05386193 [76,] -0.05386193 0.14304920 [77,] 0.25028345 -0.05386193 [78,] -0.63356738 0.25028345 [79,] 0.17875652 -0.63356738 [80,] -0.01815461 0.17875652 [81,] 0.20125928 -0.01815461 [82,] -0.01815461 0.20125928 [83,] -0.75439021 -0.01815461 [84,] -0.01348096 -0.75439021 [85,] -0.02679780 -0.01348096 [86,] -0.01907486 -0.02679780 [87,] 0.08749232 -0.01907486 [88,] 0.02527564 0.08749232 [89,] -0.01043168 0.02527564 [90,] 0.06565662 -0.01043168 [91,] -0.14056476 0.06565662 [92,] 0.05701343 -0.14056476 [93,] 0.02527564 0.05701343 [94,] -0.13192158 0.02527564 [95,] -0.01043168 -0.13192158 [96,] -0.14056476 -0.01043168 [97,] 0.02527564 -0.14056476 [98,] 0.01663246 0.02527564 [99,] -0.01043168 0.01663246 [100,] -0.01907486 -0.01043168 [101,] 0.02527564 -0.01907486 [102,] 0.02527564 0.02527564 [103,] 0.02527564 0.02527564 [104,] 0.13184283 0.02527564 [105,] 0.02527564 0.13184283 [106,] 0.02527564 0.02527564 [107,] 0.12319964 0.02527564 [108,] 0.02527564 0.12319964 [109,] 0.01663246 0.02527564 [110,] 0.16358062 0.01663246 [111,] -0.13192158 0.16358062 [112,] 0.28904005 -0.13192158 [113,] 0.12319964 0.28904005 [114,] 0.01663246 0.12319964 [115,] 0.02527564 0.01663246 [116,] -0.01907486 0.02527564 [117,] 0.01663246 -0.01907486 [118,] 0.02527564 0.01663246 [119,] -0.01043168 0.02527564 [120,] 0.01663246 -0.01043168 [121,] 0.02527564 0.01663246 [122,] 0.12319964 0.02527564 [123,] 0.29371370 0.12319964 [124,] -0.01043168 0.29371370 [125,] -0.13192158 -0.01043168 [126,] 0.06565662 -0.13192158 [127,] -0.01043168 0.06565662 [128,] 0.02527564 -0.01043168 [129,] -0.01043168 0.02527564 [130,] 0.01663246 -0.01043168 [131,] -0.01907486 0.01663246 [132,] 0.28039686 -0.01907486 [133,] 0.02527564 0.28039686 [134,] 0.02527564 0.02527564 [135,] 0.02527564 0.02527564 [136,] 0.28507052 0.02527564 [137,] 0.12787330 0.28507052 [138,] -0.13192158 0.12787330 [139,] 0.02527564 -0.13192158 [140,] -0.74666727 0.02527564 [141,] 0.09613551 -0.74666727 [142,] 0.01663246 0.09613551 [143,] 0.02994930 0.01663246 [144,] 0.06565662 0.02994930 [145,] -0.16762890 0.06565662 [146,] 0.13184283 -0.16762890 [147,] -0.13192158 0.13184283 [148,] 0.01663246 -0.13192158 [149,] 0.02994930 0.01663246 [150,] -0.01043168 0.02994930 [151,] -0.71960314 -0.01043168 [152,] -0.67922217 -0.71960314 [153,] 0.28039686 -0.67922217 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -0.01815461 0.09402503 2 -0.01815461 -0.01815461 3 -0.01815461 -0.01815461 4 -0.01815461 -0.01815461 5 -0.02212414 -0.01815461 6 -0.01815461 -0.02212414 7 0.13837554 -0.01815461 8 -0.05386193 0.13837554 9 -0.02679780 -0.05386193 10 0.12973235 -0.02679780 11 -0.01815461 0.12973235 12 0.28599077 -0.01815461 13 0.12973235 0.28599077 14 0.25028345 0.12973235 15 0.40681360 0.25028345 16 -0.56612227 0.40681360 17 0.12973235 -0.56612227 18 -0.05386193 0.12973235 19 -0.59318640 -0.05386193 20 0.01358318 -0.59318640 21 0.24164026 0.01358318 22 -0.01348096 0.24164026 23 -0.02212414 -0.01348096 24 0.36643262 -0.02212414 25 0.28599077 0.36643262 26 -0.06250512 0.28599077 27 0.24560979 -0.06250512 28 -0.05386193 0.24560979 29 0.02222636 -0.05386193 30 -0.01815461 0.02222636 31 -0.02679780 -0.01815461 32 0.01358318 -0.02679780 33 0.10266822 0.01358318 34 -0.01815461 0.10266822 35 -0.01815461 -0.01815461 36 0.43387773 -0.01815461 37 0.20990247 0.43387773 38 -0.01348096 0.20990247 39 0.17875652 -0.01348096 40 -0.74971655 0.17875652 41 0.20990247 -0.74971655 42 -0.02212414 0.20990247 43 0.12973235 -0.02212414 44 0.02222636 0.12973235 45 -0.01348096 0.02222636 46 -0.01815461 -0.01348096 47 -0.05386193 -0.01815461 48 -0.01348096 -0.05386193 49 -0.01815461 -0.01348096 50 0.40213994 -0.01815461 51 -0.56612227 0.40213994 52 -0.05386193 -0.56612227 53 -0.75439021 -0.05386193 54 -0.01815461 -0.75439021 55 0.36643262 -0.01815461 56 0.25028345 0.36643262 57 -0.05386193 0.25028345 58 -0.05386193 -0.05386193 59 -0.60182959 -0.05386193 60 0.09402503 -0.60182959 61 0.28599077 0.09402503 62 -0.01815461 0.28599077 63 0.09402503 -0.01815461 64 -0.01815461 0.09402503 65 -0.01815461 -0.01815461 66 -0.55747908 -0.01815461 67 -0.02679780 -0.55747908 68 -0.05386193 -0.02679780 69 0.24560979 -0.05386193 70 -0.01815461 0.24560979 71 -0.05386193 -0.01815461 72 0.20990247 -0.05386193 73 0.23696660 0.20990247 74 -0.05386193 0.23696660 75 0.14304920 -0.05386193 76 -0.05386193 0.14304920 77 0.25028345 -0.05386193 78 -0.63356738 0.25028345 79 0.17875652 -0.63356738 80 -0.01815461 0.17875652 81 0.20125928 -0.01815461 82 -0.01815461 0.20125928 83 -0.75439021 -0.01815461 84 -0.01348096 -0.75439021 85 -0.02679780 -0.01348096 86 -0.01907486 -0.02679780 87 0.08749232 -0.01907486 88 0.02527564 0.08749232 89 -0.01043168 0.02527564 90 0.06565662 -0.01043168 91 -0.14056476 0.06565662 92 0.05701343 -0.14056476 93 0.02527564 0.05701343 94 -0.13192158 0.02527564 95 -0.01043168 -0.13192158 96 -0.14056476 -0.01043168 97 0.02527564 -0.14056476 98 0.01663246 0.02527564 99 -0.01043168 0.01663246 100 -0.01907486 -0.01043168 101 0.02527564 -0.01907486 102 0.02527564 0.02527564 103 0.02527564 0.02527564 104 0.13184283 0.02527564 105 0.02527564 0.13184283 106 0.02527564 0.02527564 107 0.12319964 0.02527564 108 0.02527564 0.12319964 109 0.01663246 0.02527564 110 0.16358062 0.01663246 111 -0.13192158 0.16358062 112 0.28904005 -0.13192158 113 0.12319964 0.28904005 114 0.01663246 0.12319964 115 0.02527564 0.01663246 116 -0.01907486 0.02527564 117 0.01663246 -0.01907486 118 0.02527564 0.01663246 119 -0.01043168 0.02527564 120 0.01663246 -0.01043168 121 0.02527564 0.01663246 122 0.12319964 0.02527564 123 0.29371370 0.12319964 124 -0.01043168 0.29371370 125 -0.13192158 -0.01043168 126 0.06565662 -0.13192158 127 -0.01043168 0.06565662 128 0.02527564 -0.01043168 129 -0.01043168 0.02527564 130 0.01663246 -0.01043168 131 -0.01907486 0.01663246 132 0.28039686 -0.01907486 133 0.02527564 0.28039686 134 0.02527564 0.02527564 135 0.02527564 0.02527564 136 0.28507052 0.02527564 137 0.12787330 0.28507052 138 -0.13192158 0.12787330 139 0.02527564 -0.13192158 140 -0.74666727 0.02527564 141 0.09613551 -0.74666727 142 0.01663246 0.09613551 143 0.02994930 0.01663246 144 0.06565662 0.02994930 145 -0.16762890 0.06565662 146 0.13184283 -0.16762890 147 -0.13192158 0.13184283 148 0.01663246 -0.13192158 149 0.02994930 0.01663246 150 -0.01043168 0.02994930 151 -0.71960314 -0.01043168 152 -0.67922217 -0.71960314 153 0.28039686 -0.67922217 > 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/7aa1v1355774603.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/8qeyt1355774603.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/940401355774603.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/10c2sh1355774603.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/117h5f1355774603.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/12mouu1355774603.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/13xg9t1355774604.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/1442dy1355774604.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/15drvu1355774604.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/16c1kk1355774604.tab") + } > > try(system("convert tmp/1ywj01355774603.ps tmp/1ywj01355774603.png",intern=TRUE)) character(0) > try(system("convert tmp/2y4ff1355774603.ps tmp/2y4ff1355774603.png",intern=TRUE)) character(0) > try(system("convert tmp/3m4d51355774603.ps tmp/3m4d51355774603.png",intern=TRUE)) character(0) > try(system("convert tmp/406cn1355774603.ps tmp/406cn1355774603.png",intern=TRUE)) character(0) > try(system("convert tmp/5nlt71355774603.ps tmp/5nlt71355774603.png",intern=TRUE)) character(0) > try(system("convert tmp/6fppl1355774603.ps tmp/6fppl1355774603.png",intern=TRUE)) character(0) > try(system("convert tmp/7aa1v1355774603.ps tmp/7aa1v1355774603.png",intern=TRUE)) character(0) > try(system("convert tmp/8qeyt1355774603.ps tmp/8qeyt1355774603.png",intern=TRUE)) character(0) > try(system("convert tmp/940401355774603.ps tmp/940401355774603.png",intern=TRUE)) character(0) > try(system("convert tmp/10c2sh1355774603.ps tmp/10c2sh1355774603.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 7.955 1.036 9.633