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(9 + ,26 + ,24 + ,14 + ,11 + ,12 + ,24 + ,9 + ,23 + ,25 + ,11 + ,7 + ,8 + ,25 + ,9 + ,25 + ,17 + ,6 + ,17 + ,8 + ,30 + ,9 + ,23 + ,18 + ,12 + ,10 + ,8 + ,19 + ,9 + ,19 + ,18 + ,8 + ,12 + ,9 + ,22 + ,9 + ,29 + ,16 + ,10 + ,12 + ,7 + ,22 + ,10 + ,25 + ,20 + ,10 + ,11 + ,4 + ,25 + ,10 + ,21 + ,16 + ,11 + ,11 + ,11 + ,23 + ,10 + ,22 + ,18 + ,16 + ,12 + ,7 + ,17 + ,10 + ,25 + ,17 + ,11 + ,13 + ,7 + ,21 + ,10 + ,24 + ,23 + ,13 + ,14 + ,12 + ,19 + ,10 + ,18 + ,30 + ,12 + ,16 + ,10 + ,19 + ,10 + ,22 + ,23 + ,8 + ,11 + ,10 + ,15 + ,10 + ,15 + ,18 + ,12 + ,10 + ,8 + ,16 + ,10 + ,22 + ,15 + ,11 + ,11 + ,7.9 + ,23 + ,10 + ,28 + ,12 + ,4 + ,15 + ,4 + ,27 + ,10 + ,20 + ,21 + ,9 + ,9 + ,9 + ,22 + ,10 + ,12 + ,15 + ,8 + ,11 + ,8 + ,14 + ,10 + ,24 + ,20 + ,8 + ,17 + ,7 + ,22 + ,10 + ,20 + ,31 + ,14 + ,17 + ,11 + ,23 + ,10 + ,21 + ,27 + ,15 + ,11 + ,9 + ,23 + ,10 + ,20 + ,34 + ,16 + ,18 + ,11 + ,21 + ,10 + ,21 + ,21 + ,9 + ,14 + ,13 + ,19 + ,10 + ,23 + ,31 + ,14 + ,10 + ,8 + ,18 + ,10 + ,28 + ,19 + ,11 + ,11 + ,8 + ,20 + ,10 + ,24 + ,16 + ,8 + ,15 + ,9 + ,23 + ,10 + ,24 + ,20 + ,9 + ,15 + ,6 + ,25 + ,10 + ,24 + ,21 + ,9 + ,13 + ,9 + ,19 + ,10 + ,23 + ,22 + ,9 + ,16 + ,9 + ,24 + ,10 + ,23 + ,17 + ,9 + ,13 + ,6 + ,22 + ,10 + ,29 + ,24 + ,10 + ,9 + ,6 + ,25 + ,10 + ,24 + ,25 + ,16 + ,18 + ,16 + ,26 + ,10 + ,18 + ,26 + ,11 + ,18 + ,5 + ,29 + ,10 + ,25 + ,25 + ,8 + ,12 + ,7 + ,32 + ,10 + ,21 + ,17 + ,9 + ,17 + ,9 + ,25 + ,10 + ,26 + ,32 + ,16 + ,9 + ,6 + ,29 + ,10 + ,22 + ,33 + ,11 + ,9 + ,6 + ,28 + ,10 + ,22 + ,13 + ,16 + ,12 + ,5 + ,17 + ,10 + ,22 + ,32 + ,12 + ,18 + ,12 + ,28 + ,10 + ,23 + ,25 + ,12 + ,12 + ,7 + ,29 + ,10 + ,30 + ,29 + ,14 + ,18 + ,10 + ,26 + ,10 + ,23 + ,22 + ,9 + ,14 + ,9 + ,25 + ,10 + ,17 + ,18 + ,10 + ,15 + ,8 + ,14 + ,10 + ,23 + ,17 + ,9 + ,16 + ,5 + ,25 + ,10 + ,23 + ,20 + ,10 + ,10 + ,8 + ,26 + ,10 + ,25 + ,15 + ,12 + ,11 + ,8 + ,20 + ,10 + ,24 + ,20 + ,14 + ,14 + ,10 + ,18 + ,10 + ,24 + ,33 + ,14 + ,9 + ,6 + ,32 + ,10 + ,23 + ,29 + ,10 + ,12 + ,8 + ,25 + ,10 + ,21 + ,23 + ,14 + ,17 + ,7 + ,25 + ,10 + ,24 + ,26 + ,16 + ,5 + ,4 + ,23 + ,10 + ,24 + ,18 + ,9 + ,12 + ,8 + ,21 + ,10 + ,28 + ,20 + ,10 + ,12 + ,8 + ,20 + ,10 + ,16 + ,11 + ,6 + ,6 + ,4 + ,15 + ,10 + ,20 + ,28 + ,8 + ,24 + ,20 + ,30 + ,10 + ,29 + ,26 + ,13 + ,12 + ,8 + ,24 + ,10 + ,27 + ,22 + ,10 + ,12 + ,8 + ,26 + ,10 + ,22 + ,17 + ,8 + ,14 + ,6 + ,24 + ,10 + ,28 + ,12 + ,7 + ,7 + ,4 + ,22 + ,10 + ,16 + ,14 + ,15 + ,13 + ,8 + ,14 + ,10 + ,25 + ,17 + ,9 + ,12 + ,9 + ,24 + ,10 + ,24 + ,21 + ,10 + ,13 + ,6 + ,24 + ,10 + ,28 + ,19 + ,12 + ,14 + ,7 + ,24 + ,10 + ,24 + ,18 + ,13 + ,8 + ,9 + ,24 + ,10 + ,23 + ,10 + ,10 + ,11 + ,5 + ,19 + ,10 + ,30 + ,29 + ,11 + ,9 + ,5 + ,31 + ,10 + ,24 + ,31 + ,8 + ,11 + ,8 + ,22 + ,10 + ,21 + ,19 + ,9 + ,13 + ,8 + ,27 + ,10 + ,25 + ,9 + ,13 + ,10 + ,6 + ,19 + ,10 + ,25 + ,20 + ,11 + ,11 + ,8 + ,25 + ,10 + ,22 + ,28 + ,8 + ,12 + ,7 + ,20 + ,10 + ,23 + ,19 + ,9 + ,9 + ,7 + ,21 + ,10 + ,26 + ,30 + ,9 + ,15 + ,9 + ,27 + ,10 + ,23 + ,29 + ,15 + ,18 + ,11 + ,23 + ,10 + ,25 + ,26 + ,9 + ,15 + ,6 + ,25 + ,10 + ,21 + ,23 + ,10 + ,12 + ,8 + ,20 + ,10 + ,25 + ,13 + ,14 + ,13 + ,6 + ,21 + ,10 + ,24 + ,21 + ,12 + ,14 + ,9 + ,22 + ,10 + ,29 + ,19 + ,12 + ,10 + ,8 + ,23 + ,10 + ,22 + ,28 + ,11 + ,13 + ,6 + ,25 + ,10 + ,27 + ,23 + ,14 + ,13 + ,10 + ,25 + ,10 + ,26 + ,18 + ,6 + ,11 + ,8 + ,17 + ,10 + ,22 + ,21 + ,12 + ,13 + ,8 + ,19 + ,10 + ,24 + ,20 + ,8 + ,16 + ,10 + ,25 + ,10 + ,27 + ,23 + ,14 + ,8 + ,5 + ,19 + ,10 + ,24 + ,21 + ,11 + ,16 + ,7 + ,20 + ,10 + ,24 + ,21 + ,10 + ,11 + ,5 + ,26 + ,10 + ,29 + ,15 + ,14 + ,9 + ,8 + ,23 + ,10 + ,22 + ,28 + ,12 + ,16 + ,14 + ,27 + ,10 + ,21 + ,19 + ,10 + ,12 + ,7 + ,17 + ,10 + ,24 + ,26 + ,14 + ,14 + ,8 + ,17 + ,10 + ,24 + ,10 + ,5 + ,8 + ,6 + ,19 + ,10 + ,23 + ,16 + ,11 + ,9 + ,5 + ,17 + ,10 + ,20 + ,22 + ,10 + ,15 + ,6 + ,22 + ,10 + ,27 + ,19 + ,9 + ,11 + ,10 + ,21 + ,10 + ,26 + ,31 + ,10 + ,21 + ,12 + ,32 + ,10 + ,25 + ,31 + ,16 + ,14 + ,9 + ,21 + ,10 + ,21 + ,29 + ,13 + ,18 + ,12 + ,21 + ,10 + ,21 + ,19 + ,9 + ,12 + ,7 + ,18 + ,10 + ,19 + ,22 + ,10 + ,13 + ,8 + ,18 + ,10 + ,21 + ,23 + ,10 + ,15 + ,10 + ,23 + ,10 + ,21 + ,15 + ,7 + ,12 + ,6 + ,19 + ,10 + ,16 + ,20 + ,9 + ,19 + ,10 + ,20 + ,10 + ,22 + ,18 + ,8 + ,15 + ,10 + ,21 + ,10 + ,29 + ,23 + ,14 + ,11 + ,10 + ,20 + ,10 + ,15 + ,25 + ,14 + ,11 + ,5 + ,17 + ,10 + ,17 + ,21 + ,8 + ,10 + ,7 + ,18 + ,10 + ,15 + ,24 + ,9 + ,13 + ,10 + ,19 + ,10 + ,21 + ,25 + ,14 + ,15 + ,11 + ,22 + ,10 + ,21 + ,17 + ,14 + ,12 + ,6 + ,15 + ,10 + ,19 + ,13 + ,8 + ,12 + ,7 + ,14 + ,10 + ,24 + ,28 + ,8 + ,16 + ,12 + ,18 + ,10 + ,20 + ,21 + ,8 + ,9 + ,11 + ,24 + ,10 + ,17 + ,25 + ,7 + ,18 + ,11 + ,35 + ,10 + ,23 + ,9 + ,6 + ,8 + ,11 + ,29 + ,10 + ,24 + ,16 + ,8 + ,13 + ,5 + ,21 + ,10 + ,14 + ,19 + ,6 + ,17 + ,8 + ,25 + ,10 + ,19 + ,17 + ,11 + ,9 + ,6 + ,20 + ,10 + ,24 + ,25 + ,14 + ,15 + ,9 + ,22 + ,10 + ,13 + ,20 + ,11 + ,8 + ,4 + ,13 + ,10 + ,22 + ,29 + ,11 + ,7 + ,4 + ,26 + ,10 + ,16 + ,14 + ,11 + ,12 + ,7 + ,17 + ,10 + ,19 + ,22 + ,14 + ,14 + ,11 + ,25 + ,10 + ,25 + ,15 + ,8 + ,6 + ,6 + ,20 + ,10 + ,25 + ,19 + ,20 + ,8 + ,7 + ,19 + ,10 + ,23 + ,20 + ,11 + ,17 + ,8 + ,21 + ,10 + ,24 + ,15 + ,8 + ,10 + ,4 + ,22 + ,10 + ,26 + ,20 + ,11 + ,11 + ,8 + ,24 + ,10 + ,26 + ,18 + ,10 + ,14 + ,9 + ,21 + ,10 + ,25 + ,33 + ,14 + ,11 + ,8 + ,26 + ,10 + ,18 + ,22 + ,11 + ,13 + ,11 + ,24 + ,10 + ,21 + ,16 + ,9 + ,12 + ,8 + ,16 + ,10 + ,26 + ,17 + ,9 + ,11 + ,5 + ,23 + ,10 + ,23 + ,16 + ,8 + ,9 + ,4 + ,18 + ,10 + ,23 + ,21 + ,10 + ,12 + ,8 + ,16 + ,10 + ,22 + ,26 + ,13 + ,20 + ,10 + ,26 + ,10 + ,20 + ,18 + ,13 + ,12 + ,6 + ,19 + ,10 + ,13 + ,18 + ,12 + ,13 + ,9 + ,21 + ,10 + ,24 + ,17 + ,8 + ,12 + ,9 + ,21 + ,10 + ,15 + ,22 + ,13 + ,12 + ,13 + ,22 + ,10 + ,14 + ,30 + ,14 + ,9 + ,9 + ,23 + ,10 + ,22 + ,30 + ,12 + ,15 + ,10 + ,29 + ,10 + ,10 + ,24 + ,14 + ,24 + ,20 + ,21 + ,10 + ,24 + ,21 + ,15 + ,7 + ,5 + ,21 + ,10 + ,22 + ,21 + ,13 + ,17 + ,11 + ,23 + ,10 + ,24 + ,29 + ,16 + ,11 + ,6 + ,27 + ,10 + ,19 + ,31 + ,9 + ,17 + ,9 + ,25 + ,10 + ,20 + ,20 + ,9 + ,11 + ,7 + ,21 + ,10 + ,13 + ,16 + ,9 + ,12 + ,9 + ,10 + ,10 + ,20 + ,22 + ,8 + ,14 + ,10 + ,20 + ,10 + ,22 + ,20 + ,7 + ,11 + ,9 + ,26 + ,10 + ,24 + ,28 + ,16 + ,16 + ,8 + ,24 + ,10 + ,29 + ,38 + ,11 + ,21 + ,7 + ,29 + ,10 + ,12 + ,22 + ,9 + ,14 + ,6 + ,19 + ,10 + ,20 + ,20 + ,11 + ,20 + ,13 + ,24 + ,10 + ,21 + ,17 + ,9 + ,13 + ,6 + ,19 + ,10 + ,24 + ,28 + ,14 + ,11 + ,8 + ,24 + ,10 + ,22 + ,22 + ,13 + ,15 + ,10 + ,22 + ,10 + ,20 + ,31 + ,16 + ,19 + ,16 + ,17) + ,dim=c(7 + ,159) + ,dimnames=list(c('Variable' + ,'Parameter' + ,'S.D.' + ,'T-STAT' + ,'2-tail' + ,'1-tail' + ,'MultipleLinearRegression') + ,1:159)) > y <- array(NA,dim=c(7,159),dimnames=list(c('Variable','Parameter','S.D.','T-STAT','2-tail','1-tail','MultipleLinearRegression'),1:159)) > 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 = '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 Parameter Variable S.D. T-STAT 2-tail 1-tail MultipleLinearRegression 1 26 9 24 14 11 12.0 24 2 23 9 25 11 7 8.0 25 3 25 9 17 6 17 8.0 30 4 23 9 18 12 10 8.0 19 5 19 9 18 8 12 9.0 22 6 29 9 16 10 12 7.0 22 7 25 10 20 10 11 4.0 25 8 21 10 16 11 11 11.0 23 9 22 10 18 16 12 7.0 17 10 25 10 17 11 13 7.0 21 11 24 10 23 13 14 12.0 19 12 18 10 30 12 16 10.0 19 13 22 10 23 8 11 10.0 15 14 15 10 18 12 10 8.0 16 15 22 10 15 11 11 7.9 23 16 28 10 12 4 15 4.0 27 17 20 10 21 9 9 9.0 22 18 12 10 15 8 11 8.0 14 19 24 10 20 8 17 7.0 22 20 20 10 31 14 17 11.0 23 21 21 10 27 15 11 9.0 23 22 20 10 34 16 18 11.0 21 23 21 10 21 9 14 13.0 19 24 23 10 31 14 10 8.0 18 25 28 10 19 11 11 8.0 20 26 24 10 16 8 15 9.0 23 27 24 10 20 9 15 6.0 25 28 24 10 21 9 13 9.0 19 29 23 10 22 9 16 9.0 24 30 23 10 17 9 13 6.0 22 31 29 10 24 10 9 6.0 25 32 24 10 25 16 18 16.0 26 33 18 10 26 11 18 5.0 29 34 25 10 25 8 12 7.0 32 35 21 10 17 9 17 9.0 25 36 26 10 32 16 9 6.0 29 37 22 10 33 11 9 6.0 28 38 22 10 13 16 12 5.0 17 39 22 10 32 12 18 12.0 28 40 23 10 25 12 12 7.0 29 41 30 10 29 14 18 10.0 26 42 23 10 22 9 14 9.0 25 43 17 10 18 10 15 8.0 14 44 23 10 17 9 16 5.0 25 45 23 10 20 10 10 8.0 26 46 25 10 15 12 11 8.0 20 47 24 10 20 14 14 10.0 18 48 24 10 33 14 9 6.0 32 49 23 10 29 10 12 8.0 25 50 21 10 23 14 17 7.0 25 51 24 10 26 16 5 4.0 23 52 24 10 18 9 12 8.0 21 53 28 10 20 10 12 8.0 20 54 16 10 11 6 6 4.0 15 55 20 10 28 8 24 20.0 30 56 29 10 26 13 12 8.0 24 57 27 10 22 10 12 8.0 26 58 22 10 17 8 14 6.0 24 59 28 10 12 7 7 4.0 22 60 16 10 14 15 13 8.0 14 61 25 10 17 9 12 9.0 24 62 24 10 21 10 13 6.0 24 63 28 10 19 12 14 7.0 24 64 24 10 18 13 8 9.0 24 65 23 10 10 10 11 5.0 19 66 30 10 29 11 9 5.0 31 67 24 10 31 8 11 8.0 22 68 21 10 19 9 13 8.0 27 69 25 10 9 13 10 6.0 19 70 25 10 20 11 11 8.0 25 71 22 10 28 8 12 7.0 20 72 23 10 19 9 9 7.0 21 73 26 10 30 9 15 9.0 27 74 23 10 29 15 18 11.0 23 75 25 10 26 9 15 6.0 25 76 21 10 23 10 12 8.0 20 77 25 10 13 14 13 6.0 21 78 24 10 21 12 14 9.0 22 79 29 10 19 12 10 8.0 23 80 22 10 28 11 13 6.0 25 81 27 10 23 14 13 10.0 25 82 26 10 18 6 11 8.0 17 83 22 10 21 12 13 8.0 19 84 24 10 20 8 16 10.0 25 85 27 10 23 14 8 5.0 19 86 24 10 21 11 16 7.0 20 87 24 10 21 10 11 5.0 26 88 29 10 15 14 9 8.0 23 89 22 10 28 12 16 14.0 27 90 21 10 19 10 12 7.0 17 91 24 10 26 14 14 8.0 17 92 24 10 10 5 8 6.0 19 93 23 10 16 11 9 5.0 17 94 20 10 22 10 15 6.0 22 95 27 10 19 9 11 10.0 21 96 26 10 31 10 21 12.0 32 97 25 10 31 16 14 9.0 21 98 21 10 29 13 18 12.0 21 99 21 10 19 9 12 7.0 18 100 19 10 22 10 13 8.0 18 101 21 10 23 10 15 10.0 23 102 21 10 15 7 12 6.0 19 103 16 10 20 9 19 10.0 20 104 22 10 18 8 15 10.0 21 105 29 10 23 14 11 10.0 20 106 15 10 25 14 11 5.0 17 107 17 10 21 8 10 7.0 18 108 15 10 24 9 13 10.0 19 109 21 10 25 14 15 11.0 22 110 21 10 17 14 12 6.0 15 111 19 10 13 8 12 7.0 14 112 24 10 28 8 16 12.0 18 113 20 10 21 8 9 11.0 24 114 17 10 25 7 18 11.0 35 115 23 10 9 6 8 11.0 29 116 24 10 16 8 13 5.0 21 117 14 10 19 6 17 8.0 25 118 19 10 17 11 9 6.0 20 119 24 10 25 14 15 9.0 22 120 13 10 20 11 8 4.0 13 121 22 10 29 11 7 4.0 26 122 16 10 14 11 12 7.0 17 123 19 10 22 14 14 11.0 25 124 25 10 15 8 6 6.0 20 125 25 10 19 20 8 7.0 19 126 23 10 20 11 17 8.0 21 127 24 10 15 8 10 4.0 22 128 26 10 20 11 11 8.0 24 129 26 10 18 10 14 9.0 21 130 25 10 33 14 11 8.0 26 131 18 10 22 11 13 11.0 24 132 21 10 16 9 12 8.0 16 133 26 10 17 9 11 5.0 23 134 23 10 16 8 9 4.0 18 135 23 10 21 10 12 8.0 16 136 22 10 26 13 20 10.0 26 137 20 10 18 13 12 6.0 19 138 13 10 18 12 13 9.0 21 139 24 10 17 8 12 9.0 21 140 15 10 22 13 12 13.0 22 141 14 10 30 14 9 9.0 23 142 22 10 30 12 15 10.0 29 143 10 10 24 14 24 20.0 21 144 24 10 21 15 7 5.0 21 145 22 10 21 13 17 11.0 23 146 24 10 29 16 11 6.0 27 147 19 10 31 9 17 9.0 25 148 20 10 20 9 11 7.0 21 149 13 10 16 9 12 9.0 10 150 20 10 22 8 14 10.0 20 151 22 10 20 7 11 9.0 26 152 24 10 28 16 16 8.0 24 153 29 10 38 11 21 7.0 29 154 12 10 22 9 14 6.0 19 155 20 10 20 11 20 13.0 24 156 21 10 17 9 13 6.0 19 157 24 10 28 14 11 8.0 24 158 22 10 22 13 15 10.0 22 159 20 10 31 16 19 16.0 17 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Variable S.D. 28.21131 -1.21076 -0.06624 `T-STAT` `2-tail` `1-tail` 0.21998 -0.13804 -0.26768 MultipleLinearRegression 0.41518 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -9.0937 -1.7734 0.2311 2.2693 7.2319 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 28.21131 14.94576 1.888 0.0610 . Variable -1.21076 1.48482 -0.815 0.4161 S.D. -0.06624 0.06322 -1.048 0.2964 `T-STAT` 0.21998 0.11277 1.951 0.0529 . `2-tail` -0.13804 0.10526 -1.311 0.1917 `1-tail` -0.26768 0.13150 -2.036 0.0435 * MultipleLinearRegression 0.41518 0.07626 5.444 2.05e-07 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 3.503 on 152 degrees of freedom Multiple R-squared: 0.2257, Adjusted R-squared: 0.1952 F-statistic: 7.386 on 6 and 152 DF, p-value: 6.016e-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.527011339 0.945977321 0.4729887 [2,] 0.562050758 0.875898483 0.4379492 [3,] 0.488797048 0.977594096 0.5112030 [4,] 0.540312609 0.919374782 0.4596874 [5,] 0.741606301 0.516787397 0.2583937 [6,] 0.654975316 0.690049367 0.3450247 [7,] 0.624349814 0.751300372 0.3756502 [8,] 0.538687107 0.922625787 0.4613129 [9,] 0.676523850 0.646952300 0.3234762 [10,] 0.601787714 0.796424571 0.3982123 [11,] 0.589009300 0.821981400 0.4109907 [12,] 0.525027626 0.949944748 0.4749724 [13,] 0.455644610 0.911289221 0.5443554 [14,] 0.404802514 0.809605029 0.5951975 [15,] 0.409292696 0.818585392 0.5907073 [16,] 0.571837158 0.856325685 0.4281628 [17,] 0.510576212 0.978847576 0.4894238 [18,] 0.443519563 0.887039125 0.5564804 [19,] 0.437932035 0.875864071 0.5620680 [20,] 0.373771832 0.747543663 0.6262282 [21,] 0.313336026 0.626672052 0.6866640 [22,] 0.347263297 0.694526595 0.6527367 [23,] 0.296163154 0.592326307 0.7038368 [24,] 0.521927365 0.956145269 0.4780726 [25,] 0.470812922 0.941625844 0.5291871 [26,] 0.432862899 0.865725799 0.5671371 [27,] 0.375546236 0.751092473 0.6244538 [28,] 0.348910287 0.697820575 0.6510897 [29,] 0.297272497 0.594544994 0.7027275 [30,] 0.249904029 0.499808057 0.7500960 [31,] 0.222560825 0.445121651 0.7774392 [32,] 0.375203931 0.750407863 0.6247961 [33,] 0.323419485 0.646838971 0.6765805 [34,] 0.291372185 0.582744370 0.7086278 [35,] 0.247786889 0.495573778 0.7522131 [36,] 0.211393905 0.422787810 0.7886061 [37,] 0.191987018 0.383974036 0.8080130 [38,] 0.179547882 0.359095765 0.8204521 [39,] 0.164459893 0.328919785 0.8355401 [40,] 0.134369240 0.268738480 0.8656308 [41,] 0.124728456 0.249456913 0.8752715 [42,] 0.102954440 0.205908880 0.8970456 [43,] 0.087832970 0.175665940 0.9121670 [44,] 0.147392748 0.294785495 0.8526073 [45,] 0.176759866 0.353519732 0.8232401 [46,] 0.165314067 0.330628133 0.8346859 [47,] 0.222746328 0.445492656 0.7772537 [48,] 0.215184325 0.430368650 0.7848157 [49,] 0.184195411 0.368390821 0.8158046 [50,] 0.197396036 0.394792072 0.8026040 [51,] 0.225127634 0.450255269 0.7748724 [52,] 0.198905634 0.397811268 0.8010944 [53,] 0.167144064 0.334288127 0.8328559 [54,] 0.182384014 0.364768028 0.8176160 [55,] 0.153297484 0.306594967 0.8467025 [56,] 0.126476445 0.252952889 0.8735236 [57,] 0.122928310 0.245856620 0.8770717 [58,] 0.112290924 0.224581848 0.8877091 [59,] 0.111389709 0.222779417 0.8886103 [60,] 0.094797851 0.189595701 0.9052021 [61,] 0.077395403 0.154790807 0.9226046 [62,] 0.062899220 0.125798440 0.9371008 [63,] 0.049682013 0.099364027 0.9503180 [64,] 0.046640046 0.093280093 0.9533600 [65,] 0.037362175 0.074724350 0.9626378 [66,] 0.031051733 0.062103466 0.9689483 [67,] 0.023817202 0.047634403 0.9761828 [68,] 0.018700231 0.037400461 0.9812998 [69,] 0.014968940 0.029937881 0.9850311 [70,] 0.022492401 0.044984801 0.9775076 [71,] 0.017931427 0.035862854 0.9820686 [72,] 0.017533894 0.035067788 0.9824661 [73,] 0.031361480 0.062722961 0.9686385 [74,] 0.024186212 0.048372424 0.9758138 [75,] 0.020179899 0.040359797 0.9798201 [76,] 0.022102080 0.044204161 0.9778979 [77,] 0.019589696 0.039179393 0.9804103 [78,] 0.014892082 0.029784165 0.9851079 [79,] 0.019443287 0.038886575 0.9805567 [80,] 0.015290831 0.030581662 0.9847092 [81,] 0.011441891 0.022883781 0.9885581 [82,] 0.011501518 0.023003037 0.9884985 [83,] 0.010055661 0.020111321 0.9899443 [84,] 0.007711865 0.015423730 0.9922881 [85,] 0.006374597 0.012749193 0.9936254 [86,] 0.011679987 0.023359975 0.9883200 [87,] 0.010578120 0.021156240 0.9894219 [88,] 0.010061256 0.020122513 0.9899387 [89,] 0.007699113 0.015398226 0.9923009 [90,] 0.005680825 0.011361650 0.9943192 [91,] 0.004348979 0.008697957 0.9956510 [92,] 0.003213483 0.006426966 0.9967865 [93,] 0.002286472 0.004572945 0.9977135 [94,] 0.002444720 0.004889440 0.9975553 [95,] 0.001915245 0.003830490 0.9980848 [96,] 0.008114481 0.016228963 0.9918855 [97,] 0.018161872 0.036323744 0.9818381 [98,] 0.018024504 0.036049007 0.9819755 [99,] 0.022717948 0.045435896 0.9772821 [100,] 0.017527722 0.035055444 0.9824723 [101,] 0.012802049 0.025604098 0.9871980 [102,] 0.009268614 0.018537228 0.9907314 [103,] 0.022728373 0.045456747 0.9772716 [104,] 0.020597181 0.041194362 0.9794028 [105,] 0.057200294 0.114400588 0.9427997 [106,] 0.048462705 0.096925410 0.9515373 [107,] 0.039276437 0.078552874 0.9607236 [108,] 0.115731467 0.231462934 0.8842685 [109,] 0.110887113 0.221774227 0.8891129 [110,] 0.098312791 0.196625582 0.9016872 [111,] 0.171833931 0.343667861 0.8281661 [112,] 0.163712493 0.327424987 0.8362875 [113,] 0.195066967 0.390133934 0.8049330 [114,] 0.188054053 0.376108106 0.8119459 [115,] 0.187235425 0.374470850 0.8127646 [116,] 0.170002447 0.340004894 0.8299976 [117,] 0.138341399 0.276682798 0.8616586 [118,] 0.108178568 0.216357136 0.8918214 [119,] 0.111630465 0.223260930 0.8883695 [120,] 0.160133501 0.320267002 0.8398665 [121,] 0.137951852 0.275903704 0.8620481 [122,] 0.120423104 0.240846209 0.8795769 [123,] 0.104299008 0.208598016 0.8957010 [124,] 0.095674176 0.191348352 0.9043258 [125,] 0.078100593 0.156201185 0.9218994 [126,] 0.106580435 0.213160870 0.8934196 [127,] 0.079028732 0.158057464 0.9209713 [128,] 0.057635798 0.115271597 0.9423642 [129,] 0.146870834 0.293741668 0.8531292 [130,] 0.208134150 0.416268300 0.7918659 [131,] 0.188534490 0.377068979 0.8114655 [132,] 0.406055846 0.812111691 0.5939442 [133,] 0.356404340 0.712808681 0.6435957 [134,] 0.666036976 0.667926049 0.3339630 [135,] 0.604830923 0.790338153 0.3951691 [136,] 0.494206523 0.988413046 0.5057935 [137,] 0.423316958 0.846633916 0.5766830 [138,] 0.433611034 0.867222068 0.5663890 [139,] 0.303307218 0.606614436 0.6966928 [140,] 0.211421302 0.422842605 0.7885787 > postscript(file="/var/www/html/rcomp/tmp/1254s1290537787.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/2delv1290537787.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/3delv1290537787.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/4delv1290537787.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/5delv1290537787.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 = 159 Frequency = 1 1 2 3 4 5 6 1.96198836 -2.34990302 -0.47541873 -0.12838779 -3.95022967 4.94195085 7 8 9 10 11 12 0.23105658 -1.54976023 0.04120504 2.55219581 3.81651422 -1.75907577 13 14 15 16 17 18 3.62765168 -5.67208736 -1.44582232 3.74280788 -2.17484625 -7.02248808 19 20 21 22 23 24 2.54786551 -1.38779014 -2.23637049 -0.66062022 1.83163864 1.91876212 25 26 27 28 29 30 6.09146220 2.12699047 0.53857534 3.62286332 1.02733562 0.30929750 31 32 33 34 35 36 4.75531461 2.00569913 -7.01819970 -0.96292485 -1.58102251 -0.69534591 37 38 39 40 41 42 -3.11401000 -0.82538213 -0.55175486 -2.59731477 7.10454125 0.33607077 43 44 45 46 47 48 -1.71155041 -0.78979783 -1.25143295 2.60650322 3.27761284 -3.43467660 49 50 51 52 53 54 0.03602926 -2.81883590 -1.68926801 2.18804543 6.51573122 -5.02362508 55 56 57 58 59 60 0.20255893 5.59252953 3.15714033 -1.16303736 4.05442013 -4.35252389 61 62 63 64 65 66 2.14394489 0.52393199 4.35720463 -0.22191044 0.32737746 3.10779059 67 68 69 70 71 72 2.71597942 -3.09874711 1.73082689 1.08180703 1.21796598 0.57247890 73 74 75 76 77 78 3.17370674 1.39778167 1.93604025 -0.28553632 1.35958887 1.85541908 79 80 81 82 83 84 5.48789773 -1.64752119 3.43204374 6.37066954 0.69523298 1.96733304 85 86 87 88 89 90 3.89449444 2.64647976 -0.85019593 4.64491388 -0.14227017 0.42734346 91 92 93 94 95 96 3.55489120 2.28084508 1.05913474 -2.30337914 5.65161350 2.57537377 97 98 99 100 101 102 3.05311094 0.93578937 0.23214597 -1.38337825 -0.58158203 -0.27572895 103 104 105 106 107 108 -3.76262253 1.35752171 7.23185808 -6.72853005 -3.69146833 -4.91072102 109 110 111 112 113 114 -0.64616017 -0.02239783 -0.28461709 5.93891172 -2.24985719 -8.08949429 115 116 117 118 119 120 -1.81876407 1.61053238 -8.05627027 -3.85247750 1.81847342 -7.42089490 121 122 123 124 125 126 -3.36007828 -5.12385967 -4.22847471 2.26085385 0.84498997 1.57078145 127 128 129 130 131 132 0.44729768 2.49698689 4.51183125 0.86785399 -4.29139020 1.13145646 133 134 135 136 137 138 2.35034944 1.03621880 3.24269484 -0.59812384 -2.39689076 -9.06617600 139 140 141 142 143 144 2.60946687 -6.50367131 -9.09374065 -2.04891692 -7.64569315 -0.42637847 145 146 147 148 149 150 0.16975073 -1.78763365 -2.65360439 -2.08519196 -4.10978114 -0.10036432 151 152 153 154 155 156 -1.18576012 0.61724067 5.72622401 -8.97589966 -0.92221464 -0.44516291 157 158 159 0.36699296 0.10740655 2.27782532 > postscript(file="/var/www/html/rcomp/tmp/656ky1290537787.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 = 159 Frequency = 1 lag(myerror, k = 1) myerror 0 1.96198836 NA 1 -2.34990302 1.96198836 2 -0.47541873 -2.34990302 3 -0.12838779 -0.47541873 4 -3.95022967 -0.12838779 5 4.94195085 -3.95022967 6 0.23105658 4.94195085 7 -1.54976023 0.23105658 8 0.04120504 -1.54976023 9 2.55219581 0.04120504 10 3.81651422 2.55219581 11 -1.75907577 3.81651422 12 3.62765168 -1.75907577 13 -5.67208736 3.62765168 14 -1.44582232 -5.67208736 15 3.74280788 -1.44582232 16 -2.17484625 3.74280788 17 -7.02248808 -2.17484625 18 2.54786551 -7.02248808 19 -1.38779014 2.54786551 20 -2.23637049 -1.38779014 21 -0.66062022 -2.23637049 22 1.83163864 -0.66062022 23 1.91876212 1.83163864 24 6.09146220 1.91876212 25 2.12699047 6.09146220 26 0.53857534 2.12699047 27 3.62286332 0.53857534 28 1.02733562 3.62286332 29 0.30929750 1.02733562 30 4.75531461 0.30929750 31 2.00569913 4.75531461 32 -7.01819970 2.00569913 33 -0.96292485 -7.01819970 34 -1.58102251 -0.96292485 35 -0.69534591 -1.58102251 36 -3.11401000 -0.69534591 37 -0.82538213 -3.11401000 38 -0.55175486 -0.82538213 39 -2.59731477 -0.55175486 40 7.10454125 -2.59731477 41 0.33607077 7.10454125 42 -1.71155041 0.33607077 43 -0.78979783 -1.71155041 44 -1.25143295 -0.78979783 45 2.60650322 -1.25143295 46 3.27761284 2.60650322 47 -3.43467660 3.27761284 48 0.03602926 -3.43467660 49 -2.81883590 0.03602926 50 -1.68926801 -2.81883590 51 2.18804543 -1.68926801 52 6.51573122 2.18804543 53 -5.02362508 6.51573122 54 0.20255893 -5.02362508 55 5.59252953 0.20255893 56 3.15714033 5.59252953 57 -1.16303736 3.15714033 58 4.05442013 -1.16303736 59 -4.35252389 4.05442013 60 2.14394489 -4.35252389 61 0.52393199 2.14394489 62 4.35720463 0.52393199 63 -0.22191044 4.35720463 64 0.32737746 -0.22191044 65 3.10779059 0.32737746 66 2.71597942 3.10779059 67 -3.09874711 2.71597942 68 1.73082689 -3.09874711 69 1.08180703 1.73082689 70 1.21796598 1.08180703 71 0.57247890 1.21796598 72 3.17370674 0.57247890 73 1.39778167 3.17370674 74 1.93604025 1.39778167 75 -0.28553632 1.93604025 76 1.35958887 -0.28553632 77 1.85541908 1.35958887 78 5.48789773 1.85541908 79 -1.64752119 5.48789773 80 3.43204374 -1.64752119 81 6.37066954 3.43204374 82 0.69523298 6.37066954 83 1.96733304 0.69523298 84 3.89449444 1.96733304 85 2.64647976 3.89449444 86 -0.85019593 2.64647976 87 4.64491388 -0.85019593 88 -0.14227017 4.64491388 89 0.42734346 -0.14227017 90 3.55489120 0.42734346 91 2.28084508 3.55489120 92 1.05913474 2.28084508 93 -2.30337914 1.05913474 94 5.65161350 -2.30337914 95 2.57537377 5.65161350 96 3.05311094 2.57537377 97 0.93578937 3.05311094 98 0.23214597 0.93578937 99 -1.38337825 0.23214597 100 -0.58158203 -1.38337825 101 -0.27572895 -0.58158203 102 -3.76262253 -0.27572895 103 1.35752171 -3.76262253 104 7.23185808 1.35752171 105 -6.72853005 7.23185808 106 -3.69146833 -6.72853005 107 -4.91072102 -3.69146833 108 -0.64616017 -4.91072102 109 -0.02239783 -0.64616017 110 -0.28461709 -0.02239783 111 5.93891172 -0.28461709 112 -2.24985719 5.93891172 113 -8.08949429 -2.24985719 114 -1.81876407 -8.08949429 115 1.61053238 -1.81876407 116 -8.05627027 1.61053238 117 -3.85247750 -8.05627027 118 1.81847342 -3.85247750 119 -7.42089490 1.81847342 120 -3.36007828 -7.42089490 121 -5.12385967 -3.36007828 122 -4.22847471 -5.12385967 123 2.26085385 -4.22847471 124 0.84498997 2.26085385 125 1.57078145 0.84498997 126 0.44729768 1.57078145 127 2.49698689 0.44729768 128 4.51183125 2.49698689 129 0.86785399 4.51183125 130 -4.29139020 0.86785399 131 1.13145646 -4.29139020 132 2.35034944 1.13145646 133 1.03621880 2.35034944 134 3.24269484 1.03621880 135 -0.59812384 3.24269484 136 -2.39689076 -0.59812384 137 -9.06617600 -2.39689076 138 2.60946687 -9.06617600 139 -6.50367131 2.60946687 140 -9.09374065 -6.50367131 141 -2.04891692 -9.09374065 142 -7.64569315 -2.04891692 143 -0.42637847 -7.64569315 144 0.16975073 -0.42637847 145 -1.78763365 0.16975073 146 -2.65360439 -1.78763365 147 -2.08519196 -2.65360439 148 -4.10978114 -2.08519196 149 -0.10036432 -4.10978114 150 -1.18576012 -0.10036432 151 0.61724067 -1.18576012 152 5.72622401 0.61724067 153 -8.97589966 5.72622401 154 -0.92221464 -8.97589966 155 -0.44516291 -0.92221464 156 0.36699296 -0.44516291 157 0.10740655 0.36699296 158 2.27782532 0.10740655 159 NA 2.27782532 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -2.34990302 1.96198836 [2,] -0.47541873 -2.34990302 [3,] -0.12838779 -0.47541873 [4,] -3.95022967 -0.12838779 [5,] 4.94195085 -3.95022967 [6,] 0.23105658 4.94195085 [7,] -1.54976023 0.23105658 [8,] 0.04120504 -1.54976023 [9,] 2.55219581 0.04120504 [10,] 3.81651422 2.55219581 [11,] -1.75907577 3.81651422 [12,] 3.62765168 -1.75907577 [13,] -5.67208736 3.62765168 [14,] -1.44582232 -5.67208736 [15,] 3.74280788 -1.44582232 [16,] -2.17484625 3.74280788 [17,] -7.02248808 -2.17484625 [18,] 2.54786551 -7.02248808 [19,] -1.38779014 2.54786551 [20,] -2.23637049 -1.38779014 [21,] -0.66062022 -2.23637049 [22,] 1.83163864 -0.66062022 [23,] 1.91876212 1.83163864 [24,] 6.09146220 1.91876212 [25,] 2.12699047 6.09146220 [26,] 0.53857534 2.12699047 [27,] 3.62286332 0.53857534 [28,] 1.02733562 3.62286332 [29,] 0.30929750 1.02733562 [30,] 4.75531461 0.30929750 [31,] 2.00569913 4.75531461 [32,] -7.01819970 2.00569913 [33,] -0.96292485 -7.01819970 [34,] -1.58102251 -0.96292485 [35,] -0.69534591 -1.58102251 [36,] -3.11401000 -0.69534591 [37,] -0.82538213 -3.11401000 [38,] -0.55175486 -0.82538213 [39,] -2.59731477 -0.55175486 [40,] 7.10454125 -2.59731477 [41,] 0.33607077 7.10454125 [42,] -1.71155041 0.33607077 [43,] -0.78979783 -1.71155041 [44,] -1.25143295 -0.78979783 [45,] 2.60650322 -1.25143295 [46,] 3.27761284 2.60650322 [47,] -3.43467660 3.27761284 [48,] 0.03602926 -3.43467660 [49,] -2.81883590 0.03602926 [50,] -1.68926801 -2.81883590 [51,] 2.18804543 -1.68926801 [52,] 6.51573122 2.18804543 [53,] -5.02362508 6.51573122 [54,] 0.20255893 -5.02362508 [55,] 5.59252953 0.20255893 [56,] 3.15714033 5.59252953 [57,] -1.16303736 3.15714033 [58,] 4.05442013 -1.16303736 [59,] -4.35252389 4.05442013 [60,] 2.14394489 -4.35252389 [61,] 0.52393199 2.14394489 [62,] 4.35720463 0.52393199 [63,] -0.22191044 4.35720463 [64,] 0.32737746 -0.22191044 [65,] 3.10779059 0.32737746 [66,] 2.71597942 3.10779059 [67,] -3.09874711 2.71597942 [68,] 1.73082689 -3.09874711 [69,] 1.08180703 1.73082689 [70,] 1.21796598 1.08180703 [71,] 0.57247890 1.21796598 [72,] 3.17370674 0.57247890 [73,] 1.39778167 3.17370674 [74,] 1.93604025 1.39778167 [75,] -0.28553632 1.93604025 [76,] 1.35958887 -0.28553632 [77,] 1.85541908 1.35958887 [78,] 5.48789773 1.85541908 [79,] -1.64752119 5.48789773 [80,] 3.43204374 -1.64752119 [81,] 6.37066954 3.43204374 [82,] 0.69523298 6.37066954 [83,] 1.96733304 0.69523298 [84,] 3.89449444 1.96733304 [85,] 2.64647976 3.89449444 [86,] -0.85019593 2.64647976 [87,] 4.64491388 -0.85019593 [88,] -0.14227017 4.64491388 [89,] 0.42734346 -0.14227017 [90,] 3.55489120 0.42734346 [91,] 2.28084508 3.55489120 [92,] 1.05913474 2.28084508 [93,] -2.30337914 1.05913474 [94,] 5.65161350 -2.30337914 [95,] 2.57537377 5.65161350 [96,] 3.05311094 2.57537377 [97,] 0.93578937 3.05311094 [98,] 0.23214597 0.93578937 [99,] -1.38337825 0.23214597 [100,] -0.58158203 -1.38337825 [101,] -0.27572895 -0.58158203 [102,] -3.76262253 -0.27572895 [103,] 1.35752171 -3.76262253 [104,] 7.23185808 1.35752171 [105,] -6.72853005 7.23185808 [106,] -3.69146833 -6.72853005 [107,] -4.91072102 -3.69146833 [108,] -0.64616017 -4.91072102 [109,] -0.02239783 -0.64616017 [110,] -0.28461709 -0.02239783 [111,] 5.93891172 -0.28461709 [112,] -2.24985719 5.93891172 [113,] -8.08949429 -2.24985719 [114,] -1.81876407 -8.08949429 [115,] 1.61053238 -1.81876407 [116,] -8.05627027 1.61053238 [117,] -3.85247750 -8.05627027 [118,] 1.81847342 -3.85247750 [119,] -7.42089490 1.81847342 [120,] -3.36007828 -7.42089490 [121,] -5.12385967 -3.36007828 [122,] -4.22847471 -5.12385967 [123,] 2.26085385 -4.22847471 [124,] 0.84498997 2.26085385 [125,] 1.57078145 0.84498997 [126,] 0.44729768 1.57078145 [127,] 2.49698689 0.44729768 [128,] 4.51183125 2.49698689 [129,] 0.86785399 4.51183125 [130,] -4.29139020 0.86785399 [131,] 1.13145646 -4.29139020 [132,] 2.35034944 1.13145646 [133,] 1.03621880 2.35034944 [134,] 3.24269484 1.03621880 [135,] -0.59812384 3.24269484 [136,] -2.39689076 -0.59812384 [137,] -9.06617600 -2.39689076 [138,] 2.60946687 -9.06617600 [139,] -6.50367131 2.60946687 [140,] -9.09374065 -6.50367131 [141,] -2.04891692 -9.09374065 [142,] -7.64569315 -2.04891692 [143,] -0.42637847 -7.64569315 [144,] 0.16975073 -0.42637847 [145,] -1.78763365 0.16975073 [146,] -2.65360439 -1.78763365 [147,] -2.08519196 -2.65360439 [148,] -4.10978114 -2.08519196 [149,] -0.10036432 -4.10978114 [150,] -1.18576012 -0.10036432 [151,] 0.61724067 -1.18576012 [152,] 5.72622401 0.61724067 [153,] -8.97589966 5.72622401 [154,] -0.92221464 -8.97589966 [155,] -0.44516291 -0.92221464 [156,] 0.36699296 -0.44516291 [157,] 0.10740655 0.36699296 [158,] 2.27782532 0.10740655 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -2.34990302 1.96198836 2 -0.47541873 -2.34990302 3 -0.12838779 -0.47541873 4 -3.95022967 -0.12838779 5 4.94195085 -3.95022967 6 0.23105658 4.94195085 7 -1.54976023 0.23105658 8 0.04120504 -1.54976023 9 2.55219581 0.04120504 10 3.81651422 2.55219581 11 -1.75907577 3.81651422 12 3.62765168 -1.75907577 13 -5.67208736 3.62765168 14 -1.44582232 -5.67208736 15 3.74280788 -1.44582232 16 -2.17484625 3.74280788 17 -7.02248808 -2.17484625 18 2.54786551 -7.02248808 19 -1.38779014 2.54786551 20 -2.23637049 -1.38779014 21 -0.66062022 -2.23637049 22 1.83163864 -0.66062022 23 1.91876212 1.83163864 24 6.09146220 1.91876212 25 2.12699047 6.09146220 26 0.53857534 2.12699047 27 3.62286332 0.53857534 28 1.02733562 3.62286332 29 0.30929750 1.02733562 30 4.75531461 0.30929750 31 2.00569913 4.75531461 32 -7.01819970 2.00569913 33 -0.96292485 -7.01819970 34 -1.58102251 -0.96292485 35 -0.69534591 -1.58102251 36 -3.11401000 -0.69534591 37 -0.82538213 -3.11401000 38 -0.55175486 -0.82538213 39 -2.59731477 -0.55175486 40 7.10454125 -2.59731477 41 0.33607077 7.10454125 42 -1.71155041 0.33607077 43 -0.78979783 -1.71155041 44 -1.25143295 -0.78979783 45 2.60650322 -1.25143295 46 3.27761284 2.60650322 47 -3.43467660 3.27761284 48 0.03602926 -3.43467660 49 -2.81883590 0.03602926 50 -1.68926801 -2.81883590 51 2.18804543 -1.68926801 52 6.51573122 2.18804543 53 -5.02362508 6.51573122 54 0.20255893 -5.02362508 55 5.59252953 0.20255893 56 3.15714033 5.59252953 57 -1.16303736 3.15714033 58 4.05442013 -1.16303736 59 -4.35252389 4.05442013 60 2.14394489 -4.35252389 61 0.52393199 2.14394489 62 4.35720463 0.52393199 63 -0.22191044 4.35720463 64 0.32737746 -0.22191044 65 3.10779059 0.32737746 66 2.71597942 3.10779059 67 -3.09874711 2.71597942 68 1.73082689 -3.09874711 69 1.08180703 1.73082689 70 1.21796598 1.08180703 71 0.57247890 1.21796598 72 3.17370674 0.57247890 73 1.39778167 3.17370674 74 1.93604025 1.39778167 75 -0.28553632 1.93604025 76 1.35958887 -0.28553632 77 1.85541908 1.35958887 78 5.48789773 1.85541908 79 -1.64752119 5.48789773 80 3.43204374 -1.64752119 81 6.37066954 3.43204374 82 0.69523298 6.37066954 83 1.96733304 0.69523298 84 3.89449444 1.96733304 85 2.64647976 3.89449444 86 -0.85019593 2.64647976 87 4.64491388 -0.85019593 88 -0.14227017 4.64491388 89 0.42734346 -0.14227017 90 3.55489120 0.42734346 91 2.28084508 3.55489120 92 1.05913474 2.28084508 93 -2.30337914 1.05913474 94 5.65161350 -2.30337914 95 2.57537377 5.65161350 96 3.05311094 2.57537377 97 0.93578937 3.05311094 98 0.23214597 0.93578937 99 -1.38337825 0.23214597 100 -0.58158203 -1.38337825 101 -0.27572895 -0.58158203 102 -3.76262253 -0.27572895 103 1.35752171 -3.76262253 104 7.23185808 1.35752171 105 -6.72853005 7.23185808 106 -3.69146833 -6.72853005 107 -4.91072102 -3.69146833 108 -0.64616017 -4.91072102 109 -0.02239783 -0.64616017 110 -0.28461709 -0.02239783 111 5.93891172 -0.28461709 112 -2.24985719 5.93891172 113 -8.08949429 -2.24985719 114 -1.81876407 -8.08949429 115 1.61053238 -1.81876407 116 -8.05627027 1.61053238 117 -3.85247750 -8.05627027 118 1.81847342 -3.85247750 119 -7.42089490 1.81847342 120 -3.36007828 -7.42089490 121 -5.12385967 -3.36007828 122 -4.22847471 -5.12385967 123 2.26085385 -4.22847471 124 0.84498997 2.26085385 125 1.57078145 0.84498997 126 0.44729768 1.57078145 127 2.49698689 0.44729768 128 4.51183125 2.49698689 129 0.86785399 4.51183125 130 -4.29139020 0.86785399 131 1.13145646 -4.29139020 132 2.35034944 1.13145646 133 1.03621880 2.35034944 134 3.24269484 1.03621880 135 -0.59812384 3.24269484 136 -2.39689076 -0.59812384 137 -9.06617600 -2.39689076 138 2.60946687 -9.06617600 139 -6.50367131 2.60946687 140 -9.09374065 -6.50367131 141 -2.04891692 -9.09374065 142 -7.64569315 -2.04891692 143 -0.42637847 -7.64569315 144 0.16975073 -0.42637847 145 -1.78763365 0.16975073 146 -2.65360439 -1.78763365 147 -2.08519196 -2.65360439 148 -4.10978114 -2.08519196 149 -0.10036432 -4.10978114 150 -1.18576012 -0.10036432 151 0.61724067 -1.18576012 152 5.72622401 0.61724067 153 -8.97589966 5.72622401 154 -0.92221464 -8.97589966 155 -0.44516291 -0.92221464 156 0.36699296 -0.44516291 157 0.10740655 0.36699296 158 2.27782532 0.10740655 > 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/7yxk11290537787.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/8yxk11290537787.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/9yxk11290537787.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/1096jm1290537787.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/115zkn1290537788.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/128zjs1290537788.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/13fixm1290537788.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/14qsx71290537788.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/15bavv1290537788.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/1672tm1290537788.tab") + } > > try(system("convert tmp/1254s1290537787.ps tmp/1254s1290537787.png",intern=TRUE)) character(0) > try(system("convert tmp/2delv1290537787.ps tmp/2delv1290537787.png",intern=TRUE)) character(0) > try(system("convert tmp/3delv1290537787.ps tmp/3delv1290537787.png",intern=TRUE)) character(0) > try(system("convert tmp/4delv1290537787.ps tmp/4delv1290537787.png",intern=TRUE)) character(0) > try(system("convert tmp/5delv1290537787.ps tmp/5delv1290537787.png",intern=TRUE)) character(0) > try(system("convert tmp/656ky1290537787.ps tmp/656ky1290537787.png",intern=TRUE)) character(0) > try(system("convert tmp/7yxk11290537787.ps tmp/7yxk11290537787.png",intern=TRUE)) character(0) > try(system("convert tmp/8yxk11290537787.ps tmp/8yxk11290537787.png",intern=TRUE)) character(0) > try(system("convert tmp/9yxk11290537787.ps tmp/9yxk11290537787.png",intern=TRUE)) character(0) > try(system("convert tmp/1096jm1290537787.ps tmp/1096jm1290537787.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.136 1.735 9.306