R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(41 + ,38 + ,13 + ,12 + ,12 + ,53 + ,32 + ,39 + ,32 + ,16 + ,11 + ,11 + ,86 + ,51 + ,30 + ,35 + ,19 + ,15 + ,14 + ,66 + ,42 + ,31 + ,33 + ,15 + ,6 + ,12 + ,67 + ,41 + ,34 + ,37 + ,14 + ,13 + ,21 + ,76 + ,46 + ,35 + ,29 + ,13 + ,10 + ,12 + ,78 + ,47 + ,39 + ,31 + ,19 + ,12 + ,22 + ,53 + ,37 + ,34 + ,36 + ,15 + ,14 + ,11 + ,80 + ,49 + ,36 + ,35 + ,14 + ,12 + ,10 + ,74 + ,45 + ,37 + ,38 + ,15 + ,6 + ,13 + ,76 + ,47 + ,38 + ,31 + ,16 + ,10 + ,10 + ,79 + ,49 + ,36 + ,34 + ,16 + ,12 + ,8 + ,54 + ,33 + ,38 + ,35 + ,16 + ,12 + ,15 + ,67 + ,42 + ,39 + ,38 + ,16 + ,11 + ,14 + ,54 + ,33 + ,33 + ,37 + ,17 + ,15 + ,10 + ,87 + ,53 + ,32 + ,33 + ,15 + ,12 + ,14 + ,58 + ,36 + ,36 + ,32 + ,15 + ,10 + ,14 + ,75 + ,45 + ,38 + ,38 + ,20 + ,12 + ,11 + ,88 + ,54 + ,39 + ,38 + ,18 + ,11 + ,10 + ,64 + ,41 + ,32 + ,32 + ,16 + ,12 + ,13 + ,57 + ,36 + ,32 + ,33 + ,16 + ,11 + ,7 + ,66 + ,41 + ,31 + ,31 + ,16 + ,12 + ,14 + ,68 + ,44 + ,39 + ,38 + ,19 + ,13 + ,12 + ,54 + ,33 + ,37 + ,39 + ,16 + ,11 + ,14 + ,56 + ,37 + ,39 + ,32 + ,17 + ,9 + ,11 + ,86 + ,52 + ,41 + ,32 + ,17 + ,13 + ,9 + ,80 + ,47 + ,36 + ,35 + ,16 + ,10 + ,11 + ,76 + ,43 + ,33 + ,37 + ,15 + ,14 + ,15 + ,69 + ,44 + ,33 + ,33 + ,16 + ,12 + ,14 + ,78 + ,45 + ,34 + ,33 + ,14 + ,10 + ,13 + ,67 + ,44 + ,31 + ,28 + ,15 + ,12 + ,9 + ,80 + ,49 + ,27 + ,32 + ,12 + ,8 + ,15 + ,54 + ,33 + ,37 + ,31 + ,14 + ,10 + ,10 + ,71 + ,43 + ,34 + ,37 + ,16 + ,12 + ,11 + ,84 + ,54 + ,34 + ,30 + ,14 + ,12 + ,13 + ,74 + ,42 + ,32 + ,33 + ,7 + ,7 + ,8 + ,71 + ,44 + ,29 + ,31 + ,10 + ,6 + ,20 + ,63 + ,37 + ,36 + ,33 + ,14 + ,12 + ,12 + ,71 + ,43 + ,29 + ,31 + ,16 + ,10 + ,10 + ,76 + ,46 + ,35 + ,33 + ,16 + ,10 + ,10 + ,69 + ,42 + ,37 + ,32 + ,16 + ,10 + ,9 + ,74 + ,45 + ,34 + ,33 + ,14 + ,12 + ,14 + ,75 + ,44 + ,38 + ,32 + ,20 + ,15 + ,8 + ,54 + ,33 + ,35 + ,33 + ,14 + ,10 + ,14 + ,52 + ,31 + ,38 + ,28 + ,14 + ,10 + ,11 + ,69 + ,42 + ,37 + ,35 + ,11 + ,12 + ,13 + ,68 + ,40 + ,38 + ,39 + ,14 + ,13 + ,9 + ,65 + ,43 + ,33 + ,34 + ,15 + ,11 + ,11 + ,75 + ,46 + ,36 + ,38 + ,16 + ,11 + ,15 + ,74 + ,42 + ,38 + ,32 + ,14 + ,12 + ,11 + ,75 + ,45 + ,32 + ,38 + ,16 + ,14 + ,10 + ,72 + ,44 + ,32 + ,30 + ,14 + ,10 + ,14 + ,67 + ,40 + ,32 + ,33 + ,12 + ,12 + ,18 + ,63 + ,37 + ,34 + ,38 + ,16 + ,13 + ,14 + ,62 + ,46 + ,32 + ,32 + ,9 + ,5 + ,11 + ,63 + ,36 + ,37 + ,32 + ,14 + ,6 + ,12 + ,76 + ,47 + ,39 + ,34 + ,16 + ,12 + ,13 + ,74 + ,45 + ,29 + ,34 + ,16 + ,12 + ,9 + ,67 + ,42 + ,37 + ,36 + ,15 + ,11 + ,10 + ,73 + ,43 + ,35 + ,34 + ,16 + ,10 + ,15 + ,70 + ,43 + ,30 + ,28 + ,12 + ,7 + ,20 + ,53 + ,32 + ,38 + ,34 + ,16 + ,12 + ,12 + ,77 + ,45 + ,34 + ,35 + ,16 + ,14 + ,12 + ,77 + ,45 + ,31 + ,35 + ,14 + ,11 + ,14 + ,52 + ,31 + ,34 + ,31 + ,16 + ,12 + ,13 + ,54 + ,33 + ,35 + ,37 + ,17 + ,13 + ,11 + ,80 + ,49 + ,36 + ,35 + ,18 + ,14 + ,17 + ,66 + ,42 + ,30 + ,27 + ,18 + ,11 + ,12 + ,73 + ,41 + ,39 + ,40 + ,12 + ,12 + ,13 + ,63 + ,38 + ,35 + ,37 + ,16 + ,12 + ,14 + ,69 + ,42 + ,38 + ,36 + ,10 + ,8 + ,13 + ,67 + ,44 + ,31 + ,38 + ,14 + ,11 + ,15 + ,54 + ,33 + ,34 + ,39 + ,18 + ,14 + ,13 + ,81 + ,48 + ,38 + ,41 + ,18 + ,14 + ,10 + ,69 + ,40 + ,34 + ,27 + ,16 + ,12 + ,11 + ,84 + ,50 + ,39 + ,30 + ,17 + ,9 + ,19 + ,80 + ,49 + ,37 + ,37 + ,16 + ,13 + ,13 + ,70 + ,43 + ,34 + ,31 + ,16 + ,11 + ,17 + ,69 + ,44 + ,28 + ,31 + ,13 + ,12 + ,13 + ,77 + ,47 + ,37 + ,27 + ,16 + ,12 + ,9 + ,54 + ,33 + ,33 + ,36 + ,16 + ,12 + ,11 + ,79 + ,46 + ,37 + ,38 + ,20 + ,12 + ,10 + ,30 + ,0 + ,35 + ,37 + ,16 + ,12 + ,9 + ,71 + ,45 + ,37 + ,33 + ,15 + ,12 + ,12 + ,73 + ,43 + ,32 + ,34 + ,15 + ,11 + ,12 + ,72 + ,44 + ,33 + ,31 + ,16 + ,10 + ,13 + ,77 + ,47 + ,38 + ,39 + ,14 + ,9 + ,13 + ,75 + ,45 + ,33 + ,34 + ,16 + ,12 + ,12 + ,69 + ,42 + ,29 + ,32 + ,16 + ,12 + ,15 + ,54 + ,33 + ,33 + ,33 + ,15 + ,12 + ,22 + ,70 + ,43 + ,31 + ,36 + ,12 + ,9 + ,13 + ,73 + ,46 + ,36 + ,32 + ,17 + ,15 + ,15 + ,54 + ,33 + ,35 + ,41 + ,16 + ,12 + ,13 + ,77 + ,46 + ,32 + ,28 + ,15 + ,12 + ,15 + ,82 + ,48 + ,29 + ,30 + ,13 + ,12 + ,10 + ,80 + ,47 + ,39 + ,36 + ,16 + ,10 + ,11 + ,80 + ,47 + ,37 + ,35 + ,16 + ,13 + ,16 + ,69 + ,43 + ,35 + ,31 + ,16 + ,9 + ,11 + ,78 + ,46 + ,37 + ,34 + ,16 + ,12 + ,11 + ,81 + ,48 + ,32 + ,36 + ,14 + ,10 + ,10 + ,76 + ,46 + ,38 + ,36 + ,16 + ,14 + ,10 + ,76 + ,45 + ,37 + ,35 + ,16 + ,11 + ,16 + ,73 + ,45 + ,36 + ,37 + ,20 + ,15 + ,12 + ,85 + ,52 + ,32 + ,28 + ,15 + ,11 + ,11 + ,66 + ,42 + ,33 + ,39 + ,16 + ,11 + ,16 + ,79 + ,47 + ,40 + ,32 + ,13 + ,12 + ,19 + ,68 + ,41 + ,38 + ,35 + ,17 + ,12 + ,11 + ,76 + ,47 + ,41 + ,39 + ,16 + ,12 + ,16 + ,71 + ,43 + ,36 + ,35 + ,16 + ,11 + ,15 + ,54 + ,33 + ,43 + ,42 + ,12 + ,7 + ,24 + ,46 + ,30 + ,30 + ,34 + ,16 + ,12 + ,14 + ,82 + ,49 + ,31 + ,33 + ,16 + ,14 + ,15 + ,74 + ,44 + ,32 + ,41 + ,17 + ,11 + ,11 + ,88 + ,55 + ,32 + ,33 + ,13 + ,11 + ,15 + ,38 + ,11 + ,37 + ,34 + ,12 + ,10 + ,12 + ,76 + ,47 + ,37 + ,32 + ,18 + ,13 + ,10 + ,86 + ,53 + ,33 + ,40 + ,14 + ,13 + ,14 + ,54 + ,33 + ,34 + ,40 + ,14 + ,8 + ,13 + ,70 + ,44 + ,33 + ,35 + ,13 + ,11 + ,9 + ,69 + ,42 + ,38 + ,36 + ,16 + ,12 + ,15 + ,90 + ,55 + ,33 + ,37 + ,13 + ,11 + ,15 + ,54 + ,33 + ,31 + ,27 + ,16 + ,13 + ,14 + ,76 + ,46 + ,38 + ,39 + ,13 + ,12 + ,11 + ,89 + ,54 + ,37 + ,38 + ,16 + ,14 + ,8 + ,76 + ,47 + ,33 + ,31 + ,15 + ,13 + ,11 + ,73 + ,45 + ,31 + ,33 + ,16 + ,15 + ,11 + ,79 + ,47 + ,39 + ,32 + ,15 + ,10 + ,8 + ,90 + ,55 + ,44 + ,39 + ,17 + ,11 + ,10 + ,74 + ,44 + ,33 + ,36 + ,15 + ,9 + ,11 + ,81 + ,53 + ,35 + ,33 + ,12 + ,11 + ,13 + ,72 + ,44 + ,32 + ,33 + ,16 + ,10 + ,11 + ,71 + ,42 + ,28 + ,32 + ,10 + ,11 + ,20 + ,66 + ,40 + ,40 + ,37 + ,16 + ,8 + ,10 + ,77 + ,46 + ,27 + ,30 + ,12 + ,11 + ,15 + ,65 + ,40 + ,37 + ,38 + ,14 + ,12 + ,12 + ,74 + ,46 + ,32 + ,29 + ,15 + ,12 + ,14 + ,82 + ,53 + ,28 + ,22 + ,13 + ,9 + ,23 + ,54 + ,33 + ,34 + ,35 + ,15 + ,11 + ,14 + ,63 + ,42 + ,30 + ,35 + ,11 + ,10 + ,16 + ,54 + ,35 + ,35 + ,34 + ,12 + ,8 + ,11 + ,64 + ,40 + ,31 + ,35 + ,8 + ,9 + ,12 + ,69 + ,41 + ,32 + ,34 + ,16 + ,8 + ,10 + ,54 + ,33 + ,30 + ,34 + ,15 + ,9 + ,14 + ,84 + ,51 + ,30 + ,35 + ,17 + ,15 + ,12 + ,86 + ,53 + ,31 + ,23 + ,16 + ,11 + ,12 + ,77 + ,46 + ,40 + ,31 + ,10 + ,8 + ,11 + ,89 + ,55 + ,32 + ,27 + ,18 + ,13 + ,12 + ,76 + ,47 + ,36 + ,36 + ,13 + ,12 + ,13 + ,60 + ,38 + ,32 + ,31 + ,16 + ,12 + ,11 + ,75 + ,46 + ,35 + ,32 + ,13 + ,9 + ,19 + ,73 + ,46 + ,38 + ,39 + ,10 + ,7 + ,12 + ,85 + ,53 + ,42 + ,37 + ,15 + ,13 + ,17 + ,79 + ,47 + ,34 + ,38 + ,16 + ,9 + ,9 + ,71 + ,41 + ,35 + ,39 + ,16 + ,6 + ,12 + ,72 + ,44 + ,35 + ,34 + ,14 + ,8 + ,19 + ,69 + ,43 + ,33 + ,31 + ,10 + ,8 + ,18 + ,78 + ,51 + ,36 + ,32 + ,17 + ,15 + ,15 + ,54 + ,33 + ,32 + ,37 + ,13 + ,6 + ,14 + ,69 + ,43 + ,33 + ,36 + ,15 + ,9 + ,11 + ,81 + ,53 + ,34 + ,32 + ,16 + ,11 + ,9 + ,84 + ,51 + ,32 + ,35 + ,12 + ,8 + ,18 + ,84 + ,50 + ,34 + ,36 + ,13 + ,8 + ,16 + ,69 + ,46) + ,dim=c(7 + ,162) + ,dimnames=list(c('Connected' + ,'Separate' + ,'Learning' + ,'Software' + ,'Depression' + ,'Belonging' + ,'Belonging_Final') + ,1:162)) > y <- array(NA,dim=c(7,162),dimnames=list(c('Connected','Separate','Learning','Software','Depression','Belonging','Belonging_Final'),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 = '4' > par3 <- 'No Linear Trend' > par2 <- 'Do not include Seasonal Dummies' > par1 <- '4' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from 'package:base': as.Date, as.Date.numeric > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x Software Connected Separate Learning Depression Belonging Belonging_Final 1 12 41 38 13 12 53 32 2 11 39 32 16 11 86 51 3 15 30 35 19 14 66 42 4 6 31 33 15 12 67 41 5 13 34 37 14 21 76 46 6 10 35 29 13 12 78 47 7 12 39 31 19 22 53 37 8 14 34 36 15 11 80 49 9 12 36 35 14 10 74 45 10 6 37 38 15 13 76 47 11 10 38 31 16 10 79 49 12 12 36 34 16 8 54 33 13 12 38 35 16 15 67 42 14 11 39 38 16 14 54 33 15 15 33 37 17 10 87 53 16 12 32 33 15 14 58 36 17 10 36 32 15 14 75 45 18 12 38 38 20 11 88 54 19 11 39 38 18 10 64 41 20 12 32 32 16 13 57 36 21 11 32 33 16 7 66 41 22 12 31 31 16 14 68 44 23 13 39 38 19 12 54 33 24 11 37 39 16 14 56 37 25 9 39 32 17 11 86 52 26 13 41 32 17 9 80 47 27 10 36 35 16 11 76 43 28 14 33 37 15 15 69 44 29 12 33 33 16 14 78 45 30 10 34 33 14 13 67 44 31 12 31 28 15 9 80 49 32 8 27 32 12 15 54 33 33 10 37 31 14 10 71 43 34 12 34 37 16 11 84 54 35 12 34 30 14 13 74 42 36 7 32 33 7 8 71 44 37 6 29 31 10 20 63 37 38 12 36 33 14 12 71 43 39 10 29 31 16 10 76 46 40 10 35 33 16 10 69 42 41 10 37 32 16 9 74 45 42 12 34 33 14 14 75 44 43 15 38 32 20 8 54 33 44 10 35 33 14 14 52 31 45 10 38 28 14 11 69 42 46 12 37 35 11 13 68 40 47 13 38 39 14 9 65 43 48 11 33 34 15 11 75 46 49 11 36 38 16 15 74 42 50 12 38 32 14 11 75 45 51 14 32 38 16 10 72 44 52 10 32 30 14 14 67 40 53 12 32 33 12 18 63 37 54 13 34 38 16 14 62 46 55 5 32 32 9 11 63 36 56 6 37 32 14 12 76 47 57 12 39 34 16 13 74 45 58 12 29 34 16 9 67 42 59 11 37 36 15 10 73 43 60 10 35 34 16 15 70 43 61 7 30 28 12 20 53 32 62 12 38 34 16 12 77 45 63 14 34 35 16 12 77 45 64 11 31 35 14 14 52 31 65 12 34 31 16 13 54 33 66 13 35 37 17 11 80 49 67 14 36 35 18 17 66 42 68 11 30 27 18 12 73 41 69 12 39 40 12 13 63 38 70 12 35 37 16 14 69 42 71 8 38 36 10 13 67 44 72 11 31 38 14 15 54 33 73 14 34 39 18 13 81 48 74 14 38 41 18 10 69 40 75 12 34 27 16 11 84 50 76 9 39 30 17 19 80 49 77 13 37 37 16 13 70 43 78 11 34 31 16 17 69 44 79 12 28 31 13 13 77 47 80 12 37 27 16 9 54 33 81 12 33 36 16 11 79 46 82 12 37 38 20 10 30 0 83 12 35 37 16 9 71 45 84 12 37 33 15 12 73 43 85 11 32 34 15 12 72 44 86 10 33 31 16 13 77 47 87 9 38 39 14 13 75 45 88 12 33 34 16 12 69 42 89 12 29 32 16 15 54 33 90 12 33 33 15 22 70 43 91 9 31 36 12 13 73 46 92 15 36 32 17 15 54 33 93 12 35 41 16 13 77 46 94 12 32 28 15 15 82 48 95 12 29 30 13 10 80 47 96 10 39 36 16 11 80 47 97 13 37 35 16 16 69 43 98 9 35 31 16 11 78 46 99 12 37 34 16 11 81 48 100 10 32 36 14 10 76 46 101 14 38 36 16 10 76 45 102 11 37 35 16 16 73 45 103 15 36 37 20 12 85 52 104 11 32 28 15 11 66 42 105 11 33 39 16 16 79 47 106 12 40 32 13 19 68 41 107 12 38 35 17 11 76 47 108 12 41 39 16 16 71 43 109 11 36 35 16 15 54 33 110 7 43 42 12 24 46 30 111 12 30 34 16 14 82 49 112 14 31 33 16 15 74 44 113 11 32 41 17 11 88 55 114 11 32 33 13 15 38 11 115 10 37 34 12 12 76 47 116 13 37 32 18 10 86 53 117 13 33 40 14 14 54 33 118 8 34 40 14 13 70 44 119 11 33 35 13 9 69 42 120 12 38 36 16 15 90 55 121 11 33 37 13 15 54 33 122 13 31 27 16 14 76 46 123 12 38 39 13 11 89 54 124 14 37 38 16 8 76 47 125 13 33 31 15 11 73 45 126 15 31 33 16 11 79 47 127 10 39 32 15 8 90 55 128 11 44 39 17 10 74 44 129 9 33 36 15 11 81 53 130 11 35 33 12 13 72 44 131 10 32 33 16 11 71 42 132 11 28 32 10 20 66 40 133 8 40 37 16 10 77 46 134 11 27 30 12 15 65 40 135 12 37 38 14 12 74 46 136 12 32 29 15 14 82 53 137 9 28 22 13 23 54 33 138 11 34 35 15 14 63 42 139 10 30 35 11 16 54 35 140 8 35 34 12 11 64 40 141 9 31 35 8 12 69 41 142 8 32 34 16 10 54 33 143 9 30 34 15 14 84 51 144 15 30 35 17 12 86 53 145 11 31 23 16 12 77 46 146 8 40 31 10 11 89 55 147 13 32 27 18 12 76 47 148 12 36 36 13 13 60 38 149 12 32 31 16 11 75 46 150 9 35 32 13 19 73 46 151 7 38 39 10 12 85 53 152 13 42 37 15 17 79 47 153 9 34 38 16 9 71 41 154 6 35 39 16 12 72 44 155 8 35 34 14 19 69 43 156 8 33 31 10 18 78 51 157 15 36 32 17 15 54 33 158 6 32 37 13 14 69 43 159 9 33 36 15 11 81 53 160 11 34 32 16 9 84 51 161 8 32 35 12 18 84 50 162 8 34 36 13 16 69 46 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Connected Separate Learning 4.004067 -0.048300 0.030672 0.526837 Depression Belonging Belonging_Final -0.008181 0.001537 -0.004676 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -5.7459 -0.9337 0.2131 1.3610 3.2400 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 4.004067 2.391114 1.675 0.096 . Connected -0.048300 0.046880 -1.030 0.304 Separate 0.030672 0.043735 0.701 0.484 Learning 0.526837 0.066941 7.870 5.7e-13 *** Depression -0.008181 0.049081 -0.167 0.868 Belonging 0.001537 0.043720 0.035 0.972 Belonging_Final -0.004676 0.063046 -0.074 0.941 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1.822 on 155 degrees of freedom Multiple R-squared: 0.3032, Adjusted R-squared: 0.2762 F-statistic: 11.24 on 6 and 155 DF, p-value: 2.106e-10 > 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.999928518 0.0001429645 7.148224e-05 [2,] 0.999783017 0.0004339661 2.169830e-04 [3,] 0.999427269 0.0011454616 5.727308e-04 [4,] 0.998675784 0.0026484323 1.324216e-03 [5,] 0.997976372 0.0040472564 2.023628e-03 [6,] 0.998060737 0.0038785260 1.939263e-03 [7,] 0.996721382 0.0065572365 3.278618e-03 [8,] 0.994718897 0.0105622053 5.281103e-03 [9,] 0.993650429 0.0126991425 6.349571e-03 [10,] 0.990420382 0.0191592365 9.579618e-03 [11,] 0.984529434 0.0309411330 1.547057e-02 [12,] 0.976056018 0.0478879647 2.394398e-02 [13,] 0.965150130 0.0696997395 3.484987e-02 [14,] 0.949082235 0.1018355307 5.091777e-02 [15,] 0.929337715 0.1413245708 7.066229e-02 [16,] 0.930182474 0.1396350524 6.981753e-02 [17,] 0.929344180 0.1413116406 7.065582e-02 [18,] 0.930902468 0.1381950643 6.909753e-02 [19,] 0.939300157 0.1213996866 6.069984e-02 [20,] 0.918006106 0.1639877885 8.199389e-02 [21,] 0.894222758 0.2115544833 1.057772e-01 [22,] 0.875523737 0.2489525259 1.244763e-01 [23,] 0.895320832 0.2093583368 1.046792e-01 [24,] 0.866065220 0.2678695599 1.339348e-01 [25,] 0.831461293 0.3370774136 1.685387e-01 [26,] 0.817445928 0.3651081436 1.825541e-01 [27,] 0.778012939 0.4439741229 2.219871e-01 [28,] 0.823426308 0.3531473837 1.765737e-01 [29,] 0.814219948 0.3715601035 1.857801e-01 [30,] 0.803880566 0.3922388679 1.961194e-01 [31,] 0.785166386 0.4296672276 2.148336e-01 [32,] 0.760587457 0.4788250861 2.394125e-01 [33,] 0.744132226 0.5117355474 2.558678e-01 [34,] 0.743250023 0.5134999532 2.567500e-01 [35,] 0.700864824 0.5982703530 2.991352e-01 [36,] 0.654801453 0.6903970930 3.451985e-01 [37,] 0.719392741 0.5612145187 2.806073e-01 [38,] 0.730469156 0.5390616880 2.695308e-01 [39,] 0.686159849 0.6276803012 3.138402e-01 [40,] 0.648910142 0.7021797167 3.510899e-01 [41,] 0.636319895 0.7273602094 3.636801e-01 [42,] 0.641075896 0.7178482070 3.589241e-01 [43,] 0.594589848 0.8108203042 4.054102e-01 [44,] 0.623310628 0.7533787449 3.766894e-01 [45,] 0.590441866 0.8191162688 4.095581e-01 [46,] 0.678571733 0.6428565337 3.214283e-01 [47,] 0.842584875 0.3148302492 1.574151e-01 [48,] 0.814686945 0.3706261100 1.853131e-01 [49,] 0.780543922 0.4389121560 2.194561e-01 [50,] 0.743380172 0.5132396562 2.566198e-01 [51,] 0.730455526 0.5390889489 2.695445e-01 [52,] 0.744471088 0.5110578232 2.555289e-01 [53,] 0.708002182 0.5839956358 2.919978e-01 [54,] 0.727660100 0.5446797994 2.723399e-01 [55,] 0.686900706 0.6261985876 3.130993e-01 [56,] 0.651447538 0.6971049239 3.485525e-01 [57,] 0.612754444 0.7744911126 3.872456e-01 [58,] 0.595535069 0.8089298617 4.044649e-01 [59,] 0.577478880 0.8450422410 4.225211e-01 [60,] 0.593810722 0.8123785557 4.061893e-01 [61,] 0.549657013 0.9006859748 4.503430e-01 [62,] 0.508395310 0.9832093810 4.916047e-01 [63,] 0.464781956 0.9295639125 5.352180e-01 [64,] 0.434661932 0.8693238645 5.653381e-01 [65,] 0.411724662 0.8234493242 5.882753e-01 [66,] 0.386552490 0.7731049791 6.134475e-01 [67,] 0.436809648 0.8736192957 5.631904e-01 [68,] 0.417559816 0.8351196314 5.824402e-01 [69,] 0.377102599 0.7542051977 6.228974e-01 [70,] 0.379005514 0.7580110275 6.209945e-01 [71,] 0.356230395 0.7124607905 6.437696e-01 [72,] 0.315738344 0.6314766883 6.842617e-01 [73,] 0.328954713 0.6579094251 6.710453e-01 [74,] 0.294029409 0.5880588171 7.059706e-01 [75,] 0.266399108 0.5327982157 7.336009e-01 [76,] 0.230189047 0.4603780944 7.698110e-01 [77,] 0.222289527 0.4445790539 7.777105e-01 [78,] 0.222903500 0.4458070006 7.770965e-01 [79,] 0.190515244 0.3810304871 8.094848e-01 [80,] 0.161648157 0.3232963140 8.383518e-01 [81,] 0.142859490 0.2857189800 8.571405e-01 [82,] 0.123835776 0.2476715520 8.761642e-01 [83,] 0.173889300 0.3477786001 8.261107e-01 [84,] 0.149476989 0.2989539780 8.505230e-01 [85,] 0.133958215 0.2679164298 8.660418e-01 [86,] 0.130862512 0.2617250240 8.691375e-01 [87,] 0.124934114 0.2498682289 8.750659e-01 [88,] 0.118107148 0.2362142955 8.818929e-01 [89,] 0.148147088 0.2962941769 8.518529e-01 [90,] 0.123285746 0.2465714924 8.767143e-01 [91,] 0.104838453 0.2096769064 8.951615e-01 [92,] 0.120136683 0.2402733659 8.798633e-01 [93,] 0.099257225 0.1985144499 9.007428e-01 [94,] 0.092443083 0.1848861662 9.075569e-01 [95,] 0.074417442 0.1488348838 9.255826e-01 [96,] 0.061869153 0.1237383062 9.381308e-01 [97,] 0.067454346 0.1349086919 9.325457e-01 [98,] 0.053313422 0.1066268442 9.466866e-01 [99,] 0.044541719 0.0890834381 9.554583e-01 [100,] 0.034694823 0.0693896457 9.653052e-01 [101,] 0.035908878 0.0718177560 9.640911e-01 [102,] 0.027314142 0.0546282838 9.726859e-01 [103,] 0.031997163 0.0639943259 9.680028e-01 [104,] 0.028172657 0.0563453145 9.718273e-01 [105,] 0.023130764 0.0462615276 9.768692e-01 [106,] 0.017382845 0.0347656908 9.826172e-01 [107,] 0.013229096 0.0264581921 9.867709e-01 [108,] 0.017882095 0.0357641904 9.821179e-01 [109,] 0.020655702 0.0413114045 9.793443e-01 [110,] 0.016124431 0.0322488628 9.838756e-01 [111,] 0.012330384 0.0246607689 9.876696e-01 [112,] 0.010011072 0.0200221447 9.899889e-01 [113,] 0.008222648 0.0164452960 9.917774e-01 [114,] 0.009737295 0.0194745905 9.902627e-01 [115,] 0.017254588 0.0345091760 9.827454e-01 [116,] 0.018289302 0.0365786037 9.817107e-01 [117,] 0.047964204 0.0959284075 9.520358e-01 [118,] 0.036605121 0.0732102422 9.633949e-01 [119,] 0.027667236 0.0553344721 9.723328e-01 [120,] 0.024338989 0.0486779781 9.756610e-01 [121,] 0.022261096 0.0445221930 9.777389e-01 [122,] 0.017494293 0.0349885862 9.825057e-01 [123,] 0.021755108 0.0435102160 9.782449e-01 [124,] 0.033464815 0.0669296292 9.665352e-01 [125,] 0.034862955 0.0697259108 9.651370e-01 [126,] 0.037126686 0.0742533719 9.628733e-01 [127,] 0.029666868 0.0593337353 9.703331e-01 [128,] 0.028352294 0.0567045874 9.716477e-01 [129,] 0.020920738 0.0418414754 9.790793e-01 [130,] 0.021808743 0.0436174861 9.781913e-01 [131,] 0.015640367 0.0312807338 9.843596e-01 [132,] 0.049490999 0.0989819976 9.505090e-01 [133,] 0.053669841 0.1073396826 9.463302e-01 [134,] 0.039695700 0.0793914008 9.603043e-01 [135,] 0.356443129 0.7128862590 6.435569e-01 [136,] 0.362051589 0.7241031777 6.379484e-01 [137,] 0.636151057 0.7276978870 3.638489e-01 [138,] 0.560504974 0.8789900529 4.394950e-01 [139,] 0.583618719 0.8327625611 4.163813e-01 [140,] 0.477550512 0.9551010236 5.224495e-01 [141,] 0.429632752 0.8592655040 5.703672e-01 [142,] 0.301969815 0.6039396297 6.980302e-01 [143,] 0.426203569 0.8524071376 5.737964e-01 > postscript(file="/var/wessaorg/rcomp/tmp/1deaf1351697518.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') > points(x[,1]-mysum$resid) > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/2d2ve1351697518.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/3vxdv1351697518.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/4z5zx1351697518.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/52qt41351697518.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 2.128174991 -0.334949791 1.571019668 -5.234565342 2.397660049 0.146146914 7 8 9 10 11 12 -0.809551017 2.827569023 1.464012007 -5.075719092 -1.359353020 0.399270303 13 14 15 16 17 18 0.544571389 -0.529433188 2.694690749 0.820546076 -0.939622647 -1.663671787 19 20 21 22 23 24 -1.593787337 0.317737471 -0.752469238 0.328795678 -0.126304512 -0.641072841 25 26 27 28 29 30 -2.857109990 1.208967360 -1.593906892 2.774844398 0.353358956 -0.540619552 31 32 33 34 35 36 0.911683208 -1.809471905 -0.369742812 0.287294918 1.531285130 0.003585483 37 38 39 40 41 42 -2.582749838 1.536975251 -1.803469337 -1.582961860 -1.457526542 1.455266153 43 44 45 46 47 48 1.449867265 -0.521878650 -0.222849225 3.103203299 2.434222423 -0.165731684 49 50 51 52 53 54 -0.654801974 1.659271075 2.123521558 -0.555728155 2.430770935 1.277565865 55 56 57 58 59 60 -3.019989371 -4.373032018 0.610452384 0.091460681 -0.053012568 -1.569590286 61 62 63 64 65 66 -2.504120635 0.549361174 2.325490255 0.223578550 0.435590389 0.791523742 67 68 69 70 71 72 1.412197181 -1.688564870 2.517938503 0.327073785 -0.332089838 0.146022687 73 74 75 76 77 78 1.165191960 1.253536451 0.575308209 -2.735127714 1.418632006 -0.503299552 79 80 81 82 83 84 1.756422514 0.670454022 0.239940430 -1.883537470 0.297125191 1.055364659 85 86 87 88 89 90 -0.210592753 -1.582588428 -1.539070507 0.306128324 0.179781295 0.948584202 91 92 93 94 95 96 -0.723729869 2.991043032 0.202615901 1.001317570 1.806241119 -1.467121519 97 98 99 100 101 102 1.506055030 -2.508563760 0.500762218 -0.758256304 2.473192713 -0.490739754 103 104 105 106 107 108 1.273839265 -0.034873704 -0.806494871 2.340206194 -0.005438433 0.573492772 109 110 111 112 113 114 -0.574136032 -2.271501485 0.190345773 2.266411393 -1.460299868 0.796228249 115 116 117 118 119 120 0.619297380 0.515949498 2.173097652 -2.759933377 0.831423806 0.539344071 121 122 123 124 125 126 0.800130667 1.448540875 1.991975504 2.356540367 1.924681351 3.240032934 127 128 129 130 131 132 -0.820097612 -0.857463560 -2.203562103 1.553668938 -1.722754118 2.347697004 133 134 135 136 137 138 -3.457740155 1.267700771 1.441334088 0.985846796 -0.915843577 -0.123824317 139 140 141 142 143 144 0.787781862 -1.499774960 1.388873183 -3.777567150 -2.276538660 2.629033703 145 146 147 148 149 150 -0.446670072 -0.080863809 0.431482270 1.973500826 0.351147619 -0.885595133 151 152 153 154 155 156 -1.417862800 2.224564098 -2.800551969 -5.745889460 -2.481657071 -0.363496355 157 158 159 160 161 162 2.991043032 -4.232639374 -2.203562103 -0.589736401 -1.602054493 -2.074977250 > postscript(file="/var/wessaorg/rcomp/tmp/6l1101351697518.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 2.128174991 NA 1 -0.334949791 2.128174991 2 1.571019668 -0.334949791 3 -5.234565342 1.571019668 4 2.397660049 -5.234565342 5 0.146146914 2.397660049 6 -0.809551017 0.146146914 7 2.827569023 -0.809551017 8 1.464012007 2.827569023 9 -5.075719092 1.464012007 10 -1.359353020 -5.075719092 11 0.399270303 -1.359353020 12 0.544571389 0.399270303 13 -0.529433188 0.544571389 14 2.694690749 -0.529433188 15 0.820546076 2.694690749 16 -0.939622647 0.820546076 17 -1.663671787 -0.939622647 18 -1.593787337 -1.663671787 19 0.317737471 -1.593787337 20 -0.752469238 0.317737471 21 0.328795678 -0.752469238 22 -0.126304512 0.328795678 23 -0.641072841 -0.126304512 24 -2.857109990 -0.641072841 25 1.208967360 -2.857109990 26 -1.593906892 1.208967360 27 2.774844398 -1.593906892 28 0.353358956 2.774844398 29 -0.540619552 0.353358956 30 0.911683208 -0.540619552 31 -1.809471905 0.911683208 32 -0.369742812 -1.809471905 33 0.287294918 -0.369742812 34 1.531285130 0.287294918 35 0.003585483 1.531285130 36 -2.582749838 0.003585483 37 1.536975251 -2.582749838 38 -1.803469337 1.536975251 39 -1.582961860 -1.803469337 40 -1.457526542 -1.582961860 41 1.455266153 -1.457526542 42 1.449867265 1.455266153 43 -0.521878650 1.449867265 44 -0.222849225 -0.521878650 45 3.103203299 -0.222849225 46 2.434222423 3.103203299 47 -0.165731684 2.434222423 48 -0.654801974 -0.165731684 49 1.659271075 -0.654801974 50 2.123521558 1.659271075 51 -0.555728155 2.123521558 52 2.430770935 -0.555728155 53 1.277565865 2.430770935 54 -3.019989371 1.277565865 55 -4.373032018 -3.019989371 56 0.610452384 -4.373032018 57 0.091460681 0.610452384 58 -0.053012568 0.091460681 59 -1.569590286 -0.053012568 60 -2.504120635 -1.569590286 61 0.549361174 -2.504120635 62 2.325490255 0.549361174 63 0.223578550 2.325490255 64 0.435590389 0.223578550 65 0.791523742 0.435590389 66 1.412197181 0.791523742 67 -1.688564870 1.412197181 68 2.517938503 -1.688564870 69 0.327073785 2.517938503 70 -0.332089838 0.327073785 71 0.146022687 -0.332089838 72 1.165191960 0.146022687 73 1.253536451 1.165191960 74 0.575308209 1.253536451 75 -2.735127714 0.575308209 76 1.418632006 -2.735127714 77 -0.503299552 1.418632006 78 1.756422514 -0.503299552 79 0.670454022 1.756422514 80 0.239940430 0.670454022 81 -1.883537470 0.239940430 82 0.297125191 -1.883537470 83 1.055364659 0.297125191 84 -0.210592753 1.055364659 85 -1.582588428 -0.210592753 86 -1.539070507 -1.582588428 87 0.306128324 -1.539070507 88 0.179781295 0.306128324 89 0.948584202 0.179781295 90 -0.723729869 0.948584202 91 2.991043032 -0.723729869 92 0.202615901 2.991043032 93 1.001317570 0.202615901 94 1.806241119 1.001317570 95 -1.467121519 1.806241119 96 1.506055030 -1.467121519 97 -2.508563760 1.506055030 98 0.500762218 -2.508563760 99 -0.758256304 0.500762218 100 2.473192713 -0.758256304 101 -0.490739754 2.473192713 102 1.273839265 -0.490739754 103 -0.034873704 1.273839265 104 -0.806494871 -0.034873704 105 2.340206194 -0.806494871 106 -0.005438433 2.340206194 107 0.573492772 -0.005438433 108 -0.574136032 0.573492772 109 -2.271501485 -0.574136032 110 0.190345773 -2.271501485 111 2.266411393 0.190345773 112 -1.460299868 2.266411393 113 0.796228249 -1.460299868 114 0.619297380 0.796228249 115 0.515949498 0.619297380 116 2.173097652 0.515949498 117 -2.759933377 2.173097652 118 0.831423806 -2.759933377 119 0.539344071 0.831423806 120 0.800130667 0.539344071 121 1.448540875 0.800130667 122 1.991975504 1.448540875 123 2.356540367 1.991975504 124 1.924681351 2.356540367 125 3.240032934 1.924681351 126 -0.820097612 3.240032934 127 -0.857463560 -0.820097612 128 -2.203562103 -0.857463560 129 1.553668938 -2.203562103 130 -1.722754118 1.553668938 131 2.347697004 -1.722754118 132 -3.457740155 2.347697004 133 1.267700771 -3.457740155 134 1.441334088 1.267700771 135 0.985846796 1.441334088 136 -0.915843577 0.985846796 137 -0.123824317 -0.915843577 138 0.787781862 -0.123824317 139 -1.499774960 0.787781862 140 1.388873183 -1.499774960 141 -3.777567150 1.388873183 142 -2.276538660 -3.777567150 143 2.629033703 -2.276538660 144 -0.446670072 2.629033703 145 -0.080863809 -0.446670072 146 0.431482270 -0.080863809 147 1.973500826 0.431482270 148 0.351147619 1.973500826 149 -0.885595133 0.351147619 150 -1.417862800 -0.885595133 151 2.224564098 -1.417862800 152 -2.800551969 2.224564098 153 -5.745889460 -2.800551969 154 -2.481657071 -5.745889460 155 -0.363496355 -2.481657071 156 2.991043032 -0.363496355 157 -4.232639374 2.991043032 158 -2.203562103 -4.232639374 159 -0.589736401 -2.203562103 160 -1.602054493 -0.589736401 161 -2.074977250 -1.602054493 162 NA -2.074977250 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -0.334949791 2.128174991 [2,] 1.571019668 -0.334949791 [3,] -5.234565342 1.571019668 [4,] 2.397660049 -5.234565342 [5,] 0.146146914 2.397660049 [6,] -0.809551017 0.146146914 [7,] 2.827569023 -0.809551017 [8,] 1.464012007 2.827569023 [9,] -5.075719092 1.464012007 [10,] -1.359353020 -5.075719092 [11,] 0.399270303 -1.359353020 [12,] 0.544571389 0.399270303 [13,] -0.529433188 0.544571389 [14,] 2.694690749 -0.529433188 [15,] 0.820546076 2.694690749 [16,] -0.939622647 0.820546076 [17,] -1.663671787 -0.939622647 [18,] -1.593787337 -1.663671787 [19,] 0.317737471 -1.593787337 [20,] -0.752469238 0.317737471 [21,] 0.328795678 -0.752469238 [22,] -0.126304512 0.328795678 [23,] -0.641072841 -0.126304512 [24,] -2.857109990 -0.641072841 [25,] 1.208967360 -2.857109990 [26,] -1.593906892 1.208967360 [27,] 2.774844398 -1.593906892 [28,] 0.353358956 2.774844398 [29,] -0.540619552 0.353358956 [30,] 0.911683208 -0.540619552 [31,] -1.809471905 0.911683208 [32,] -0.369742812 -1.809471905 [33,] 0.287294918 -0.369742812 [34,] 1.531285130 0.287294918 [35,] 0.003585483 1.531285130 [36,] -2.582749838 0.003585483 [37,] 1.536975251 -2.582749838 [38,] -1.803469337 1.536975251 [39,] -1.582961860 -1.803469337 [40,] -1.457526542 -1.582961860 [41,] 1.455266153 -1.457526542 [42,] 1.449867265 1.455266153 [43,] -0.521878650 1.449867265 [44,] -0.222849225 -0.521878650 [45,] 3.103203299 -0.222849225 [46,] 2.434222423 3.103203299 [47,] -0.165731684 2.434222423 [48,] -0.654801974 -0.165731684 [49,] 1.659271075 -0.654801974 [50,] 2.123521558 1.659271075 [51,] -0.555728155 2.123521558 [52,] 2.430770935 -0.555728155 [53,] 1.277565865 2.430770935 [54,] -3.019989371 1.277565865 [55,] -4.373032018 -3.019989371 [56,] 0.610452384 -4.373032018 [57,] 0.091460681 0.610452384 [58,] -0.053012568 0.091460681 [59,] -1.569590286 -0.053012568 [60,] -2.504120635 -1.569590286 [61,] 0.549361174 -2.504120635 [62,] 2.325490255 0.549361174 [63,] 0.223578550 2.325490255 [64,] 0.435590389 0.223578550 [65,] 0.791523742 0.435590389 [66,] 1.412197181 0.791523742 [67,] -1.688564870 1.412197181 [68,] 2.517938503 -1.688564870 [69,] 0.327073785 2.517938503 [70,] -0.332089838 0.327073785 [71,] 0.146022687 -0.332089838 [72,] 1.165191960 0.146022687 [73,] 1.253536451 1.165191960 [74,] 0.575308209 1.253536451 [75,] -2.735127714 0.575308209 [76,] 1.418632006 -2.735127714 [77,] -0.503299552 1.418632006 [78,] 1.756422514 -0.503299552 [79,] 0.670454022 1.756422514 [80,] 0.239940430 0.670454022 [81,] -1.883537470 0.239940430 [82,] 0.297125191 -1.883537470 [83,] 1.055364659 0.297125191 [84,] -0.210592753 1.055364659 [85,] -1.582588428 -0.210592753 [86,] -1.539070507 -1.582588428 [87,] 0.306128324 -1.539070507 [88,] 0.179781295 0.306128324 [89,] 0.948584202 0.179781295 [90,] -0.723729869 0.948584202 [91,] 2.991043032 -0.723729869 [92,] 0.202615901 2.991043032 [93,] 1.001317570 0.202615901 [94,] 1.806241119 1.001317570 [95,] -1.467121519 1.806241119 [96,] 1.506055030 -1.467121519 [97,] -2.508563760 1.506055030 [98,] 0.500762218 -2.508563760 [99,] -0.758256304 0.500762218 [100,] 2.473192713 -0.758256304 [101,] -0.490739754 2.473192713 [102,] 1.273839265 -0.490739754 [103,] -0.034873704 1.273839265 [104,] -0.806494871 -0.034873704 [105,] 2.340206194 -0.806494871 [106,] -0.005438433 2.340206194 [107,] 0.573492772 -0.005438433 [108,] -0.574136032 0.573492772 [109,] -2.271501485 -0.574136032 [110,] 0.190345773 -2.271501485 [111,] 2.266411393 0.190345773 [112,] -1.460299868 2.266411393 [113,] 0.796228249 -1.460299868 [114,] 0.619297380 0.796228249 [115,] 0.515949498 0.619297380 [116,] 2.173097652 0.515949498 [117,] -2.759933377 2.173097652 [118,] 0.831423806 -2.759933377 [119,] 0.539344071 0.831423806 [120,] 0.800130667 0.539344071 [121,] 1.448540875 0.800130667 [122,] 1.991975504 1.448540875 [123,] 2.356540367 1.991975504 [124,] 1.924681351 2.356540367 [125,] 3.240032934 1.924681351 [126,] -0.820097612 3.240032934 [127,] -0.857463560 -0.820097612 [128,] -2.203562103 -0.857463560 [129,] 1.553668938 -2.203562103 [130,] -1.722754118 1.553668938 [131,] 2.347697004 -1.722754118 [132,] -3.457740155 2.347697004 [133,] 1.267700771 -3.457740155 [134,] 1.441334088 1.267700771 [135,] 0.985846796 1.441334088 [136,] -0.915843577 0.985846796 [137,] -0.123824317 -0.915843577 [138,] 0.787781862 -0.123824317 [139,] -1.499774960 0.787781862 [140,] 1.388873183 -1.499774960 [141,] -3.777567150 1.388873183 [142,] -2.276538660 -3.777567150 [143,] 2.629033703 -2.276538660 [144,] -0.446670072 2.629033703 [145,] -0.080863809 -0.446670072 [146,] 0.431482270 -0.080863809 [147,] 1.973500826 0.431482270 [148,] 0.351147619 1.973500826 [149,] -0.885595133 0.351147619 [150,] -1.417862800 -0.885595133 [151,] 2.224564098 -1.417862800 [152,] -2.800551969 2.224564098 [153,] -5.745889460 -2.800551969 [154,] -2.481657071 -5.745889460 [155,] -0.363496355 -2.481657071 [156,] 2.991043032 -0.363496355 [157,] -4.232639374 2.991043032 [158,] -2.203562103 -4.232639374 [159,] -0.589736401 -2.203562103 [160,] -1.602054493 -0.589736401 [161,] -2.074977250 -1.602054493 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -0.334949791 2.128174991 2 1.571019668 -0.334949791 3 -5.234565342 1.571019668 4 2.397660049 -5.234565342 5 0.146146914 2.397660049 6 -0.809551017 0.146146914 7 2.827569023 -0.809551017 8 1.464012007 2.827569023 9 -5.075719092 1.464012007 10 -1.359353020 -5.075719092 11 0.399270303 -1.359353020 12 0.544571389 0.399270303 13 -0.529433188 0.544571389 14 2.694690749 -0.529433188 15 0.820546076 2.694690749 16 -0.939622647 0.820546076 17 -1.663671787 -0.939622647 18 -1.593787337 -1.663671787 19 0.317737471 -1.593787337 20 -0.752469238 0.317737471 21 0.328795678 -0.752469238 22 -0.126304512 0.328795678 23 -0.641072841 -0.126304512 24 -2.857109990 -0.641072841 25 1.208967360 -2.857109990 26 -1.593906892 1.208967360 27 2.774844398 -1.593906892 28 0.353358956 2.774844398 29 -0.540619552 0.353358956 30 0.911683208 -0.540619552 31 -1.809471905 0.911683208 32 -0.369742812 -1.809471905 33 0.287294918 -0.369742812 34 1.531285130 0.287294918 35 0.003585483 1.531285130 36 -2.582749838 0.003585483 37 1.536975251 -2.582749838 38 -1.803469337 1.536975251 39 -1.582961860 -1.803469337 40 -1.457526542 -1.582961860 41 1.455266153 -1.457526542 42 1.449867265 1.455266153 43 -0.521878650 1.449867265 44 -0.222849225 -0.521878650 45 3.103203299 -0.222849225 46 2.434222423 3.103203299 47 -0.165731684 2.434222423 48 -0.654801974 -0.165731684 49 1.659271075 -0.654801974 50 2.123521558 1.659271075 51 -0.555728155 2.123521558 52 2.430770935 -0.555728155 53 1.277565865 2.430770935 54 -3.019989371 1.277565865 55 -4.373032018 -3.019989371 56 0.610452384 -4.373032018 57 0.091460681 0.610452384 58 -0.053012568 0.091460681 59 -1.569590286 -0.053012568 60 -2.504120635 -1.569590286 61 0.549361174 -2.504120635 62 2.325490255 0.549361174 63 0.223578550 2.325490255 64 0.435590389 0.223578550 65 0.791523742 0.435590389 66 1.412197181 0.791523742 67 -1.688564870 1.412197181 68 2.517938503 -1.688564870 69 0.327073785 2.517938503 70 -0.332089838 0.327073785 71 0.146022687 -0.332089838 72 1.165191960 0.146022687 73 1.253536451 1.165191960 74 0.575308209 1.253536451 75 -2.735127714 0.575308209 76 1.418632006 -2.735127714 77 -0.503299552 1.418632006 78 1.756422514 -0.503299552 79 0.670454022 1.756422514 80 0.239940430 0.670454022 81 -1.883537470 0.239940430 82 0.297125191 -1.883537470 83 1.055364659 0.297125191 84 -0.210592753 1.055364659 85 -1.582588428 -0.210592753 86 -1.539070507 -1.582588428 87 0.306128324 -1.539070507 88 0.179781295 0.306128324 89 0.948584202 0.179781295 90 -0.723729869 0.948584202 91 2.991043032 -0.723729869 92 0.202615901 2.991043032 93 1.001317570 0.202615901 94 1.806241119 1.001317570 95 -1.467121519 1.806241119 96 1.506055030 -1.467121519 97 -2.508563760 1.506055030 98 0.500762218 -2.508563760 99 -0.758256304 0.500762218 100 2.473192713 -0.758256304 101 -0.490739754 2.473192713 102 1.273839265 -0.490739754 103 -0.034873704 1.273839265 104 -0.806494871 -0.034873704 105 2.340206194 -0.806494871 106 -0.005438433 2.340206194 107 0.573492772 -0.005438433 108 -0.574136032 0.573492772 109 -2.271501485 -0.574136032 110 0.190345773 -2.271501485 111 2.266411393 0.190345773 112 -1.460299868 2.266411393 113 0.796228249 -1.460299868 114 0.619297380 0.796228249 115 0.515949498 0.619297380 116 2.173097652 0.515949498 117 -2.759933377 2.173097652 118 0.831423806 -2.759933377 119 0.539344071 0.831423806 120 0.800130667 0.539344071 121 1.448540875 0.800130667 122 1.991975504 1.448540875 123 2.356540367 1.991975504 124 1.924681351 2.356540367 125 3.240032934 1.924681351 126 -0.820097612 3.240032934 127 -0.857463560 -0.820097612 128 -2.203562103 -0.857463560 129 1.553668938 -2.203562103 130 -1.722754118 1.553668938 131 2.347697004 -1.722754118 132 -3.457740155 2.347697004 133 1.267700771 -3.457740155 134 1.441334088 1.267700771 135 0.985846796 1.441334088 136 -0.915843577 0.985846796 137 -0.123824317 -0.915843577 138 0.787781862 -0.123824317 139 -1.499774960 0.787781862 140 1.388873183 -1.499774960 141 -3.777567150 1.388873183 142 -2.276538660 -3.777567150 143 2.629033703 -2.276538660 144 -0.446670072 2.629033703 145 -0.080863809 -0.446670072 146 0.431482270 -0.080863809 147 1.973500826 0.431482270 148 0.351147619 1.973500826 149 -0.885595133 0.351147619 150 -1.417862800 -0.885595133 151 2.224564098 -1.417862800 152 -2.800551969 2.224564098 153 -5.745889460 -2.800551969 154 -2.481657071 -5.745889460 155 -0.363496355 -2.481657071 156 2.991043032 -0.363496355 157 -4.232639374 2.991043032 158 -2.203562103 -4.232639374 159 -0.589736401 -2.203562103 160 -1.602054493 -0.589736401 161 -2.074977250 -1.602054493 > plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals') > lines(lowess(z)) > abline(lm(z)) > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/77clb1351697518.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/86az31351697518.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/9249b1351697518.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/wessaorg/rcomp/tmp/10gokd1351697518.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) > a<-table.row.end(a) > myeq <- colnames(x)[1] > myeq <- paste(myeq, '[t] = ', sep='') > for (i in 1:k){ + if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') + myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ') + if (rownames(mysum$coefficients)[i] != '(Intercept)') { + myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') + if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') + } + } > myeq <- paste(myeq, ' + e[t]') > a<-table.row.start(a) > a<-table.element(a, myeq) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/11wgw71351697518.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Variable',header=TRUE) > a<-table.element(a,'Parameter',header=TRUE) > a<-table.element(a,'S.D.',header=TRUE) > a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE) > a<-table.element(a,'2-tail p-value',header=TRUE) > a<-table.element(a,'1-tail p-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:k){ + a<-table.row.start(a) + a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE) + a<-table.element(a,mysum$coefficients[i,1]) + a<-table.element(a, round(mysum$coefficients[i,2],6)) + a<-table.element(a, round(mysum$coefficients[i,3],4)) + a<-table.element(a, round(mysum$coefficients[i,4],6)) + a<-table.element(a, round(mysum$coefficients[i,4]/2,6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/1261t81351697518.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple R',1,TRUE) > a<-table.element(a, sqrt(mysum$r.squared)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'R-squared',1,TRUE) > a<-table.element(a, mysum$r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Adjusted R-squared',1,TRUE) > a<-table.element(a, mysum$adj.r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (value)',1,TRUE) > a<-table.element(a, mysum$fstatistic[1]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'p-value',1,TRUE) > a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3])) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Residual Standard Deviation',1,TRUE) > a<-table.element(a, mysum$sigma) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Sum Squared Residuals',1,TRUE) > a<-table.element(a, sum(myerror*myerror)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/13z9pq1351697518.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Time or Index', 1, TRUE) > a<-table.element(a, 'Actuals', 1, TRUE) > a<-table.element(a, 'Interpolation
Forecast', 1, TRUE) > a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE) > a<-table.row.end(a) > for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,i, 1, TRUE) + a<-table.element(a,x[i]) + a<-table.element(a,x[i]-mysum$resid[i]) + a<-table.element(a,mysum$resid[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/14jzio1351697518.tab") > if (n > n25) { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'p-values',header=TRUE) + a<-table.element(a,'Alternative Hypothesis',3,header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'breakpoint index',header=TRUE) + a<-table.element(a,'greater',header=TRUE) + a<-table.element(a,'2-sided',header=TRUE) + a<-table.element(a,'less',header=TRUE) + a<-table.row.end(a) + for (mypoint in kp3:nmkm3) { + a<-table.row.start(a) + a<-table.element(a,mypoint,header=TRUE) + a<-table.element(a,gqarr[mypoint-kp3+1,1]) + a<-table.element(a,gqarr[mypoint-kp3+1,2]) + a<-table.element(a,gqarr[mypoint-kp3+1,3]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/wessaorg/rcomp/tmp/15i1fn1351697518.tab") + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Description',header=TRUE) + a<-table.element(a,'# significant tests',header=TRUE) + a<-table.element(a,'% significant tests',header=TRUE) + a<-table.element(a,'OK/NOK',header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'1% type I error level',header=TRUE) + a<-table.element(a,numsignificant1) + a<-table.element(a,numsignificant1/numgqtests) + if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'5% type I error level',header=TRUE) + a<-table.element(a,numsignificant5) + a<-table.element(a,numsignificant5/numgqtests) + if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'10% type I error level',header=TRUE) + a<-table.element(a,numsignificant10) + a<-table.element(a,numsignificant10/numgqtests) + if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/wessaorg/rcomp/tmp/16ml2i1351697518.tab") + } > > try(system("convert tmp/1deaf1351697518.ps tmp/1deaf1351697518.png",intern=TRUE)) character(0) > try(system("convert tmp/2d2ve1351697518.ps tmp/2d2ve1351697518.png",intern=TRUE)) character(0) > try(system("convert tmp/3vxdv1351697518.ps tmp/3vxdv1351697518.png",intern=TRUE)) character(0) > try(system("convert tmp/4z5zx1351697518.ps tmp/4z5zx1351697518.png",intern=TRUE)) character(0) > try(system("convert tmp/52qt41351697518.ps tmp/52qt41351697518.png",intern=TRUE)) character(0) > try(system("convert tmp/6l1101351697518.ps tmp/6l1101351697518.png",intern=TRUE)) character(0) > try(system("convert tmp/77clb1351697518.ps tmp/77clb1351697518.png",intern=TRUE)) character(0) > try(system("convert tmp/86az31351697518.ps tmp/86az31351697518.png",intern=TRUE)) character(0) > try(system("convert tmp/9249b1351697518.ps tmp/9249b1351697518.png",intern=TRUE)) character(0) > try(system("convert tmp/10gokd1351697518.ps tmp/10gokd1351697518.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 11.502 1.675 13.488