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(14 + ,13 + ,41 + ,12 + ,53 + ,18 + ,16 + ,39 + ,11 + ,86 + ,11 + ,19 + ,30 + ,14 + ,66 + ,12 + ,15 + ,31 + ,12 + ,67 + ,16 + ,14 + ,34 + ,21 + ,76 + ,18 + ,13 + ,35 + ,12 + ,78 + ,14 + ,19 + ,39 + ,22 + ,53 + ,14 + ,15 + ,34 + ,11 + ,80 + ,15 + ,14 + ,36 + ,10 + ,74 + ,15 + ,15 + ,37 + ,13 + ,76 + ,17 + ,16 + ,38 + ,10 + ,79 + ,19 + ,16 + ,36 + ,8 + ,54 + ,10 + ,16 + ,38 + ,15 + ,67 + ,16 + ,16 + ,39 + ,14 + ,54 + ,18 + ,17 + ,33 + ,10 + ,87 + ,14 + ,15 + ,32 + ,14 + ,58 + ,14 + ,15 + ,36 + ,14 + ,75 + ,17 + ,20 + ,38 + ,11 + ,88 + ,14 + ,18 + ,39 + ,10 + ,64 + ,16 + ,16 + ,32 + ,13 + ,57 + ,18 + ,16 + ,32 + ,7 + ,66 + ,11 + ,16 + ,31 + ,14 + ,68 + ,14 + ,19 + ,39 + ,12 + ,54 + ,12 + ,16 + ,37 + ,14 + ,56 + ,17 + ,17 + ,39 + ,11 + ,86 + ,9 + ,17 + ,41 + ,9 + ,80 + ,16 + ,16 + ,36 + ,11 + ,76 + ,14 + ,15 + ,33 + ,15 + ,69 + ,15 + ,16 + ,33 + ,14 + ,78 + ,11 + ,14 + ,34 + ,13 + ,67 + ,16 + ,15 + ,31 + ,9 + ,80 + ,13 + ,12 + ,27 + ,15 + ,54 + ,17 + ,14 + ,37 + ,10 + ,71 + ,15 + ,16 + ,34 + ,11 + ,84 + ,14 + ,14 + ,34 + ,13 + ,74 + ,16 + ,7 + ,32 + ,8 + ,71 + ,9 + ,10 + ,29 + ,20 + ,63 + ,15 + ,14 + ,36 + ,12 + ,71 + ,17 + ,16 + ,29 + ,10 + ,76 + ,13 + ,16 + ,35 + ,10 + ,69 + ,15 + ,16 + ,37 + ,9 + ,74 + ,16 + ,14 + ,34 + ,14 + ,75 + ,16 + ,20 + ,38 + ,8 + ,54 + ,12 + ,14 + ,35 + ,14 + ,52 + ,12 + ,14 + ,38 + ,11 + ,69 + ,11 + ,11 + ,37 + ,13 + ,68 + ,15 + ,14 + ,38 + ,9 + ,65 + ,15 + ,15 + ,33 + ,11 + ,75 + ,17 + ,16 + ,36 + ,15 + ,74 + ,13 + ,14 + ,38 + ,11 + ,75 + ,16 + ,16 + ,32 + ,10 + ,72 + ,14 + ,14 + ,32 + ,14 + ,67 + ,11 + ,12 + ,32 + ,18 + ,63 + ,12 + ,16 + ,34 + ,14 + ,62 + ,12 + ,9 + ,32 + ,11 + ,63 + ,15 + ,14 + ,37 + ,12 + ,76 + ,16 + ,16 + ,39 + ,13 + ,74 + ,15 + ,16 + ,29 + ,9 + ,67 + ,12 + ,15 + ,37 + ,10 + ,73 + ,12 + ,16 + ,35 + ,15 + ,70 + ,8 + ,12 + ,30 + ,20 + ,53 + ,13 + ,16 + ,38 + ,12 + ,77 + ,11 + ,16 + ,34 + ,12 + ,77 + ,14 + ,14 + ,31 + ,14 + ,52 + ,15 + ,16 + ,34 + ,13 + ,54 + ,10 + ,17 + ,35 + ,11 + ,80 + ,11 + ,18 + ,36 + ,17 + ,66 + ,12 + ,18 + ,30 + ,12 + ,73 + ,15 + ,12 + ,39 + ,13 + ,63 + ,15 + ,16 + ,35 + ,14 + ,69 + ,14 + ,10 + ,38 + ,13 + ,67 + ,16 + ,14 + ,31 + ,15 + ,54 + ,15 + ,18 + ,34 + ,13 + ,81 + ,15 + ,18 + ,38 + ,10 + ,69 + ,13 + ,16 + ,34 + ,11 + ,84 + ,12 + ,17 + ,39 + ,19 + ,80 + ,17 + ,16 + ,37 + ,13 + ,70 + ,13 + ,16 + ,34 + ,17 + ,69 + ,15 + ,13 + ,28 + ,13 + ,77 + ,13 + ,16 + ,37 + ,9 + ,54 + ,15 + ,16 + ,33 + ,11 + ,79 + ,16 + ,20 + ,37 + ,10 + ,30 + ,15 + ,16 + ,35 + ,9 + ,71 + ,16 + ,15 + ,37 + ,12 + ,73 + ,15 + ,15 + ,32 + ,12 + ,72 + ,14 + ,16 + ,33 + ,13 + ,77 + ,15 + ,14 + ,38 + ,13 + ,75 + ,14 + ,16 + ,33 + ,12 + ,69 + ,13 + ,16 + ,29 + ,15 + ,54 + ,7 + ,15 + ,33 + ,22 + ,70 + ,17 + ,12 + ,31 + ,13 + ,73 + ,13 + ,17 + ,36 + ,15 + ,54 + ,15 + ,16 + ,35 + ,13 + ,77 + ,14 + ,15 + ,32 + ,15 + ,82 + ,13 + ,13 + ,29 + ,10 + ,80 + ,16 + ,16 + ,39 + ,11 + ,80 + ,12 + ,16 + ,37 + ,16 + ,69 + ,14 + ,16 + ,35 + ,11 + ,78 + ,17 + ,16 + ,37 + ,11 + ,81 + ,15 + ,14 + ,32 + ,10 + ,76 + ,17 + ,16 + ,38 + ,10 + ,76 + ,12 + ,16 + ,37 + ,16 + ,73 + ,16 + ,20 + ,36 + ,12 + ,85 + ,11 + ,15 + ,32 + ,11 + ,66 + ,15 + ,16 + ,33 + ,16 + ,79 + ,9 + ,13 + ,40 + ,19 + ,68 + ,16 + ,17 + ,38 + ,11 + ,76 + ,15 + ,16 + ,41 + ,16 + ,71 + ,10 + ,16 + ,36 + ,15 + ,54 + ,10 + ,12 + ,43 + ,24 + ,46 + ,15 + ,16 + ,30 + ,14 + ,82 + ,11 + ,16 + ,31 + ,15 + ,74 + ,13 + ,17 + ,32 + ,11 + ,88 + ,14 + ,13 + ,32 + ,15 + ,38 + ,18 + ,12 + ,37 + ,12 + ,76 + ,16 + ,18 + ,37 + ,10 + ,86 + ,14 + ,14 + ,33 + ,14 + ,54 + ,14 + ,14 + ,34 + ,13 + ,70 + ,14 + ,13 + ,33 + ,9 + ,69 + ,14 + ,16 + ,38 + ,15 + ,90 + ,12 + ,13 + ,33 + ,15 + ,54 + ,14 + ,16 + ,31 + ,14 + ,76 + ,15 + ,13 + ,38 + ,11 + ,89 + ,15 + ,16 + ,37 + ,8 + ,76 + ,15 + ,15 + ,33 + ,11 + ,73 + ,13 + ,16 + ,31 + ,11 + ,79 + ,17 + ,15 + ,39 + ,8 + ,90 + ,17 + ,17 + ,44 + ,10 + ,74 + ,19 + ,15 + ,33 + ,11 + ,81 + ,15 + ,12 + ,35 + ,13 + ,72 + ,13 + ,16 + ,32 + ,11 + ,71 + ,9 + ,10 + ,28 + ,20 + ,66 + ,15 + ,16 + ,40 + ,10 + ,77 + ,15 + ,12 + ,27 + ,15 + ,65 + ,15 + ,14 + ,37 + ,12 + ,74 + ,16 + ,15 + ,32 + ,14 + ,82 + ,11 + ,13 + ,28 + ,23 + ,54 + ,14 + ,15 + ,34 + ,14 + ,63 + ,11 + ,11 + ,30 + ,16 + ,54 + ,15 + ,12 + ,35 + ,11 + ,64 + ,13 + ,8 + ,31 + ,12 + ,69 + ,15 + ,16 + ,32 + ,10 + ,54 + ,16 + ,15 + ,30 + ,14 + ,84 + ,14 + ,17 + ,30 + ,12 + ,86 + ,15 + ,16 + ,31 + ,12 + ,77 + ,16 + ,10 + ,40 + ,11 + ,89 + ,16 + ,18 + ,32 + ,12 + ,76 + ,11 + ,13 + ,36 + ,13 + ,60 + ,12 + ,16 + ,32 + ,11 + ,75 + ,9 + ,13 + ,35 + ,19 + ,73 + ,16 + ,10 + ,38 + ,12 + ,85 + ,13 + ,15 + ,42 + ,17 + ,79 + ,16 + ,16 + ,34 + ,9 + ,71 + ,12 + ,16 + ,35 + ,12 + ,72 + ,9 + ,14 + ,35 + ,19 + ,69 + ,13 + ,10 + ,33 + ,18 + ,78 + ,13 + ,17 + ,36 + ,15 + ,54 + ,14 + ,13 + ,32 + ,14 + ,69 + ,19 + ,15 + ,33 + ,11 + ,81 + ,13 + ,16 + ,34 + ,9 + ,84 + ,12 + ,12 + ,32 + ,18 + ,84 + ,13 + ,13 + ,34 + ,16 + ,69) + ,dim=c(5 + ,162) + ,dimnames=list(c('Happiness' + ,'Learning' + ,'Connected' + ,'Depression' + ,'Belonging ') + ,1:162)) > y <- array(NA,dim=c(5,162),dimnames=list(c('Happiness','Learning','Connected','Depression','Belonging '),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 = 'First Differences' > par2 = 'Do not include Seasonal Dummies' > par1 = '1' > #'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 (1-B)Happiness (1-B)Learning (1-B)Connected (1-B)Depression 1 4 3 -2 -1 2 -7 3 -9 3 3 1 -4 1 -2 4 4 -1 3 9 5 2 -1 1 -9 6 -4 6 4 10 7 0 -4 -5 -11 8 1 -1 2 -1 9 0 1 1 3 10 2 1 1 -3 11 2 0 -2 -2 12 -9 0 2 7 13 6 0 1 -1 14 2 1 -6 -4 15 -4 -2 -1 4 16 0 0 4 0 17 3 5 2 -3 18 -3 -2 1 -1 19 2 -2 -7 3 20 2 0 0 -6 21 -7 0 -1 7 22 3 3 8 -2 23 -2 -3 -2 2 24 5 1 2 -3 25 -8 0 2 -2 26 7 -1 -5 2 27 -2 -1 -3 4 28 1 1 0 -1 29 -4 -2 1 -1 30 5 1 -3 -4 31 -3 -3 -4 6 32 4 2 10 -5 33 -2 2 -3 1 34 -1 -2 0 2 35 2 -7 -2 -5 36 -7 3 -3 12 37 6 4 7 -8 38 2 2 -7 -2 39 -4 0 6 0 40 2 0 2 -1 41 1 -2 -3 5 42 0 6 4 -6 43 -4 -6 -3 6 44 0 0 3 -3 45 -1 -3 -1 2 46 4 3 1 -4 47 0 1 -5 2 48 2 1 3 4 49 -4 -2 2 -4 50 3 2 -6 -1 51 -2 -2 0 4 52 -3 -2 0 4 53 1 4 2 -4 54 0 -7 -2 -3 55 3 5 5 1 56 1 2 2 1 57 -1 0 -10 -4 58 -3 -1 8 1 59 0 1 -2 5 60 -4 -4 -5 5 61 5 4 8 -8 62 -2 0 -4 0 63 3 -2 -3 2 64 1 2 3 -1 65 -5 1 1 -2 66 1 1 1 6 67 1 0 -6 -5 68 3 -6 9 1 69 0 4 -4 1 70 -1 -6 3 -1 71 2 4 -7 2 72 -1 4 3 -2 73 0 0 4 -3 74 -2 -2 -4 1 75 -1 1 5 8 76 5 -1 -2 -6 77 -4 0 -3 4 78 2 -3 -6 -4 79 -2 3 9 -4 80 2 0 -4 2 81 1 4 4 -1 82 -1 -4 -2 -1 83 1 -1 2 3 84 -1 0 -5 0 85 -1 1 1 1 86 1 -2 5 0 87 -1 2 -5 -1 88 -1 0 -4 3 89 -6 -1 4 7 90 10 -3 -2 -9 91 -4 5 5 2 92 2 -1 -1 -2 93 -1 -1 -3 2 94 -1 -2 -3 -5 95 3 3 10 1 96 -4 0 -2 5 97 2 0 -2 -5 98 3 0 2 0 99 -2 -2 -5 -1 100 2 2 6 0 101 -5 0 -1 6 102 4 4 -1 -4 103 -5 -5 -4 -1 104 4 1 1 5 105 -6 -3 7 3 106 7 4 -2 -8 107 -1 -1 3 5 108 -5 0 -5 -1 109 0 -4 7 9 110 5 4 -13 -10 111 -4 0 1 1 112 2 1 1 -4 113 1 -4 0 4 114 4 -1 5 -3 115 -2 6 0 -2 116 -2 -4 -4 4 117 0 0 1 -1 118 0 -1 -1 -4 119 0 3 5 6 120 -2 -3 -5 0 121 2 3 -2 -1 122 1 -3 7 -3 123 0 3 -1 -3 124 0 -1 -4 3 125 -2 1 -2 0 126 4 -1 8 -3 127 0 2 5 2 128 2 -2 -11 1 129 -4 -3 2 2 130 -2 4 -3 -2 131 -4 -6 -4 9 132 6 6 12 -10 133 0 -4 -13 5 134 0 2 10 -3 135 1 1 -5 2 136 -5 -2 -4 9 137 3 2 6 -9 138 -3 -4 -4 2 139 4 1 5 -5 140 -2 -4 -4 1 141 2 8 1 -2 142 1 -1 -2 4 143 -2 2 0 -2 144 1 -1 1 0 145 1 -6 9 -1 146 0 8 -8 1 147 -5 -5 4 1 148 1 3 -4 -2 149 -3 -3 3 8 150 7 -3 3 -7 151 -3 5 4 5 152 3 1 -8 -8 153 -4 0 1 3 154 -3 -2 0 7 155 4 -4 -2 -1 156 0 7 3 -3 157 1 -4 -4 -1 158 5 2 1 -3 159 -6 1 1 -2 160 -1 -4 -2 9 161 1 1 2 -2 (1-B)Belonging\r 1 33 2 -20 3 1 4 9 5 2 6 -25 7 27 8 -6 9 2 10 3 11 -25 12 13 13 -13 14 33 15 -29 16 17 17 13 18 -24 19 -7 20 9 21 2 22 -14 23 2 24 30 25 -6 26 -4 27 -7 28 9 29 -11 30 13 31 -26 32 17 33 13 34 -10 35 -3 36 -8 37 8 38 5 39 -7 40 5 41 1 42 -21 43 -2 44 17 45 -1 46 -3 47 10 48 -1 49 1 50 -3 51 -5 52 -4 53 -1 54 1 55 13 56 -2 57 -7 58 6 59 -3 60 -17 61 24 62 0 63 -25 64 2 65 26 66 -14 67 7 68 -10 69 6 70 -2 71 -13 72 27 73 -12 74 15 75 -4 76 -10 77 -1 78 8 79 -23 80 25 81 -49 82 41 83 2 84 -1 85 5 86 -2 87 -6 88 -15 89 16 90 3 91 -19 92 23 93 5 94 -2 95 0 96 -11 97 9 98 3 99 -5 100 0 101 -3 102 12 103 -19 104 13 105 -11 106 8 107 -5 108 -17 109 -8 110 36 111 -8 112 14 113 -50 114 38 115 10 116 -32 117 16 118 -1 119 21 120 -36 121 22 122 13 123 -13 124 -3 125 6 126 11 127 -16 128 7 129 -9 130 -1 131 -5 132 11 133 -12 134 9 135 8 136 -28 137 9 138 -9 139 10 140 5 141 -15 142 30 143 2 144 -9 145 12 146 -13 147 -16 148 15 149 -2 150 12 151 -6 152 -8 153 1 154 -3 155 9 156 -24 157 15 158 12 159 3 160 0 161 -15 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) `(1-B)Learning` `(1-B)Connected` `(1-B)Depression` 5.305e-05 7.403e-02 2.623e-02 -3.506e-01 `(1-B)Belonging\r` 3.609e-02 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -8.5372 -1.7440 0.0203 1.6945 8.0506 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 5.305e-05 2.197e-01 0.000 0.9998 `(1-B)Learning` 7.403e-02 7.461e-02 0.992 0.3227 `(1-B)Connected` 2.623e-02 4.803e-02 0.546 0.5858 `(1-B)Depression` -3.506e-01 5.326e-02 -6.583 6.65e-10 *** `(1-B)Belonging\r` 3.609e-02 1.492e-02 2.419 0.0167 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 2.788 on 156 degrees of freedom Multiple R-squared: 0.3177, Adjusted R-squared: 0.3002 F-statistic: 18.16 on 4 and 156 DF, p-value: 2.906e-12 > 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.27702111 0.5540422241 0.7229788880 [2,] 0.15476169 0.3095233799 0.8452383101 [3,] 0.09644961 0.1928992256 0.9035503872 [4,] 0.47716752 0.9543350444 0.5228324778 [5,] 0.97933059 0.0413388127 0.0206694064 [6,] 0.99168621 0.0166275780 0.0083137890 [7,] 0.98841783 0.0231643376 0.0115821688 [8,] 0.98116726 0.0376654871 0.0188327435 [9,] 0.97619770 0.0476046019 0.0238023009 [10,] 0.96277819 0.0744436229 0.0372218114 [11,] 0.95805059 0.0838988260 0.0419494130 [12,] 0.97928969 0.0414206139 0.0207103070 [13,] 0.96849106 0.0630178817 0.0315089408 [14,] 0.98003354 0.0399329141 0.0199664571 [15,] 0.97166083 0.0566783329 0.0283391665 [16,] 0.95938448 0.0812310486 0.0406155243 [17,] 0.95293186 0.0941362840 0.0470681420 [18,] 0.99712440 0.0057511915 0.0028755957 [19,] 0.99988853 0.0002229445 0.0001114722 [20,] 0.99980264 0.0003947228 0.0001973614 [21,] 0.99965998 0.0006800458 0.0003400229 [22,] 0.99971663 0.0005667347 0.0002833673 [23,] 0.99971734 0.0005653196 0.0002826598 [24,] 0.99953873 0.0009225482 0.0004612741 [25,] 0.99928282 0.0014343543 0.0007171771 [26,] 0.99911988 0.0017602412 0.0008801206 [27,] 0.99861473 0.0027705463 0.0013852732 [28,] 0.99800797 0.0039840679 0.0019920340 [29,] 0.99775273 0.0044945302 0.0022472651 [30,] 0.99719655 0.0056068999 0.0028034499 [31,] 0.99612881 0.0077423779 0.0038711889 [32,] 0.99711417 0.0057716551 0.0028858275 [33,] 0.99606347 0.0078730636 0.0039365318 [34,] 0.99610683 0.0077863307 0.0038931653 [35,] 0.99501957 0.0099608623 0.0049804312 [36,] 0.99330181 0.0133963709 0.0066981855 [37,] 0.99171087 0.0165782517 0.0082891258 [38,] 0.98837895 0.0232420958 0.0116210479 [39,] 0.98712040 0.0257591935 0.0128795967 [40,] 0.98240457 0.0351908593 0.0175954296 [41,] 0.98354069 0.0329186275 0.0164593137 [42,] 0.99196759 0.0160648151 0.0080324075 [43,] 0.99150729 0.0169854129 0.0084927064 [44,] 0.98825216 0.0234956805 0.0117478403 [45,] 0.98476766 0.0304646800 0.0152323400 [46,] 0.97995116 0.0400976725 0.0200488363 [47,] 0.97358040 0.0528391983 0.0264195992 [48,] 0.97039925 0.0592014920 0.0296007460 [49,] 0.96300517 0.0739896630 0.0369948315 [50,] 0.95707742 0.0858451686 0.0429225843 [51,] 0.95750647 0.0849870519 0.0424935260 [52,] 0.95060170 0.0987966043 0.0493983021 [53,] 0.93928939 0.1214212274 0.0607106137 [54,] 0.92483138 0.1503372356 0.0751686178 [55,] 0.91521629 0.1695674244 0.0847837122 [56,] 0.94664868 0.1067026424 0.0533513212 [57,] 0.93285829 0.1342834125 0.0671417063 [58,] 0.97898678 0.0420264483 0.0210132241 [59,] 0.98192856 0.0361428719 0.0180714360 [60,] 0.97676040 0.0464791947 0.0232395973 [61,] 0.98226625 0.0354675049 0.0177337525 [62,] 0.97653259 0.0469348120 0.0234674060 [63,] 0.97026310 0.0594737934 0.0297368967 [64,] 0.97188542 0.0562291616 0.0281145808 [65,] 0.97285476 0.0542904772 0.0271452386 [66,] 0.96550725 0.0689854947 0.0344927474 [67,] 0.96040772 0.0791845627 0.0395922814 [68,] 0.95471513 0.0905697485 0.0452848742 [69,] 0.95852589 0.0829482228 0.0414741114 [70,] 0.95582460 0.0883507942 0.0441753971 [71,] 0.94500781 0.1099843882 0.0549921941 [72,] 0.94847384 0.1030523277 0.0515261638 [73,] 0.94202637 0.1159472614 0.0579736307 [74,] 0.93676757 0.1264648607 0.0632324304 [75,] 0.93815469 0.1236906190 0.0618453095 [76,] 0.93120801 0.1375839814 0.0687919907 [77,] 0.91612635 0.1677472965 0.0838736482 [78,] 0.89896477 0.2020704646 0.1010352323 [79,] 0.88033258 0.2393348407 0.1196674203 [80,] 0.85968536 0.2806292713 0.1403146356 [81,] 0.83516426 0.3296714825 0.1648357413 [82,] 0.87057520 0.2588495916 0.1294247958 [83,] 0.96093270 0.0781345927 0.0390672964 [84,] 0.96222306 0.0755538897 0.0377769449 [85,] 0.95190976 0.0961804875 0.0480902438 [86,] 0.93922293 0.1215541362 0.0607770681 [87,] 0.93542040 0.1291591941 0.0645795971 [88,] 0.93736013 0.1252797446 0.0626398723 [89,] 0.92808244 0.1438351232 0.0719175616 [90,] 0.91015903 0.1796819480 0.0898409740 [91,] 0.91111984 0.1777603158 0.0888801579 [92,] 0.90035387 0.1992922517 0.0996461259 [93,] 0.88787140 0.2242571993 0.1121285997 [94,] 0.88951037 0.2209792585 0.1104896293 [95,] 0.87635320 0.2472936084 0.1236468042 [96,] 0.90546831 0.1890633785 0.0945316893 [97,] 0.94814032 0.1037193668 0.0518596834 [98,] 0.96751957 0.0649608685 0.0324804342 [99,] 0.97631770 0.0473645901 0.0236822951 [100,] 0.96933608 0.0613278320 0.0306639160 [101,] 0.98322500 0.0335499906 0.0167749953 [102,] 0.98737749 0.0252450222 0.0126225111 [103,] 0.98259889 0.0348022115 0.0174011057 [104,] 0.98569679 0.0286064205 0.0143032103 [105,] 0.98012659 0.0397468234 0.0198734117 [106,] 0.99211553 0.0157689447 0.0078844723 [107,] 0.98922174 0.0215565206 0.0107782603 [108,] 0.99210156 0.0157968702 0.0078984351 [109,] 0.99006425 0.0198714996 0.0099357498 [110,] 0.98721872 0.0255625690 0.0127812845 [111,] 0.98375198 0.0324960386 0.0162480193 [112,] 0.97822179 0.0435564167 0.0217782084 [113,] 0.96985955 0.0602809041 0.0301404520 [114,] 0.95890258 0.0821948375 0.0410974188 [115,] 0.94562705 0.1087458971 0.0543729485 [116,] 0.92832375 0.1433524952 0.0716762476 [117,] 0.91143509 0.1771298120 0.0885649060 [118,] 0.91048134 0.1790373269 0.0895186635 [119,] 0.90703164 0.1859367273 0.0929683637 [120,] 0.90065235 0.1986952945 0.0993476473 [121,] 0.88032133 0.2393573494 0.1196786747 [122,] 0.87253368 0.2549326411 0.1274663206 [123,] 0.88488590 0.2302281996 0.1151140998 [124,] 0.85030117 0.2993976632 0.1496988316 [125,] 0.83146685 0.3370662936 0.1685331468 [126,] 0.81332265 0.3733546981 0.1866773490 [127,] 0.77936040 0.4412791925 0.2206395963 [128,] 0.73268770 0.5346245937 0.2673122969 [129,] 0.67971400 0.6405720022 0.3202860011 [130,] 0.63296520 0.7340696067 0.3670348033 [131,] 0.57645181 0.8470963812 0.4235481906 [132,] 0.51766784 0.9646643242 0.4823321621 [133,] 0.48361301 0.9672260269 0.5163869866 [134,] 0.46719315 0.9343863059 0.5328068471 [135,] 0.39192802 0.7838560339 0.6080719831 [136,] 0.39462037 0.7892407483 0.6053796259 [137,] 0.34397615 0.6879522906 0.6560238547 [138,] 0.26864021 0.5372804150 0.7313597925 [139,] 0.21187341 0.4237468298 0.7881265851 [140,] 0.29009698 0.5801939516 0.7099030242 [141,] 0.21577133 0.4315426610 0.7842286695 [142,] 0.14970682 0.2994136350 0.8502931825 [143,] 0.12517775 0.2503554960 0.8748222520 [144,] 0.07672209 0.1534441872 0.9232779064 [145,] 0.04630413 0.0926082666 0.9536958667 [146,] 0.03068071 0.0613614188 0.9693192906 [147,] 0.01256824 0.0251364891 0.9874317554 > postscript(file="/var/wessaorg/rcomp/tmp/1cqax1322159749.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/2a3vu1322159749.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/3vgf91322159749.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/49wg21322159749.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/5jgx61322159749.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 = 161 Frequency = 1 1 2 3 4 5 6 2.288818165 -5.212582530 0.532567196 6.825845404 -1.179758216 -0.141009096 7 8 9 10 11 12 -4.403699471 0.887460591 0.879294749 0.739650857 2.253406617 -7.067495728 13 14 15 16 17 18 6.092270605 -0.510000505 -1.376851910 -0.718445775 1.056429387 -2.362704390 19 20 21 22 23 24 3.635974076 -0.428399330 -4.591854832 2.372101617 -1.096504370 2.739055265 25 26 27 28 29 30 -8.537161703 8.050638310 -0.192363007 0.250534470 -3.831845767 3.133080345 31 32 33 34 35 36 0.368774787 1.223181359 -2.187985855 0.210069520 0.925904292 -2.647652197 37 38 39 40 41 42 2.426809387 1.153838637 -3.904788693 1.416465199 2.943556902 -1.894843208 43 44 45 46 47 48 -1.301468573 -1.743998784 -0.014466014 2.457525740 0.397349911 3.285700750 49 50 51 52 53 54 -5.342902432 2.766908667 -0.269184106 -1.305271904 -0.714904507 -0.517261536 55 56 57 58 59 60 2.380125002 1.222205927 -1.887558810 -3.001757853 1.839594220 -1.206353429 61 62 63 64 65 66 0.823179577 -1.895152898 4.830061609 0.350444331 -6.739775821 3.508477569 67 68 69 70 71 72 -0.848280821 3.919569941 -0.057205453 -0.912967580 3.057730511 -3.050402532 73 74 75 76 77 78 -0.723677673 -1.937817965 1.743884798 3.383748526 -2.482919408 0.688312899 79 80 81 82 83 84 -3.030518602 1.903837511 2.016637780 -2.481676937 2.001128935 -0.832840061 85 86 87 88 89 90 -0.930154010 1.089056578 -1.151052977 0.697942123 -4.154179587 7.010888325 91 92 93 94 95 96 -3.114472771 0.568996875 -0.326601951 -2.454106528 2.866200412 -1.797673782 97 98 99 100 101 102 -0.025356571 2.839233478 -1.891022327 1.694537495 -2.762008523 1.894629230 103 104 105 106 107 108 -4.189929353 5.183514333 -4.512795655 3.662834732 0.928703849 -4.606027972 109 110 111 112 113 114 3.556526657 0.239666437 -3.386983021 -0.007907607 4.502826040 1.519736988 115 116 117 118 119 120 -3.506294071 0.958145824 -0.954275544 -1.266081332 0.992445252 -0.347678286 121 122 123 124 125 126 0.685783945 -0.482458908 -0.778553519 1.338918156 -2.238159376 2.415432426 127 128 129 130 131 132 0.999352670 2.534459689 -2.804438742 -2.882593951 -0.115202093 1.338176212 133 134 135 136 137 138 2.823007886 -1.786930890 1.469525507 -0.581301181 -0.785586831 -1.573058901 139 140 141 142 143 144 1.680950751 -1.428880759 1.221616623 1.446163420 -2.921473237 1.372541707 145 146 147 148 149 150 0.424453015 0.437244419 -3.806807690 -0.359744073 0.020277726 4.256158314 151 152 153 154 155 156 -1.505611063 0.619678570 -3.010587840 -0.289581655 3.673132607 -0.782606339 157 158 159 160 161 0.509055894 3.340831060 -6.909756461 2.503849616 0.713598869 > postscript(file="/var/wessaorg/rcomp/tmp/60kyg1322159749.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 = 161 Frequency = 1 lag(myerror, k = 1) myerror 0 2.288818165 NA 1 -5.212582530 2.288818165 2 0.532567196 -5.212582530 3 6.825845404 0.532567196 4 -1.179758216 6.825845404 5 -0.141009096 -1.179758216 6 -4.403699471 -0.141009096 7 0.887460591 -4.403699471 8 0.879294749 0.887460591 9 0.739650857 0.879294749 10 2.253406617 0.739650857 11 -7.067495728 2.253406617 12 6.092270605 -7.067495728 13 -0.510000505 6.092270605 14 -1.376851910 -0.510000505 15 -0.718445775 -1.376851910 16 1.056429387 -0.718445775 17 -2.362704390 1.056429387 18 3.635974076 -2.362704390 19 -0.428399330 3.635974076 20 -4.591854832 -0.428399330 21 2.372101617 -4.591854832 22 -1.096504370 2.372101617 23 2.739055265 -1.096504370 24 -8.537161703 2.739055265 25 8.050638310 -8.537161703 26 -0.192363007 8.050638310 27 0.250534470 -0.192363007 28 -3.831845767 0.250534470 29 3.133080345 -3.831845767 30 0.368774787 3.133080345 31 1.223181359 0.368774787 32 -2.187985855 1.223181359 33 0.210069520 -2.187985855 34 0.925904292 0.210069520 35 -2.647652197 0.925904292 36 2.426809387 -2.647652197 37 1.153838637 2.426809387 38 -3.904788693 1.153838637 39 1.416465199 -3.904788693 40 2.943556902 1.416465199 41 -1.894843208 2.943556902 42 -1.301468573 -1.894843208 43 -1.743998784 -1.301468573 44 -0.014466014 -1.743998784 45 2.457525740 -0.014466014 46 0.397349911 2.457525740 47 3.285700750 0.397349911 48 -5.342902432 3.285700750 49 2.766908667 -5.342902432 50 -0.269184106 2.766908667 51 -1.305271904 -0.269184106 52 -0.714904507 -1.305271904 53 -0.517261536 -0.714904507 54 2.380125002 -0.517261536 55 1.222205927 2.380125002 56 -1.887558810 1.222205927 57 -3.001757853 -1.887558810 58 1.839594220 -3.001757853 59 -1.206353429 1.839594220 60 0.823179577 -1.206353429 61 -1.895152898 0.823179577 62 4.830061609 -1.895152898 63 0.350444331 4.830061609 64 -6.739775821 0.350444331 65 3.508477569 -6.739775821 66 -0.848280821 3.508477569 67 3.919569941 -0.848280821 68 -0.057205453 3.919569941 69 -0.912967580 -0.057205453 70 3.057730511 -0.912967580 71 -3.050402532 3.057730511 72 -0.723677673 -3.050402532 73 -1.937817965 -0.723677673 74 1.743884798 -1.937817965 75 3.383748526 1.743884798 76 -2.482919408 3.383748526 77 0.688312899 -2.482919408 78 -3.030518602 0.688312899 79 1.903837511 -3.030518602 80 2.016637780 1.903837511 81 -2.481676937 2.016637780 82 2.001128935 -2.481676937 83 -0.832840061 2.001128935 84 -0.930154010 -0.832840061 85 1.089056578 -0.930154010 86 -1.151052977 1.089056578 87 0.697942123 -1.151052977 88 -4.154179587 0.697942123 89 7.010888325 -4.154179587 90 -3.114472771 7.010888325 91 0.568996875 -3.114472771 92 -0.326601951 0.568996875 93 -2.454106528 -0.326601951 94 2.866200412 -2.454106528 95 -1.797673782 2.866200412 96 -0.025356571 -1.797673782 97 2.839233478 -0.025356571 98 -1.891022327 2.839233478 99 1.694537495 -1.891022327 100 -2.762008523 1.694537495 101 1.894629230 -2.762008523 102 -4.189929353 1.894629230 103 5.183514333 -4.189929353 104 -4.512795655 5.183514333 105 3.662834732 -4.512795655 106 0.928703849 3.662834732 107 -4.606027972 0.928703849 108 3.556526657 -4.606027972 109 0.239666437 3.556526657 110 -3.386983021 0.239666437 111 -0.007907607 -3.386983021 112 4.502826040 -0.007907607 113 1.519736988 4.502826040 114 -3.506294071 1.519736988 115 0.958145824 -3.506294071 116 -0.954275544 0.958145824 117 -1.266081332 -0.954275544 118 0.992445252 -1.266081332 119 -0.347678286 0.992445252 120 0.685783945 -0.347678286 121 -0.482458908 0.685783945 122 -0.778553519 -0.482458908 123 1.338918156 -0.778553519 124 -2.238159376 1.338918156 125 2.415432426 -2.238159376 126 0.999352670 2.415432426 127 2.534459689 0.999352670 128 -2.804438742 2.534459689 129 -2.882593951 -2.804438742 130 -0.115202093 -2.882593951 131 1.338176212 -0.115202093 132 2.823007886 1.338176212 133 -1.786930890 2.823007886 134 1.469525507 -1.786930890 135 -0.581301181 1.469525507 136 -0.785586831 -0.581301181 137 -1.573058901 -0.785586831 138 1.680950751 -1.573058901 139 -1.428880759 1.680950751 140 1.221616623 -1.428880759 141 1.446163420 1.221616623 142 -2.921473237 1.446163420 143 1.372541707 -2.921473237 144 0.424453015 1.372541707 145 0.437244419 0.424453015 146 -3.806807690 0.437244419 147 -0.359744073 -3.806807690 148 0.020277726 -0.359744073 149 4.256158314 0.020277726 150 -1.505611063 4.256158314 151 0.619678570 -1.505611063 152 -3.010587840 0.619678570 153 -0.289581655 -3.010587840 154 3.673132607 -0.289581655 155 -0.782606339 3.673132607 156 0.509055894 -0.782606339 157 3.340831060 0.509055894 158 -6.909756461 3.340831060 159 2.503849616 -6.909756461 160 0.713598869 2.503849616 161 NA 0.713598869 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -5.212582530 2.288818165 [2,] 0.532567196 -5.212582530 [3,] 6.825845404 0.532567196 [4,] -1.179758216 6.825845404 [5,] -0.141009096 -1.179758216 [6,] -4.403699471 -0.141009096 [7,] 0.887460591 -4.403699471 [8,] 0.879294749 0.887460591 [9,] 0.739650857 0.879294749 [10,] 2.253406617 0.739650857 [11,] -7.067495728 2.253406617 [12,] 6.092270605 -7.067495728 [13,] -0.510000505 6.092270605 [14,] -1.376851910 -0.510000505 [15,] -0.718445775 -1.376851910 [16,] 1.056429387 -0.718445775 [17,] -2.362704390 1.056429387 [18,] 3.635974076 -2.362704390 [19,] -0.428399330 3.635974076 [20,] -4.591854832 -0.428399330 [21,] 2.372101617 -4.591854832 [22,] -1.096504370 2.372101617 [23,] 2.739055265 -1.096504370 [24,] -8.537161703 2.739055265 [25,] 8.050638310 -8.537161703 [26,] -0.192363007 8.050638310 [27,] 0.250534470 -0.192363007 [28,] -3.831845767 0.250534470 [29,] 3.133080345 -3.831845767 [30,] 0.368774787 3.133080345 [31,] 1.223181359 0.368774787 [32,] -2.187985855 1.223181359 [33,] 0.210069520 -2.187985855 [34,] 0.925904292 0.210069520 [35,] -2.647652197 0.925904292 [36,] 2.426809387 -2.647652197 [37,] 1.153838637 2.426809387 [38,] -3.904788693 1.153838637 [39,] 1.416465199 -3.904788693 [40,] 2.943556902 1.416465199 [41,] -1.894843208 2.943556902 [42,] -1.301468573 -1.894843208 [43,] -1.743998784 -1.301468573 [44,] -0.014466014 -1.743998784 [45,] 2.457525740 -0.014466014 [46,] 0.397349911 2.457525740 [47,] 3.285700750 0.397349911 [48,] -5.342902432 3.285700750 [49,] 2.766908667 -5.342902432 [50,] -0.269184106 2.766908667 [51,] -1.305271904 -0.269184106 [52,] -0.714904507 -1.305271904 [53,] -0.517261536 -0.714904507 [54,] 2.380125002 -0.517261536 [55,] 1.222205927 2.380125002 [56,] -1.887558810 1.222205927 [57,] -3.001757853 -1.887558810 [58,] 1.839594220 -3.001757853 [59,] -1.206353429 1.839594220 [60,] 0.823179577 -1.206353429 [61,] -1.895152898 0.823179577 [62,] 4.830061609 -1.895152898 [63,] 0.350444331 4.830061609 [64,] -6.739775821 0.350444331 [65,] 3.508477569 -6.739775821 [66,] -0.848280821 3.508477569 [67,] 3.919569941 -0.848280821 [68,] -0.057205453 3.919569941 [69,] -0.912967580 -0.057205453 [70,] 3.057730511 -0.912967580 [71,] -3.050402532 3.057730511 [72,] -0.723677673 -3.050402532 [73,] -1.937817965 -0.723677673 [74,] 1.743884798 -1.937817965 [75,] 3.383748526 1.743884798 [76,] -2.482919408 3.383748526 [77,] 0.688312899 -2.482919408 [78,] -3.030518602 0.688312899 [79,] 1.903837511 -3.030518602 [80,] 2.016637780 1.903837511 [81,] -2.481676937 2.016637780 [82,] 2.001128935 -2.481676937 [83,] -0.832840061 2.001128935 [84,] -0.930154010 -0.832840061 [85,] 1.089056578 -0.930154010 [86,] -1.151052977 1.089056578 [87,] 0.697942123 -1.151052977 [88,] -4.154179587 0.697942123 [89,] 7.010888325 -4.154179587 [90,] -3.114472771 7.010888325 [91,] 0.568996875 -3.114472771 [92,] -0.326601951 0.568996875 [93,] -2.454106528 -0.326601951 [94,] 2.866200412 -2.454106528 [95,] -1.797673782 2.866200412 [96,] -0.025356571 -1.797673782 [97,] 2.839233478 -0.025356571 [98,] -1.891022327 2.839233478 [99,] 1.694537495 -1.891022327 [100,] -2.762008523 1.694537495 [101,] 1.894629230 -2.762008523 [102,] -4.189929353 1.894629230 [103,] 5.183514333 -4.189929353 [104,] -4.512795655 5.183514333 [105,] 3.662834732 -4.512795655 [106,] 0.928703849 3.662834732 [107,] -4.606027972 0.928703849 [108,] 3.556526657 -4.606027972 [109,] 0.239666437 3.556526657 [110,] -3.386983021 0.239666437 [111,] -0.007907607 -3.386983021 [112,] 4.502826040 -0.007907607 [113,] 1.519736988 4.502826040 [114,] -3.506294071 1.519736988 [115,] 0.958145824 -3.506294071 [116,] -0.954275544 0.958145824 [117,] -1.266081332 -0.954275544 [118,] 0.992445252 -1.266081332 [119,] -0.347678286 0.992445252 [120,] 0.685783945 -0.347678286 [121,] -0.482458908 0.685783945 [122,] -0.778553519 -0.482458908 [123,] 1.338918156 -0.778553519 [124,] -2.238159376 1.338918156 [125,] 2.415432426 -2.238159376 [126,] 0.999352670 2.415432426 [127,] 2.534459689 0.999352670 [128,] -2.804438742 2.534459689 [129,] -2.882593951 -2.804438742 [130,] -0.115202093 -2.882593951 [131,] 1.338176212 -0.115202093 [132,] 2.823007886 1.338176212 [133,] -1.786930890 2.823007886 [134,] 1.469525507 -1.786930890 [135,] -0.581301181 1.469525507 [136,] -0.785586831 -0.581301181 [137,] -1.573058901 -0.785586831 [138,] 1.680950751 -1.573058901 [139,] -1.428880759 1.680950751 [140,] 1.221616623 -1.428880759 [141,] 1.446163420 1.221616623 [142,] -2.921473237 1.446163420 [143,] 1.372541707 -2.921473237 [144,] 0.424453015 1.372541707 [145,] 0.437244419 0.424453015 [146,] -3.806807690 0.437244419 [147,] -0.359744073 -3.806807690 [148,] 0.020277726 -0.359744073 [149,] 4.256158314 0.020277726 [150,] -1.505611063 4.256158314 [151,] 0.619678570 -1.505611063 [152,] -3.010587840 0.619678570 [153,] -0.289581655 -3.010587840 [154,] 3.673132607 -0.289581655 [155,] -0.782606339 3.673132607 [156,] 0.509055894 -0.782606339 [157,] 3.340831060 0.509055894 [158,] -6.909756461 3.340831060 [159,] 2.503849616 -6.909756461 [160,] 0.713598869 2.503849616 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -5.212582530 2.288818165 2 0.532567196 -5.212582530 3 6.825845404 0.532567196 4 -1.179758216 6.825845404 5 -0.141009096 -1.179758216 6 -4.403699471 -0.141009096 7 0.887460591 -4.403699471 8 0.879294749 0.887460591 9 0.739650857 0.879294749 10 2.253406617 0.739650857 11 -7.067495728 2.253406617 12 6.092270605 -7.067495728 13 -0.510000505 6.092270605 14 -1.376851910 -0.510000505 15 -0.718445775 -1.376851910 16 1.056429387 -0.718445775 17 -2.362704390 1.056429387 18 3.635974076 -2.362704390 19 -0.428399330 3.635974076 20 -4.591854832 -0.428399330 21 2.372101617 -4.591854832 22 -1.096504370 2.372101617 23 2.739055265 -1.096504370 24 -8.537161703 2.739055265 25 8.050638310 -8.537161703 26 -0.192363007 8.050638310 27 0.250534470 -0.192363007 28 -3.831845767 0.250534470 29 3.133080345 -3.831845767 30 0.368774787 3.133080345 31 1.223181359 0.368774787 32 -2.187985855 1.223181359 33 0.210069520 -2.187985855 34 0.925904292 0.210069520 35 -2.647652197 0.925904292 36 2.426809387 -2.647652197 37 1.153838637 2.426809387 38 -3.904788693 1.153838637 39 1.416465199 -3.904788693 40 2.943556902 1.416465199 41 -1.894843208 2.943556902 42 -1.301468573 -1.894843208 43 -1.743998784 -1.301468573 44 -0.014466014 -1.743998784 45 2.457525740 -0.014466014 46 0.397349911 2.457525740 47 3.285700750 0.397349911 48 -5.342902432 3.285700750 49 2.766908667 -5.342902432 50 -0.269184106 2.766908667 51 -1.305271904 -0.269184106 52 -0.714904507 -1.305271904 53 -0.517261536 -0.714904507 54 2.380125002 -0.517261536 55 1.222205927 2.380125002 56 -1.887558810 1.222205927 57 -3.001757853 -1.887558810 58 1.839594220 -3.001757853 59 -1.206353429 1.839594220 60 0.823179577 -1.206353429 61 -1.895152898 0.823179577 62 4.830061609 -1.895152898 63 0.350444331 4.830061609 64 -6.739775821 0.350444331 65 3.508477569 -6.739775821 66 -0.848280821 3.508477569 67 3.919569941 -0.848280821 68 -0.057205453 3.919569941 69 -0.912967580 -0.057205453 70 3.057730511 -0.912967580 71 -3.050402532 3.057730511 72 -0.723677673 -3.050402532 73 -1.937817965 -0.723677673 74 1.743884798 -1.937817965 75 3.383748526 1.743884798 76 -2.482919408 3.383748526 77 0.688312899 -2.482919408 78 -3.030518602 0.688312899 79 1.903837511 -3.030518602 80 2.016637780 1.903837511 81 -2.481676937 2.016637780 82 2.001128935 -2.481676937 83 -0.832840061 2.001128935 84 -0.930154010 -0.832840061 85 1.089056578 -0.930154010 86 -1.151052977 1.089056578 87 0.697942123 -1.151052977 88 -4.154179587 0.697942123 89 7.010888325 -4.154179587 90 -3.114472771 7.010888325 91 0.568996875 -3.114472771 92 -0.326601951 0.568996875 93 -2.454106528 -0.326601951 94 2.866200412 -2.454106528 95 -1.797673782 2.866200412 96 -0.025356571 -1.797673782 97 2.839233478 -0.025356571 98 -1.891022327 2.839233478 99 1.694537495 -1.891022327 100 -2.762008523 1.694537495 101 1.894629230 -2.762008523 102 -4.189929353 1.894629230 103 5.183514333 -4.189929353 104 -4.512795655 5.183514333 105 3.662834732 -4.512795655 106 0.928703849 3.662834732 107 -4.606027972 0.928703849 108 3.556526657 -4.606027972 109 0.239666437 3.556526657 110 -3.386983021 0.239666437 111 -0.007907607 -3.386983021 112 4.502826040 -0.007907607 113 1.519736988 4.502826040 114 -3.506294071 1.519736988 115 0.958145824 -3.506294071 116 -0.954275544 0.958145824 117 -1.266081332 -0.954275544 118 0.992445252 -1.266081332 119 -0.347678286 0.992445252 120 0.685783945 -0.347678286 121 -0.482458908 0.685783945 122 -0.778553519 -0.482458908 123 1.338918156 -0.778553519 124 -2.238159376 1.338918156 125 2.415432426 -2.238159376 126 0.999352670 2.415432426 127 2.534459689 0.999352670 128 -2.804438742 2.534459689 129 -2.882593951 -2.804438742 130 -0.115202093 -2.882593951 131 1.338176212 -0.115202093 132 2.823007886 1.338176212 133 -1.786930890 2.823007886 134 1.469525507 -1.786930890 135 -0.581301181 1.469525507 136 -0.785586831 -0.581301181 137 -1.573058901 -0.785586831 138 1.680950751 -1.573058901 139 -1.428880759 1.680950751 140 1.221616623 -1.428880759 141 1.446163420 1.221616623 142 -2.921473237 1.446163420 143 1.372541707 -2.921473237 144 0.424453015 1.372541707 145 0.437244419 0.424453015 146 -3.806807690 0.437244419 147 -0.359744073 -3.806807690 148 0.020277726 -0.359744073 149 4.256158314 0.020277726 150 -1.505611063 4.256158314 151 0.619678570 -1.505611063 152 -3.010587840 0.619678570 153 -0.289581655 -3.010587840 154 3.673132607 -0.289581655 155 -0.782606339 3.673132607 156 0.509055894 -0.782606339 157 3.340831060 0.509055894 158 -6.909756461 3.340831060 159 2.503849616 -6.909756461 160 0.713598869 2.503849616 > 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/7jznx1322159749.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/8ybza1322159749.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/9197c1322159749.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/10d3681322159749.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/11jlit1322159749.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/12hzv11322159749.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/13fs7g1322159749.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/14d6ww1322159749.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/155ju41322159749.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/16vuex1322159749.tab") + } > > try(system("convert tmp/1cqax1322159749.ps tmp/1cqax1322159749.png",intern=TRUE)) character(0) > try(system("convert tmp/2a3vu1322159749.ps tmp/2a3vu1322159749.png",intern=TRUE)) character(0) > try(system("convert tmp/3vgf91322159749.ps tmp/3vgf91322159749.png",intern=TRUE)) character(0) > try(system("convert tmp/49wg21322159749.ps tmp/49wg21322159749.png",intern=TRUE)) character(0) > try(system("convert tmp/5jgx61322159749.ps tmp/5jgx61322159749.png",intern=TRUE)) character(0) > try(system("convert tmp/60kyg1322159749.ps tmp/60kyg1322159749.png",intern=TRUE)) character(0) > try(system("convert tmp/7jznx1322159749.ps tmp/7jznx1322159749.png",intern=TRUE)) character(0) > try(system("convert tmp/8ybza1322159749.ps tmp/8ybza1322159749.png",intern=TRUE)) character(0) > try(system("convert tmp/9197c1322159749.ps tmp/9197c1322159749.png",intern=TRUE)) character(0) > try(system("convert tmp/10d3681322159749.ps tmp/10d3681322159749.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.694 0.498 5.221