R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-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(2 + ,41 + ,38 + ,13 + ,12 + ,14 + ,2 + ,39 + ,32 + ,16 + ,11 + ,18 + ,2 + ,30 + ,35 + ,19 + ,15 + ,11 + ,1 + ,31 + ,33 + ,15 + ,6 + ,12 + ,2 + ,34 + ,37 + ,14 + ,13 + ,16 + ,2 + ,35 + ,29 + ,13 + ,10 + ,18 + ,2 + ,39 + ,31 + ,19 + ,12 + ,14 + ,2 + ,34 + ,36 + ,15 + ,14 + ,14 + ,2 + ,36 + ,35 + ,14 + ,12 + ,15 + ,2 + ,37 + ,38 + ,15 + ,6 + ,15 + ,1 + ,38 + ,31 + ,16 + ,10 + ,17 + ,2 + ,36 + ,34 + ,16 + ,12 + ,19 + ,1 + ,38 + ,35 + ,16 + ,12 + ,10 + ,2 + ,39 + ,38 + ,16 + ,11 + ,16 + ,2 + ,33 + ,37 + ,17 + ,15 + ,18 + ,1 + ,32 + ,33 + ,15 + ,12 + ,14 + ,1 + ,36 + ,32 + ,15 + ,10 + ,14 + ,2 + ,38 + ,38 + ,20 + ,12 + ,17 + ,1 + ,39 + ,38 + ,18 + ,11 + ,14 + ,2 + ,32 + ,32 + ,16 + ,12 + ,16 + ,1 + ,32 + ,33 + ,16 + ,11 + ,18 + ,2 + ,31 + ,31 + ,16 + ,12 + ,11 + ,2 + ,39 + ,38 + ,19 + ,13 + ,14 + ,2 + ,37 + ,39 + ,16 + ,11 + ,12 + ,1 + ,39 + ,32 + ,17 + ,9 + ,17 + ,2 + ,41 + ,32 + ,17 + ,13 + ,9 + ,1 + ,36 + ,35 + ,16 + ,10 + ,16 + ,2 + ,33 + ,37 + ,15 + ,14 + ,14 + ,2 + ,33 + ,33 + ,16 + ,12 + ,15 + ,1 + ,34 + ,33 + ,14 + ,10 + ,11 + ,2 + ,31 + ,28 + ,15 + ,12 + ,16 + ,1 + ,27 + ,32 + ,12 + ,8 + ,13 + ,2 + ,37 + ,31 + ,14 + ,10 + ,17 + ,2 + ,34 + ,37 + ,16 + ,12 + ,15 + ,1 + ,34 + ,30 + ,14 + ,12 + ,14 + ,1 + ,32 + ,33 + ,7 + ,7 + ,16 + ,1 + ,29 + ,31 + ,10 + ,6 + ,9 + ,1 + ,36 + ,33 + ,14 + ,12 + ,15 + ,2 + ,29 + ,31 + ,16 + ,10 + ,17 + ,1 + ,35 + ,33 + ,16 + ,10 + ,13 + ,1 + ,37 + ,32 + ,16 + ,10 + ,15 + ,2 + ,34 + ,33 + ,14 + ,12 + ,16 + ,1 + ,38 + ,32 + ,20 + ,15 + ,16 + ,1 + ,35 + ,33 + ,14 + ,10 + ,12 + ,2 + ,38 + ,28 + ,14 + ,10 + ,12 + ,2 + ,37 + ,35 + ,11 + ,12 + ,11 + ,2 + ,38 + ,39 + ,14 + ,13 + ,15 + ,2 + ,33 + ,34 + ,15 + ,11 + ,15 + ,2 + ,36 + ,38 + ,16 + ,11 + ,17 + ,1 + ,38 + ,32 + ,14 + ,12 + ,13 + ,2 + ,32 + ,38 + ,16 + ,14 + ,16 + ,1 + ,32 + ,30 + ,14 + ,10 + ,14 + ,1 + ,32 + ,33 + ,12 + ,12 + ,11 + ,2 + ,34 + ,38 + ,16 + ,13 + ,12 + ,1 + ,32 + ,32 + ,9 + ,5 + ,12 + ,2 + ,37 + ,32 + ,14 + ,6 + ,15 + ,2 + ,39 + ,34 + ,16 + ,12 + ,16 + ,2 + ,29 + ,34 + ,16 + ,12 + ,15 + ,1 + ,37 + ,36 + ,15 + ,11 + ,12 + ,2 + ,35 + ,34 + ,16 + ,10 + ,12 + ,1 + ,30 + ,28 + ,12 + ,7 + ,8 + ,1 + ,38 + ,34 + ,16 + ,12 + ,13 + ,2 + ,34 + ,35 + ,16 + ,14 + ,11 + ,2 + ,31 + ,35 + ,14 + ,11 + ,14 + ,2 + ,34 + ,31 + ,16 + ,12 + ,15 + ,1 + ,35 + ,37 + ,17 + ,13 + ,10 + ,2 + ,36 + ,35 + ,18 + ,14 + ,11 + ,1 + ,30 + ,27 + ,18 + ,11 + ,12 + ,2 + ,39 + ,40 + ,12 + ,12 + ,15 + ,1 + ,35 + ,37 + ,16 + ,12 + ,15 + ,1 + ,38 + ,36 + ,10 + ,8 + ,14 + ,2 + ,31 + ,38 + ,14 + ,11 + ,16 + ,2 + ,34 + ,39 + ,18 + ,14 + ,15 + ,1 + ,38 + ,41 + ,18 + ,14 + ,15 + ,1 + ,34 + ,27 + ,16 + ,12 + ,13 + ,2 + ,39 + ,30 + ,17 + ,9 + ,12 + ,2 + ,37 + ,37 + ,16 + ,13 + ,17 + ,2 + ,34 + ,31 + ,16 + ,11 + ,13 + ,1 + ,28 + ,31 + ,13 + ,12 + ,15 + ,1 + ,37 + ,27 + ,16 + ,12 + ,13 + ,1 + ,33 + ,36 + ,16 + ,12 + ,15 + ,1 + ,37 + ,38 + ,20 + ,12 + ,16 + ,2 + ,35 + ,37 + ,16 + ,12 + ,15 + ,1 + ,37 + ,33 + ,15 + ,12 + ,16 + ,2 + ,32 + ,34 + ,15 + ,11 + ,15 + ,2 + ,33 + ,31 + ,16 + ,10 + ,14 + ,1 + ,38 + ,39 + ,14 + ,9 + ,15 + ,2 + ,33 + ,34 + ,16 + ,12 + ,14 + ,2 + ,29 + ,32 + ,16 + ,12 + ,13 + ,2 + ,33 + ,33 + ,15 + ,12 + ,7 + ,2 + ,31 + ,36 + ,12 + ,9 + ,17 + ,2 + ,36 + ,32 + ,17 + ,15 + ,13 + ,2 + ,35 + ,41 + ,16 + ,12 + ,15 + ,2 + ,32 + ,28 + ,15 + ,12 + ,14 + ,2 + ,29 + ,30 + ,13 + ,12 + ,13 + ,2 + ,39 + ,36 + ,16 + ,10 + ,16 + ,2 + ,37 + ,35 + ,16 + ,13 + ,12 + ,2 + ,35 + ,31 + ,16 + ,9 + ,14 + ,1 + ,37 + ,34 + ,16 + ,12 + ,17 + ,1 + ,32 + ,36 + ,14 + ,10 + ,15 + ,2 + ,38 + ,36 + ,16 + ,14 + ,17 + ,1 + ,37 + ,35 + ,16 + ,11 + ,12 + ,2 + ,36 + ,37 + ,20 + ,15 + ,16 + ,1 + ,32 + ,28 + ,15 + ,11 + ,11 + ,2 + ,33 + ,39 + ,16 + ,11 + ,15 + ,1 + ,40 + ,32 + ,13 + ,12 + ,9 + ,2 + ,38 + ,35 + ,17 + ,12 + ,16 + ,1 + ,41 + ,39 + ,16 + ,12 + ,15 + ,1 + ,36 + ,35 + ,16 + ,11 + ,10 + ,2 + ,43 + ,42 + ,12 + ,7 + ,10 + ,2 + ,30 + ,34 + ,16 + ,12 + ,15 + ,2 + ,31 + ,33 + ,16 + ,14 + ,11 + ,2 + ,32 + ,41 + ,17 + ,11 + ,13 + ,1 + ,32 + ,33 + ,13 + ,11 + ,14 + ,2 + ,37 + ,34 + ,12 + ,10 + ,18 + ,1 + ,37 + ,32 + ,18 + ,13 + ,16 + ,2 + ,33 + ,40 + ,14 + ,13 + ,14 + ,2 + ,34 + ,40 + ,14 + ,8 + ,14 + ,2 + ,33 + ,35 + ,13 + ,11 + ,14 + ,2 + ,38 + ,36 + ,16 + ,12 + ,14 + ,2 + ,33 + ,37 + ,13 + ,11 + ,12 + ,2 + ,31 + ,27 + ,16 + ,13 + ,14 + ,2 + ,38 + ,39 + ,13 + ,12 + ,15 + ,2 + ,37 + ,38 + ,16 + ,14 + ,15 + ,2 + ,33 + ,31 + ,15 + ,13 + ,15 + ,2 + ,31 + ,33 + ,16 + ,15 + ,13 + ,1 + ,39 + ,32 + ,15 + ,10 + ,17 + ,2 + ,44 + ,39 + ,17 + ,11 + ,17 + ,2 + ,33 + ,36 + ,15 + ,9 + ,19 + ,2 + ,35 + ,33 + ,12 + ,11 + ,15 + ,1 + ,32 + ,33 + ,16 + ,10 + ,13 + ,1 + ,28 + ,32 + ,10 + ,11 + ,9 + ,2 + ,40 + ,37 + ,16 + ,8 + ,15 + ,1 + ,27 + ,30 + ,12 + ,11 + ,15 + ,1 + ,37 + ,38 + ,14 + ,12 + ,15 + ,2 + ,32 + ,29 + ,15 + ,12 + ,16 + ,1 + ,28 + ,22 + ,13 + ,9 + ,11 + ,1 + ,34 + ,35 + ,15 + ,11 + ,14 + ,2 + ,30 + ,35 + ,11 + ,10 + ,11 + ,2 + ,35 + ,34 + ,12 + ,8 + ,15 + ,1 + ,31 + ,35 + ,8 + ,9 + ,13 + ,2 + ,32 + ,34 + ,16 + ,8 + ,15 + ,1 + ,30 + ,34 + ,15 + ,9 + ,16 + ,2 + ,30 + ,35 + ,17 + ,15 + ,14 + ,1 + ,31 + ,23 + ,16 + ,11 + ,15 + ,2 + ,40 + ,31 + ,10 + ,8 + ,16 + ,2 + ,32 + ,27 + ,18 + ,13 + ,16 + ,1 + ,36 + ,36 + ,13 + ,12 + ,11 + ,1 + ,32 + ,31 + ,16 + ,12 + ,12 + ,1 + ,35 + ,32 + ,13 + ,9 + ,9 + ,2 + ,38 + ,39 + ,10 + ,7 + ,16 + ,2 + ,42 + ,37 + ,15 + ,13 + ,13 + ,1 + ,34 + ,38 + ,16 + ,9 + ,16 + ,2 + ,35 + ,39 + ,16 + ,6 + ,12 + ,2 + ,35 + ,34 + ,14 + ,8 + ,9 + ,2 + ,33 + ,31 + ,10 + ,8 + ,13 + ,2 + ,36 + ,32 + ,17 + ,15 + ,13 + ,2 + ,32 + ,37 + ,13 + ,6 + ,14 + ,2 + ,33 + ,36 + ,15 + ,9 + ,19 + ,2 + ,34 + ,32 + ,16 + ,11 + ,13 + ,2 + ,32 + ,35 + ,12 + ,8 + ,12 + ,2 + ,34 + ,36 + ,13 + ,8 + ,13) + ,dim=c(6 + ,162) + ,dimnames=list(c('gender' + ,'connected' + ,'separate' + ,'learning' + ,'software' + ,'happiness') + ,1:162)) > y <- array(NA,dim=c(6,162),dimnames=list(c('gender','connected','separate','learning','software','happiness'),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 = '5' > #'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 > 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 gender connected separate learning happiness 1 12 2 41 38 13 14 2 11 2 39 32 16 18 3 15 2 30 35 19 11 4 6 1 31 33 15 12 5 13 2 34 37 14 16 6 10 2 35 29 13 18 7 12 2 39 31 19 14 8 14 2 34 36 15 14 9 12 2 36 35 14 15 10 6 2 37 38 15 15 11 10 1 38 31 16 17 12 12 2 36 34 16 19 13 12 1 38 35 16 10 14 11 2 39 38 16 16 15 15 2 33 37 17 18 16 12 1 32 33 15 14 17 10 1 36 32 15 14 18 12 2 38 38 20 17 19 11 1 39 38 18 14 20 12 2 32 32 16 16 21 11 1 32 33 16 18 22 12 2 31 31 16 11 23 13 2 39 38 19 14 24 11 2 37 39 16 12 25 9 1 39 32 17 17 26 13 2 41 32 17 9 27 10 1 36 35 16 16 28 14 2 33 37 15 14 29 12 2 33 33 16 15 30 10 1 34 33 14 11 31 12 2 31 28 15 16 32 8 1 27 32 12 13 33 10 2 37 31 14 17 34 12 2 34 37 16 15 35 12 1 34 30 14 14 36 7 1 32 33 7 16 37 6 1 29 31 10 9 38 12 1 36 33 14 15 39 10 2 29 31 16 17 40 10 1 35 33 16 13 41 10 1 37 32 16 15 42 12 2 34 33 14 16 43 15 1 38 32 20 16 44 10 1 35 33 14 12 45 10 2 38 28 14 12 46 12 2 37 35 11 11 47 13 2 38 39 14 15 48 11 2 33 34 15 15 49 11 2 36 38 16 17 50 12 1 38 32 14 13 51 14 2 32 38 16 16 52 10 1 32 30 14 14 53 12 1 32 33 12 11 54 13 2 34 38 16 12 55 5 1 32 32 9 12 56 6 2 37 32 14 15 57 12 2 39 34 16 16 58 12 2 29 34 16 15 59 11 1 37 36 15 12 60 10 2 35 34 16 12 61 7 1 30 28 12 8 62 12 1 38 34 16 13 63 14 2 34 35 16 11 64 11 2 31 35 14 14 65 12 2 34 31 16 15 66 13 1 35 37 17 10 67 14 2 36 35 18 11 68 11 1 30 27 18 12 69 12 2 39 40 12 15 70 12 1 35 37 16 15 71 8 1 38 36 10 14 72 11 2 31 38 14 16 73 14 2 34 39 18 15 74 14 1 38 41 18 15 75 12 1 34 27 16 13 76 9 2 39 30 17 12 77 13 2 37 37 16 17 78 11 2 34 31 16 13 79 12 1 28 31 13 15 80 12 1 37 27 16 13 81 12 1 33 36 16 15 82 12 1 37 38 20 16 83 12 2 35 37 16 15 84 12 1 37 33 15 16 85 11 2 32 34 15 15 86 10 2 33 31 16 14 87 9 1 38 39 14 15 88 12 2 33 34 16 14 89 12 2 29 32 16 13 90 12 2 33 33 15 7 91 9 2 31 36 12 17 92 15 2 36 32 17 13 93 12 2 35 41 16 15 94 12 2 32 28 15 14 95 12 2 29 30 13 13 96 10 2 39 36 16 16 97 13 2 37 35 16 12 98 9 2 35 31 16 14 99 12 1 37 34 16 17 100 10 1 32 36 14 15 101 14 2 38 36 16 17 102 11 1 37 35 16 12 103 15 2 36 37 20 16 104 11 1 32 28 15 11 105 11 2 33 39 16 15 106 12 1 40 32 13 9 107 12 2 38 35 17 16 108 12 1 41 39 16 15 109 11 1 36 35 16 10 110 7 2 43 42 12 10 111 12 2 30 34 16 15 112 14 2 31 33 16 11 113 11 2 32 41 17 13 114 11 1 32 33 13 14 115 10 2 37 34 12 18 116 13 1 37 32 18 16 117 13 2 33 40 14 14 118 8 2 34 40 14 14 119 11 2 33 35 13 14 120 12 2 38 36 16 14 121 11 2 33 37 13 12 122 13 2 31 27 16 14 123 12 2 38 39 13 15 124 14 2 37 38 16 15 125 13 2 33 31 15 15 126 15 2 31 33 16 13 127 10 1 39 32 15 17 128 11 2 44 39 17 17 129 9 2 33 36 15 19 130 11 2 35 33 12 15 131 10 1 32 33 16 13 132 11 1 28 32 10 9 133 8 2 40 37 16 15 134 11 1 27 30 12 15 135 12 1 37 38 14 15 136 12 2 32 29 15 16 137 9 1 28 22 13 11 138 11 1 34 35 15 14 139 10 2 30 35 11 11 140 8 2 35 34 12 15 141 9 1 31 35 8 13 142 8 2 32 34 16 15 143 9 1 30 34 15 16 144 15 2 30 35 17 14 145 11 1 31 23 16 15 146 8 2 40 31 10 16 147 13 2 32 27 18 16 148 12 1 36 36 13 11 149 12 1 32 31 16 12 150 9 1 35 32 13 9 151 7 2 38 39 10 16 152 13 2 42 37 15 13 153 9 1 34 38 16 16 154 6 2 35 39 16 12 155 8 2 35 34 14 9 156 8 2 33 31 10 13 157 15 2 36 32 17 13 158 6 2 32 37 13 14 159 9 2 33 36 15 19 160 11 2 34 32 16 13 161 8 2 32 35 12 12 162 8 2 34 36 13 13 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) gender connected separate learning happiness 3.86486 0.45002 -0.04317 0.01850 0.52488 -0.03727 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -5.9263 -0.9909 0.1542 1.2985 3.0493 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3.86486 1.88849 2.047 0.0424 * gender 0.45002 0.30613 1.470 0.1436 connected -0.04317 0.04637 -0.931 0.3533 separate 0.01850 0.04439 0.417 0.6774 learning 0.52488 0.06555 8.007 2.53e-13 *** happiness -0.03727 0.06320 -0.590 0.5563 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1.803 on 156 degrees of freedom Multiple R-squared: 0.3132, Adjusted R-squared: 0.2912 F-statistic: 14.23 on 5 and 156 DF, p-value: 1.817e-11 > 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.020594841 0.041189683 0.979405159 [2,] 0.974776205 0.050447590 0.025223795 [3,] 0.995903306 0.008193388 0.004096694 [4,] 0.991346133 0.017307735 0.008653867 [5,] 0.993037707 0.013924586 0.006962293 [6,] 0.987554722 0.024890555 0.012445278 [7,] 0.990866446 0.018267108 0.009133554 [8,] 0.990428337 0.019143326 0.009571663 [9,] 0.984215643 0.031568713 0.015784357 [10,] 0.979607501 0.040784998 0.020392499 [11,] 0.969513758 0.060972484 0.030486242 [12,] 0.954378240 0.091243520 0.045621760 [13,] 0.934653108 0.130693783 0.065346892 [14,] 0.909331782 0.181336437 0.090668218 [15,] 0.877189467 0.245621066 0.122810533 [16,] 0.850056851 0.299886297 0.149943149 [17,] 0.830388657 0.339222685 0.169611343 [18,] 0.806918446 0.386163107 0.193081554 [19,] 0.763703230 0.472593540 0.236296770 [20,] 0.768394990 0.463210021 0.231605010 [21,] 0.718421310 0.563157381 0.281578690 [22,] 0.663647804 0.672704391 0.336352196 [23,] 0.607459820 0.785080359 0.392540180 [24,] 0.600008105 0.799983790 0.399991895 [25,] 0.550114187 0.899771626 0.449885813 [26,] 0.492187574 0.984375149 0.507812426 [27,] 0.539526364 0.920947273 0.460473636 [28,] 0.482011638 0.964023276 0.517988362 [29,] 0.540257068 0.919485864 0.459742932 [30,] 0.586869378 0.826261243 0.413130622 [31,] 0.601418387 0.797163226 0.398581613 [32,] 0.558454623 0.883090753 0.441545377 [33,] 0.512275640 0.975448720 0.487724360 [34,] 0.475406907 0.950813814 0.524593093 [35,] 0.544718921 0.910562158 0.455281079 [36,] 0.493782206 0.987564413 0.506217794 [37,] 0.447288495 0.894576991 0.552711505 [38,] 0.488640707 0.977281415 0.511359293 [39,] 0.492138970 0.984277940 0.507861030 [40,] 0.445580556 0.891161111 0.554419444 [41,] 0.412510062 0.825020123 0.587489938 [42,] 0.429687128 0.859374257 0.570312872 [43,] 0.436009493 0.872018986 0.563990507 [44,] 0.389131053 0.778262106 0.610868947 [45,] 0.440678831 0.881357662 0.559321169 [46,] 0.401002795 0.802005589 0.598997205 [47,] 0.485522494 0.971044988 0.514477506 [48,] 0.745440073 0.509119855 0.254559927 [49,] 0.706866174 0.586267653 0.293133826 [50,] 0.664118657 0.671762686 0.335881343 [51,] 0.619811563 0.760376874 0.380188437 [52,] 0.624105590 0.751788821 0.375894410 [53,] 0.648443457 0.703113087 0.351556543 [54,] 0.616499820 0.767000361 0.383500180 [55,] 0.626412792 0.747174415 0.373587208 [56,] 0.581522597 0.836954806 0.418477403 [57,] 0.537104459 0.925791082 0.462895541 [58,] 0.502829739 0.994340522 0.497170261 [59,] 0.472682054 0.945364109 0.527317946 [60,] 0.451174580 0.902349160 0.548825420 [61,] 0.468489314 0.936978628 0.531510686 [62,] 0.426593899 0.853187798 0.573406101 [63,] 0.382747576 0.765495152 0.617252424 [64,] 0.343839211 0.687678422 0.656160789 [65,] 0.316594370 0.633188739 0.683405630 [66,] 0.304277014 0.608554029 0.695722986 [67,] 0.291781103 0.583562206 0.708218897 [68,] 0.371745798 0.743491596 0.628254202 [69,] 0.353584970 0.707169940 0.646415030 [70,] 0.318427554 0.636855108 0.681572446 [71,] 0.338696279 0.677392558 0.661303721 [72,] 0.326413144 0.652826288 0.673586856 [73,] 0.289804176 0.579608353 0.710195824 [74,] 0.274515368 0.549030736 0.725484632 [75,] 0.240308662 0.480617325 0.759691338 [76,] 0.225391182 0.450782364 0.774608818 [77,] 0.193738105 0.387476211 0.806261895 [78,] 0.192445491 0.384890983 0.807554509 [79,] 0.181862480 0.363724960 0.818137520 [80,] 0.153127045 0.306254090 0.846872955 [81,] 0.127291171 0.254582342 0.872708829 [82,] 0.105627561 0.211255121 0.894372439 [83,] 0.091408520 0.182817041 0.908591480 [84,] 0.119930201 0.239860402 0.880069799 [85,] 0.103520409 0.207040818 0.896479591 [86,] 0.088098203 0.176196406 0.911901797 [87,] 0.084414273 0.168828546 0.915585727 [88,] 0.080414683 0.160829365 0.919585317 [89,] 0.071522334 0.143044667 0.928477666 [90,] 0.093697581 0.187395162 0.906302419 [91,] 0.079275297 0.158550594 0.920724703 [92,] 0.063961131 0.127922262 0.936038869 [93,] 0.078748886 0.157497772 0.921251114 [94,] 0.063501417 0.127002834 0.936498583 [95,] 0.059311265 0.118622529 0.940688735 [96,] 0.048646303 0.097292607 0.951353697 [97,] 0.040998442 0.081996884 0.959001558 [98,] 0.042956360 0.085912719 0.957043640 [99,] 0.033328029 0.066656058 0.966671971 [100,] 0.027950895 0.055901789 0.972049105 [101,] 0.021373766 0.042747532 0.978626234 [102,] 0.029565373 0.059130746 0.970434627 [103,] 0.022625746 0.045251492 0.977374254 [104,] 0.024418246 0.048836493 0.975581754 [105,] 0.021314863 0.042629726 0.978685137 [106,] 0.017402427 0.034804854 0.982597573 [107,] 0.013275229 0.026550458 0.986724771 [108,] 0.010314129 0.020628259 0.989685871 [109,] 0.014583483 0.029166966 0.985416517 [110,] 0.018110166 0.036220332 0.981889834 [111,] 0.014389779 0.028779558 0.985610221 [112,] 0.010793161 0.021586322 0.989206839 [113,] 0.008481310 0.016962620 0.991518690 [114,] 0.006870819 0.013741638 0.993129181 [115,] 0.008740841 0.017481681 0.991259159 [116,] 0.016172657 0.032345315 0.983827343 [117,] 0.017910247 0.035820494 0.982089753 [118,] 0.051392767 0.102785533 0.948607233 [119,] 0.041040728 0.082081457 0.958959272 [120,] 0.031782459 0.063564918 0.968217541 [121,] 0.027307612 0.054615223 0.972692388 [122,] 0.027072551 0.054145103 0.972927449 [123,] 0.022786213 0.045572427 0.977213787 [124,] 0.025244464 0.050488927 0.974755536 [125,] 0.040635664 0.081271329 0.959364336 [126,] 0.041148786 0.082297572 0.958851214 [127,] 0.041037249 0.082074498 0.958962751 [128,] 0.035628979 0.071257959 0.964371021 [129,] 0.033433881 0.066867763 0.966566119 [130,] 0.023658192 0.047316383 0.976341808 [131,] 0.027330392 0.054660784 0.972669608 [132,] 0.020026972 0.040053944 0.979973028 [133,] 0.042128310 0.084256619 0.957871690 [134,] 0.059233634 0.118467268 0.940766366 [135,] 0.042889590 0.085779180 0.957110410 [136,] 0.292644004 0.585288007 0.707355996 [137,] 0.342922471 0.685844941 0.657077529 [138,] 0.612260268 0.775479464 0.387739732 [139,] 0.595236999 0.809526003 0.404763001 [140,] 0.856549111 0.286901777 0.143450889 [141,] 0.804449346 0.391101308 0.195550654 [142,] 0.741740035 0.516519930 0.258259965 [143,] 0.624965321 0.750069358 0.375034679 [144,] 0.520600243 0.958799515 0.479399757 [145,] 0.363041248 0.726082495 0.636958752 > postscript(file="/var/wessaorg/rcomp/tmp/1m6am1323868384.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/29ykn1323868384.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/3l1ww1323868384.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/42q6j1323868384.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/5bkm61323868384.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.00046561 -0.40045768 1.31995720 -5.01304717 2.26641163 0.05700214 7 8 9 10 11 12 -1.10568513 2.68548956 1.35248683 -5.18472304 -1.01237952 0.47029461 13 14 15 16 17 18 0.65273976 -0.58599282 2.72312572 1.10466322 -0.70414715 -1.69143142 19 20 21 22 23 24 -1.26027813 0.22279682 -0.27114479 0.01177917 -0.23518195 -0.83991315 25 26 27 28 29 30 -2.51259030 0.82558320 -1.20999168 2.62381749 0.21020085 -0.39591479 31 32 33 34 35 36 0.77850623 -1.55531751 -0.45580460 0.17937519 1.77139065 0.37827112 37 38 39 40 41 42 -2.54978115 1.83950599 -1.85095226 -1.32797191 -1.14858945 1.34040982 43 44 45 46 47 48 1.83231699 -0.31547333 -0.54347811 2.82123487 2.36483368 -0.28341494 49 50 51 52 53 54 -0.67824145 1.86981271 2.11179954 -0.31495439 2.56750768 1.04906884 55 56 57 58 59 60 -2.80207258 -4.54884201 0.48800536 0.01901123 0.19048931 -1.83376046 61 62 63 64 65 66 -2.53814643 0.78304611 2.06729854 0.09935530 0.29037247 0.96133935 67 68 69 70 71 72 1.10387608 -1.51987367 2.43927416 0.67256778 -0.06738153 0.11839453 73 74 75 76 77 78 1.09260859 1.67831965 0.73985285 -3.11195594 1.38343062 -0.78416540 79 80 81 82 83 84 2.05600868 0.86937041 0.60472228 -1.32185281 0.22254771 1.39506369 85 86 87 88 89 90 -0.32658746 -1.79006899 -1.18514625 0.15443237 -0.01852755 0.43693313 91 92 93 94 95 96 -0.75756994 2.75879634 0.14854952 0.74714089 1.59312281 -1.54899373 97 98 99 100 101 102 1.23408504 -2.70372395 0.88894933 -0.38868273 2.44510268 -0.31589489 103 104 105 106 107 108 1.20345415 0.08535415 -0.90079642 2.33196576 -0.09855046 0.89460380 109 110 111 112 113 114 -0.43360528 -2.61137952 0.06218375 1.97478008 -1.58038966 1.15443073 115 116 117 118 119 120 0.57573321 0.83891198 2.09320260 -2.86362488 0.71058409 0.33329588 121 122 123 124 125 126 0.59904713 1.19758416 1.88971744 2.29039320 1.77208370 3.04931795 127 128 129 130 131 132 -0.46282279 -0.87624459 -2.17133829 1.39608091 -1.45748947 2.38854678 133 134 135 136 137 138 -3.56158969 1.55621946 1.79018078 0.80317921 -0.92657115 0.15400917 139 140 141 142 143 144 0.51902723 -1.62241864 1.66140895 -3.85147121 -1.92564350 2.48153151 145 146 147 148 149 150 -0.24112865 -0.26402096 0.26552704 2.15981537 0.54224069 -0.88389684 151 152 153 154 155 156 -1.49836237 1.97510123 -2.35183535 -5.92625819 -2.89579975 -0.67803540 157 158 159 160 161 162 2.75879634 -4.36958752 -2.17133829 -0.80266495 -1.88224255 -2.30201187 > postscript(file="/var/wessaorg/rcomp/tmp/66o3t1323868384.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.00046561 NA 1 -0.40045768 2.00046561 2 1.31995720 -0.40045768 3 -5.01304717 1.31995720 4 2.26641163 -5.01304717 5 0.05700214 2.26641163 6 -1.10568513 0.05700214 7 2.68548956 -1.10568513 8 1.35248683 2.68548956 9 -5.18472304 1.35248683 10 -1.01237952 -5.18472304 11 0.47029461 -1.01237952 12 0.65273976 0.47029461 13 -0.58599282 0.65273976 14 2.72312572 -0.58599282 15 1.10466322 2.72312572 16 -0.70414715 1.10466322 17 -1.69143142 -0.70414715 18 -1.26027813 -1.69143142 19 0.22279682 -1.26027813 20 -0.27114479 0.22279682 21 0.01177917 -0.27114479 22 -0.23518195 0.01177917 23 -0.83991315 -0.23518195 24 -2.51259030 -0.83991315 25 0.82558320 -2.51259030 26 -1.20999168 0.82558320 27 2.62381749 -1.20999168 28 0.21020085 2.62381749 29 -0.39591479 0.21020085 30 0.77850623 -0.39591479 31 -1.55531751 0.77850623 32 -0.45580460 -1.55531751 33 0.17937519 -0.45580460 34 1.77139065 0.17937519 35 0.37827112 1.77139065 36 -2.54978115 0.37827112 37 1.83950599 -2.54978115 38 -1.85095226 1.83950599 39 -1.32797191 -1.85095226 40 -1.14858945 -1.32797191 41 1.34040982 -1.14858945 42 1.83231699 1.34040982 43 -0.31547333 1.83231699 44 -0.54347811 -0.31547333 45 2.82123487 -0.54347811 46 2.36483368 2.82123487 47 -0.28341494 2.36483368 48 -0.67824145 -0.28341494 49 1.86981271 -0.67824145 50 2.11179954 1.86981271 51 -0.31495439 2.11179954 52 2.56750768 -0.31495439 53 1.04906884 2.56750768 54 -2.80207258 1.04906884 55 -4.54884201 -2.80207258 56 0.48800536 -4.54884201 57 0.01901123 0.48800536 58 0.19048931 0.01901123 59 -1.83376046 0.19048931 60 -2.53814643 -1.83376046 61 0.78304611 -2.53814643 62 2.06729854 0.78304611 63 0.09935530 2.06729854 64 0.29037247 0.09935530 65 0.96133935 0.29037247 66 1.10387608 0.96133935 67 -1.51987367 1.10387608 68 2.43927416 -1.51987367 69 0.67256778 2.43927416 70 -0.06738153 0.67256778 71 0.11839453 -0.06738153 72 1.09260859 0.11839453 73 1.67831965 1.09260859 74 0.73985285 1.67831965 75 -3.11195594 0.73985285 76 1.38343062 -3.11195594 77 -0.78416540 1.38343062 78 2.05600868 -0.78416540 79 0.86937041 2.05600868 80 0.60472228 0.86937041 81 -1.32185281 0.60472228 82 0.22254771 -1.32185281 83 1.39506369 0.22254771 84 -0.32658746 1.39506369 85 -1.79006899 -0.32658746 86 -1.18514625 -1.79006899 87 0.15443237 -1.18514625 88 -0.01852755 0.15443237 89 0.43693313 -0.01852755 90 -0.75756994 0.43693313 91 2.75879634 -0.75756994 92 0.14854952 2.75879634 93 0.74714089 0.14854952 94 1.59312281 0.74714089 95 -1.54899373 1.59312281 96 1.23408504 -1.54899373 97 -2.70372395 1.23408504 98 0.88894933 -2.70372395 99 -0.38868273 0.88894933 100 2.44510268 -0.38868273 101 -0.31589489 2.44510268 102 1.20345415 -0.31589489 103 0.08535415 1.20345415 104 -0.90079642 0.08535415 105 2.33196576 -0.90079642 106 -0.09855046 2.33196576 107 0.89460380 -0.09855046 108 -0.43360528 0.89460380 109 -2.61137952 -0.43360528 110 0.06218375 -2.61137952 111 1.97478008 0.06218375 112 -1.58038966 1.97478008 113 1.15443073 -1.58038966 114 0.57573321 1.15443073 115 0.83891198 0.57573321 116 2.09320260 0.83891198 117 -2.86362488 2.09320260 118 0.71058409 -2.86362488 119 0.33329588 0.71058409 120 0.59904713 0.33329588 121 1.19758416 0.59904713 122 1.88971744 1.19758416 123 2.29039320 1.88971744 124 1.77208370 2.29039320 125 3.04931795 1.77208370 126 -0.46282279 3.04931795 127 -0.87624459 -0.46282279 128 -2.17133829 -0.87624459 129 1.39608091 -2.17133829 130 -1.45748947 1.39608091 131 2.38854678 -1.45748947 132 -3.56158969 2.38854678 133 1.55621946 -3.56158969 134 1.79018078 1.55621946 135 0.80317921 1.79018078 136 -0.92657115 0.80317921 137 0.15400917 -0.92657115 138 0.51902723 0.15400917 139 -1.62241864 0.51902723 140 1.66140895 -1.62241864 141 -3.85147121 1.66140895 142 -1.92564350 -3.85147121 143 2.48153151 -1.92564350 144 -0.24112865 2.48153151 145 -0.26402096 -0.24112865 146 0.26552704 -0.26402096 147 2.15981537 0.26552704 148 0.54224069 2.15981537 149 -0.88389684 0.54224069 150 -1.49836237 -0.88389684 151 1.97510123 -1.49836237 152 -2.35183535 1.97510123 153 -5.92625819 -2.35183535 154 -2.89579975 -5.92625819 155 -0.67803540 -2.89579975 156 2.75879634 -0.67803540 157 -4.36958752 2.75879634 158 -2.17133829 -4.36958752 159 -0.80266495 -2.17133829 160 -1.88224255 -0.80266495 161 -2.30201187 -1.88224255 162 NA -2.30201187 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -0.40045768 2.00046561 [2,] 1.31995720 -0.40045768 [3,] -5.01304717 1.31995720 [4,] 2.26641163 -5.01304717 [5,] 0.05700214 2.26641163 [6,] -1.10568513 0.05700214 [7,] 2.68548956 -1.10568513 [8,] 1.35248683 2.68548956 [9,] -5.18472304 1.35248683 [10,] -1.01237952 -5.18472304 [11,] 0.47029461 -1.01237952 [12,] 0.65273976 0.47029461 [13,] -0.58599282 0.65273976 [14,] 2.72312572 -0.58599282 [15,] 1.10466322 2.72312572 [16,] -0.70414715 1.10466322 [17,] -1.69143142 -0.70414715 [18,] -1.26027813 -1.69143142 [19,] 0.22279682 -1.26027813 [20,] -0.27114479 0.22279682 [21,] 0.01177917 -0.27114479 [22,] -0.23518195 0.01177917 [23,] -0.83991315 -0.23518195 [24,] -2.51259030 -0.83991315 [25,] 0.82558320 -2.51259030 [26,] -1.20999168 0.82558320 [27,] 2.62381749 -1.20999168 [28,] 0.21020085 2.62381749 [29,] -0.39591479 0.21020085 [30,] 0.77850623 -0.39591479 [31,] -1.55531751 0.77850623 [32,] -0.45580460 -1.55531751 [33,] 0.17937519 -0.45580460 [34,] 1.77139065 0.17937519 [35,] 0.37827112 1.77139065 [36,] -2.54978115 0.37827112 [37,] 1.83950599 -2.54978115 [38,] -1.85095226 1.83950599 [39,] -1.32797191 -1.85095226 [40,] -1.14858945 -1.32797191 [41,] 1.34040982 -1.14858945 [42,] 1.83231699 1.34040982 [43,] -0.31547333 1.83231699 [44,] -0.54347811 -0.31547333 [45,] 2.82123487 -0.54347811 [46,] 2.36483368 2.82123487 [47,] -0.28341494 2.36483368 [48,] -0.67824145 -0.28341494 [49,] 1.86981271 -0.67824145 [50,] 2.11179954 1.86981271 [51,] -0.31495439 2.11179954 [52,] 2.56750768 -0.31495439 [53,] 1.04906884 2.56750768 [54,] -2.80207258 1.04906884 [55,] -4.54884201 -2.80207258 [56,] 0.48800536 -4.54884201 [57,] 0.01901123 0.48800536 [58,] 0.19048931 0.01901123 [59,] -1.83376046 0.19048931 [60,] -2.53814643 -1.83376046 [61,] 0.78304611 -2.53814643 [62,] 2.06729854 0.78304611 [63,] 0.09935530 2.06729854 [64,] 0.29037247 0.09935530 [65,] 0.96133935 0.29037247 [66,] 1.10387608 0.96133935 [67,] -1.51987367 1.10387608 [68,] 2.43927416 -1.51987367 [69,] 0.67256778 2.43927416 [70,] -0.06738153 0.67256778 [71,] 0.11839453 -0.06738153 [72,] 1.09260859 0.11839453 [73,] 1.67831965 1.09260859 [74,] 0.73985285 1.67831965 [75,] -3.11195594 0.73985285 [76,] 1.38343062 -3.11195594 [77,] -0.78416540 1.38343062 [78,] 2.05600868 -0.78416540 [79,] 0.86937041 2.05600868 [80,] 0.60472228 0.86937041 [81,] -1.32185281 0.60472228 [82,] 0.22254771 -1.32185281 [83,] 1.39506369 0.22254771 [84,] -0.32658746 1.39506369 [85,] -1.79006899 -0.32658746 [86,] -1.18514625 -1.79006899 [87,] 0.15443237 -1.18514625 [88,] -0.01852755 0.15443237 [89,] 0.43693313 -0.01852755 [90,] -0.75756994 0.43693313 [91,] 2.75879634 -0.75756994 [92,] 0.14854952 2.75879634 [93,] 0.74714089 0.14854952 [94,] 1.59312281 0.74714089 [95,] -1.54899373 1.59312281 [96,] 1.23408504 -1.54899373 [97,] -2.70372395 1.23408504 [98,] 0.88894933 -2.70372395 [99,] -0.38868273 0.88894933 [100,] 2.44510268 -0.38868273 [101,] -0.31589489 2.44510268 [102,] 1.20345415 -0.31589489 [103,] 0.08535415 1.20345415 [104,] -0.90079642 0.08535415 [105,] 2.33196576 -0.90079642 [106,] -0.09855046 2.33196576 [107,] 0.89460380 -0.09855046 [108,] -0.43360528 0.89460380 [109,] -2.61137952 -0.43360528 [110,] 0.06218375 -2.61137952 [111,] 1.97478008 0.06218375 [112,] -1.58038966 1.97478008 [113,] 1.15443073 -1.58038966 [114,] 0.57573321 1.15443073 [115,] 0.83891198 0.57573321 [116,] 2.09320260 0.83891198 [117,] -2.86362488 2.09320260 [118,] 0.71058409 -2.86362488 [119,] 0.33329588 0.71058409 [120,] 0.59904713 0.33329588 [121,] 1.19758416 0.59904713 [122,] 1.88971744 1.19758416 [123,] 2.29039320 1.88971744 [124,] 1.77208370 2.29039320 [125,] 3.04931795 1.77208370 [126,] -0.46282279 3.04931795 [127,] -0.87624459 -0.46282279 [128,] -2.17133829 -0.87624459 [129,] 1.39608091 -2.17133829 [130,] -1.45748947 1.39608091 [131,] 2.38854678 -1.45748947 [132,] -3.56158969 2.38854678 [133,] 1.55621946 -3.56158969 [134,] 1.79018078 1.55621946 [135,] 0.80317921 1.79018078 [136,] -0.92657115 0.80317921 [137,] 0.15400917 -0.92657115 [138,] 0.51902723 0.15400917 [139,] -1.62241864 0.51902723 [140,] 1.66140895 -1.62241864 [141,] -3.85147121 1.66140895 [142,] -1.92564350 -3.85147121 [143,] 2.48153151 -1.92564350 [144,] -0.24112865 2.48153151 [145,] -0.26402096 -0.24112865 [146,] 0.26552704 -0.26402096 [147,] 2.15981537 0.26552704 [148,] 0.54224069 2.15981537 [149,] -0.88389684 0.54224069 [150,] -1.49836237 -0.88389684 [151,] 1.97510123 -1.49836237 [152,] -2.35183535 1.97510123 [153,] -5.92625819 -2.35183535 [154,] -2.89579975 -5.92625819 [155,] -0.67803540 -2.89579975 [156,] 2.75879634 -0.67803540 [157,] -4.36958752 2.75879634 [158,] -2.17133829 -4.36958752 [159,] -0.80266495 -2.17133829 [160,] -1.88224255 -0.80266495 [161,] -2.30201187 -1.88224255 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -0.40045768 2.00046561 2 1.31995720 -0.40045768 3 -5.01304717 1.31995720 4 2.26641163 -5.01304717 5 0.05700214 2.26641163 6 -1.10568513 0.05700214 7 2.68548956 -1.10568513 8 1.35248683 2.68548956 9 -5.18472304 1.35248683 10 -1.01237952 -5.18472304 11 0.47029461 -1.01237952 12 0.65273976 0.47029461 13 -0.58599282 0.65273976 14 2.72312572 -0.58599282 15 1.10466322 2.72312572 16 -0.70414715 1.10466322 17 -1.69143142 -0.70414715 18 -1.26027813 -1.69143142 19 0.22279682 -1.26027813 20 -0.27114479 0.22279682 21 0.01177917 -0.27114479 22 -0.23518195 0.01177917 23 -0.83991315 -0.23518195 24 -2.51259030 -0.83991315 25 0.82558320 -2.51259030 26 -1.20999168 0.82558320 27 2.62381749 -1.20999168 28 0.21020085 2.62381749 29 -0.39591479 0.21020085 30 0.77850623 -0.39591479 31 -1.55531751 0.77850623 32 -0.45580460 -1.55531751 33 0.17937519 -0.45580460 34 1.77139065 0.17937519 35 0.37827112 1.77139065 36 -2.54978115 0.37827112 37 1.83950599 -2.54978115 38 -1.85095226 1.83950599 39 -1.32797191 -1.85095226 40 -1.14858945 -1.32797191 41 1.34040982 -1.14858945 42 1.83231699 1.34040982 43 -0.31547333 1.83231699 44 -0.54347811 -0.31547333 45 2.82123487 -0.54347811 46 2.36483368 2.82123487 47 -0.28341494 2.36483368 48 -0.67824145 -0.28341494 49 1.86981271 -0.67824145 50 2.11179954 1.86981271 51 -0.31495439 2.11179954 52 2.56750768 -0.31495439 53 1.04906884 2.56750768 54 -2.80207258 1.04906884 55 -4.54884201 -2.80207258 56 0.48800536 -4.54884201 57 0.01901123 0.48800536 58 0.19048931 0.01901123 59 -1.83376046 0.19048931 60 -2.53814643 -1.83376046 61 0.78304611 -2.53814643 62 2.06729854 0.78304611 63 0.09935530 2.06729854 64 0.29037247 0.09935530 65 0.96133935 0.29037247 66 1.10387608 0.96133935 67 -1.51987367 1.10387608 68 2.43927416 -1.51987367 69 0.67256778 2.43927416 70 -0.06738153 0.67256778 71 0.11839453 -0.06738153 72 1.09260859 0.11839453 73 1.67831965 1.09260859 74 0.73985285 1.67831965 75 -3.11195594 0.73985285 76 1.38343062 -3.11195594 77 -0.78416540 1.38343062 78 2.05600868 -0.78416540 79 0.86937041 2.05600868 80 0.60472228 0.86937041 81 -1.32185281 0.60472228 82 0.22254771 -1.32185281 83 1.39506369 0.22254771 84 -0.32658746 1.39506369 85 -1.79006899 -0.32658746 86 -1.18514625 -1.79006899 87 0.15443237 -1.18514625 88 -0.01852755 0.15443237 89 0.43693313 -0.01852755 90 -0.75756994 0.43693313 91 2.75879634 -0.75756994 92 0.14854952 2.75879634 93 0.74714089 0.14854952 94 1.59312281 0.74714089 95 -1.54899373 1.59312281 96 1.23408504 -1.54899373 97 -2.70372395 1.23408504 98 0.88894933 -2.70372395 99 -0.38868273 0.88894933 100 2.44510268 -0.38868273 101 -0.31589489 2.44510268 102 1.20345415 -0.31589489 103 0.08535415 1.20345415 104 -0.90079642 0.08535415 105 2.33196576 -0.90079642 106 -0.09855046 2.33196576 107 0.89460380 -0.09855046 108 -0.43360528 0.89460380 109 -2.61137952 -0.43360528 110 0.06218375 -2.61137952 111 1.97478008 0.06218375 112 -1.58038966 1.97478008 113 1.15443073 -1.58038966 114 0.57573321 1.15443073 115 0.83891198 0.57573321 116 2.09320260 0.83891198 117 -2.86362488 2.09320260 118 0.71058409 -2.86362488 119 0.33329588 0.71058409 120 0.59904713 0.33329588 121 1.19758416 0.59904713 122 1.88971744 1.19758416 123 2.29039320 1.88971744 124 1.77208370 2.29039320 125 3.04931795 1.77208370 126 -0.46282279 3.04931795 127 -0.87624459 -0.46282279 128 -2.17133829 -0.87624459 129 1.39608091 -2.17133829 130 -1.45748947 1.39608091 131 2.38854678 -1.45748947 132 -3.56158969 2.38854678 133 1.55621946 -3.56158969 134 1.79018078 1.55621946 135 0.80317921 1.79018078 136 -0.92657115 0.80317921 137 0.15400917 -0.92657115 138 0.51902723 0.15400917 139 -1.62241864 0.51902723 140 1.66140895 -1.62241864 141 -3.85147121 1.66140895 142 -1.92564350 -3.85147121 143 2.48153151 -1.92564350 144 -0.24112865 2.48153151 145 -0.26402096 -0.24112865 146 0.26552704 -0.26402096 147 2.15981537 0.26552704 148 0.54224069 2.15981537 149 -0.88389684 0.54224069 150 -1.49836237 -0.88389684 151 1.97510123 -1.49836237 152 -2.35183535 1.97510123 153 -5.92625819 -2.35183535 154 -2.89579975 -5.92625819 155 -0.67803540 -2.89579975 156 2.75879634 -0.67803540 157 -4.36958752 2.75879634 158 -2.17133829 -4.36958752 159 -0.80266495 -2.17133829 160 -1.88224255 -0.80266495 161 -2.30201187 -1.88224255 > 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/7p21k1323868384.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/8cngz1323868384.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/9uql31323868384.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/10p6ra1323868384.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/117n791323868384.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/12eetp1323868384.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/13yfw51323868384.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/1430zt1323868384.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/1521ef1323868384.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/16ouei1323868384.tab") + } > > try(system("convert tmp/1m6am1323868384.ps tmp/1m6am1323868384.png",intern=TRUE)) character(0) > try(system("convert tmp/29ykn1323868384.ps tmp/29ykn1323868384.png",intern=TRUE)) character(0) > try(system("convert tmp/3l1ww1323868384.ps tmp/3l1ww1323868384.png",intern=TRUE)) character(0) > try(system("convert tmp/42q6j1323868384.ps tmp/42q6j1323868384.png",intern=TRUE)) character(0) > try(system("convert tmp/5bkm61323868384.ps tmp/5bkm61323868384.png",intern=TRUE)) character(0) > try(system("convert tmp/66o3t1323868384.ps tmp/66o3t1323868384.png",intern=TRUE)) character(0) > try(system("convert tmp/7p21k1323868384.ps tmp/7p21k1323868384.png",intern=TRUE)) character(0) > try(system("convert tmp/8cngz1323868384.ps tmp/8cngz1323868384.png",intern=TRUE)) character(0) > try(system("convert tmp/9uql31323868384.ps tmp/9uql31323868384.png",intern=TRUE)) character(0) > try(system("convert tmp/10p6ra1323868384.ps tmp/10p6ra1323868384.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.828 0.545 5.386