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. Natural language support but running in an English locale 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(1 + ,26 + ,21 + ,21 + ,23 + ,17 + ,23 + ,4 + ,1 + ,20 + ,16 + ,15 + ,24 + ,17 + ,20 + ,4 + ,1 + ,19 + ,19 + ,18 + ,22 + ,18 + ,20 + ,6 + ,2 + ,19 + ,18 + ,11 + ,20 + ,21 + ,21 + ,8 + ,1 + ,20 + ,16 + ,8 + ,24 + ,20 + ,24 + ,8 + ,1 + ,25 + ,23 + ,19 + ,27 + ,28 + ,22 + ,4 + ,2 + ,25 + ,17 + ,4 + ,28 + ,19 + ,23 + ,4 + ,1 + ,22 + ,12 + ,20 + ,27 + ,22 + ,20 + ,8 + ,1 + ,26 + ,19 + ,16 + ,24 + ,16 + ,25 + ,5 + ,1 + ,22 + ,16 + ,14 + ,23 + ,18 + ,23 + ,4 + ,2 + ,17 + ,19 + ,10 + ,24 + ,25 + ,27 + ,4 + ,2 + ,22 + ,20 + ,13 + ,27 + ,17 + ,27 + ,4 + ,1 + ,19 + ,13 + ,14 + ,27 + ,14 + ,22 + ,4 + ,1 + ,24 + ,20 + ,8 + ,28 + ,11 + ,24 + ,4 + ,1 + ,26 + ,27 + ,23 + ,27 + ,27 + ,25 + ,4 + ,2 + ,21 + ,17 + ,11 + ,23 + ,20 + ,22 + ,8 + ,1 + ,13 + ,8 + ,9 + ,24 + ,22 + ,28 + ,4 + ,2 + ,26 + ,25 + ,24 + ,28 + ,22 + ,28 + ,4 + ,2 + ,20 + ,26 + ,5 + ,27 + ,21 + ,27 + ,4 + ,1 + ,22 + ,13 + ,15 + ,25 + ,23 + ,25 + ,8 + ,2 + ,14 + ,19 + ,5 + ,19 + ,17 + ,16 + ,4 + ,1 + ,21 + ,15 + ,19 + ,24 + ,24 + ,28 + ,7 + ,1 + ,7 + ,5 + ,6 + ,20 + ,14 + ,21 + ,4 + ,2 + ,23 + ,16 + ,13 + ,28 + ,17 + ,24 + ,4 + ,1 + ,17 + ,14 + ,11 + ,26 + ,23 + ,27 + ,5 + ,1 + ,25 + ,24 + ,17 + ,23 + ,24 + ,14 + ,4 + ,1 + ,25 + ,24 + ,17 + ,23 + ,24 + ,14 + ,4 + ,1 + ,19 + ,9 + ,5 + ,20 + ,8 + ,27 + ,4 + ,2 + ,20 + ,19 + ,9 + ,11 + ,22 + ,20 + ,4 + ,1 + ,23 + ,19 + ,15 + ,24 + ,23 + ,21 + ,4 + ,2 + ,22 + ,25 + ,17 + ,25 + ,25 + ,22 + ,4 + ,1 + ,22 + ,19 + ,17 + ,23 + ,21 + ,21 + ,4 + ,1 + ,21 + ,18 + ,20 + ,18 + ,24 + ,12 + ,15 + ,2 + ,15 + ,15 + ,12 + ,20 + ,15 + ,20 + ,10 + ,2 + ,20 + ,12 + ,7 + ,20 + ,22 + ,24 + ,4 + ,2 + ,22 + ,21 + ,16 + ,24 + ,21 + ,19 + ,8 + ,1 + ,18 + ,12 + ,7 + ,23 + ,25 + ,28 + ,4 + ,2 + ,20 + ,15 + ,14 + ,25 + ,16 + ,23 + ,4 + ,2 + ,28 + ,28 + ,24 + ,28 + ,28 + ,27 + ,4 + ,1 + ,22 + ,25 + ,15 + ,26 + ,23 + ,22 + ,4 + ,1 + ,18 + ,19 + ,15 + ,26 + ,21 + ,27 + ,7 + ,1 + ,23 + ,20 + ,10 + ,23 + ,21 + ,26 + ,4 + ,1 + ,20 + ,24 + ,14 + ,22 + ,26 + ,22 + ,6 + ,2 + ,25 + ,26 + ,18 + ,24 + ,22 + ,21 + ,5 + ,2 + ,26 + ,25 + ,12 + ,21 + ,21 + ,19 + ,4 + ,1 + ,15 + ,12 + ,9 + ,20 + ,18 + ,24 + ,16 + ,2 + ,17 + ,12 + ,9 + ,22 + ,12 + ,19 + ,5 + ,2 + ,23 + ,15 + ,8 + ,20 + ,25 + ,26 + ,12 + ,1 + ,21 + ,17 + ,18 + ,25 + ,17 + ,22 + ,6 + ,2 + ,13 + ,14 + ,10 + ,20 + ,24 + ,28 + ,9 + ,1 + ,18 + ,16 + ,17 + ,22 + ,15 + ,21 + ,9 + ,1 + ,19 + ,11 + ,14 + ,23 + ,13 + ,23 + ,4 + ,1 + ,22 + ,20 + ,16 + ,25 + ,26 + ,28 + ,5 + ,1 + ,16 + ,11 + ,10 + ,23 + ,16 + ,10 + ,4 + ,2 + ,24 + ,22 + ,19 + ,23 + ,24 + ,24 + ,4 + ,1 + ,18 + ,20 + ,10 + ,22 + ,21 + ,21 + ,5 + ,1 + ,20 + ,19 + ,14 + ,24 + ,20 + ,21 + ,4 + ,1 + ,24 + ,17 + ,10 + ,25 + ,14 + ,24 + ,4 + ,2 + ,14 + ,21 + ,4 + ,21 + ,25 + ,24 + ,4 + ,2 + ,22 + ,23 + ,19 + ,12 + ,25 + ,25 + ,5 + ,1 + ,24 + ,18 + ,9 + ,17 + ,20 + ,25 + ,4 + ,1 + ,18 + ,17 + ,12 + ,20 + ,22 + ,23 + ,6 + ,1 + ,21 + ,27 + ,16 + ,23 + ,20 + ,21 + ,4 + ,2 + ,23 + ,25 + ,11 + ,23 + ,26 + ,16 + ,4 + ,1 + ,17 + ,19 + ,18 + ,20 + ,18 + ,17 + ,18 + ,2 + ,22 + ,22 + ,11 + ,28 + ,22 + ,25 + ,4 + ,2 + ,24 + ,24 + ,24 + ,24 + ,24 + ,24 + ,6 + ,2 + ,21 + ,20 + ,17 + ,24 + ,17 + ,23 + ,4 + ,1 + ,22 + ,19 + ,18 + ,24 + ,24 + ,25 + ,4 + ,1 + ,16 + ,11 + ,9 + ,24 + ,20 + ,23 + ,5 + ,1 + ,21 + ,22 + ,19 + ,28 + ,19 + ,28 + ,4 + ,2 + ,23 + ,22 + ,18 + ,25 + ,20 + ,26 + ,4 + ,2 + ,22 + ,16 + ,12 + ,21 + ,15 + ,22 + ,5 + ,1 + ,24 + ,20 + ,23 + ,25 + ,23 + ,19 + ,10 + ,1 + ,24 + ,24 + ,22 + ,25 + ,26 + ,26 + ,5 + ,1 + ,16 + ,16 + ,14 + ,18 + ,22 + ,18 + ,8 + ,1 + ,16 + ,16 + ,14 + ,17 + ,20 + ,18 + ,8 + ,2 + ,21 + ,22 + ,16 + ,26 + ,24 + ,25 + ,5 + ,2 + ,26 + ,24 + ,23 + ,28 + ,26 + ,27 + ,4 + ,2 + ,15 + ,16 + ,7 + ,21 + ,21 + ,12 + ,4 + ,2 + ,25 + ,27 + ,10 + ,27 + ,25 + ,15 + ,4 + ,1 + ,18 + ,11 + ,12 + ,22 + ,13 + ,21 + ,5 + ,1 + ,23 + ,21 + ,12 + ,21 + ,20 + ,23 + ,4 + ,1 + ,20 + ,20 + ,12 + ,25 + ,22 + ,22 + ,4 + ,2 + ,17 + ,20 + ,17 + ,22 + ,23 + ,21 + ,8 + ,2 + ,25 + ,27 + ,21 + ,23 + ,28 + ,24 + ,4 + ,1 + ,24 + ,20 + ,16 + ,26 + ,22 + ,27 + ,5 + ,1 + ,17 + ,12 + ,11 + ,19 + ,20 + ,22 + ,14 + ,1 + ,19 + ,8 + ,14 + ,25 + ,6 + ,28 + ,8 + ,1 + ,20 + ,21 + ,13 + ,21 + ,21 + ,26 + ,8 + ,1 + ,15 + ,18 + ,9 + ,13 + ,20 + ,10 + ,4 + ,2 + ,27 + ,24 + ,19 + ,24 + ,18 + ,19 + ,4 + ,1 + ,22 + ,16 + ,13 + ,25 + ,23 + ,22 + ,6 + ,1 + ,23 + ,18 + ,19 + ,26 + ,20 + ,21 + ,4 + ,1 + ,16 + ,20 + ,13 + ,25 + ,24 + ,24 + ,7 + ,1 + ,19 + ,20 + ,13 + ,25 + ,22 + ,25 + ,7 + ,2 + ,25 + ,19 + ,13 + ,22 + ,21 + ,21 + ,4 + ,1 + ,19 + ,17 + ,14 + ,21 + ,18 + ,20 + ,6 + ,2 + ,19 + ,16 + ,12 + ,23 + ,21 + ,21 + ,4 + ,2 + ,26 + ,26 + ,22 + ,25 + ,23 + ,24 + ,7 + ,1 + ,21 + ,15 + ,11 + ,24 + ,23 + ,23 + ,4 + ,2 + ,20 + ,22 + ,5 + ,21 + ,15 + ,18 + ,4 + ,1 + ,24 + ,17 + ,18 + ,21 + ,21 + ,24 + ,8 + ,1 + ,22 + ,23 + ,19 + ,25 + ,24 + ,24 + ,4 + ,2 + ,20 + ,21 + ,14 + ,22 + ,23 + ,19 + ,4 + ,1 + ,18 + ,19 + ,15 + ,20 + ,21 + ,20 + ,10 + ,2 + ,18 + ,14 + ,12 + ,20 + ,21 + ,18 + ,8 + ,1 + ,24 + ,17 + ,19 + ,23 + ,20 + ,20 + ,6 + ,1 + ,24 + ,12 + ,15 + ,28 + ,11 + ,27 + ,4 + ,1 + ,22 + ,24 + ,17 + ,23 + ,22 + ,23 + ,4 + ,1 + ,23 + ,18 + ,8 + ,28 + ,27 + ,26 + ,4 + ,1 + ,22 + ,20 + ,10 + ,24 + ,25 + ,23 + ,5 + ,1 + ,20 + ,16 + ,12 + ,18 + ,18 + ,17 + ,4 + ,1 + ,18 + ,20 + ,12 + ,20 + ,20 + ,21 + ,6 + ,1 + ,25 + ,22 + ,20 + ,28 + ,24 + ,25 + ,4 + ,2 + ,18 + ,12 + ,12 + ,21 + ,10 + ,23 + ,5 + ,1 + ,16 + ,16 + ,12 + ,21 + ,27 + ,27 + ,7 + ,1 + ,20 + ,17 + ,14 + ,25 + ,21 + ,24 + ,8 + ,2 + ,19 + ,22 + ,6 + ,19 + ,21 + ,20 + ,5 + ,1 + ,15 + ,12 + ,10 + ,18 + ,18 + ,27 + ,8 + ,1 + ,19 + ,14 + ,18 + ,21 + ,15 + ,21 + ,10 + ,1 + ,19 + ,23 + ,18 + ,22 + ,24 + ,24 + ,8 + ,1 + ,16 + ,15 + ,7 + ,24 + ,22 + ,21 + ,5 + ,1 + ,17 + ,17 + ,18 + ,15 + ,14 + ,15 + ,12 + ,1 + ,28 + ,28 + ,9 + ,28 + ,28 + ,25 + ,4 + ,2 + ,23 + ,20 + ,17 + ,26 + ,18 + ,25 + ,5 + ,1 + ,25 + ,23 + ,22 + ,23 + ,26 + ,22 + ,4 + ,1 + ,20 + ,13 + ,11 + ,26 + ,17 + ,24 + ,6 + ,2 + ,17 + ,18 + ,15 + ,20 + ,19 + ,21 + ,4 + ,2 + ,23 + ,23 + ,17 + ,22 + ,22 + ,22 + ,4 + ,1 + ,16 + ,19 + ,15 + ,20 + ,18 + ,23 + ,7 + ,2 + ,23 + ,23 + ,22 + ,23 + ,24 + ,22 + ,7 + ,2 + ,11 + ,12 + ,9 + ,22 + ,15 + ,20 + ,10 + ,2 + ,18 + ,16 + ,13 + ,24 + ,18 + ,23 + ,4 + ,2 + ,24 + ,23 + ,20 + ,23 + ,26 + ,25 + ,5 + ,1 + ,23 + ,13 + ,14 + ,22 + ,11 + ,23 + ,8 + ,1 + ,21 + ,22 + ,14 + ,26 + ,26 + ,22 + ,11 + ,2 + ,16 + ,18 + ,12 + ,23 + ,21 + ,25 + ,7 + ,2 + ,24 + ,23 + ,20 + ,27 + ,23 + ,26 + ,4 + ,1 + ,23 + ,20 + ,20 + ,23 + ,23 + ,22 + ,8 + ,1 + ,18 + ,10 + ,8 + ,21 + ,15 + ,24 + ,6 + ,1 + ,20 + ,17 + ,17 + ,26 + ,22 + ,24 + ,7 + ,1 + ,9 + ,18 + ,9 + ,23 + ,26 + ,25 + ,5 + ,2 + ,24 + ,15 + ,18 + ,21 + ,16 + ,20 + ,4 + ,1 + ,25 + ,23 + ,22 + ,27 + ,20 + ,26 + ,8 + ,1 + ,20 + ,17 + ,10 + ,19 + ,18 + ,21 + ,4 + ,2 + ,21 + ,17 + ,13 + ,23 + ,22 + ,26 + ,8 + ,2 + ,25 + ,22 + ,15 + ,25 + ,16 + ,21 + ,6 + ,2 + ,22 + ,20 + ,18 + ,23 + ,19 + ,22 + ,4 + ,2 + ,21 + ,20 + ,18 + ,22 + ,20 + ,16 + ,9 + ,1 + ,21 + ,19 + ,12 + ,22 + ,19 + ,26 + ,5 + ,1 + ,22 + ,18 + ,12 + ,25 + ,23 + ,28 + ,6 + ,1 + ,27 + ,22 + ,20 + ,25 + ,24 + ,18 + ,4 + ,2 + ,24 + ,20 + ,12 + ,28 + ,25 + ,25 + ,4 + ,2 + ,24 + ,22 + ,16 + ,28 + ,21 + ,23 + ,4 + ,2 + ,21 + ,18 + ,16 + ,20 + ,21 + ,21 + ,5 + ,1 + ,18 + ,16 + ,18 + ,25 + ,23 + ,20 + ,6 + ,1 + ,16 + ,16 + ,16 + ,19 + ,27 + ,25 + ,16 + ,1 + ,22 + ,16 + ,13 + ,25 + ,23 + ,22 + ,6 + ,1 + ,20 + ,16 + ,17 + ,22 + ,18 + ,21 + ,6 + ,2 + ,18 + ,17 + ,13 + ,18 + ,16 + ,16 + ,4 + ,1 + ,20 + ,18 + ,17 + ,20 + ,16 + ,18 + ,4) + ,dim=c(8 + ,162) + ,dimnames=list(c('G' + ,'IM1' + ,'IM2' + ,'IM3' + ,'EM1' + ,'EM2' + ,'EM3' + ,'AM') + ,1:162)) > y <- array(NA,dim=c(8,162),dimnames=list(c('G','IM1','IM2','IM3','EM1','EM2','EM3','AM'),1:162)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '8' > #'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 AM G IM1 IM2 IM3 EM1 EM2 EM3 1 4 1 26 21 21 23 17 23 2 4 1 20 16 15 24 17 20 3 6 1 19 19 18 22 18 20 4 8 2 19 18 11 20 21 21 5 8 1 20 16 8 24 20 24 6 4 1 25 23 19 27 28 22 7 4 2 25 17 4 28 19 23 8 8 1 22 12 20 27 22 20 9 5 1 26 19 16 24 16 25 10 4 1 22 16 14 23 18 23 11 4 2 17 19 10 24 25 27 12 4 2 22 20 13 27 17 27 13 4 1 19 13 14 27 14 22 14 4 1 24 20 8 28 11 24 15 4 1 26 27 23 27 27 25 16 8 2 21 17 11 23 20 22 17 4 1 13 8 9 24 22 28 18 4 2 26 25 24 28 22 28 19 4 2 20 26 5 27 21 27 20 8 1 22 13 15 25 23 25 21 4 2 14 19 5 19 17 16 22 7 1 21 15 19 24 24 28 23 4 1 7 5 6 20 14 21 24 4 2 23 16 13 28 17 24 25 5 1 17 14 11 26 23 27 26 4 1 25 24 17 23 24 14 27 4 1 25 24 17 23 24 14 28 4 1 19 9 5 20 8 27 29 4 2 20 19 9 11 22 20 30 4 1 23 19 15 24 23 21 31 4 2 22 25 17 25 25 22 32 4 1 22 19 17 23 21 21 33 15 1 21 18 20 18 24 12 34 10 2 15 15 12 20 15 20 35 4 2 20 12 7 20 22 24 36 8 2 22 21 16 24 21 19 37 4 1 18 12 7 23 25 28 38 4 2 20 15 14 25 16 23 39 4 2 28 28 24 28 28 27 40 4 1 22 25 15 26 23 22 41 7 1 18 19 15 26 21 27 42 4 1 23 20 10 23 21 26 43 6 1 20 24 14 22 26 22 44 5 2 25 26 18 24 22 21 45 4 2 26 25 12 21 21 19 46 16 1 15 12 9 20 18 24 47 5 2 17 12 9 22 12 19 48 12 2 23 15 8 20 25 26 49 6 1 21 17 18 25 17 22 50 9 2 13 14 10 20 24 28 51 9 1 18 16 17 22 15 21 52 4 1 19 11 14 23 13 23 53 5 1 22 20 16 25 26 28 54 4 1 16 11 10 23 16 10 55 4 2 24 22 19 23 24 24 56 5 1 18 20 10 22 21 21 57 4 1 20 19 14 24 20 21 58 4 1 24 17 10 25 14 24 59 4 2 14 21 4 21 25 24 60 5 2 22 23 19 12 25 25 61 4 1 24 18 9 17 20 25 62 6 1 18 17 12 20 22 23 63 4 1 21 27 16 23 20 21 64 4 2 23 25 11 23 26 16 65 18 1 17 19 18 20 18 17 66 4 2 22 22 11 28 22 25 67 6 2 24 24 24 24 24 24 68 4 2 21 20 17 24 17 23 69 4 1 22 19 18 24 24 25 70 5 1 16 11 9 24 20 23 71 4 1 21 22 19 28 19 28 72 4 2 23 22 18 25 20 26 73 5 2 22 16 12 21 15 22 74 10 1 24 20 23 25 23 19 75 5 1 24 24 22 25 26 26 76 8 1 16 16 14 18 22 18 77 8 1 16 16 14 17 20 18 78 5 2 21 22 16 26 24 25 79 4 2 26 24 23 28 26 27 80 4 2 15 16 7 21 21 12 81 4 2 25 27 10 27 25 15 82 5 1 18 11 12 22 13 21 83 4 1 23 21 12 21 20 23 84 4 1 20 20 12 25 22 22 85 8 2 17 20 17 22 23 21 86 4 2 25 27 21 23 28 24 87 5 1 24 20 16 26 22 27 88 14 1 17 12 11 19 20 22 89 8 1 19 8 14 25 6 28 90 8 1 20 21 13 21 21 26 91 4 1 15 18 9 13 20 10 92 4 2 27 24 19 24 18 19 93 6 1 22 16 13 25 23 22 94 4 1 23 18 19 26 20 21 95 7 1 16 20 13 25 24 24 96 7 1 19 20 13 25 22 25 97 4 2 25 19 13 22 21 21 98 6 1 19 17 14 21 18 20 99 4 2 19 16 12 23 21 21 100 7 2 26 26 22 25 23 24 101 4 1 21 15 11 24 23 23 102 4 2 20 22 5 21 15 18 103 8 1 24 17 18 21 21 24 104 4 1 22 23 19 25 24 24 105 4 2 20 21 14 22 23 19 106 10 1 18 19 15 20 21 20 107 8 2 18 14 12 20 21 18 108 6 1 24 17 19 23 20 20 109 4 1 24 12 15 28 11 27 110 4 1 22 24 17 23 22 23 111 4 1 23 18 8 28 27 26 112 5 1 22 20 10 24 25 23 113 4 1 20 16 12 18 18 17 114 6 1 18 20 12 20 20 21 115 4 1 25 22 20 28 24 25 116 5 2 18 12 12 21 10 23 117 7 1 16 16 12 21 27 27 118 8 1 20 17 14 25 21 24 119 5 2 19 22 6 19 21 20 120 8 1 15 12 10 18 18 27 121 10 1 19 14 18 21 15 21 122 8 1 19 23 18 22 24 24 123 5 1 16 15 7 24 22 21 124 12 1 17 17 18 15 14 15 125 4 1 28 28 9 28 28 25 126 5 2 23 20 17 26 18 25 127 4 1 25 23 22 23 26 22 128 6 1 20 13 11 26 17 24 129 4 2 17 18 15 20 19 21 130 4 2 23 23 17 22 22 22 131 7 1 16 19 15 20 18 23 132 7 2 23 23 22 23 24 22 133 10 2 11 12 9 22 15 20 134 4 2 18 16 13 24 18 23 135 5 2 24 23 20 23 26 25 136 8 1 23 13 14 22 11 23 137 11 1 21 22 14 26 26 22 138 7 2 16 18 12 23 21 25 139 4 2 24 23 20 27 23 26 140 8 1 23 20 20 23 23 22 141 6 1 18 10 8 21 15 24 142 7 1 20 17 17 26 22 24 143 5 1 9 18 9 23 26 25 144 4 2 24 15 18 21 16 20 145 8 1 25 23 22 27 20 26 146 4 1 20 17 10 19 18 21 147 8 2 21 17 13 23 22 26 148 6 2 25 22 15 25 16 21 149 4 2 22 20 18 23 19 22 150 9 2 21 20 18 22 20 16 151 5 1 21 19 12 22 19 26 152 6 1 22 18 12 25 23 28 153 4 1 27 22 20 25 24 18 154 4 2 24 20 12 28 25 25 155 4 2 24 22 16 28 21 23 156 5 2 21 18 16 20 21 21 157 6 1 18 16 18 25 23 20 158 16 1 16 16 16 19 27 25 159 6 1 22 16 13 25 23 22 160 6 1 20 16 17 22 18 21 161 4 2 18 17 13 18 16 16 162 4 1 20 18 17 20 16 18 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) G IM1 IM2 IM3 EM1 12.498874 -0.441931 -0.185414 -0.138080 0.195650 -0.182549 EM2 EM3 0.083052 0.000807 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -4.7712 -1.4438 -0.4795 0.9432 10.3392 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 12.498874 1.755983 7.118 3.90e-11 *** G -0.441931 0.400716 -1.103 0.2718 IM1 -0.185414 0.073716 -2.515 0.0129 * IM2 -0.138080 0.066287 -2.083 0.0389 * IM3 0.195650 0.048662 4.021 9.06e-05 *** EM1 -0.182549 0.071556 -2.551 0.0117 * EM2 0.083052 0.055628 1.493 0.1375 EM3 0.000807 0.057360 0.014 0.9888 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 2.341 on 154 degrees of freedom Multiple R-squared: 0.2398, Adjusted R-squared: 0.2053 F-statistic: 6.941 on 7 and 154 DF, p-value: 3.496e-07 > 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.498687555 0.99737511 0.501312445 [2,] 0.455390301 0.91078060 0.544609699 [3,] 0.327031869 0.65406374 0.672968131 [4,] 0.274588870 0.54917774 0.725411130 [5,] 0.194035242 0.38807048 0.805964758 [6,] 0.176128523 0.35225705 0.823871477 [7,] 0.143067556 0.28613511 0.856932444 [8,] 0.098562204 0.19712441 0.901437796 [9,] 0.065385370 0.13077074 0.934614630 [10,] 0.075199122 0.15039824 0.924800878 [11,] 0.075091528 0.15018306 0.924908472 [12,] 0.052829676 0.10565935 0.947170324 [13,] 0.043609149 0.08721830 0.956390851 [14,] 0.030510697 0.06102139 0.969489303 [15,] 0.019152278 0.03830456 0.980847722 [16,] 0.016852385 0.03370477 0.983147615 [17,] 0.011757624 0.02351525 0.988242376 [18,] 0.011540290 0.02308058 0.988459710 [19,] 0.016386367 0.03277273 0.983613633 [20,] 0.012469038 0.02493808 0.987530962 [21,] 0.008009009 0.01601802 0.991990991 [22,] 0.005644989 0.01128998 0.994355011 [23,] 0.336376943 0.67275389 0.663623057 [24,] 0.441751832 0.88350366 0.558248168 [25,] 0.450103847 0.90020769 0.549896153 [26,] 0.432130259 0.86426052 0.567869741 [27,] 0.392880884 0.78576177 0.607119116 [28,] 0.380837705 0.76167541 0.619162295 [29,] 0.330228314 0.66045663 0.669771686 [30,] 0.280064719 0.56012944 0.719935281 [31,] 0.298855073 0.59771015 0.701144927 [32,] 0.254041452 0.50808290 0.745958548 [33,] 0.220070447 0.44014089 0.779929553 [34,] 0.182903222 0.36580644 0.817096778 [35,] 0.153682570 0.30736514 0.846317430 [36,] 0.854369628 0.29126074 0.145630372 [37,] 0.828803628 0.34239274 0.171196372 [38,] 0.954958644 0.09008271 0.045041356 [39,] 0.942131344 0.11573731 0.057868656 [40,] 0.933281777 0.13343645 0.066718223 [41,] 0.931190053 0.13761989 0.068809947 [42,] 0.932667177 0.13466565 0.067332823 [43,] 0.916755810 0.16648838 0.083244190 [44,] 0.922495704 0.15500859 0.077504296 [45,] 0.915781272 0.16843746 0.084218728 [46,] 0.896221715 0.20755657 0.103778285 [47,] 0.884287857 0.23142429 0.115712143 [48,] 0.858734083 0.28253183 0.141265917 [49,] 0.836111175 0.32777765 0.163888825 [50,] 0.848355101 0.30328980 0.151644899 [51,] 0.827090165 0.34581967 0.172909835 [52,] 0.797638454 0.40472309 0.202361546 [53,] 0.768827298 0.46234540 0.231172702 [54,] 0.734848313 0.53030337 0.265151687 [55,] 0.997333755 0.00533249 0.002666245 [56,] 0.996261055 0.00747789 0.003738945 [57,] 0.994729809 0.01054038 0.005270191 [58,] 0.993433433 0.01313313 0.006566567 [59,] 0.993677739 0.01264452 0.006322261 [60,] 0.992617150 0.01476570 0.007382850 [61,] 0.991046537 0.01790693 0.008953463 [62,] 0.988470821 0.02305836 0.011529179 [63,] 0.984497374 0.03100525 0.015502626 [64,] 0.988888116 0.02222377 0.011111884 [65,] 0.986302460 0.02739508 0.013697540 [66,] 0.981623468 0.03675306 0.018376532 [67,] 0.975648829 0.04870234 0.024351171 [68,] 0.968196154 0.06360769 0.031803846 [69,] 0.961674385 0.07665123 0.038325615 [70,] 0.958560364 0.08287927 0.041439636 [71,] 0.958455640 0.08308872 0.041544360 [72,] 0.953133707 0.09373259 0.046866293 [73,] 0.943520224 0.11295955 0.056479776 [74,] 0.932489260 0.13502148 0.067510740 [75,] 0.919436934 0.16112613 0.080563066 [76,] 0.909507718 0.18098456 0.090492282 [77,] 0.891070777 0.21785845 0.108929223 [78,] 0.977832634 0.04433473 0.022167366 [79,] 0.973733243 0.05253351 0.026266757 [80,] 0.970756332 0.05848734 0.029243668 [81,] 0.978397874 0.04320425 0.021602126 [82,] 0.971566220 0.05686756 0.028433780 [83,] 0.963051862 0.07389628 0.036948138 [84,] 0.960141192 0.07971762 0.039858808 [85,] 0.949733270 0.10053346 0.050266730 [86,] 0.939966184 0.12006763 0.060033816 [87,] 0.924893161 0.15021368 0.075106839 [88,] 0.907466756 0.18506649 0.092533244 [89,] 0.897392301 0.20521540 0.102607699 [90,] 0.892374053 0.21525189 0.107625947 [91,] 0.884920341 0.23015932 0.115079659 [92,] 0.865178219 0.26964356 0.134821781 [93,] 0.843505879 0.31298824 0.156494121 [94,] 0.840714451 0.31857110 0.159285549 [95,] 0.823128909 0.35374218 0.176871091 [96,] 0.835616867 0.32876627 0.164383133 [97,] 0.814932300 0.37013540 0.185067700 [98,] 0.780210484 0.43957903 0.219789516 [99,] 0.750693484 0.49861303 0.249306516 [100,] 0.737340203 0.52531959 0.262659797 [101,] 0.695586190 0.60882762 0.304413810 [102,] 0.648978845 0.70204231 0.351021155 [103,] 0.657597545 0.68480491 0.342402455 [104,] 0.611684135 0.77663173 0.388315865 [105,] 0.592188001 0.81562400 0.407811999 [106,] 0.547187449 0.90562510 0.452812551 [107,] 0.508465683 0.98306863 0.491534317 [108,] 0.478597973 0.95719595 0.521402027 [109,] 0.432770166 0.86554033 0.567229834 [110,] 0.381967168 0.76393434 0.618032832 [111,] 0.370052913 0.74010583 0.629947087 [112,] 0.322979423 0.64595885 0.677020577 [113,] 0.287464820 0.57492964 0.712535180 [114,] 0.410067793 0.82013559 0.589932207 [115,] 0.375093120 0.75018624 0.624906880 [116,] 0.320705554 0.64141111 0.679294446 [117,] 0.339468655 0.67893731 0.660531345 [118,] 0.287868998 0.57573800 0.712131002 [119,] 0.288005096 0.57601019 0.711994904 [120,] 0.247951732 0.49590346 0.752048268 [121,] 0.201297872 0.40259574 0.798702128 [122,] 0.161074223 0.32214845 0.838925777 [123,] 0.246527233 0.49305447 0.753472767 [124,] 0.206728097 0.41345619 0.793271903 [125,] 0.213047585 0.42609517 0.786952415 [126,] 0.286628131 0.57325626 0.713371869 [127,] 0.530895047 0.93820991 0.469104953 [128,] 0.467856700 0.93571340 0.532143300 [129,] 0.506323152 0.98735370 0.493676848 [130,] 0.430266152 0.86053230 0.569733848 [131,] 0.434367577 0.86873515 0.565632423 [132,] 0.361154556 0.72230911 0.638845444 [133,] 0.490782336 0.98156467 0.509217664 [134,] 0.425384438 0.85076888 0.574615562 [135,] 0.357084494 0.71416899 0.642915506 [136,] 0.282901709 0.56580342 0.717098291 [137,] 0.239112063 0.47822413 0.760887937 [138,] 0.570410752 0.85917850 0.429589248 [139,] 0.453088801 0.90617760 0.546911199 [140,] 0.687968763 0.62406247 0.312031237 [141,] 0.570847465 0.85830507 0.429152535 > postscript(file="/var/www/html/freestat/rcomp/tmp/1k8gx1291999235.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') > points(x[,1]-mysum$resid) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/2k8gx1291999235.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/3uzxi1291999235.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/4uzxi1291999235.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/5uzxi1291999235.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > qqline(mysum$resid) > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 162 Frequency = 1 1 2 3 4 5 6 -1.676958073 -2.120977935 -0.927249906 2.131088326 2.996185286 -1.377484465 7 8 9 10 11 12 2.099920395 0.851667299 0.289116353 -1.822521103 -1.512867059 0.177398303 13 14 15 16 17 18 -1.729795517 1.767826208 -1.341717008 2.993727590 -3.771338808 -0.776208117 19 20 21 22 23 24 1.868039321 1.515811453 -1.330310900 -0.444062886 -4.771245272 -0.004538312 25 26 27 28 29 30 -1.309647462 -1.239634621 -1.239634621 -1.304831730 -2.879299472 -1.649613582 31 32 33 34 35 36 -0.940277859 -2.242771688 6.692149288 3.278659906 -1.814852766 2.855131959 37 38 39 40 41 42 -2.332351471 -1.358297838 -0.488644132 -0.642257053 0.949673295 -0.553764733 43 44 45 46 47 48 0.065133349 0.625810614 0.384063313 8.757052959 -0.562742554 6.709211097 49 50 51 52 53 54 -0.203497827 1.407125435 1.917093995 -2.653904860 -0.964854345 -2.666214378 55 56 57 58 59 60 -1.658647801 -0.659350223 -1.761051024 0.165484720 -1.164276608 -2.983289238 61 62 63 64 65 66 -1.460292985 -0.914653130 -1.044843140 -0.024272499 10.339245302 0.613760176 67 68 69 70 71 72 -0.178187191 -1.335032133 -2.508257105 -1.630715811 -1.332047418 -0.952721363 73 74 75 76 77 78 -0.104424520 3.292846413 -1.213988680 -0.175923316 -0.192367710 -0.081103618 79 80 81 82 83 84 -1.050039845 -1.914319344 1.632419452 -1.628954454 -1.086607751 -1.216034210 85 86 87 88 89 90 1.061514842 -1.506340117 -0.078461719 6.389543933 1.874280981 2.076026197 91 92 93 94 95 96 -3.847111438 -0.141348208 0.323772297 -1.956039107 0.678940283 1.400480643 97 98 99 100 101 102 -0.644547242 -0.603360160 -1.793076090 2.125701833 -1.791778537 0.726003203 103 104 105 106 107 108 1.288729085 -1.968230575 -1.655598747 2.860031395 1.200124708 -0.455543361 109 110 111 112 113 114 -0.708783649 -1.637037011 -0.024195547 0.113582200 -2.709951071 -0.332694481 115 116 117 118 119 120 -1.198878594 -0.983949567 -0.659502027 2.059864033 0.479915692 0.193885204 121 122 123 124 125 126 2.448149942 1.123530258 -0.851585956 3.484164706 2.005783468 0.316227627 127 128 129 130 131 132 -2.528523337 0.609249088 -2.856234975 -1.329513117 -0.264062350 0.708683056 133 134 135 136 137 138 3.074807706 -1.744049515 -0.883128435 2.347468751 5.704581514 0.923612852 139 140 141 142 143 144 -0.904585222 1.326862813 -0.335509752 0.572411555 -2.644530589 -2.127011705 145 146 147 148 149 150 2.696754975 -2.001251218 2.433096073 2.341299790 -1.693112963 2.860714202 151 152 153 154 155 156 -0.470417418 0.790740096 -1.370046105 0.263622879 0.091006913 -1.476331051 157 158 159 160 161 162 -1.394519559 7.194416421 0.323772297 -0.961233341 -2.529507137 -2.881644853 > postscript(file="/var/www/html/freestat/rcomp/tmp/658ek1291999235.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 162 Frequency = 1 lag(myerror, k = 1) myerror 0 -1.676958073 NA 1 -2.120977935 -1.676958073 2 -0.927249906 -2.120977935 3 2.131088326 -0.927249906 4 2.996185286 2.131088326 5 -1.377484465 2.996185286 6 2.099920395 -1.377484465 7 0.851667299 2.099920395 8 0.289116353 0.851667299 9 -1.822521103 0.289116353 10 -1.512867059 -1.822521103 11 0.177398303 -1.512867059 12 -1.729795517 0.177398303 13 1.767826208 -1.729795517 14 -1.341717008 1.767826208 15 2.993727590 -1.341717008 16 -3.771338808 2.993727590 17 -0.776208117 -3.771338808 18 1.868039321 -0.776208117 19 1.515811453 1.868039321 20 -1.330310900 1.515811453 21 -0.444062886 -1.330310900 22 -4.771245272 -0.444062886 23 -0.004538312 -4.771245272 24 -1.309647462 -0.004538312 25 -1.239634621 -1.309647462 26 -1.239634621 -1.239634621 27 -1.304831730 -1.239634621 28 -2.879299472 -1.304831730 29 -1.649613582 -2.879299472 30 -0.940277859 -1.649613582 31 -2.242771688 -0.940277859 32 6.692149288 -2.242771688 33 3.278659906 6.692149288 34 -1.814852766 3.278659906 35 2.855131959 -1.814852766 36 -2.332351471 2.855131959 37 -1.358297838 -2.332351471 38 -0.488644132 -1.358297838 39 -0.642257053 -0.488644132 40 0.949673295 -0.642257053 41 -0.553764733 0.949673295 42 0.065133349 -0.553764733 43 0.625810614 0.065133349 44 0.384063313 0.625810614 45 8.757052959 0.384063313 46 -0.562742554 8.757052959 47 6.709211097 -0.562742554 48 -0.203497827 6.709211097 49 1.407125435 -0.203497827 50 1.917093995 1.407125435 51 -2.653904860 1.917093995 52 -0.964854345 -2.653904860 53 -2.666214378 -0.964854345 54 -1.658647801 -2.666214378 55 -0.659350223 -1.658647801 56 -1.761051024 -0.659350223 57 0.165484720 -1.761051024 58 -1.164276608 0.165484720 59 -2.983289238 -1.164276608 60 -1.460292985 -2.983289238 61 -0.914653130 -1.460292985 62 -1.044843140 -0.914653130 63 -0.024272499 -1.044843140 64 10.339245302 -0.024272499 65 0.613760176 10.339245302 66 -0.178187191 0.613760176 67 -1.335032133 -0.178187191 68 -2.508257105 -1.335032133 69 -1.630715811 -2.508257105 70 -1.332047418 -1.630715811 71 -0.952721363 -1.332047418 72 -0.104424520 -0.952721363 73 3.292846413 -0.104424520 74 -1.213988680 3.292846413 75 -0.175923316 -1.213988680 76 -0.192367710 -0.175923316 77 -0.081103618 -0.192367710 78 -1.050039845 -0.081103618 79 -1.914319344 -1.050039845 80 1.632419452 -1.914319344 81 -1.628954454 1.632419452 82 -1.086607751 -1.628954454 83 -1.216034210 -1.086607751 84 1.061514842 -1.216034210 85 -1.506340117 1.061514842 86 -0.078461719 -1.506340117 87 6.389543933 -0.078461719 88 1.874280981 6.389543933 89 2.076026197 1.874280981 90 -3.847111438 2.076026197 91 -0.141348208 -3.847111438 92 0.323772297 -0.141348208 93 -1.956039107 0.323772297 94 0.678940283 -1.956039107 95 1.400480643 0.678940283 96 -0.644547242 1.400480643 97 -0.603360160 -0.644547242 98 -1.793076090 -0.603360160 99 2.125701833 -1.793076090 100 -1.791778537 2.125701833 101 0.726003203 -1.791778537 102 1.288729085 0.726003203 103 -1.968230575 1.288729085 104 -1.655598747 -1.968230575 105 2.860031395 -1.655598747 106 1.200124708 2.860031395 107 -0.455543361 1.200124708 108 -0.708783649 -0.455543361 109 -1.637037011 -0.708783649 110 -0.024195547 -1.637037011 111 0.113582200 -0.024195547 112 -2.709951071 0.113582200 113 -0.332694481 -2.709951071 114 -1.198878594 -0.332694481 115 -0.983949567 -1.198878594 116 -0.659502027 -0.983949567 117 2.059864033 -0.659502027 118 0.479915692 2.059864033 119 0.193885204 0.479915692 120 2.448149942 0.193885204 121 1.123530258 2.448149942 122 -0.851585956 1.123530258 123 3.484164706 -0.851585956 124 2.005783468 3.484164706 125 0.316227627 2.005783468 126 -2.528523337 0.316227627 127 0.609249088 -2.528523337 128 -2.856234975 0.609249088 129 -1.329513117 -2.856234975 130 -0.264062350 -1.329513117 131 0.708683056 -0.264062350 132 3.074807706 0.708683056 133 -1.744049515 3.074807706 134 -0.883128435 -1.744049515 135 2.347468751 -0.883128435 136 5.704581514 2.347468751 137 0.923612852 5.704581514 138 -0.904585222 0.923612852 139 1.326862813 -0.904585222 140 -0.335509752 1.326862813 141 0.572411555 -0.335509752 142 -2.644530589 0.572411555 143 -2.127011705 -2.644530589 144 2.696754975 -2.127011705 145 -2.001251218 2.696754975 146 2.433096073 -2.001251218 147 2.341299790 2.433096073 148 -1.693112963 2.341299790 149 2.860714202 -1.693112963 150 -0.470417418 2.860714202 151 0.790740096 -0.470417418 152 -1.370046105 0.790740096 153 0.263622879 -1.370046105 154 0.091006913 0.263622879 155 -1.476331051 0.091006913 156 -1.394519559 -1.476331051 157 7.194416421 -1.394519559 158 0.323772297 7.194416421 159 -0.961233341 0.323772297 160 -2.529507137 -0.961233341 161 -2.881644853 -2.529507137 162 NA -2.881644853 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -2.120977935 -1.676958073 [2,] -0.927249906 -2.120977935 [3,] 2.131088326 -0.927249906 [4,] 2.996185286 2.131088326 [5,] -1.377484465 2.996185286 [6,] 2.099920395 -1.377484465 [7,] 0.851667299 2.099920395 [8,] 0.289116353 0.851667299 [9,] -1.822521103 0.289116353 [10,] -1.512867059 -1.822521103 [11,] 0.177398303 -1.512867059 [12,] -1.729795517 0.177398303 [13,] 1.767826208 -1.729795517 [14,] -1.341717008 1.767826208 [15,] 2.993727590 -1.341717008 [16,] -3.771338808 2.993727590 [17,] -0.776208117 -3.771338808 [18,] 1.868039321 -0.776208117 [19,] 1.515811453 1.868039321 [20,] -1.330310900 1.515811453 [21,] -0.444062886 -1.330310900 [22,] -4.771245272 -0.444062886 [23,] -0.004538312 -4.771245272 [24,] -1.309647462 -0.004538312 [25,] -1.239634621 -1.309647462 [26,] -1.239634621 -1.239634621 [27,] -1.304831730 -1.239634621 [28,] -2.879299472 -1.304831730 [29,] -1.649613582 -2.879299472 [30,] -0.940277859 -1.649613582 [31,] -2.242771688 -0.940277859 [32,] 6.692149288 -2.242771688 [33,] 3.278659906 6.692149288 [34,] -1.814852766 3.278659906 [35,] 2.855131959 -1.814852766 [36,] -2.332351471 2.855131959 [37,] -1.358297838 -2.332351471 [38,] -0.488644132 -1.358297838 [39,] -0.642257053 -0.488644132 [40,] 0.949673295 -0.642257053 [41,] -0.553764733 0.949673295 [42,] 0.065133349 -0.553764733 [43,] 0.625810614 0.065133349 [44,] 0.384063313 0.625810614 [45,] 8.757052959 0.384063313 [46,] -0.562742554 8.757052959 [47,] 6.709211097 -0.562742554 [48,] -0.203497827 6.709211097 [49,] 1.407125435 -0.203497827 [50,] 1.917093995 1.407125435 [51,] -2.653904860 1.917093995 [52,] -0.964854345 -2.653904860 [53,] -2.666214378 -0.964854345 [54,] -1.658647801 -2.666214378 [55,] -0.659350223 -1.658647801 [56,] -1.761051024 -0.659350223 [57,] 0.165484720 -1.761051024 [58,] -1.164276608 0.165484720 [59,] -2.983289238 -1.164276608 [60,] -1.460292985 -2.983289238 [61,] -0.914653130 -1.460292985 [62,] -1.044843140 -0.914653130 [63,] -0.024272499 -1.044843140 [64,] 10.339245302 -0.024272499 [65,] 0.613760176 10.339245302 [66,] -0.178187191 0.613760176 [67,] -1.335032133 -0.178187191 [68,] -2.508257105 -1.335032133 [69,] -1.630715811 -2.508257105 [70,] -1.332047418 -1.630715811 [71,] -0.952721363 -1.332047418 [72,] -0.104424520 -0.952721363 [73,] 3.292846413 -0.104424520 [74,] -1.213988680 3.292846413 [75,] -0.175923316 -1.213988680 [76,] -0.192367710 -0.175923316 [77,] -0.081103618 -0.192367710 [78,] -1.050039845 -0.081103618 [79,] -1.914319344 -1.050039845 [80,] 1.632419452 -1.914319344 [81,] -1.628954454 1.632419452 [82,] -1.086607751 -1.628954454 [83,] -1.216034210 -1.086607751 [84,] 1.061514842 -1.216034210 [85,] -1.506340117 1.061514842 [86,] -0.078461719 -1.506340117 [87,] 6.389543933 -0.078461719 [88,] 1.874280981 6.389543933 [89,] 2.076026197 1.874280981 [90,] -3.847111438 2.076026197 [91,] -0.141348208 -3.847111438 [92,] 0.323772297 -0.141348208 [93,] -1.956039107 0.323772297 [94,] 0.678940283 -1.956039107 [95,] 1.400480643 0.678940283 [96,] -0.644547242 1.400480643 [97,] -0.603360160 -0.644547242 [98,] -1.793076090 -0.603360160 [99,] 2.125701833 -1.793076090 [100,] -1.791778537 2.125701833 [101,] 0.726003203 -1.791778537 [102,] 1.288729085 0.726003203 [103,] -1.968230575 1.288729085 [104,] -1.655598747 -1.968230575 [105,] 2.860031395 -1.655598747 [106,] 1.200124708 2.860031395 [107,] -0.455543361 1.200124708 [108,] -0.708783649 -0.455543361 [109,] -1.637037011 -0.708783649 [110,] -0.024195547 -1.637037011 [111,] 0.113582200 -0.024195547 [112,] -2.709951071 0.113582200 [113,] -0.332694481 -2.709951071 [114,] -1.198878594 -0.332694481 [115,] -0.983949567 -1.198878594 [116,] -0.659502027 -0.983949567 [117,] 2.059864033 -0.659502027 [118,] 0.479915692 2.059864033 [119,] 0.193885204 0.479915692 [120,] 2.448149942 0.193885204 [121,] 1.123530258 2.448149942 [122,] -0.851585956 1.123530258 [123,] 3.484164706 -0.851585956 [124,] 2.005783468 3.484164706 [125,] 0.316227627 2.005783468 [126,] -2.528523337 0.316227627 [127,] 0.609249088 -2.528523337 [128,] -2.856234975 0.609249088 [129,] -1.329513117 -2.856234975 [130,] -0.264062350 -1.329513117 [131,] 0.708683056 -0.264062350 [132,] 3.074807706 0.708683056 [133,] -1.744049515 3.074807706 [134,] -0.883128435 -1.744049515 [135,] 2.347468751 -0.883128435 [136,] 5.704581514 2.347468751 [137,] 0.923612852 5.704581514 [138,] -0.904585222 0.923612852 [139,] 1.326862813 -0.904585222 [140,] -0.335509752 1.326862813 [141,] 0.572411555 -0.335509752 [142,] -2.644530589 0.572411555 [143,] -2.127011705 -2.644530589 [144,] 2.696754975 -2.127011705 [145,] -2.001251218 2.696754975 [146,] 2.433096073 -2.001251218 [147,] 2.341299790 2.433096073 [148,] -1.693112963 2.341299790 [149,] 2.860714202 -1.693112963 [150,] -0.470417418 2.860714202 [151,] 0.790740096 -0.470417418 [152,] -1.370046105 0.790740096 [153,] 0.263622879 -1.370046105 [154,] 0.091006913 0.263622879 [155,] -1.476331051 0.091006913 [156,] -1.394519559 -1.476331051 [157,] 7.194416421 -1.394519559 [158,] 0.323772297 7.194416421 [159,] -0.961233341 0.323772297 [160,] -2.529507137 -0.961233341 [161,] -2.881644853 -2.529507137 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -2.120977935 -1.676958073 2 -0.927249906 -2.120977935 3 2.131088326 -0.927249906 4 2.996185286 2.131088326 5 -1.377484465 2.996185286 6 2.099920395 -1.377484465 7 0.851667299 2.099920395 8 0.289116353 0.851667299 9 -1.822521103 0.289116353 10 -1.512867059 -1.822521103 11 0.177398303 -1.512867059 12 -1.729795517 0.177398303 13 1.767826208 -1.729795517 14 -1.341717008 1.767826208 15 2.993727590 -1.341717008 16 -3.771338808 2.993727590 17 -0.776208117 -3.771338808 18 1.868039321 -0.776208117 19 1.515811453 1.868039321 20 -1.330310900 1.515811453 21 -0.444062886 -1.330310900 22 -4.771245272 -0.444062886 23 -0.004538312 -4.771245272 24 -1.309647462 -0.004538312 25 -1.239634621 -1.309647462 26 -1.239634621 -1.239634621 27 -1.304831730 -1.239634621 28 -2.879299472 -1.304831730 29 -1.649613582 -2.879299472 30 -0.940277859 -1.649613582 31 -2.242771688 -0.940277859 32 6.692149288 -2.242771688 33 3.278659906 6.692149288 34 -1.814852766 3.278659906 35 2.855131959 -1.814852766 36 -2.332351471 2.855131959 37 -1.358297838 -2.332351471 38 -0.488644132 -1.358297838 39 -0.642257053 -0.488644132 40 0.949673295 -0.642257053 41 -0.553764733 0.949673295 42 0.065133349 -0.553764733 43 0.625810614 0.065133349 44 0.384063313 0.625810614 45 8.757052959 0.384063313 46 -0.562742554 8.757052959 47 6.709211097 -0.562742554 48 -0.203497827 6.709211097 49 1.407125435 -0.203497827 50 1.917093995 1.407125435 51 -2.653904860 1.917093995 52 -0.964854345 -2.653904860 53 -2.666214378 -0.964854345 54 -1.658647801 -2.666214378 55 -0.659350223 -1.658647801 56 -1.761051024 -0.659350223 57 0.165484720 -1.761051024 58 -1.164276608 0.165484720 59 -2.983289238 -1.164276608 60 -1.460292985 -2.983289238 61 -0.914653130 -1.460292985 62 -1.044843140 -0.914653130 63 -0.024272499 -1.044843140 64 10.339245302 -0.024272499 65 0.613760176 10.339245302 66 -0.178187191 0.613760176 67 -1.335032133 -0.178187191 68 -2.508257105 -1.335032133 69 -1.630715811 -2.508257105 70 -1.332047418 -1.630715811 71 -0.952721363 -1.332047418 72 -0.104424520 -0.952721363 73 3.292846413 -0.104424520 74 -1.213988680 3.292846413 75 -0.175923316 -1.213988680 76 -0.192367710 -0.175923316 77 -0.081103618 -0.192367710 78 -1.050039845 -0.081103618 79 -1.914319344 -1.050039845 80 1.632419452 -1.914319344 81 -1.628954454 1.632419452 82 -1.086607751 -1.628954454 83 -1.216034210 -1.086607751 84 1.061514842 -1.216034210 85 -1.506340117 1.061514842 86 -0.078461719 -1.506340117 87 6.389543933 -0.078461719 88 1.874280981 6.389543933 89 2.076026197 1.874280981 90 -3.847111438 2.076026197 91 -0.141348208 -3.847111438 92 0.323772297 -0.141348208 93 -1.956039107 0.323772297 94 0.678940283 -1.956039107 95 1.400480643 0.678940283 96 -0.644547242 1.400480643 97 -0.603360160 -0.644547242 98 -1.793076090 -0.603360160 99 2.125701833 -1.793076090 100 -1.791778537 2.125701833 101 0.726003203 -1.791778537 102 1.288729085 0.726003203 103 -1.968230575 1.288729085 104 -1.655598747 -1.968230575 105 2.860031395 -1.655598747 106 1.200124708 2.860031395 107 -0.455543361 1.200124708 108 -0.708783649 -0.455543361 109 -1.637037011 -0.708783649 110 -0.024195547 -1.637037011 111 0.113582200 -0.024195547 112 -2.709951071 0.113582200 113 -0.332694481 -2.709951071 114 -1.198878594 -0.332694481 115 -0.983949567 -1.198878594 116 -0.659502027 -0.983949567 117 2.059864033 -0.659502027 118 0.479915692 2.059864033 119 0.193885204 0.479915692 120 2.448149942 0.193885204 121 1.123530258 2.448149942 122 -0.851585956 1.123530258 123 3.484164706 -0.851585956 124 2.005783468 3.484164706 125 0.316227627 2.005783468 126 -2.528523337 0.316227627 127 0.609249088 -2.528523337 128 -2.856234975 0.609249088 129 -1.329513117 -2.856234975 130 -0.264062350 -1.329513117 131 0.708683056 -0.264062350 132 3.074807706 0.708683056 133 -1.744049515 3.074807706 134 -0.883128435 -1.744049515 135 2.347468751 -0.883128435 136 5.704581514 2.347468751 137 0.923612852 5.704581514 138 -0.904585222 0.923612852 139 1.326862813 -0.904585222 140 -0.335509752 1.326862813 141 0.572411555 -0.335509752 142 -2.644530589 0.572411555 143 -2.127011705 -2.644530589 144 2.696754975 -2.127011705 145 -2.001251218 2.696754975 146 2.433096073 -2.001251218 147 2.341299790 2.433096073 148 -1.693112963 2.341299790 149 2.860714202 -1.693112963 150 -0.470417418 2.860714202 151 0.790740096 -0.470417418 152 -1.370046105 0.790740096 153 0.263622879 -1.370046105 154 0.091006913 0.263622879 155 -1.476331051 0.091006913 156 -1.394519559 -1.476331051 157 7.194416421 -1.394519559 158 0.323772297 7.194416421 159 -0.961233341 0.323772297 160 -2.529507137 -0.961233341 161 -2.881644853 -2.529507137 > 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/758ek1291999235.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/8gid51291999235.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/9gid51291999235.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/html/freestat/rcomp/tmp/109rd91291999235.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #Note: the /var/www/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/11c9te1291999235.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/12xsa21291999235.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/13tk7b1291999235.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/14w26z1291999235.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/1503m51291999235.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/16wv2d1291999235.tab") + } > try(system("convert tmp/1k8gx1291999235.ps tmp/1k8gx1291999235.png",intern=TRUE)) character(0) > try(system("convert tmp/2k8gx1291999235.ps tmp/2k8gx1291999235.png",intern=TRUE)) character(0) > try(system("convert tmp/3uzxi1291999235.ps tmp/3uzxi1291999235.png",intern=TRUE)) character(0) > try(system("convert tmp/4uzxi1291999235.ps tmp/4uzxi1291999235.png",intern=TRUE)) character(0) > try(system("convert tmp/5uzxi1291999235.ps tmp/5uzxi1291999235.png",intern=TRUE)) character(0) > try(system("convert tmp/658ek1291999235.ps tmp/658ek1291999235.png",intern=TRUE)) character(0) > try(system("convert tmp/758ek1291999235.ps tmp/758ek1291999235.png",intern=TRUE)) character(0) > try(system("convert tmp/8gid51291999235.ps tmp/8gid51291999235.png",intern=TRUE)) character(0) > try(system("convert tmp/9gid51291999235.ps tmp/9gid51291999235.png",intern=TRUE)) character(0) > try(system("convert tmp/109rd91291999235.ps tmp/109rd91291999235.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 6.577 2.801 14.232