R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(45 + ,64 + ,64 + ,62 + ,64 + ,62 + ,45 + ,69 + ,64 + ,64 + ,62 + ,64 + ,49 + ,69 + ,69 + ,64 + ,64 + ,62 + ,50 + ,65 + ,69 + ,69 + ,64 + ,64 + ,54 + ,56 + ,65 + ,69 + ,69 + ,64 + ,59 + ,58 + ,56 + ,65 + ,69 + ,69 + ,58 + ,53 + ,58 + ,56 + ,65 + ,69 + ,56 + ,62 + ,53 + ,58 + ,56 + ,65 + ,48 + ,55 + ,62 + ,53 + ,58 + ,56 + ,50 + ,60 + ,55 + ,62 + ,53 + ,58 + ,52 + ,59 + ,60 + ,55 + ,62 + ,53 + ,53 + ,58 + ,59 + ,60 + ,55 + ,62 + ,55 + ,53 + ,58 + ,59 + ,60 + ,55 + ,43 + ,57 + ,53 + ,58 + ,59 + ,60 + ,42 + ,57 + ,57 + ,53 + ,58 + ,59 + ,38 + ,53 + ,57 + ,57 + ,53 + ,58 + ,41 + ,54 + ,53 + ,57 + ,57 + ,53 + ,41 + ,53 + ,54 + ,53 + ,57 + ,57 + ,39 + ,57 + ,53 + ,54 + ,53 + ,57 + ,34 + ,57 + ,57 + ,53 + ,54 + ,53 + ,27 + ,55 + ,57 + ,57 + ,53 + ,54 + ,15 + ,49 + ,55 + ,57 + ,57 + ,53 + ,14 + ,50 + ,49 + ,55 + ,57 + ,57 + ,31 + ,49 + ,50 + ,49 + ,55 + ,57 + ,41 + ,54 + ,49 + ,50 + ,49 + ,55 + ,43 + ,58 + ,54 + ,49 + ,50 + ,49 + ,46 + ,58 + ,58 + ,54 + ,49 + ,50 + ,42 + ,52 + ,58 + ,58 + ,54 + ,49 + ,45 + ,56 + ,52 + ,58 + ,58 + ,54 + ,45 + ,52 + ,56 + ,52 + ,58 + ,58 + ,40 + ,59 + ,52 + ,56 + ,52 + ,58 + ,35 + ,53 + ,59 + ,52 + ,56 + ,52 + ,36 + ,52 + ,53 + ,59 + ,52 + ,56 + ,38 + ,53 + ,52 + ,53 + ,59 + ,52 + ,39 + ,51 + ,53 + ,52 + ,53 + ,59 + ,32 + ,50 + ,51 + ,53 + ,52 + ,53 + ,24 + ,56 + ,50 + ,51 + ,53 + ,52 + ,21 + ,52 + ,56 + ,50 + ,51 + ,53 + ,12 + ,46 + ,52 + ,56 + ,50 + ,51 + ,29 + ,48 + ,46 + ,52 + ,56 + ,50 + ,36 + ,46 + ,48 + ,46 + ,52 + ,56 + ,31 + ,48 + ,46 + ,48 + ,46 + ,52 + ,28 + ,48 + ,48 + ,46 + ,48 + ,46 + ,30 + ,49 + ,48 + ,48 + ,46 + ,48 + ,38 + ,53 + ,49 + ,48 + ,48 + ,46 + ,27 + ,48 + ,53 + ,49 + ,48 + ,48 + ,40 + ,51 + ,48 + ,53 + ,49 + ,48 + ,40 + ,48 + ,51 + ,48 + ,53 + ,49 + ,44 + ,50 + ,48 + ,51 + ,48 + ,53 + ,47 + ,55 + ,50 + ,48 + ,51 + ,48 + ,45 + ,52 + ,55 + ,50 + ,48 + ,51 + ,42 + ,53 + ,52 + ,55 + ,50 + ,48 + ,38 + ,52 + ,53 + ,52 + ,55 + ,50 + ,46 + ,55 + ,52 + ,53 + ,52 + ,55 + ,37 + ,53 + ,55 + ,52 + ,53 + ,52 + ,41 + ,53 + ,53 + ,55 + ,52 + ,53 + ,40 + ,56 + ,53 + ,53 + ,55 + ,52 + ,33 + ,54 + ,56 + ,53 + ,53 + ,55 + ,34 + ,52 + ,54 + ,56 + ,53 + ,53 + ,36 + ,55 + ,52 + ,54 + ,56 + ,53 + ,36 + ,54 + ,55 + ,52 + ,54 + ,56 + ,38 + ,59 + ,54 + ,55 + ,52 + ,54 + ,42 + ,56 + ,59 + ,54 + ,55 + ,52 + ,35 + ,56 + ,56 + ,59 + ,54 + ,55 + ,25 + ,51 + ,56 + ,56 + ,59 + ,54 + ,24 + ,53 + ,51 + ,56 + ,56 + ,59 + ,22 + ,52 + ,53 + ,51 + ,56 + ,56 + ,27 + ,51 + ,52 + ,53 + ,51 + ,56 + ,17 + ,46 + ,51 + ,52 + ,53 + ,51 + ,30 + ,49 + ,46 + ,51 + ,52 + ,53 + ,30 + ,46 + ,49 + ,46 + ,51 + ,52 + ,34 + ,55 + ,46 + ,49 + ,46 + ,51 + ,37 + ,57 + ,55 + ,46 + ,49 + ,46 + ,36 + ,53 + ,57 + ,55 + ,46 + ,49 + ,33 + ,52 + ,53 + ,57 + ,55 + ,46 + ,33 + ,53 + ,52 + ,53 + ,57 + ,55 + ,33 + ,50 + ,53 + ,52 + ,53 + ,57 + ,37 + ,54 + ,50 + ,53 + ,52 + ,53 + ,40 + ,53 + ,54 + ,50 + ,53 + ,52 + ,35 + ,50 + ,53 + ,54 + ,50 + ,53 + ,37 + ,51 + ,50 + ,53 + ,54 + ,50 + ,43 + ,52 + ,51 + ,50 + ,53 + ,54 + ,42 + ,47 + ,52 + ,51 + ,50 + ,53 + ,33 + ,51 + ,47 + ,52 + ,51 + ,50 + ,39 + ,49 + ,51 + ,47 + ,52 + ,51 + ,40 + ,53 + ,49 + ,51 + ,47 + ,52 + ,37 + ,52 + ,53 + ,49 + ,51 + ,47 + ,44 + ,45 + ,52 + ,53 + ,49 + ,51 + ,42 + ,53 + ,45 + ,52 + ,53 + ,49 + ,43 + ,51 + ,53 + ,45 + ,52 + ,53 + ,40 + ,48 + ,51 + ,53 + ,45 + ,52 + ,30 + ,48 + ,48 + ,51 + ,53 + ,45 + ,30 + ,48 + ,48 + ,48 + ,51 + ,53 + ,31 + ,48 + ,48 + ,48 + ,48 + ,51 + ,18 + ,40 + ,48 + ,48 + ,48 + ,48 + ,24 + ,43 + ,40 + ,48 + ,48 + ,48 + ,22 + ,40 + ,43 + ,40 + ,48 + ,48 + ,26 + ,39 + ,40 + ,43 + ,40 + ,48 + ,28 + ,39 + ,39 + ,40 + ,43 + ,40 + ,23 + ,36 + ,39 + ,39 + ,40 + ,43 + ,17 + ,41 + ,36 + ,39 + ,39 + ,40 + ,12 + ,39 + ,41 + ,36 + ,39 + ,39 + ,9 + ,40 + ,39 + ,41 + ,36 + ,39 + ,19 + ,39 + ,40 + ,39 + ,41 + ,36 + ,21 + ,46 + ,39 + ,40 + ,39 + ,41 + ,18 + ,40 + ,46 + ,39 + ,40 + ,39 + ,18 + ,37 + ,40 + ,46 + ,39 + ,40 + ,15 + ,37 + ,37 + ,40 + ,46 + ,39 + ,24 + ,44 + ,37 + ,37 + ,40 + ,46 + ,18 + ,41 + ,44 + ,37 + ,37 + ,40 + ,19 + ,40 + ,41 + ,44 + ,37 + ,37 + ,30 + ,36 + ,40 + ,41 + ,44 + ,37 + ,33 + ,38 + ,36 + ,40 + ,41 + ,44 + ,35 + ,43 + ,38 + ,36 + ,40 + ,41 + ,36 + ,42 + ,43 + ,38 + ,36 + ,40 + ,47 + ,45 + ,42 + ,43 + ,38 + ,36 + ,46 + ,46 + ,45 + ,42 + ,43 + ,38) + ,dim=c(6 + ,117) + ,dimnames=list(c('X' + ,'Y' + ,'Y1' + ,'Y2' + ,'Y3' + ,'Y4') + ,1:117)) > y <- array(NA,dim=c(6,117),dimnames=list(c('X','Y','Y1','Y2','Y3','Y4'),1:117)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'Linear Trend' > par2 = 'Include Monthly Dummies' > par1 = '2' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo 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 Y X Y1 Y2 Y3 Y4 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t 1 64 45 64 62 64 62 1 0 0 0 0 0 0 0 0 0 0 1 2 69 45 64 64 62 64 0 1 0 0 0 0 0 0 0 0 0 2 3 69 49 69 64 64 62 0 0 1 0 0 0 0 0 0 0 0 3 4 65 50 69 69 64 64 0 0 0 1 0 0 0 0 0 0 0 4 5 56 54 65 69 69 64 0 0 0 0 1 0 0 0 0 0 0 5 6 58 59 56 65 69 69 0 0 0 0 0 1 0 0 0 0 0 6 7 53 58 58 56 65 69 0 0 0 0 0 0 1 0 0 0 0 7 8 62 56 53 58 56 65 0 0 0 0 0 0 0 1 0 0 0 8 9 55 48 62 53 58 56 0 0 0 0 0 0 0 0 1 0 0 9 10 60 50 55 62 53 58 0 0 0 0 0 0 0 0 0 1 0 10 11 59 52 60 55 62 53 0 0 0 0 0 0 0 0 0 0 1 11 12 58 53 59 60 55 62 0 0 0 0 0 0 0 0 0 0 0 12 13 53 55 58 59 60 55 1 0 0 0 0 0 0 0 0 0 0 13 14 57 43 53 58 59 60 0 1 0 0 0 0 0 0 0 0 0 14 15 57 42 57 53 58 59 0 0 1 0 0 0 0 0 0 0 0 15 16 53 38 57 57 53 58 0 0 0 1 0 0 0 0 0 0 0 16 17 54 41 53 57 57 53 0 0 0 0 1 0 0 0 0 0 0 17 18 53 41 54 53 57 57 0 0 0 0 0 1 0 0 0 0 0 18 19 57 39 53 54 53 57 0 0 0 0 0 0 1 0 0 0 0 19 20 57 34 57 53 54 53 0 0 0 0 0 0 0 1 0 0 0 20 21 55 27 57 57 53 54 0 0 0 0 0 0 0 0 1 0 0 21 22 49 15 55 57 57 53 0 0 0 0 0 0 0 0 0 1 0 22 23 50 14 49 55 57 57 0 0 0 0 0 0 0 0 0 0 1 23 24 49 31 50 49 55 57 0 0 0 0 0 0 0 0 0 0 0 24 25 54 41 49 50 49 55 1 0 0 0 0 0 0 0 0 0 0 25 26 58 43 54 49 50 49 0 1 0 0 0 0 0 0 0 0 0 26 27 58 46 58 54 49 50 0 0 1 0 0 0 0 0 0 0 0 27 28 52 42 58 58 54 49 0 0 0 1 0 0 0 0 0 0 0 28 29 56 45 52 58 58 54 0 0 0 0 1 0 0 0 0 0 0 29 30 52 45 56 52 58 58 0 0 0 0 0 1 0 0 0 0 0 30 31 59 40 52 56 52 58 0 0 0 0 0 0 1 0 0 0 0 31 32 53 35 59 52 56 52 0 0 0 0 0 0 0 1 0 0 0 32 33 52 36 53 59 52 56 0 0 0 0 0 0 0 0 1 0 0 33 34 53 38 52 53 59 52 0 0 0 0 0 0 0 0 0 1 0 34 35 51 39 53 52 53 59 0 0 0 0 0 0 0 0 0 0 1 35 36 50 32 51 53 52 53 0 0 0 0 0 0 0 0 0 0 0 36 37 56 24 50 51 53 52 1 0 0 0 0 0 0 0 0 0 0 37 38 52 21 56 50 51 53 0 1 0 0 0 0 0 0 0 0 0 38 39 46 12 52 56 50 51 0 0 1 0 0 0 0 0 0 0 0 39 40 48 29 46 52 56 50 0 0 0 1 0 0 0 0 0 0 0 40 41 46 36 48 46 52 56 0 0 0 0 1 0 0 0 0 0 0 41 42 48 31 46 48 46 52 0 0 0 0 0 1 0 0 0 0 0 42 43 48 28 48 46 48 46 0 0 0 0 0 0 1 0 0 0 0 43 44 49 30 48 48 46 48 0 0 0 0 0 0 0 1 0 0 0 44 45 53 38 49 48 48 46 0 0 0 0 0 0 0 0 1 0 0 45 46 48 27 53 49 48 48 0 0 0 0 0 0 0 0 0 1 0 46 47 51 40 48 53 49 48 0 0 0 0 0 0 0 0 0 0 1 47 48 48 40 51 48 53 49 0 0 0 0 0 0 0 0 0 0 0 48 49 50 44 48 51 48 53 1 0 0 0 0 0 0 0 0 0 0 49 50 55 47 50 48 51 48 0 1 0 0 0 0 0 0 0 0 0 50 51 52 45 55 50 48 51 0 0 1 0 0 0 0 0 0 0 0 51 52 53 42 52 55 50 48 0 0 0 1 0 0 0 0 0 0 0 52 53 52 38 53 52 55 50 0 0 0 0 1 0 0 0 0 0 0 53 54 55 46 52 53 52 55 0 0 0 0 0 1 0 0 0 0 0 54 55 53 37 55 52 53 52 0 0 0 0 0 0 1 0 0 0 0 55 56 53 41 53 55 52 53 0 0 0 0 0 0 0 1 0 0 0 56 57 56 40 53 53 55 52 0 0 0 0 0 0 0 0 1 0 0 57 58 54 33 56 53 53 55 0 0 0 0 0 0 0 0 0 1 0 58 59 52 34 54 56 53 53 0 0 0 0 0 0 0 0 0 0 1 59 60 55 36 52 54 56 53 0 0 0 0 0 0 0 0 0 0 0 60 61 54 36 55 52 54 56 1 0 0 0 0 0 0 0 0 0 0 61 62 59 38 54 55 52 54 0 1 0 0 0 0 0 0 0 0 0 62 63 56 42 59 54 55 52 0 0 1 0 0 0 0 0 0 0 0 63 64 56 35 56 59 54 55 0 0 0 1 0 0 0 0 0 0 0 64 65 51 25 56 56 59 54 0 0 0 0 1 0 0 0 0 0 0 65 66 53 24 51 56 56 59 0 0 0 0 0 1 0 0 0 0 0 66 67 52 22 53 51 56 56 0 0 0 0 0 0 1 0 0 0 0 67 68 51 27 52 53 51 56 0 0 0 0 0 0 0 1 0 0 0 68 69 46 17 51 52 53 51 0 0 0 0 0 0 0 0 1 0 0 69 70 49 30 46 51 52 53 0 0 0 0 0 0 0 0 0 1 0 70 71 46 30 49 46 51 52 0 0 0 0 0 0 0 0 0 0 1 71 72 55 34 46 49 46 51 0 0 0 0 0 0 0 0 0 0 0 72 73 57 37 55 46 49 46 1 0 0 0 0 0 0 0 0 0 0 73 74 53 36 57 55 46 49 0 1 0 0 0 0 0 0 0 0 0 74 75 52 33 53 57 55 46 0 0 1 0 0 0 0 0 0 0 0 75 76 53 33 52 53 57 55 0 0 0 1 0 0 0 0 0 0 0 76 77 50 33 53 52 53 57 0 0 0 0 1 0 0 0 0 0 0 77 78 54 37 50 53 52 53 0 0 0 0 0 1 0 0 0 0 0 78 79 53 40 54 50 53 52 0 0 0 0 0 0 1 0 0 0 0 79 80 50 35 53 54 50 53 0 0 0 0 0 0 0 1 0 0 0 80 81 51 37 50 53 54 50 0 0 0 0 0 0 0 0 1 0 0 81 82 52 43 51 50 53 54 0 0 0 0 0 0 0 0 0 1 0 82 83 47 42 52 51 50 53 0 0 0 0 0 0 0 0 0 0 1 83 84 51 33 47 52 51 50 0 0 0 0 0 0 0 0 0 0 0 84 85 49 39 51 47 52 51 1 0 0 0 0 0 0 0 0 0 0 85 86 53 40 49 51 47 52 0 1 0 0 0 0 0 0 0 0 0 86 87 52 37 53 49 51 47 0 0 1 0 0 0 0 0 0 0 0 87 88 45 44 52 53 49 51 0 0 0 1 0 0 0 0 0 0 0 88 89 53 42 45 52 53 49 0 0 0 0 1 0 0 0 0 0 0 89 90 51 43 53 45 52 53 0 0 0 0 0 1 0 0 0 0 0 90 91 48 40 51 53 45 52 0 0 0 0 0 0 1 0 0 0 0 91 92 48 30 48 51 53 45 0 0 0 0 0 0 0 1 0 0 0 92 93 48 30 48 48 51 53 0 0 0 0 0 0 0 0 1 0 0 93 94 48 31 48 48 48 51 0 0 0 0 0 0 0 0 0 1 0 94 95 40 18 48 48 48 48 0 0 0 0 0 0 0 0 0 0 1 95 96 43 24 40 48 48 48 0 0 0 0 0 0 0 0 0 0 0 96 97 40 22 43 40 48 48 1 0 0 0 0 0 0 0 0 0 0 97 98 39 26 40 43 40 48 0 1 0 0 0 0 0 0 0 0 0 98 99 39 28 39 40 43 40 0 0 1 0 0 0 0 0 0 0 0 99 100 36 23 39 39 40 43 0 0 0 1 0 0 0 0 0 0 0 100 101 41 17 36 39 39 40 0 0 0 0 1 0 0 0 0 0 0 101 102 39 12 41 36 39 39 0 0 0 0 0 1 0 0 0 0 0 102 103 40 9 39 41 36 39 0 0 0 0 0 0 1 0 0 0 0 103 104 39 19 40 39 41 36 0 0 0 0 0 0 0 1 0 0 0 104 105 46 21 39 40 39 41 0 0 0 0 0 0 0 0 1 0 0 105 106 40 18 46 39 40 39 0 0 0 0 0 0 0 0 0 1 0 106 107 37 18 40 46 39 40 0 0 0 0 0 0 0 0 0 0 1 107 108 37 15 37 40 46 39 0 0 0 0 0 0 0 0 0 0 0 108 109 44 24 37 37 40 46 1 0 0 0 0 0 0 0 0 0 0 109 110 41 18 44 37 37 40 0 1 0 0 0 0 0 0 0 0 0 110 111 40 19 41 44 37 37 0 0 1 0 0 0 0 0 0 0 0 111 112 36 30 40 41 44 37 0 0 0 1 0 0 0 0 0 0 0 112 113 38 33 36 40 41 44 0 0 0 0 1 0 0 0 0 0 0 113 114 43 35 38 36 40 41 0 0 0 0 0 1 0 0 0 0 0 114 115 42 36 43 38 36 40 0 0 0 0 0 0 1 0 0 0 0 115 116 45 47 42 43 38 36 0 0 0 0 0 0 0 1 0 0 0 116 117 46 46 45 42 43 38 0 0 0 0 0 0 0 0 1 0 0 117 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X Y1 Y2 Y3 Y4 14.98401 0.12878 0.32218 0.30678 -0.01857 0.03875 M1 M2 M3 M4 M5 M6 1.23353 2.06185 -0.06644 -2.62061 -1.34841 0.11381 M7 M8 M9 M10 M11 t 0.07430 0.08686 0.37792 -0.43901 -2.34191 -0.02783 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -7.75819 -1.75889 0.00524 1.79134 6.66700 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 14.98401 4.95620 3.023 0.003184 ** X 0.12878 0.03335 3.861 0.000201 *** Y1 0.32218 0.09571 3.366 0.001086 ** Y2 0.30678 0.10083 3.043 0.003003 ** Y3 -0.01857 0.10080 -0.184 0.854233 Y4 0.03875 0.09356 0.414 0.679681 M1 1.23353 1.40890 0.876 0.383406 M2 2.06185 1.44647 1.425 0.157176 M3 -0.06644 1.47187 -0.045 0.964089 M4 -2.62061 1.42050 -1.845 0.068049 . M5 -1.34841 1.38314 -0.975 0.331989 M6 0.11381 1.40176 0.081 0.935453 M7 0.07430 1.42028 0.052 0.958382 M8 0.08686 1.41125 0.062 0.951049 M9 0.37792 1.40560 0.269 0.788590 M10 -0.43901 1.43765 -0.305 0.760726 M11 -2.34191 1.42316 -1.646 0.103023 t -0.02783 0.01506 -1.848 0.067559 . --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 2.986 on 99 degrees of freedom Multiple R-squared: 0.828, Adjusted R-squared: 0.7984 F-statistic: 28.03 on 17 and 99 DF, p-value: < 2.2e-16 > if (n > n25) { + kp3 <- k + 3 + nmkm3 <- n - k - 3 + gqarr <- array(NA, dim=c(nmkm3-kp3+1,3)) + numgqtests <- 0 + numsignificant1 <- 0 + numsignificant5 <- 0 + numsignificant10 <- 0 + for (mypoint in kp3:nmkm3) { + j <- 0 + numgqtests <- numgqtests + 1 + for (myalt in c('greater', 'two.sided', 'less')) { + j <- j + 1 + gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value + } + if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1 + } + gqarr + } [,1] [,2] [,3] [1,] 0.2859947 0.57198932 0.71400534 [2,] 0.1970326 0.39406517 0.80296741 [3,] 0.1872654 0.37453079 0.81273461 [4,] 0.1970757 0.39415131 0.80292434 [5,] 0.7656101 0.46877974 0.23438987 [6,] 0.7269260 0.54614808 0.27307404 [7,] 0.6657402 0.66851967 0.33425983 [8,] 0.6095381 0.78092381 0.39046190 [9,] 0.9104318 0.17913637 0.08956818 [10,] 0.8955143 0.20897142 0.10448571 [11,] 0.9152029 0.16959430 0.08479715 [12,] 0.8894066 0.22118685 0.11059343 [13,] 0.8758089 0.24838230 0.12419115 [14,] 0.9461398 0.10772041 0.05386020 [15,] 0.9364404 0.12711923 0.06355962 [16,] 0.9179778 0.16404435 0.08202218 [17,] 0.9603786 0.07924287 0.03962144 [18,] 0.9581209 0.08375815 0.04187907 [19,] 0.9874076 0.02518471 0.01259235 [20,] 0.9848226 0.03035473 0.01517736 [21,] 0.9810847 0.03783057 0.01891529 [22,] 0.9751518 0.04969645 0.02484822 [23,] 0.9646249 0.07075026 0.03537513 [24,] 0.9525642 0.09487153 0.04743576 [25,] 0.9552641 0.08947179 0.04473590 [26,] 0.9463945 0.10721100 0.05360550 [27,] 0.9295903 0.14081941 0.07040971 [28,] 0.9447021 0.11059579 0.05529790 [29,] 0.9558956 0.08820876 0.04410438 [30,] 0.9402704 0.11945914 0.05972957 [31,] 0.9345670 0.13086601 0.06543301 [32,] 0.9211239 0.15775222 0.07887611 [33,] 0.9286200 0.14275999 0.07137999 [34,] 0.9393377 0.12132457 0.06066228 [35,] 0.9314449 0.13711017 0.06855509 [36,] 0.9283115 0.14337691 0.07168845 [37,] 0.9349657 0.13006852 0.06503426 [38,] 0.9228216 0.15435683 0.07717841 [39,] 0.8978821 0.20423572 0.10211786 [40,] 0.9014153 0.19716933 0.09858467 [41,] 0.8908181 0.21836379 0.10918190 [42,] 0.8794451 0.24110983 0.12055492 [43,] 0.8460415 0.30791696 0.15395848 [44,] 0.8535320 0.29293606 0.14646803 [45,] 0.8263691 0.34726176 0.17363088 [46,] 0.7909940 0.41801203 0.20900602 [47,] 0.7583869 0.48322613 0.24161307 [48,] 0.7115614 0.57687716 0.28843858 [49,] 0.7967176 0.40656470 0.20328235 [50,] 0.7696726 0.46065471 0.23032736 [51,] 0.7236662 0.55266752 0.27633376 [52,] 0.7770348 0.44593041 0.22296520 [53,] 0.8069250 0.38615008 0.19307504 [54,] 0.8174856 0.36502887 0.18251444 [55,] 0.7771102 0.44577969 0.22288984 [56,] 0.9165222 0.16695563 0.08347782 [57,] 0.8904000 0.21919990 0.10959995 [58,] 0.8590433 0.28191337 0.14095668 [59,] 0.8281723 0.34365532 0.17182766 [60,] 0.8034634 0.39307315 0.19653658 [61,] 0.7987136 0.40257277 0.20128639 [62,] 0.7392214 0.52155719 0.26077860 [63,] 0.6980499 0.60390017 0.30195009 [64,] 0.6469497 0.70610056 0.35305028 [65,] 0.6374093 0.72518148 0.36259074 [66,] 0.6146483 0.77070342 0.38535171 [67,] 0.6605084 0.67898317 0.33949159 [68,] 0.6407451 0.71850977 0.35925488 [69,] 0.7595618 0.48087642 0.24043821 [70,] 0.7294226 0.54115472 0.27057736 [71,] 0.6614909 0.67701826 0.33850913 [72,] 0.6597579 0.68048413 0.34024207 [73,] 0.5435391 0.91292190 0.45646095 [74,] 0.5899911 0.82001788 0.41000894 [75,] 0.6949684 0.61006319 0.30503160 [76,] 0.9026597 0.19468063 0.09734032 > postscript(file="/var/www/html/rcomp/tmp/1j2vf1258733442.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') > points(x[,1]-mysum$resid) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2pz3p1258733442.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/320oz1258733442.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/4zzi61258733442.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/586151258733442.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > qqline(mysum$resid) > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 117 Frequency = 1 1 2 3 4 5 1.1618157387 4.6331421267 4.7778964497 1.6197474355 -7.7581882320 6 7 8 9 10 -3.9034978224 -6.6650144392 3.5930333719 -3.6198488371 1.2912843635 11 12 13 14 15 2.8618467840 -2.2714111292 -7.7416482351 -1.2914684197 1.2587800698 16 17 18 19 20 -0.9253043734 0.0007049783 -1.6837484319 2.5822732051 2.4330534122 21 22 23 24 25 -0.2131748849 -3.0657288208 2.3853999186 -1.6365240080 0.8515070175 26 27 28 29 30 2.7404041588 1.6302853236 -2.3681315603 1.8147604242 -3.2226704670 31 32 33 34 35 4.4387462243 -1.6234795672 -3.4591257031 0.5758824737 -0.0201993539 36 37 38 39 40 -1.8813567185 4.9361930800 -1.1801372527 -4.3580628064 1.3450689456 41 42 43 44 45 -1.9111796045 -0.6273064542 0.0651740715 0.0947167772 2.5937207909 46 47 48 49 50 -1.8179571086 1.8410245527 -2.8701851557 -2.7926139477 1.5459786462 51 52 53 54 55 -1.4367344194 2.1176211284 1.0018443482 1.3032052228 0.0045795027 56 57 58 59 60 -0.8285385837 2.7449998958 1.3712913429 0.9747581285 2.7167315971 61 62 63 64 65 0.0046761539 3.3888393660 0.8589373477 3.6402136768 -0.2644885641 66 67 68 69 70 1.7913415599 2.1220018189 0.1091876759 -3.0064678202 0.9858112855 71 72 73 74 75 0.5040699007 6.6669970667 5.3451389912 -2.9038650479 -0.4029242510 76 77 78 79 80 4.4167753736 0.0052400001 2.8519169643 1.2218616904 -2.1183599420 81 82 83 84 85 -0.1753339992 1.3213739995 -2.2650321274 2.0187858312 -1.7345773956 86 87 88 89 90 0.6218202698 1.7571124457 -4.6593663697 5.0675896843 0.9008845618 91 92 93 94 95 -3.5465321418 -0.2436466236 0.0663345806 0.8041183694 -3.4748272271 96 97 98 99 100 -0.9841492428 -3.4446162972 -5.8625457333 -2.3557964452 -1.9950754894 101 102 103 104 105 3.5974126396 0.1550897036 0.6635235765 -1.1085080993 5.1552320643 106 107 108 109 110 -1.4660759051 -2.8070405762 -1.7588882407 3.4141248943 -1.6921681139 111 112 113 114 115 -1.7294937146 -3.1915487670 -1.5536956740 2.4347851631 -0.8866135085 116 117 -0.3074584215 -0.0863360872 > postscript(file="/var/www/html/rcomp/tmp/6v9pc1258733442.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 117 Frequency = 1 lag(myerror, k = 1) myerror 0 1.1618157387 NA 1 4.6331421267 1.1618157387 2 4.7778964497 4.6331421267 3 1.6197474355 4.7778964497 4 -7.7581882320 1.6197474355 5 -3.9034978224 -7.7581882320 6 -6.6650144392 -3.9034978224 7 3.5930333719 -6.6650144392 8 -3.6198488371 3.5930333719 9 1.2912843635 -3.6198488371 10 2.8618467840 1.2912843635 11 -2.2714111292 2.8618467840 12 -7.7416482351 -2.2714111292 13 -1.2914684197 -7.7416482351 14 1.2587800698 -1.2914684197 15 -0.9253043734 1.2587800698 16 0.0007049783 -0.9253043734 17 -1.6837484319 0.0007049783 18 2.5822732051 -1.6837484319 19 2.4330534122 2.5822732051 20 -0.2131748849 2.4330534122 21 -3.0657288208 -0.2131748849 22 2.3853999186 -3.0657288208 23 -1.6365240080 2.3853999186 24 0.8515070175 -1.6365240080 25 2.7404041588 0.8515070175 26 1.6302853236 2.7404041588 27 -2.3681315603 1.6302853236 28 1.8147604242 -2.3681315603 29 -3.2226704670 1.8147604242 30 4.4387462243 -3.2226704670 31 -1.6234795672 4.4387462243 32 -3.4591257031 -1.6234795672 33 0.5758824737 -3.4591257031 34 -0.0201993539 0.5758824737 35 -1.8813567185 -0.0201993539 36 4.9361930800 -1.8813567185 37 -1.1801372527 4.9361930800 38 -4.3580628064 -1.1801372527 39 1.3450689456 -4.3580628064 40 -1.9111796045 1.3450689456 41 -0.6273064542 -1.9111796045 42 0.0651740715 -0.6273064542 43 0.0947167772 0.0651740715 44 2.5937207909 0.0947167772 45 -1.8179571086 2.5937207909 46 1.8410245527 -1.8179571086 47 -2.8701851557 1.8410245527 48 -2.7926139477 -2.8701851557 49 1.5459786462 -2.7926139477 50 -1.4367344194 1.5459786462 51 2.1176211284 -1.4367344194 52 1.0018443482 2.1176211284 53 1.3032052228 1.0018443482 54 0.0045795027 1.3032052228 55 -0.8285385837 0.0045795027 56 2.7449998958 -0.8285385837 57 1.3712913429 2.7449998958 58 0.9747581285 1.3712913429 59 2.7167315971 0.9747581285 60 0.0046761539 2.7167315971 61 3.3888393660 0.0046761539 62 0.8589373477 3.3888393660 63 3.6402136768 0.8589373477 64 -0.2644885641 3.6402136768 65 1.7913415599 -0.2644885641 66 2.1220018189 1.7913415599 67 0.1091876759 2.1220018189 68 -3.0064678202 0.1091876759 69 0.9858112855 -3.0064678202 70 0.5040699007 0.9858112855 71 6.6669970667 0.5040699007 72 5.3451389912 6.6669970667 73 -2.9038650479 5.3451389912 74 -0.4029242510 -2.9038650479 75 4.4167753736 -0.4029242510 76 0.0052400001 4.4167753736 77 2.8519169643 0.0052400001 78 1.2218616904 2.8519169643 79 -2.1183599420 1.2218616904 80 -0.1753339992 -2.1183599420 81 1.3213739995 -0.1753339992 82 -2.2650321274 1.3213739995 83 2.0187858312 -2.2650321274 84 -1.7345773956 2.0187858312 85 0.6218202698 -1.7345773956 86 1.7571124457 0.6218202698 87 -4.6593663697 1.7571124457 88 5.0675896843 -4.6593663697 89 0.9008845618 5.0675896843 90 -3.5465321418 0.9008845618 91 -0.2436466236 -3.5465321418 92 0.0663345806 -0.2436466236 93 0.8041183694 0.0663345806 94 -3.4748272271 0.8041183694 95 -0.9841492428 -3.4748272271 96 -3.4446162972 -0.9841492428 97 -5.8625457333 -3.4446162972 98 -2.3557964452 -5.8625457333 99 -1.9950754894 -2.3557964452 100 3.5974126396 -1.9950754894 101 0.1550897036 3.5974126396 102 0.6635235765 0.1550897036 103 -1.1085080993 0.6635235765 104 5.1552320643 -1.1085080993 105 -1.4660759051 5.1552320643 106 -2.8070405762 -1.4660759051 107 -1.7588882407 -2.8070405762 108 3.4141248943 -1.7588882407 109 -1.6921681139 3.4141248943 110 -1.7294937146 -1.6921681139 111 -3.1915487670 -1.7294937146 112 -1.5536956740 -3.1915487670 113 2.4347851631 -1.5536956740 114 -0.8866135085 2.4347851631 115 -0.3074584215 -0.8866135085 116 -0.0863360872 -0.3074584215 117 NA -0.0863360872 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 4.6331421267 1.1618157387 [2,] 4.7778964497 4.6331421267 [3,] 1.6197474355 4.7778964497 [4,] -7.7581882320 1.6197474355 [5,] -3.9034978224 -7.7581882320 [6,] -6.6650144392 -3.9034978224 [7,] 3.5930333719 -6.6650144392 [8,] -3.6198488371 3.5930333719 [9,] 1.2912843635 -3.6198488371 [10,] 2.8618467840 1.2912843635 [11,] -2.2714111292 2.8618467840 [12,] -7.7416482351 -2.2714111292 [13,] -1.2914684197 -7.7416482351 [14,] 1.2587800698 -1.2914684197 [15,] -0.9253043734 1.2587800698 [16,] 0.0007049783 -0.9253043734 [17,] -1.6837484319 0.0007049783 [18,] 2.5822732051 -1.6837484319 [19,] 2.4330534122 2.5822732051 [20,] -0.2131748849 2.4330534122 [21,] -3.0657288208 -0.2131748849 [22,] 2.3853999186 -3.0657288208 [23,] -1.6365240080 2.3853999186 [24,] 0.8515070175 -1.6365240080 [25,] 2.7404041588 0.8515070175 [26,] 1.6302853236 2.7404041588 [27,] -2.3681315603 1.6302853236 [28,] 1.8147604242 -2.3681315603 [29,] -3.2226704670 1.8147604242 [30,] 4.4387462243 -3.2226704670 [31,] -1.6234795672 4.4387462243 [32,] -3.4591257031 -1.6234795672 [33,] 0.5758824737 -3.4591257031 [34,] -0.0201993539 0.5758824737 [35,] -1.8813567185 -0.0201993539 [36,] 4.9361930800 -1.8813567185 [37,] -1.1801372527 4.9361930800 [38,] -4.3580628064 -1.1801372527 [39,] 1.3450689456 -4.3580628064 [40,] -1.9111796045 1.3450689456 [41,] -0.6273064542 -1.9111796045 [42,] 0.0651740715 -0.6273064542 [43,] 0.0947167772 0.0651740715 [44,] 2.5937207909 0.0947167772 [45,] -1.8179571086 2.5937207909 [46,] 1.8410245527 -1.8179571086 [47,] -2.8701851557 1.8410245527 [48,] -2.7926139477 -2.8701851557 [49,] 1.5459786462 -2.7926139477 [50,] -1.4367344194 1.5459786462 [51,] 2.1176211284 -1.4367344194 [52,] 1.0018443482 2.1176211284 [53,] 1.3032052228 1.0018443482 [54,] 0.0045795027 1.3032052228 [55,] -0.8285385837 0.0045795027 [56,] 2.7449998958 -0.8285385837 [57,] 1.3712913429 2.7449998958 [58,] 0.9747581285 1.3712913429 [59,] 2.7167315971 0.9747581285 [60,] 0.0046761539 2.7167315971 [61,] 3.3888393660 0.0046761539 [62,] 0.8589373477 3.3888393660 [63,] 3.6402136768 0.8589373477 [64,] -0.2644885641 3.6402136768 [65,] 1.7913415599 -0.2644885641 [66,] 2.1220018189 1.7913415599 [67,] 0.1091876759 2.1220018189 [68,] -3.0064678202 0.1091876759 [69,] 0.9858112855 -3.0064678202 [70,] 0.5040699007 0.9858112855 [71,] 6.6669970667 0.5040699007 [72,] 5.3451389912 6.6669970667 [73,] -2.9038650479 5.3451389912 [74,] -0.4029242510 -2.9038650479 [75,] 4.4167753736 -0.4029242510 [76,] 0.0052400001 4.4167753736 [77,] 2.8519169643 0.0052400001 [78,] 1.2218616904 2.8519169643 [79,] -2.1183599420 1.2218616904 [80,] -0.1753339992 -2.1183599420 [81,] 1.3213739995 -0.1753339992 [82,] -2.2650321274 1.3213739995 [83,] 2.0187858312 -2.2650321274 [84,] -1.7345773956 2.0187858312 [85,] 0.6218202698 -1.7345773956 [86,] 1.7571124457 0.6218202698 [87,] -4.6593663697 1.7571124457 [88,] 5.0675896843 -4.6593663697 [89,] 0.9008845618 5.0675896843 [90,] -3.5465321418 0.9008845618 [91,] -0.2436466236 -3.5465321418 [92,] 0.0663345806 -0.2436466236 [93,] 0.8041183694 0.0663345806 [94,] -3.4748272271 0.8041183694 [95,] -0.9841492428 -3.4748272271 [96,] -3.4446162972 -0.9841492428 [97,] -5.8625457333 -3.4446162972 [98,] -2.3557964452 -5.8625457333 [99,] -1.9950754894 -2.3557964452 [100,] 3.5974126396 -1.9950754894 [101,] 0.1550897036 3.5974126396 [102,] 0.6635235765 0.1550897036 [103,] -1.1085080993 0.6635235765 [104,] 5.1552320643 -1.1085080993 [105,] -1.4660759051 5.1552320643 [106,] -2.8070405762 -1.4660759051 [107,] -1.7588882407 -2.8070405762 [108,] 3.4141248943 -1.7588882407 [109,] -1.6921681139 3.4141248943 [110,] -1.7294937146 -1.6921681139 [111,] -3.1915487670 -1.7294937146 [112,] -1.5536956740 -3.1915487670 [113,] 2.4347851631 -1.5536956740 [114,] -0.8866135085 2.4347851631 [115,] -0.3074584215 -0.8866135085 [116,] -0.0863360872 -0.3074584215 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 4.6331421267 1.1618157387 2 4.7778964497 4.6331421267 3 1.6197474355 4.7778964497 4 -7.7581882320 1.6197474355 5 -3.9034978224 -7.7581882320 6 -6.6650144392 -3.9034978224 7 3.5930333719 -6.6650144392 8 -3.6198488371 3.5930333719 9 1.2912843635 -3.6198488371 10 2.8618467840 1.2912843635 11 -2.2714111292 2.8618467840 12 -7.7416482351 -2.2714111292 13 -1.2914684197 -7.7416482351 14 1.2587800698 -1.2914684197 15 -0.9253043734 1.2587800698 16 0.0007049783 -0.9253043734 17 -1.6837484319 0.0007049783 18 2.5822732051 -1.6837484319 19 2.4330534122 2.5822732051 20 -0.2131748849 2.4330534122 21 -3.0657288208 -0.2131748849 22 2.3853999186 -3.0657288208 23 -1.6365240080 2.3853999186 24 0.8515070175 -1.6365240080 25 2.7404041588 0.8515070175 26 1.6302853236 2.7404041588 27 -2.3681315603 1.6302853236 28 1.8147604242 -2.3681315603 29 -3.2226704670 1.8147604242 30 4.4387462243 -3.2226704670 31 -1.6234795672 4.4387462243 32 -3.4591257031 -1.6234795672 33 0.5758824737 -3.4591257031 34 -0.0201993539 0.5758824737 35 -1.8813567185 -0.0201993539 36 4.9361930800 -1.8813567185 37 -1.1801372527 4.9361930800 38 -4.3580628064 -1.1801372527 39 1.3450689456 -4.3580628064 40 -1.9111796045 1.3450689456 41 -0.6273064542 -1.9111796045 42 0.0651740715 -0.6273064542 43 0.0947167772 0.0651740715 44 2.5937207909 0.0947167772 45 -1.8179571086 2.5937207909 46 1.8410245527 -1.8179571086 47 -2.8701851557 1.8410245527 48 -2.7926139477 -2.8701851557 49 1.5459786462 -2.7926139477 50 -1.4367344194 1.5459786462 51 2.1176211284 -1.4367344194 52 1.0018443482 2.1176211284 53 1.3032052228 1.0018443482 54 0.0045795027 1.3032052228 55 -0.8285385837 0.0045795027 56 2.7449998958 -0.8285385837 57 1.3712913429 2.7449998958 58 0.9747581285 1.3712913429 59 2.7167315971 0.9747581285 60 0.0046761539 2.7167315971 61 3.3888393660 0.0046761539 62 0.8589373477 3.3888393660 63 3.6402136768 0.8589373477 64 -0.2644885641 3.6402136768 65 1.7913415599 -0.2644885641 66 2.1220018189 1.7913415599 67 0.1091876759 2.1220018189 68 -3.0064678202 0.1091876759 69 0.9858112855 -3.0064678202 70 0.5040699007 0.9858112855 71 6.6669970667 0.5040699007 72 5.3451389912 6.6669970667 73 -2.9038650479 5.3451389912 74 -0.4029242510 -2.9038650479 75 4.4167753736 -0.4029242510 76 0.0052400001 4.4167753736 77 2.8519169643 0.0052400001 78 1.2218616904 2.8519169643 79 -2.1183599420 1.2218616904 80 -0.1753339992 -2.1183599420 81 1.3213739995 -0.1753339992 82 -2.2650321274 1.3213739995 83 2.0187858312 -2.2650321274 84 -1.7345773956 2.0187858312 85 0.6218202698 -1.7345773956 86 1.7571124457 0.6218202698 87 -4.6593663697 1.7571124457 88 5.0675896843 -4.6593663697 89 0.9008845618 5.0675896843 90 -3.5465321418 0.9008845618 91 -0.2436466236 -3.5465321418 92 0.0663345806 -0.2436466236 93 0.8041183694 0.0663345806 94 -3.4748272271 0.8041183694 95 -0.9841492428 -3.4748272271 96 -3.4446162972 -0.9841492428 97 -5.8625457333 -3.4446162972 98 -2.3557964452 -5.8625457333 99 -1.9950754894 -2.3557964452 100 3.5974126396 -1.9950754894 101 0.1550897036 3.5974126396 102 0.6635235765 0.1550897036 103 -1.1085080993 0.6635235765 104 5.1552320643 -1.1085080993 105 -1.4660759051 5.1552320643 106 -2.8070405762 -1.4660759051 107 -1.7588882407 -2.8070405762 108 3.4141248943 -1.7588882407 109 -1.6921681139 3.4141248943 110 -1.7294937146 -1.6921681139 111 -3.1915487670 -1.7294937146 112 -1.5536956740 -3.1915487670 113 2.4347851631 -1.5536956740 114 -0.8866135085 2.4347851631 115 -0.3074584215 -0.8866135085 116 -0.0863360872 -0.3074584215 > 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/rcomp/tmp/7vnxz1258733442.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/8voqe1258733442.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/9w4791258733442.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/html/rcomp/tmp/10m3zc1258733442.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/rcomp/tmp/115zn71258733442.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/rcomp/tmp/12u8jr1258733442.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/rcomp/tmp/13l3j01258733442.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/rcomp/tmp/14pr5v1258733442.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/rcomp/tmp/15tgta1258733442.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/rcomp/tmp/16capg1258733442.tab") + } > > system("convert tmp/1j2vf1258733442.ps tmp/1j2vf1258733442.png") > system("convert tmp/2pz3p1258733442.ps tmp/2pz3p1258733442.png") > system("convert tmp/320oz1258733442.ps tmp/320oz1258733442.png") > system("convert tmp/4zzi61258733442.ps tmp/4zzi61258733442.png") > system("convert tmp/586151258733442.ps tmp/586151258733442.png") > system("convert tmp/6v9pc1258733442.ps tmp/6v9pc1258733442.png") > system("convert tmp/7vnxz1258733442.ps tmp/7vnxz1258733442.png") > system("convert tmp/8voqe1258733442.ps tmp/8voqe1258733442.png") > system("convert tmp/9w4791258733442.ps tmp/9w4791258733442.png") > system("convert tmp/10m3zc1258733442.ps tmp/10m3zc1258733442.png") > > > proc.time() user system elapsed 3.359 1.664 8.325