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 + ,14 + ,53 + ,32 + ,39 + ,32 + ,16 + ,11 + ,18 + ,86 + ,51 + ,30 + ,35 + ,19 + ,15 + ,11 + ,66 + ,42 + ,31 + ,33 + ,15 + ,6 + ,12 + ,67 + ,41 + ,34 + ,37 + ,14 + ,13 + ,16 + ,76 + ,46 + ,35 + ,29 + ,13 + ,10 + ,18 + ,78 + ,47 + ,39 + ,31 + ,19 + ,12 + ,14 + ,53 + ,37 + ,34 + ,36 + ,15 + ,14 + ,14 + ,80 + ,49 + ,36 + ,35 + ,14 + ,12 + ,15 + ,74 + ,45 + ,37 + ,38 + ,15 + ,6 + ,15 + ,76 + ,47 + ,38 + ,31 + ,16 + ,10 + ,17 + ,79 + ,49 + ,36 + ,34 + ,16 + ,12 + ,19 + ,54 + ,33 + ,38 + ,35 + ,16 + ,12 + ,10 + ,67 + ,42 + ,39 + ,38 + ,16 + ,11 + ,16 + ,54 + ,33 + ,33 + ,37 + ,17 + ,15 + ,18 + ,87 + ,53 + ,32 + ,33 + ,15 + ,12 + ,14 + ,58 + ,36 + ,36 + ,32 + ,15 + ,10 + ,14 + ,75 + ,45 + ,38 + ,38 + ,20 + ,12 + ,17 + ,88 + ,54 + ,39 + ,38 + ,18 + ,11 + ,14 + ,64 + ,41 + ,32 + ,32 + ,16 + ,12 + ,16 + ,57 + ,36 + ,32 + ,33 + ,16 + ,11 + ,18 + ,66 + ,41 + ,31 + ,31 + ,16 + ,12 + ,11 + ,68 + ,44 + ,39 + ,38 + ,19 + ,13 + ,14 + ,54 + ,33 + ,37 + ,39 + ,16 + ,11 + ,12 + ,56 + ,37 + ,39 + ,32 + ,17 + ,9 + ,17 + ,86 + ,52 + ,41 + ,32 + ,17 + ,13 + ,9 + ,80 + ,47 + ,36 + ,35 + ,16 + ,10 + ,16 + ,76 + ,43 + ,33 + ,37 + ,15 + ,14 + ,14 + ,69 + ,44 + ,33 + ,33 + ,16 + ,12 + ,15 + ,78 + ,45 + ,34 + ,33 + ,14 + ,10 + ,11 + ,67 + ,44 + ,31 + ,28 + ,15 + ,12 + ,16 + ,80 + ,49 + ,27 + ,32 + ,12 + ,8 + ,13 + ,54 + ,33 + ,37 + ,31 + ,14 + ,10 + ,17 + ,71 + ,43 + ,34 + ,37 + ,16 + ,12 + ,15 + ,84 + ,54 + ,34 + ,30 + ,14 + ,12 + ,14 + ,74 + ,42 + ,32 + ,33 + ,7 + ,7 + ,16 + ,71 + ,44 + ,29 + ,31 + ,10 + ,6 + ,9 + ,63 + ,37 + ,36 + ,33 + ,14 + ,12 + ,15 + ,71 + ,43 + ,29 + ,31 + ,16 + ,10 + ,17 + ,76 + ,46 + ,35 + ,33 + ,16 + ,10 + ,13 + ,69 + ,42 + ,37 + ,32 + ,16 + ,10 + ,15 + ,74 + ,45 + ,34 + ,33 + ,14 + ,12 + ,16 + ,75 + ,44 + ,38 + ,32 + ,20 + ,15 + ,16 + ,54 + ,33 + ,35 + ,33 + ,14 + ,10 + ,12 + ,52 + ,31 + ,38 + ,28 + ,14 + ,10 + ,12 + ,69 + ,42 + ,37 + ,35 + ,11 + ,12 + ,11 + ,68 + ,40 + ,38 + ,39 + ,14 + ,13 + ,15 + ,65 + ,43 + ,33 + ,34 + ,15 + ,11 + ,15 + ,75 + ,46 + ,36 + ,38 + ,16 + ,11 + ,17 + ,74 + ,42 + ,38 + ,32 + ,14 + ,12 + ,13 + ,75 + ,45 + ,32 + ,38 + ,16 + ,14 + ,16 + ,72 + ,44 + ,32 + ,30 + ,14 + ,10 + ,14 + ,67 + ,40 + ,32 + ,33 + ,12 + ,12 + ,11 + ,63 + ,37 + ,34 + ,38 + ,16 + ,13 + ,12 + ,62 + ,46 + ,32 + ,32 + ,9 + ,5 + ,12 + ,63 + ,36 + ,37 + ,32 + ,14 + ,6 + ,15 + ,76 + ,47 + ,39 + ,34 + ,16 + ,12 + ,16 + ,74 + ,45 + ,29 + ,34 + ,16 + ,12 + ,15 + ,67 + ,42 + ,37 + ,36 + ,15 + ,11 + ,12 + ,73 + ,43 + ,35 + ,34 + ,16 + ,10 + ,12 + ,70 + ,43 + ,30 + ,28 + ,12 + ,7 + ,8 + ,53 + ,32 + ,38 + ,34 + ,16 + ,12 + ,13 + ,77 + ,45 + ,34 + ,35 + ,16 + ,14 + ,11 + ,77 + ,45 + ,31 + ,35 + ,14 + ,11 + ,14 + ,52 + ,31 + ,34 + ,31 + ,16 + ,12 + ,15 + ,54 + ,33 + ,35 + ,37 + ,17 + ,13 + ,10 + ,80 + ,49 + ,36 + ,35 + ,18 + ,14 + ,11 + ,66 + ,42 + ,30 + ,27 + ,18 + ,11 + ,12 + ,73 + ,41 + ,39 + ,40 + ,12 + ,12 + ,15 + ,63 + ,38 + ,35 + ,37 + ,16 + ,12 + ,15 + ,69 + ,42 + ,38 + ,36 + ,10 + ,8 + ,14 + ,67 + ,44 + ,31 + ,38 + ,14 + ,11 + ,16 + ,54 + ,33 + ,34 + ,39 + ,18 + ,14 + ,15 + ,81 + ,48 + ,38 + ,41 + ,18 + ,14 + ,15 + ,69 + ,40 + ,34 + ,27 + ,16 + ,12 + ,13 + ,84 + ,50 + ,39 + ,30 + ,17 + ,9 + ,12 + ,80 + ,49 + ,37 + ,37 + ,16 + ,13 + ,17 + ,70 + ,43 + ,34 + ,31 + ,16 + ,11 + ,13 + ,69 + ,44 + ,28 + ,31 + ,13 + ,12 + ,15 + ,77 + ,47 + ,37 + ,27 + ,16 + ,12 + ,13 + ,54 + ,33 + ,33 + ,36 + ,16 + ,12 + ,15 + ,79 + ,46 + ,37 + ,38 + ,20 + ,12 + ,16 + ,30 + ,0 + ,35 + ,37 + ,16 + ,12 + ,15 + ,71 + ,45 + ,37 + ,33 + ,15 + ,12 + ,16 + ,73 + ,43 + ,32 + ,34 + ,15 + ,11 + ,15 + ,72 + ,44 + ,33 + ,31 + ,16 + ,10 + ,14 + ,77 + ,47 + ,38 + ,39 + ,14 + ,9 + ,15 + ,75 + ,45 + ,33 + ,34 + ,16 + ,12 + ,14 + ,69 + ,42 + ,29 + ,32 + ,16 + ,12 + ,13 + ,54 + ,33 + ,33 + ,33 + ,15 + ,12 + ,7 + ,70 + ,43 + ,31 + ,36 + ,12 + ,9 + ,17 + ,73 + ,46 + ,36 + ,32 + ,17 + ,15 + ,13 + ,54 + ,33 + ,35 + ,41 + ,16 + ,12 + ,15 + ,77 + ,46 + ,32 + ,28 + ,15 + ,12 + ,14 + ,82 + ,48 + ,29 + ,30 + ,13 + ,12 + ,13 + ,80 + ,47 + ,39 + ,36 + ,16 + ,10 + ,16 + ,80 + ,47 + ,37 + ,35 + ,16 + ,13 + ,12 + ,69 + ,43 + ,35 + ,31 + ,16 + ,9 + ,14 + ,78 + ,46 + ,37 + ,34 + ,16 + ,12 + ,17 + ,81 + ,48 + ,32 + ,36 + ,14 + ,10 + ,15 + ,76 + ,46 + ,38 + ,36 + ,16 + ,14 + ,17 + ,76 + ,45 + ,37 + ,35 + ,16 + ,11 + ,12 + ,73 + ,45 + ,36 + ,37 + ,20 + ,15 + ,16 + ,85 + ,52 + ,32 + ,28 + ,15 + ,11 + ,11 + ,66 + ,42 + ,33 + ,39 + ,16 + ,11 + ,15 + ,79 + ,47 + ,40 + ,32 + ,13 + ,12 + ,9 + ,68 + ,41 + ,38 + ,35 + ,17 + ,12 + ,16 + ,76 + ,47 + ,41 + ,39 + ,16 + ,12 + ,15 + ,71 + ,43 + ,36 + ,35 + ,16 + ,11 + ,10 + ,54 + ,33 + ,43 + ,42 + ,12 + ,7 + ,10 + ,46 + ,30 + ,30 + ,34 + ,16 + ,12 + ,15 + ,82 + ,49 + ,31 + ,33 + ,16 + ,14 + ,11 + ,74 + ,44 + ,32 + ,41 + ,17 + ,11 + ,13 + ,88 + ,55 + ,32 + ,33 + ,13 + ,11 + ,14 + ,38 + ,11 + ,37 + ,34 + ,12 + ,10 + ,18 + ,76 + ,47 + ,37 + ,32 + ,18 + ,13 + ,16 + ,86 + ,53 + ,33 + ,40 + ,14 + ,13 + ,14 + ,54 + ,33 + ,34 + ,40 + ,14 + ,8 + ,14 + ,70 + ,44 + ,33 + ,35 + ,13 + ,11 + ,14 + ,69 + ,42 + ,38 + ,36 + ,16 + ,12 + ,14 + ,90 + ,55 + ,33 + ,37 + ,13 + ,11 + ,12 + ,54 + ,33 + ,31 + ,27 + ,16 + ,13 + ,14 + ,76 + ,46 + ,38 + ,39 + ,13 + ,12 + ,15 + ,89 + ,54 + ,37 + ,38 + ,16 + ,14 + ,15 + ,76 + ,47 + ,33 + ,31 + ,15 + ,13 + ,15 + ,73 + ,45 + ,31 + ,33 + ,16 + ,15 + ,13 + ,79 + ,47 + ,39 + ,32 + ,15 + ,10 + ,17 + ,90 + ,55 + ,44 + ,39 + ,17 + ,11 + ,17 + ,74 + ,44 + ,33 + ,36 + ,15 + ,9 + ,19 + ,81 + ,53 + ,35 + ,33 + ,12 + ,11 + ,15 + ,72 + ,44 + ,32 + ,33 + ,16 + ,10 + ,13 + ,71 + ,42 + ,28 + ,32 + ,10 + ,11 + ,9 + ,66 + ,40 + ,40 + ,37 + ,16 + ,8 + ,15 + ,77 + ,46 + ,27 + ,30 + ,12 + ,11 + ,15 + ,65 + ,40 + ,37 + ,38 + ,14 + ,12 + ,15 + ,74 + ,46 + ,32 + ,29 + ,15 + ,12 + ,16 + ,82 + ,53 + ,28 + ,22 + ,13 + ,9 + ,11 + ,54 + ,33 + ,34 + ,35 + ,15 + ,11 + ,14 + ,63 + ,42 + ,30 + ,35 + ,11 + ,10 + ,11 + ,54 + ,35 + ,35 + ,34 + ,12 + ,8 + ,15 + ,64 + ,40 + ,31 + ,35 + ,8 + ,9 + ,13 + ,69 + ,41 + ,32 + ,34 + ,16 + ,8 + ,15 + ,54 + ,33 + ,30 + ,34 + ,15 + ,9 + ,16 + ,84 + ,51 + ,30 + ,35 + ,17 + ,15 + ,14 + ,86 + ,53 + ,31 + ,23 + ,16 + ,11 + ,15 + ,77 + ,46 + ,40 + ,31 + ,10 + ,8 + ,16 + ,89 + ,55 + ,32 + ,27 + ,18 + ,13 + ,16 + ,76 + ,47 + ,36 + ,36 + ,13 + ,12 + ,11 + ,60 + ,38 + ,32 + ,31 + ,16 + ,12 + ,12 + ,75 + ,46 + ,35 + ,32 + ,13 + ,9 + ,9 + ,73 + ,46 + ,38 + ,39 + ,10 + ,7 + ,16 + ,85 + ,53 + ,42 + ,37 + ,15 + ,13 + ,13 + ,79 + ,47 + ,34 + ,38 + ,16 + ,9 + ,16 + ,71 + ,41 + ,35 + ,39 + ,16 + ,6 + ,12 + ,72 + ,44 + ,35 + ,34 + ,14 + ,8 + ,9 + ,69 + ,43 + ,33 + ,31 + ,10 + ,8 + ,13 + ,78 + ,51 + ,36 + ,32 + ,17 + ,15 + ,13 + ,54 + ,33 + ,32 + ,37 + ,13 + ,6 + ,14 + ,69 + ,43 + ,33 + ,36 + ,15 + ,9 + ,19 + ,81 + ,53 + ,34 + ,32 + ,16 + ,11 + ,13 + ,84 + ,51 + ,32 + ,35 + ,12 + ,8 + ,12 + ,84 + ,50 + ,34 + ,36 + ,13 + ,8 + ,13 + ,69 + ,46) + ,dim=c(7 + ,162) + ,dimnames=list(c('Connected' + ,'Separate' + ,'Learning' + ,'Software' + ,'Happiness' + ,'Belonging' + ,'Belonging_Final') + ,1:162)) > y <- array(NA,dim=c(7,162),dimnames=list(c('Connected','Separate','Learning','Software','Happiness','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 Happiness Belonging Belonging_Final 1 12 41 38 13 14 53 32 2 11 39 32 16 18 86 51 3 15 30 35 19 11 66 42 4 6 31 33 15 12 67 41 5 13 34 37 14 16 76 46 6 10 35 29 13 18 78 47 7 12 39 31 19 14 53 37 8 14 34 36 15 14 80 49 9 12 36 35 14 15 74 45 10 6 37 38 15 15 76 47 11 10 38 31 16 17 79 49 12 12 36 34 16 19 54 33 13 12 38 35 16 10 67 42 14 11 39 38 16 16 54 33 15 15 33 37 17 18 87 53 16 12 32 33 15 14 58 36 17 10 36 32 15 14 75 45 18 12 38 38 20 17 88 54 19 11 39 38 18 14 64 41 20 12 32 32 16 16 57 36 21 11 32 33 16 18 66 41 22 12 31 31 16 11 68 44 23 13 39 38 19 14 54 33 24 11 37 39 16 12 56 37 25 9 39 32 17 17 86 52 26 13 41 32 17 9 80 47 27 10 36 35 16 16 76 43 28 14 33 37 15 14 69 44 29 12 33 33 16 15 78 45 30 10 34 33 14 11 67 44 31 12 31 28 15 16 80 49 32 8 27 32 12 13 54 33 33 10 37 31 14 17 71 43 34 12 34 37 16 15 84 54 35 12 34 30 14 14 74 42 36 7 32 33 7 16 71 44 37 6 29 31 10 9 63 37 38 12 36 33 14 15 71 43 39 10 29 31 16 17 76 46 40 10 35 33 16 13 69 42 41 10 37 32 16 15 74 45 42 12 34 33 14 16 75 44 43 15 38 32 20 16 54 33 44 10 35 33 14 12 52 31 45 10 38 28 14 12 69 42 46 12 37 35 11 11 68 40 47 13 38 39 14 15 65 43 48 11 33 34 15 15 75 46 49 11 36 38 16 17 74 42 50 12 38 32 14 13 75 45 51 14 32 38 16 16 72 44 52 10 32 30 14 14 67 40 53 12 32 33 12 11 63 37 54 13 34 38 16 12 62 46 55 5 32 32 9 12 63 36 56 6 37 32 14 15 76 47 57 12 39 34 16 16 74 45 58 12 29 34 16 15 67 42 59 11 37 36 15 12 73 43 60 10 35 34 16 12 70 43 61 7 30 28 12 8 53 32 62 12 38 34 16 13 77 45 63 14 34 35 16 11 77 45 64 11 31 35 14 14 52 31 65 12 34 31 16 15 54 33 66 13 35 37 17 10 80 49 67 14 36 35 18 11 66 42 68 11 30 27 18 12 73 41 69 12 39 40 12 15 63 38 70 12 35 37 16 15 69 42 71 8 38 36 10 14 67 44 72 11 31 38 14 16 54 33 73 14 34 39 18 15 81 48 74 14 38 41 18 15 69 40 75 12 34 27 16 13 84 50 76 9 39 30 17 12 80 49 77 13 37 37 16 17 70 43 78 11 34 31 16 13 69 44 79 12 28 31 13 15 77 47 80 12 37 27 16 13 54 33 81 12 33 36 16 15 79 46 82 12 37 38 20 16 30 0 83 12 35 37 16 15 71 45 84 12 37 33 15 16 73 43 85 11 32 34 15 15 72 44 86 10 33 31 16 14 77 47 87 9 38 39 14 15 75 45 88 12 33 34 16 14 69 42 89 12 29 32 16 13 54 33 90 12 33 33 15 7 70 43 91 9 31 36 12 17 73 46 92 15 36 32 17 13 54 33 93 12 35 41 16 15 77 46 94 12 32 28 15 14 82 48 95 12 29 30 13 13 80 47 96 10 39 36 16 16 80 47 97 13 37 35 16 12 69 43 98 9 35 31 16 14 78 46 99 12 37 34 16 17 81 48 100 10 32 36 14 15 76 46 101 14 38 36 16 17 76 45 102 11 37 35 16 12 73 45 103 15 36 37 20 16 85 52 104 11 32 28 15 11 66 42 105 11 33 39 16 15 79 47 106 12 40 32 13 9 68 41 107 12 38 35 17 16 76 47 108 12 41 39 16 15 71 43 109 11 36 35 16 10 54 33 110 7 43 42 12 10 46 30 111 12 30 34 16 15 82 49 112 14 31 33 16 11 74 44 113 11 32 41 17 13 88 55 114 11 32 33 13 14 38 11 115 10 37 34 12 18 76 47 116 13 37 32 18 16 86 53 117 13 33 40 14 14 54 33 118 8 34 40 14 14 70 44 119 11 33 35 13 14 69 42 120 12 38 36 16 14 90 55 121 11 33 37 13 12 54 33 122 13 31 27 16 14 76 46 123 12 38 39 13 15 89 54 124 14 37 38 16 15 76 47 125 13 33 31 15 15 73 45 126 15 31 33 16 13 79 47 127 10 39 32 15 17 90 55 128 11 44 39 17 17 74 44 129 9 33 36 15 19 81 53 130 11 35 33 12 15 72 44 131 10 32 33 16 13 71 42 132 11 28 32 10 9 66 40 133 8 40 37 16 15 77 46 134 11 27 30 12 15 65 40 135 12 37 38 14 15 74 46 136 12 32 29 15 16 82 53 137 9 28 22 13 11 54 33 138 11 34 35 15 14 63 42 139 10 30 35 11 11 54 35 140 8 35 34 12 15 64 40 141 9 31 35 8 13 69 41 142 8 32 34 16 15 54 33 143 9 30 34 15 16 84 51 144 15 30 35 17 14 86 53 145 11 31 23 16 15 77 46 146 8 40 31 10 16 89 55 147 13 32 27 18 16 76 47 148 12 36 36 13 11 60 38 149 12 32 31 16 12 75 46 150 9 35 32 13 9 73 46 151 7 38 39 10 16 85 53 152 13 42 37 15 13 79 47 153 9 34 38 16 16 71 41 154 6 35 39 16 12 72 44 155 8 35 34 14 9 69 43 156 8 33 31 10 13 78 51 157 15 36 32 17 13 54 33 158 6 32 37 13 14 69 43 159 9 33 36 15 19 81 53 160 11 34 32 16 13 84 51 161 8 32 35 12 12 84 50 162 8 34 36 13 13 69 46 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Connected Separate Learning 3.885849 -0.047335 0.033582 0.532324 Happiness Belonging Belonging_Final -0.026253 0.006650 -0.009209 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -5.8146 -1.0337 0.2514 1.3194 3.2049 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3.885849 2.045906 1.899 0.0594 . Connected -0.047335 0.046870 -1.010 0.3141 Separate 0.033582 0.044056 0.762 0.4471 Learning 0.532324 0.066323 8.026 2.33e-13 *** Happiness -0.026253 0.066274 -0.396 0.6926 Belonging 0.006650 0.043392 0.153 0.8784 Belonging_Final -0.009209 0.062663 -0.147 0.8834 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1.821 on 155 degrees of freedom Multiple R-squared: 0.3038, Adjusted R-squared: 0.2768 F-statistic: 11.27 on 6 and 155 DF, p-value: 1.981e-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.999872162 0.0002556763 0.0001278381 [2,] 0.999621375 0.0007572495 0.0003786247 [3,] 0.999541509 0.0009169830 0.0004584915 [4,] 0.999047323 0.0019053538 0.0009526769 [5,] 0.998369085 0.0032618295 0.0016309148 [6,] 0.998012553 0.0039748935 0.0019874468 [7,] 0.996673254 0.0066534916 0.0033267458 [8,] 0.994066998 0.0118660049 0.0059330025 [9,] 0.992966908 0.0140661841 0.0070330920 [10,] 0.990044969 0.0199100616 0.0099550308 [11,] 0.983737343 0.0325253139 0.0162626570 [12,] 0.977440409 0.0451191814 0.0225595907 [13,] 0.967237188 0.0655256234 0.0327628117 [14,] 0.952620776 0.0947584479 0.0473792240 [15,] 0.935045104 0.1299097929 0.0649548965 [16,] 0.934814537 0.1303709257 0.0651854629 [17,] 0.934385619 0.1312287611 0.0656143805 [18,] 0.931913113 0.1361737745 0.0680868872 [19,] 0.940525537 0.1189489254 0.0594744627 [20,] 0.920091154 0.1598176924 0.0799088462 [21,] 0.899015498 0.2019690036 0.1009845018 [22,] 0.878862156 0.2422756882 0.1211378441 [23,] 0.896543604 0.2069127916 0.1034563958 [24,] 0.867228773 0.2655424536 0.1327712268 [25,] 0.832842239 0.3343155213 0.1671577607 [26,] 0.820130271 0.3597394590 0.1798697295 [27,] 0.782939786 0.4341204281 0.2170602140 [28,] 0.823466233 0.3530675347 0.1765337674 [29,] 0.814712767 0.3705744669 0.1852872335 [30,] 0.804181413 0.3916371731 0.1958185865 [31,] 0.784605710 0.4307885792 0.2153942896 [32,] 0.759294194 0.4814116129 0.2407058064 [33,] 0.743739794 0.5125204114 0.2562602057 [34,] 0.740541405 0.5189171894 0.2594585947 [35,] 0.697393139 0.6052137225 0.3026068613 [36,] 0.651912984 0.6961740314 0.3480870157 [37,] 0.719652413 0.5606951748 0.2803475874 [38,] 0.733501020 0.5329979602 0.2664989801 [39,] 0.689322225 0.6213555504 0.3106777752 [40,] 0.653654435 0.6926911309 0.3463455655 [41,] 0.641314602 0.7173707957 0.3586853979 [42,] 0.650106355 0.6997872894 0.3498936447 [43,] 0.603947264 0.7921054722 0.3960527361 [44,] 0.625722123 0.7485557533 0.3742778766 [45,] 0.592243611 0.8155127778 0.4077563889 [46,] 0.679838552 0.6403228969 0.3201614484 [47,] 0.841320808 0.3173583842 0.1586791921 [48,] 0.813528344 0.3729433122 0.1864716561 [49,] 0.779481746 0.4410365081 0.2205182540 [50,] 0.742315035 0.5153699300 0.2576849650 [51,] 0.730768767 0.5384624661 0.2692312331 [52,] 0.750706869 0.4985862627 0.2492931313 [53,] 0.714777918 0.5704441643 0.2852220821 [54,] 0.731690715 0.5366185706 0.2683092853 [55,] 0.691380071 0.6172398570 0.3086199285 [56,] 0.656792296 0.6864154087 0.3432077044 [57,] 0.616649111 0.7667017785 0.3833508893 [58,] 0.595283473 0.8094330539 0.4047165270 [59,] 0.578678971 0.8426420577 0.4213210289 [60,] 0.597196128 0.8056077430 0.4028038715 [61,] 0.553301269 0.8933974624 0.4466987312 [62,] 0.511933076 0.9761338473 0.4880669236 [63,] 0.468986414 0.9379728274 0.5310135863 [64,] 0.437402454 0.8748049077 0.5625975461 [65,] 0.414740644 0.8294812877 0.5852593562 [66,] 0.389077069 0.7781541379 0.6109229310 [67,] 0.452782102 0.9055642036 0.5472178982 [68,] 0.438199618 0.8763992357 0.5618003821 [69,] 0.396697986 0.7933959719 0.6033020141 [70,] 0.400426182 0.8008523635 0.5995738183 [71,] 0.382429969 0.7648599378 0.6175700311 [72,] 0.340609597 0.6812191940 0.6593904030 [73,] 0.348875423 0.6977508462 0.6511245769 [74,] 0.312374626 0.6247492518 0.6876253741 [75,] 0.284704778 0.5694095552 0.7152952224 [76,] 0.247058082 0.4941161646 0.7529419177 [77,] 0.239523695 0.4790473900 0.7604763050 [78,] 0.241069048 0.4821380953 0.7589309523 [79,] 0.207199910 0.4143998208 0.7928000896 [80,] 0.176571123 0.3531422450 0.8234288775 [81,] 0.151926803 0.3038536053 0.8480731974 [82,] 0.131560684 0.2631213672 0.8684393164 [83,] 0.183196950 0.3663939000 0.8168030500 [84,] 0.158328212 0.3166564236 0.8416717882 [85,] 0.141355296 0.2827105919 0.8586447041 [86,] 0.137532918 0.2750658352 0.8624670824 [87,] 0.130636102 0.2612722038 0.8693638981 [88,] 0.121437702 0.2428754036 0.8785622982 [89,] 0.153374733 0.3067494651 0.8466252675 [90,] 0.128323062 0.2566461249 0.8716769376 [91,] 0.108839243 0.2176784863 0.8911607569 [92,] 0.129282972 0.2585659443 0.8707170279 [93,] 0.108216480 0.2164329596 0.8917835202 [94,] 0.101373640 0.2027472804 0.8986263598 [95,] 0.082572006 0.1651440119 0.9174279940 [96,] 0.069496973 0.1389939457 0.9305030271 [97,] 0.069539900 0.1390798003 0.9304600998 [98,] 0.055202597 0.1104051931 0.9447974034 [99,] 0.046010001 0.0920200029 0.9539899985 [100,] 0.036228085 0.0724561693 0.9637719154 [101,] 0.040979167 0.0819583341 0.9590208330 [102,] 0.031456426 0.0629128518 0.9685435741 [103,] 0.033969533 0.0679390655 0.9660304672 [104,] 0.030083511 0.0601670219 0.9699164891 [105,] 0.024190141 0.0483802818 0.9758098591 [106,] 0.018620234 0.0372404685 0.9813797658 [107,] 0.014229547 0.0284590933 0.9857704534 [108,] 0.020132639 0.0402652778 0.9798673611 [109,] 0.023238026 0.0464760520 0.9767619740 [110,] 0.018659195 0.0373183906 0.9813408047 [111,] 0.013898058 0.0277961162 0.9861019419 [112,] 0.011364906 0.0227298112 0.9886350944 [113,] 0.009291106 0.0185822125 0.9907088937 [114,] 0.010848466 0.0216969315 0.9891515342 [115,] 0.019576144 0.0391522876 0.9804238562 [116,] 0.021252754 0.0425055082 0.9787472459 [117,] 0.051284362 0.1025687231 0.9487156385 [118,] 0.039099368 0.0781987363 0.9609006318 [119,] 0.029939817 0.0598796336 0.9700601832 [120,] 0.025418254 0.0508365075 0.9745817462 [121,] 0.024014605 0.0480292092 0.9759853954 [122,] 0.019124146 0.0382482929 0.9808758536 [123,] 0.021788904 0.0435778070 0.9782110965 [124,] 0.032891445 0.0657828899 0.9671085550 [125,] 0.035420334 0.0708406683 0.9645796658 [126,] 0.038978383 0.0779567654 0.9610216173 [127,] 0.031965852 0.0639317046 0.9680341477 [128,] 0.029784438 0.0595688765 0.9702155617 [129,] 0.022193202 0.0443864050 0.9778067975 [130,] 0.022783629 0.0455672587 0.9772163706 [131,] 0.016119859 0.0322397171 0.9838801414 [132,] 0.046932374 0.0938647482 0.9530676259 [133,] 0.051496253 0.1029925058 0.9485037471 [134,] 0.037663575 0.0753271498 0.9623364251 [135,] 0.363867473 0.7277349454 0.6361325273 [136,] 0.393634685 0.7872693709 0.6063653146 [137,] 0.679659562 0.6406808768 0.3203404384 [138,] 0.708464265 0.5830714698 0.2915357349 [139,] 0.930886729 0.1382265422 0.0691132711 [140,] 0.907871192 0.1842576159 0.0921288080 [141,] 0.837577232 0.3248455356 0.1624227678 [142,] 0.740544496 0.5189110076 0.2594555038 [143,] 0.615724824 0.7685503514 0.3842751757 > postscript(file="/var/wessaorg/rcomp/tmp/1ytih1351697233.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/2os771351697233.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/3vh4q1351697233.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/4uzxy1351697233.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/5aitf1351697233.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.16829547 -0.26132798 1.48129540 -5.26451635 2.36668598 0.26341852 7 8 9 10 11 12 -0.83919361 2.81646454 1.50635902 -5.07425987 -1.27319863 0.60280395 13 14 15 16 17 18 0.42404128 -0.46828067 2.76619552 0.84913222 -0.95812085 -1.65137893 19 20 21 22 23 24 -1.57826492 0.40954728 -0.58533702 0.26504897 -0.11775810 -0.67800858 25 26 27 28 29 30 -2.81069557 1.06780646 -1.56375491 2.76265606 0.34027037 -0.58881368 31 32 33 34 35 36 0.99562599 -1.78426645 -0.25793755 0.29625560 1.52572120 0.14744679 37 38 39 40 41 42 -2.71939593 1.57505681 -1.70688757 -1.58533989 -1.41020650 1.48924782 43 44 45 46 47 48 1.55658408 -0.53518923 -0.23702877 3.03950975 2.50813414 -0.13182775 49 50 51 52 53 54 -0.63415763 1.64261943 2.18196974 -0.54081365 2.34330171 1.25655001 55 56 57 58 59 60 -3.00910061 -4.34044131 0.64355104 0.16287612 -0.10273950 -1.64261656 61 62 63 64 65 66 -2.64175618 0.49750602 2.22207864 0.26081292 0.50386987 0.66055720 67 68 69 70 71 72 1.29762762 -1.74723039 2.55378884 0.33283627 -0.29216788 0.21768910 73 74 75 76 77 78 1.12913907 1.25744458 0.54273732 -2.86252067 1.48257051 -0.54709128 79 80 81 82 83 84 1.79280193 0.72769791 0.24208178 -1.83653907 0.34716305 1.10301985 85 86 87 88 89 90 -0.17762961 -1.59374885 -1.53995178 0.31266118 0.18110776 0.69735527 91 92 93 94 95 96 -0.63088383 2.98012707 0.18213983 0.96794465 1.80126182 -1.44509805 97 98 99 100 101 102 1.42512088 -2.51493903 0.55620918 -0.72065402 2.54200352 -0.58306243 103 104 105 106 107 108 1.26281394 -0.05966267 -0.84945638 2.17431691 0.03542760 0.54558810 109 110 111 112 113 114 -0.66705547 -2.41591845 0.17491883 2.15798144 -1.53496602 0.81655816 115 116 117 118 119 120 0.73580039 0.54526737 2.19268766 -2.76508320 0.87605017 0.46223060 121 122 123 124 125 126 0.77325285 1.44335274 1.98214889 2.39341632 1.97301127 3.20486291 127 128 129 130 131 132 -0.74502204 -0.80296761 -2.06941879 1.59492849 -1.74064496 2.20736322 133 134 135 136 137 138 -3.44685668 1.32671418 1.46215560 1.03291426 -0.98593695 -0.10136011 139 140 141 142 143 144 0.75522663 -1.42228735 1.40753757 -3.69154697 -2.26138679 2.59299469 145 146 147 148 149 150 -0.40271487 -0.02208833 0.48775505 1.92872998 0.31050208 -1.04956285 151 152 153 154 155 156 -1.37723415 2.12353895 -2.74433801 -5.81462050 -2.65007748 -0.39587253 157 158 159 160 161 162 2.98012707 -4.22924026 -2.06941879 -0.61596575 -1.71754954 -2.09961369 > postscript(file="/var/wessaorg/rcomp/tmp/6cthg1351697233.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.16829547 NA 1 -0.26132798 2.16829547 2 1.48129540 -0.26132798 3 -5.26451635 1.48129540 4 2.36668598 -5.26451635 5 0.26341852 2.36668598 6 -0.83919361 0.26341852 7 2.81646454 -0.83919361 8 1.50635902 2.81646454 9 -5.07425987 1.50635902 10 -1.27319863 -5.07425987 11 0.60280395 -1.27319863 12 0.42404128 0.60280395 13 -0.46828067 0.42404128 14 2.76619552 -0.46828067 15 0.84913222 2.76619552 16 -0.95812085 0.84913222 17 -1.65137893 -0.95812085 18 -1.57826492 -1.65137893 19 0.40954728 -1.57826492 20 -0.58533702 0.40954728 21 0.26504897 -0.58533702 22 -0.11775810 0.26504897 23 -0.67800858 -0.11775810 24 -2.81069557 -0.67800858 25 1.06780646 -2.81069557 26 -1.56375491 1.06780646 27 2.76265606 -1.56375491 28 0.34027037 2.76265606 29 -0.58881368 0.34027037 30 0.99562599 -0.58881368 31 -1.78426645 0.99562599 32 -0.25793755 -1.78426645 33 0.29625560 -0.25793755 34 1.52572120 0.29625560 35 0.14744679 1.52572120 36 -2.71939593 0.14744679 37 1.57505681 -2.71939593 38 -1.70688757 1.57505681 39 -1.58533989 -1.70688757 40 -1.41020650 -1.58533989 41 1.48924782 -1.41020650 42 1.55658408 1.48924782 43 -0.53518923 1.55658408 44 -0.23702877 -0.53518923 45 3.03950975 -0.23702877 46 2.50813414 3.03950975 47 -0.13182775 2.50813414 48 -0.63415763 -0.13182775 49 1.64261943 -0.63415763 50 2.18196974 1.64261943 51 -0.54081365 2.18196974 52 2.34330171 -0.54081365 53 1.25655001 2.34330171 54 -3.00910061 1.25655001 55 -4.34044131 -3.00910061 56 0.64355104 -4.34044131 57 0.16287612 0.64355104 58 -0.10273950 0.16287612 59 -1.64261656 -0.10273950 60 -2.64175618 -1.64261656 61 0.49750602 -2.64175618 62 2.22207864 0.49750602 63 0.26081292 2.22207864 64 0.50386987 0.26081292 65 0.66055720 0.50386987 66 1.29762762 0.66055720 67 -1.74723039 1.29762762 68 2.55378884 -1.74723039 69 0.33283627 2.55378884 70 -0.29216788 0.33283627 71 0.21768910 -0.29216788 72 1.12913907 0.21768910 73 1.25744458 1.12913907 74 0.54273732 1.25744458 75 -2.86252067 0.54273732 76 1.48257051 -2.86252067 77 -0.54709128 1.48257051 78 1.79280193 -0.54709128 79 0.72769791 1.79280193 80 0.24208178 0.72769791 81 -1.83653907 0.24208178 82 0.34716305 -1.83653907 83 1.10301985 0.34716305 84 -0.17762961 1.10301985 85 -1.59374885 -0.17762961 86 -1.53995178 -1.59374885 87 0.31266118 -1.53995178 88 0.18110776 0.31266118 89 0.69735527 0.18110776 90 -0.63088383 0.69735527 91 2.98012707 -0.63088383 92 0.18213983 2.98012707 93 0.96794465 0.18213983 94 1.80126182 0.96794465 95 -1.44509805 1.80126182 96 1.42512088 -1.44509805 97 -2.51493903 1.42512088 98 0.55620918 -2.51493903 99 -0.72065402 0.55620918 100 2.54200352 -0.72065402 101 -0.58306243 2.54200352 102 1.26281394 -0.58306243 103 -0.05966267 1.26281394 104 -0.84945638 -0.05966267 105 2.17431691 -0.84945638 106 0.03542760 2.17431691 107 0.54558810 0.03542760 108 -0.66705547 0.54558810 109 -2.41591845 -0.66705547 110 0.17491883 -2.41591845 111 2.15798144 0.17491883 112 -1.53496602 2.15798144 113 0.81655816 -1.53496602 114 0.73580039 0.81655816 115 0.54526737 0.73580039 116 2.19268766 0.54526737 117 -2.76508320 2.19268766 118 0.87605017 -2.76508320 119 0.46223060 0.87605017 120 0.77325285 0.46223060 121 1.44335274 0.77325285 122 1.98214889 1.44335274 123 2.39341632 1.98214889 124 1.97301127 2.39341632 125 3.20486291 1.97301127 126 -0.74502204 3.20486291 127 -0.80296761 -0.74502204 128 -2.06941879 -0.80296761 129 1.59492849 -2.06941879 130 -1.74064496 1.59492849 131 2.20736322 -1.74064496 132 -3.44685668 2.20736322 133 1.32671418 -3.44685668 134 1.46215560 1.32671418 135 1.03291426 1.46215560 136 -0.98593695 1.03291426 137 -0.10136011 -0.98593695 138 0.75522663 -0.10136011 139 -1.42228735 0.75522663 140 1.40753757 -1.42228735 141 -3.69154697 1.40753757 142 -2.26138679 -3.69154697 143 2.59299469 -2.26138679 144 -0.40271487 2.59299469 145 -0.02208833 -0.40271487 146 0.48775505 -0.02208833 147 1.92872998 0.48775505 148 0.31050208 1.92872998 149 -1.04956285 0.31050208 150 -1.37723415 -1.04956285 151 2.12353895 -1.37723415 152 -2.74433801 2.12353895 153 -5.81462050 -2.74433801 154 -2.65007748 -5.81462050 155 -0.39587253 -2.65007748 156 2.98012707 -0.39587253 157 -4.22924026 2.98012707 158 -2.06941879 -4.22924026 159 -0.61596575 -2.06941879 160 -1.71754954 -0.61596575 161 -2.09961369 -1.71754954 162 NA -2.09961369 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -0.26132798 2.16829547 [2,] 1.48129540 -0.26132798 [3,] -5.26451635 1.48129540 [4,] 2.36668598 -5.26451635 [5,] 0.26341852 2.36668598 [6,] -0.83919361 0.26341852 [7,] 2.81646454 -0.83919361 [8,] 1.50635902 2.81646454 [9,] -5.07425987 1.50635902 [10,] -1.27319863 -5.07425987 [11,] 0.60280395 -1.27319863 [12,] 0.42404128 0.60280395 [13,] -0.46828067 0.42404128 [14,] 2.76619552 -0.46828067 [15,] 0.84913222 2.76619552 [16,] -0.95812085 0.84913222 [17,] -1.65137893 -0.95812085 [18,] -1.57826492 -1.65137893 [19,] 0.40954728 -1.57826492 [20,] -0.58533702 0.40954728 [21,] 0.26504897 -0.58533702 [22,] -0.11775810 0.26504897 [23,] -0.67800858 -0.11775810 [24,] -2.81069557 -0.67800858 [25,] 1.06780646 -2.81069557 [26,] -1.56375491 1.06780646 [27,] 2.76265606 -1.56375491 [28,] 0.34027037 2.76265606 [29,] -0.58881368 0.34027037 [30,] 0.99562599 -0.58881368 [31,] -1.78426645 0.99562599 [32,] -0.25793755 -1.78426645 [33,] 0.29625560 -0.25793755 [34,] 1.52572120 0.29625560 [35,] 0.14744679 1.52572120 [36,] -2.71939593 0.14744679 [37,] 1.57505681 -2.71939593 [38,] -1.70688757 1.57505681 [39,] -1.58533989 -1.70688757 [40,] -1.41020650 -1.58533989 [41,] 1.48924782 -1.41020650 [42,] 1.55658408 1.48924782 [43,] -0.53518923 1.55658408 [44,] -0.23702877 -0.53518923 [45,] 3.03950975 -0.23702877 [46,] 2.50813414 3.03950975 [47,] -0.13182775 2.50813414 [48,] -0.63415763 -0.13182775 [49,] 1.64261943 -0.63415763 [50,] 2.18196974 1.64261943 [51,] -0.54081365 2.18196974 [52,] 2.34330171 -0.54081365 [53,] 1.25655001 2.34330171 [54,] -3.00910061 1.25655001 [55,] -4.34044131 -3.00910061 [56,] 0.64355104 -4.34044131 [57,] 0.16287612 0.64355104 [58,] -0.10273950 0.16287612 [59,] -1.64261656 -0.10273950 [60,] -2.64175618 -1.64261656 [61,] 0.49750602 -2.64175618 [62,] 2.22207864 0.49750602 [63,] 0.26081292 2.22207864 [64,] 0.50386987 0.26081292 [65,] 0.66055720 0.50386987 [66,] 1.29762762 0.66055720 [67,] -1.74723039 1.29762762 [68,] 2.55378884 -1.74723039 [69,] 0.33283627 2.55378884 [70,] -0.29216788 0.33283627 [71,] 0.21768910 -0.29216788 [72,] 1.12913907 0.21768910 [73,] 1.25744458 1.12913907 [74,] 0.54273732 1.25744458 [75,] -2.86252067 0.54273732 [76,] 1.48257051 -2.86252067 [77,] -0.54709128 1.48257051 [78,] 1.79280193 -0.54709128 [79,] 0.72769791 1.79280193 [80,] 0.24208178 0.72769791 [81,] -1.83653907 0.24208178 [82,] 0.34716305 -1.83653907 [83,] 1.10301985 0.34716305 [84,] -0.17762961 1.10301985 [85,] -1.59374885 -0.17762961 [86,] -1.53995178 -1.59374885 [87,] 0.31266118 -1.53995178 [88,] 0.18110776 0.31266118 [89,] 0.69735527 0.18110776 [90,] -0.63088383 0.69735527 [91,] 2.98012707 -0.63088383 [92,] 0.18213983 2.98012707 [93,] 0.96794465 0.18213983 [94,] 1.80126182 0.96794465 [95,] -1.44509805 1.80126182 [96,] 1.42512088 -1.44509805 [97,] -2.51493903 1.42512088 [98,] 0.55620918 -2.51493903 [99,] -0.72065402 0.55620918 [100,] 2.54200352 -0.72065402 [101,] -0.58306243 2.54200352 [102,] 1.26281394 -0.58306243 [103,] -0.05966267 1.26281394 [104,] -0.84945638 -0.05966267 [105,] 2.17431691 -0.84945638 [106,] 0.03542760 2.17431691 [107,] 0.54558810 0.03542760 [108,] -0.66705547 0.54558810 [109,] -2.41591845 -0.66705547 [110,] 0.17491883 -2.41591845 [111,] 2.15798144 0.17491883 [112,] -1.53496602 2.15798144 [113,] 0.81655816 -1.53496602 [114,] 0.73580039 0.81655816 [115,] 0.54526737 0.73580039 [116,] 2.19268766 0.54526737 [117,] -2.76508320 2.19268766 [118,] 0.87605017 -2.76508320 [119,] 0.46223060 0.87605017 [120,] 0.77325285 0.46223060 [121,] 1.44335274 0.77325285 [122,] 1.98214889 1.44335274 [123,] 2.39341632 1.98214889 [124,] 1.97301127 2.39341632 [125,] 3.20486291 1.97301127 [126,] -0.74502204 3.20486291 [127,] -0.80296761 -0.74502204 [128,] -2.06941879 -0.80296761 [129,] 1.59492849 -2.06941879 [130,] -1.74064496 1.59492849 [131,] 2.20736322 -1.74064496 [132,] -3.44685668 2.20736322 [133,] 1.32671418 -3.44685668 [134,] 1.46215560 1.32671418 [135,] 1.03291426 1.46215560 [136,] -0.98593695 1.03291426 [137,] -0.10136011 -0.98593695 [138,] 0.75522663 -0.10136011 [139,] -1.42228735 0.75522663 [140,] 1.40753757 -1.42228735 [141,] -3.69154697 1.40753757 [142,] -2.26138679 -3.69154697 [143,] 2.59299469 -2.26138679 [144,] -0.40271487 2.59299469 [145,] -0.02208833 -0.40271487 [146,] 0.48775505 -0.02208833 [147,] 1.92872998 0.48775505 [148,] 0.31050208 1.92872998 [149,] -1.04956285 0.31050208 [150,] -1.37723415 -1.04956285 [151,] 2.12353895 -1.37723415 [152,] -2.74433801 2.12353895 [153,] -5.81462050 -2.74433801 [154,] -2.65007748 -5.81462050 [155,] -0.39587253 -2.65007748 [156,] 2.98012707 -0.39587253 [157,] -4.22924026 2.98012707 [158,] -2.06941879 -4.22924026 [159,] -0.61596575 -2.06941879 [160,] -1.71754954 -0.61596575 [161,] -2.09961369 -1.71754954 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -0.26132798 2.16829547 2 1.48129540 -0.26132798 3 -5.26451635 1.48129540 4 2.36668598 -5.26451635 5 0.26341852 2.36668598 6 -0.83919361 0.26341852 7 2.81646454 -0.83919361 8 1.50635902 2.81646454 9 -5.07425987 1.50635902 10 -1.27319863 -5.07425987 11 0.60280395 -1.27319863 12 0.42404128 0.60280395 13 -0.46828067 0.42404128 14 2.76619552 -0.46828067 15 0.84913222 2.76619552 16 -0.95812085 0.84913222 17 -1.65137893 -0.95812085 18 -1.57826492 -1.65137893 19 0.40954728 -1.57826492 20 -0.58533702 0.40954728 21 0.26504897 -0.58533702 22 -0.11775810 0.26504897 23 -0.67800858 -0.11775810 24 -2.81069557 -0.67800858 25 1.06780646 -2.81069557 26 -1.56375491 1.06780646 27 2.76265606 -1.56375491 28 0.34027037 2.76265606 29 -0.58881368 0.34027037 30 0.99562599 -0.58881368 31 -1.78426645 0.99562599 32 -0.25793755 -1.78426645 33 0.29625560 -0.25793755 34 1.52572120 0.29625560 35 0.14744679 1.52572120 36 -2.71939593 0.14744679 37 1.57505681 -2.71939593 38 -1.70688757 1.57505681 39 -1.58533989 -1.70688757 40 -1.41020650 -1.58533989 41 1.48924782 -1.41020650 42 1.55658408 1.48924782 43 -0.53518923 1.55658408 44 -0.23702877 -0.53518923 45 3.03950975 -0.23702877 46 2.50813414 3.03950975 47 -0.13182775 2.50813414 48 -0.63415763 -0.13182775 49 1.64261943 -0.63415763 50 2.18196974 1.64261943 51 -0.54081365 2.18196974 52 2.34330171 -0.54081365 53 1.25655001 2.34330171 54 -3.00910061 1.25655001 55 -4.34044131 -3.00910061 56 0.64355104 -4.34044131 57 0.16287612 0.64355104 58 -0.10273950 0.16287612 59 -1.64261656 -0.10273950 60 -2.64175618 -1.64261656 61 0.49750602 -2.64175618 62 2.22207864 0.49750602 63 0.26081292 2.22207864 64 0.50386987 0.26081292 65 0.66055720 0.50386987 66 1.29762762 0.66055720 67 -1.74723039 1.29762762 68 2.55378884 -1.74723039 69 0.33283627 2.55378884 70 -0.29216788 0.33283627 71 0.21768910 -0.29216788 72 1.12913907 0.21768910 73 1.25744458 1.12913907 74 0.54273732 1.25744458 75 -2.86252067 0.54273732 76 1.48257051 -2.86252067 77 -0.54709128 1.48257051 78 1.79280193 -0.54709128 79 0.72769791 1.79280193 80 0.24208178 0.72769791 81 -1.83653907 0.24208178 82 0.34716305 -1.83653907 83 1.10301985 0.34716305 84 -0.17762961 1.10301985 85 -1.59374885 -0.17762961 86 -1.53995178 -1.59374885 87 0.31266118 -1.53995178 88 0.18110776 0.31266118 89 0.69735527 0.18110776 90 -0.63088383 0.69735527 91 2.98012707 -0.63088383 92 0.18213983 2.98012707 93 0.96794465 0.18213983 94 1.80126182 0.96794465 95 -1.44509805 1.80126182 96 1.42512088 -1.44509805 97 -2.51493903 1.42512088 98 0.55620918 -2.51493903 99 -0.72065402 0.55620918 100 2.54200352 -0.72065402 101 -0.58306243 2.54200352 102 1.26281394 -0.58306243 103 -0.05966267 1.26281394 104 -0.84945638 -0.05966267 105 2.17431691 -0.84945638 106 0.03542760 2.17431691 107 0.54558810 0.03542760 108 -0.66705547 0.54558810 109 -2.41591845 -0.66705547 110 0.17491883 -2.41591845 111 2.15798144 0.17491883 112 -1.53496602 2.15798144 113 0.81655816 -1.53496602 114 0.73580039 0.81655816 115 0.54526737 0.73580039 116 2.19268766 0.54526737 117 -2.76508320 2.19268766 118 0.87605017 -2.76508320 119 0.46223060 0.87605017 120 0.77325285 0.46223060 121 1.44335274 0.77325285 122 1.98214889 1.44335274 123 2.39341632 1.98214889 124 1.97301127 2.39341632 125 3.20486291 1.97301127 126 -0.74502204 3.20486291 127 -0.80296761 -0.74502204 128 -2.06941879 -0.80296761 129 1.59492849 -2.06941879 130 -1.74064496 1.59492849 131 2.20736322 -1.74064496 132 -3.44685668 2.20736322 133 1.32671418 -3.44685668 134 1.46215560 1.32671418 135 1.03291426 1.46215560 136 -0.98593695 1.03291426 137 -0.10136011 -0.98593695 138 0.75522663 -0.10136011 139 -1.42228735 0.75522663 140 1.40753757 -1.42228735 141 -3.69154697 1.40753757 142 -2.26138679 -3.69154697 143 2.59299469 -2.26138679 144 -0.40271487 2.59299469 145 -0.02208833 -0.40271487 146 0.48775505 -0.02208833 147 1.92872998 0.48775505 148 0.31050208 1.92872998 149 -1.04956285 0.31050208 150 -1.37723415 -1.04956285 151 2.12353895 -1.37723415 152 -2.74433801 2.12353895 153 -5.81462050 -2.74433801 154 -2.65007748 -5.81462050 155 -0.39587253 -2.65007748 156 2.98012707 -0.39587253 157 -4.22924026 2.98012707 158 -2.06941879 -4.22924026 159 -0.61596575 -2.06941879 160 -1.71754954 -0.61596575 161 -2.09961369 -1.71754954 > 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/7rdn31351697233.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/883k81351697233.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/9b2qq1351697233.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/10pj0n1351697233.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/118d3w1351697233.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/12m8sy1351697233.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/13drs01351697233.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/143wns1351697233.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/15f2el1351697233.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/16tbla1351697233.tab") + } > > try(system("convert tmp/1ytih1351697233.ps tmp/1ytih1351697233.png",intern=TRUE)) character(0) > try(system("convert tmp/2os771351697233.ps tmp/2os771351697233.png",intern=TRUE)) character(0) > try(system("convert tmp/3vh4q1351697233.ps tmp/3vh4q1351697233.png",intern=TRUE)) character(0) > try(system("convert tmp/4uzxy1351697233.ps tmp/4uzxy1351697233.png",intern=TRUE)) character(0) > try(system("convert tmp/5aitf1351697233.ps tmp/5aitf1351697233.png",intern=TRUE)) character(0) > try(system("convert tmp/6cthg1351697233.ps tmp/6cthg1351697233.png",intern=TRUE)) character(0) > try(system("convert tmp/7rdn31351697233.ps tmp/7rdn31351697233.png",intern=TRUE)) character(0) > try(system("convert tmp/883k81351697233.ps tmp/883k81351697233.png",intern=TRUE)) character(0) > try(system("convert tmp/9b2qq1351697233.ps tmp/9b2qq1351697233.png",intern=TRUE)) character(0) > try(system("convert tmp/10pj0n1351697233.ps tmp/10pj0n1351697233.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 7.963 1.172 9.349