R version 2.15.2 (2012-10-26) -- "Trick or Treat" 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(13 + ,41 + ,38 + ,7 + ,2 + ,16 + ,39 + ,32 + ,5 + ,2 + ,19 + ,30 + ,35 + ,5 + ,2 + ,15 + ,31 + ,33 + ,5 + ,1 + ,14 + ,34 + ,37 + ,8 + ,2 + ,13 + ,35 + ,29 + ,6 + ,2 + ,19 + ,39 + ,31 + ,5 + ,2 + ,15 + ,34 + ,36 + ,6 + ,2 + ,14 + ,36 + ,35 + ,5 + ,2 + ,15 + ,37 + ,38 + ,4 + ,2 + ,16 + ,38 + ,31 + ,6 + ,1 + ,16 + ,36 + ,34 + ,5 + ,2 + ,16 + ,38 + ,35 + ,5 + ,1 + ,16 + ,39 + ,38 + ,6 + ,2 + ,17 + ,33 + ,37 + ,7 + ,2 + ,15 + ,32 + ,33 + ,6 + ,1 + ,15 + ,36 + ,32 + ,7 + ,1 + ,20 + ,38 + ,38 + ,6 + ,2 + ,18 + ,39 + ,38 + ,8 + ,1 + ,16 + ,32 + ,32 + ,7 + ,2 + ,16 + ,32 + ,33 + ,5 + ,1 + ,16 + ,31 + ,31 + ,5 + ,2 + ,19 + ,39 + ,38 + ,7 + ,2 + ,16 + ,37 + ,39 + ,7 + ,2 + ,17 + ,39 + ,32 + ,5 + ,1 + ,17 + ,41 + ,32 + ,4 + ,2 + ,16 + ,36 + ,35 + ,10 + ,1 + ,15 + ,33 + ,37 + ,6 + ,2 + ,16 + ,33 + ,33 + ,5 + ,2 + ,14 + ,34 + ,33 + ,5 + ,1 + ,15 + ,31 + ,28 + ,5 + ,2 + ,12 + ,27 + ,32 + ,5 + ,1 + ,14 + ,37 + ,31 + ,6 + ,2 + ,16 + ,34 + ,37 + ,5 + ,2 + ,14 + ,34 + ,30 + ,5 + ,1 + ,7 + ,32 + ,33 + ,5 + ,1 + ,10 + ,29 + ,31 + ,5 + ,1 + ,14 + ,36 + ,33 + ,5 + ,1 + ,16 + ,29 + ,31 + ,5 + ,2 + ,16 + ,35 + ,33 + ,5 + ,1 + ,16 + ,37 + ,32 + ,5 + ,1 + ,14 + ,34 + ,33 + ,7 + ,2 + ,20 + ,38 + ,32 + ,5 + ,1 + ,14 + ,35 + ,33 + ,6 + ,1 + ,14 + ,38 + ,28 + ,7 + ,2 + ,11 + ,37 + ,35 + ,7 + ,2 + ,14 + ,38 + ,39 + ,5 + ,2 + ,15 + ,33 + ,34 + ,5 + ,2 + ,16 + ,36 + ,38 + ,4 + ,2 + ,14 + ,38 + ,32 + ,5 + ,1 + ,16 + ,32 + ,38 + ,4 + ,2 + ,14 + ,32 + ,30 + ,5 + ,1 + ,12 + ,32 + ,33 + ,5 + ,1 + ,16 + ,34 + ,38 + ,7 + ,2 + ,9 + ,32 + ,32 + ,5 + ,1 + ,14 + ,37 + ,32 + ,5 + ,2 + ,16 + ,39 + ,34 + ,6 + ,2 + ,16 + ,29 + ,34 + ,4 + ,2 + ,15 + ,37 + ,36 + ,6 + ,1 + ,16 + ,35 + ,34 + ,6 + ,2 + ,12 + ,30 + ,28 + ,5 + ,1 + ,16 + ,38 + ,34 + ,7 + ,1 + ,16 + ,34 + ,35 + ,6 + ,2 + ,14 + ,31 + ,35 + ,8 + ,2 + ,16 + ,34 + ,31 + ,7 + ,2 + ,17 + ,35 + ,37 + ,5 + ,1 + ,18 + ,36 + ,35 + ,6 + ,2 + ,18 + ,30 + ,27 + ,6 + ,1 + ,12 + ,39 + ,40 + ,5 + ,2 + ,16 + ,35 + ,37 + ,5 + ,1 + ,10 + ,38 + ,36 + ,5 + ,1 + ,14 + ,31 + ,38 + ,5 + ,2 + ,18 + ,34 + ,39 + ,4 + ,2 + ,18 + ,38 + ,41 + ,6 + ,1 + ,16 + ,34 + ,27 + ,6 + ,1 + ,17 + ,39 + ,30 + ,6 + ,2 + ,16 + ,37 + ,37 + ,6 + ,2 + ,16 + ,34 + ,31 + ,7 + ,2 + ,13 + ,28 + ,31 + ,5 + ,1 + ,16 + ,37 + ,27 + ,7 + ,1 + ,16 + ,33 + ,36 + ,6 + ,1 + ,20 + ,37 + ,38 + ,5 + ,1 + ,16 + ,35 + ,37 + ,5 + ,2 + ,15 + ,37 + ,33 + ,4 + ,1 + ,15 + ,32 + ,34 + ,8 + ,2 + ,16 + ,33 + ,31 + ,8 + ,2 + ,14 + ,38 + ,39 + ,5 + ,1 + ,16 + ,33 + ,34 + ,5 + ,2 + ,16 + ,29 + ,32 + ,6 + ,2 + ,15 + ,33 + ,33 + ,4 + ,2 + ,12 + ,31 + ,36 + ,5 + ,2 + ,17 + ,36 + ,32 + ,5 + ,2 + ,16 + ,35 + ,41 + ,5 + ,2 + ,15 + ,32 + ,28 + ,5 + ,2 + ,13 + ,29 + ,30 + ,6 + ,2 + ,16 + ,39 + ,36 + ,6 + ,2 + ,16 + ,37 + ,35 + ,5 + ,2 + ,16 + ,35 + ,31 + ,6 + ,2 + ,16 + ,37 + ,34 + ,5 + ,1 + ,14 + ,32 + ,36 + ,7 + ,1 + ,16 + ,38 + ,36 + ,5 + ,2 + ,16 + ,37 + ,35 + ,6 + ,1 + ,20 + ,36 + ,37 + ,6 + ,2 + ,15 + ,32 + ,28 + ,6 + ,1 + ,16 + ,33 + ,39 + ,4 + ,2 + ,13 + ,40 + ,32 + ,5 + ,1 + ,17 + ,38 + ,35 + ,5 + ,2 + ,16 + ,41 + ,39 + ,7 + ,1 + ,16 + ,36 + ,35 + ,6 + ,1 + ,12 + ,43 + ,42 + ,9 + ,2 + ,16 + ,30 + ,34 + ,6 + ,2 + ,16 + ,31 + ,33 + ,6 + ,2 + ,17 + ,32 + ,41 + ,5 + ,2 + ,13 + ,32 + ,33 + ,6 + ,1 + ,12 + ,37 + ,34 + ,5 + ,2 + ,18 + ,37 + ,32 + ,8 + ,1 + ,14 + ,33 + ,40 + ,7 + ,2 + ,14 + ,34 + ,40 + ,5 + ,2 + ,13 + ,33 + ,35 + ,7 + ,2 + ,16 + ,38 + ,36 + ,6 + ,2 + ,13 + ,33 + ,37 + ,6 + ,2 + ,16 + ,31 + ,27 + ,9 + ,2 + ,13 + ,38 + ,39 + ,7 + ,2 + ,16 + ,37 + ,38 + ,6 + ,2 + ,15 + ,33 + ,31 + ,5 + ,2 + ,16 + ,31 + ,33 + ,5 + ,2 + ,15 + ,39 + ,32 + ,6 + ,1 + ,17 + ,44 + ,39 + ,6 + ,2 + ,15 + ,33 + ,36 + ,7 + ,2 + ,12 + ,35 + ,33 + ,5 + ,2 + ,16 + ,32 + ,33 + ,5 + ,1 + ,10 + ,28 + ,32 + ,5 + ,1 + ,16 + ,40 + ,37 + ,6 + ,2 + ,12 + ,27 + ,30 + ,4 + ,1 + ,14 + ,37 + ,38 + ,5 + ,1 + ,15 + ,32 + ,29 + ,7 + ,2 + ,13 + ,28 + ,22 + ,5 + ,1 + ,15 + ,34 + ,35 + ,7 + ,1 + ,11 + ,30 + ,35 + ,7 + ,2 + ,12 + ,35 + ,34 + ,6 + ,2 + ,8 + ,31 + ,35 + ,5 + ,1 + ,16 + ,32 + ,34 + ,8 + ,2 + ,15 + ,30 + ,34 + ,5 + ,1 + ,17 + ,30 + ,35 + ,5 + ,2 + ,16 + ,31 + ,23 + ,5 + ,1 + ,10 + ,40 + ,31 + ,6 + ,2 + ,18 + ,32 + ,27 + ,4 + ,2 + ,13 + ,36 + ,36 + ,5 + ,1 + ,16 + ,32 + ,31 + ,5 + ,1 + ,13 + ,35 + ,32 + ,7 + ,1 + ,10 + ,38 + ,39 + ,6 + ,2 + ,15 + ,42 + ,37 + ,7 + ,2 + ,16 + ,34 + ,38 + ,10 + ,1 + ,16 + ,35 + ,39 + ,6 + ,2 + ,14 + ,35 + ,34 + ,8 + ,2 + ,10 + ,33 + ,31 + ,4 + ,2 + ,17 + ,36 + ,32 + ,5 + ,2 + ,13 + ,32 + ,37 + ,6 + ,2 + ,15 + ,33 + ,36 + ,7 + ,2 + ,16 + ,34 + ,32 + ,7 + ,2 + ,12 + ,32 + ,35 + ,6 + ,2 + ,13 + ,34 + ,36 + ,6 + ,2) + ,dim=c(5 + ,162) + ,dimnames=list(c('Perceived' + ,'Conected' + ,'Seperate' + ,'Age' + ,'Gender') + ,1:162)) > y <- array(NA,dim=c(5,162),dimnames=list(c('Perceived','Conected','Seperate','Age','Gender'),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 = '1' > par3 <- 'No Linear Trend' > 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 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 Perceived Conected Seperate Age Gender 1 13 41 38 7 2 2 16 39 32 5 2 3 19 30 35 5 2 4 15 31 33 5 1 5 14 34 37 8 2 6 13 35 29 6 2 7 19 39 31 5 2 8 15 34 36 6 2 9 14 36 35 5 2 10 15 37 38 4 2 11 16 38 31 6 1 12 16 36 34 5 2 13 16 38 35 5 1 14 16 39 38 6 2 15 17 33 37 7 2 16 15 32 33 6 1 17 15 36 32 7 1 18 20 38 38 6 2 19 18 39 38 8 1 20 16 32 32 7 2 21 16 32 33 5 1 22 16 31 31 5 2 23 19 39 38 7 2 24 16 37 39 7 2 25 17 39 32 5 1 26 17 41 32 4 2 27 16 36 35 10 1 28 15 33 37 6 2 29 16 33 33 5 2 30 14 34 33 5 1 31 15 31 28 5 2 32 12 27 32 5 1 33 14 37 31 6 2 34 16 34 37 5 2 35 14 34 30 5 1 36 7 32 33 5 1 37 10 29 31 5 1 38 14 36 33 5 1 39 16 29 31 5 2 40 16 35 33 5 1 41 16 37 32 5 1 42 14 34 33 7 2 43 20 38 32 5 1 44 14 35 33 6 1 45 14 38 28 7 2 46 11 37 35 7 2 47 14 38 39 5 2 48 15 33 34 5 2 49 16 36 38 4 2 50 14 38 32 5 1 51 16 32 38 4 2 52 14 32 30 5 1 53 12 32 33 5 1 54 16 34 38 7 2 55 9 32 32 5 1 56 14 37 32 5 2 57 16 39 34 6 2 58 16 29 34 4 2 59 15 37 36 6 1 60 16 35 34 6 2 61 12 30 28 5 1 62 16 38 34 7 1 63 16 34 35 6 2 64 14 31 35 8 2 65 16 34 31 7 2 66 17 35 37 5 1 67 18 36 35 6 2 68 18 30 27 6 1 69 12 39 40 5 2 70 16 35 37 5 1 71 10 38 36 5 1 72 14 31 38 5 2 73 18 34 39 4 2 74 18 38 41 6 1 75 16 34 27 6 1 76 17 39 30 6 2 77 16 37 37 6 2 78 16 34 31 7 2 79 13 28 31 5 1 80 16 37 27 7 1 81 16 33 36 6 1 82 20 37 38 5 1 83 16 35 37 5 2 84 15 37 33 4 1 85 15 32 34 8 2 86 16 33 31 8 2 87 14 38 39 5 1 88 16 33 34 5 2 89 16 29 32 6 2 90 15 33 33 4 2 91 12 31 36 5 2 92 17 36 32 5 2 93 16 35 41 5 2 94 15 32 28 5 2 95 13 29 30 6 2 96 16 39 36 6 2 97 16 37 35 5 2 98 16 35 31 6 2 99 16 37 34 5 1 100 14 32 36 7 1 101 16 38 36 5 2 102 16 37 35 6 1 103 20 36 37 6 2 104 15 32 28 6 1 105 16 33 39 4 2 106 13 40 32 5 1 107 17 38 35 5 2 108 16 41 39 7 1 109 16 36 35 6 1 110 12 43 42 9 2 111 16 30 34 6 2 112 16 31 33 6 2 113 17 32 41 5 2 114 13 32 33 6 1 115 12 37 34 5 2 116 18 37 32 8 1 117 14 33 40 7 2 118 14 34 40 5 2 119 13 33 35 7 2 120 16 38 36 6 2 121 13 33 37 6 2 122 16 31 27 9 2 123 13 38 39 7 2 124 16 37 38 6 2 125 15 33 31 5 2 126 16 31 33 5 2 127 15 39 32 6 1 128 17 44 39 6 2 129 15 33 36 7 2 130 12 35 33 5 2 131 16 32 33 5 1 132 10 28 32 5 1 133 16 40 37 6 2 134 12 27 30 4 1 135 14 37 38 5 1 136 15 32 29 7 2 137 13 28 22 5 1 138 15 34 35 7 1 139 11 30 35 7 2 140 12 35 34 6 2 141 8 31 35 5 1 142 16 32 34 8 2 143 15 30 34 5 1 144 17 30 35 5 2 145 16 31 23 5 1 146 10 40 31 6 2 147 18 32 27 4 2 148 13 36 36 5 1 149 16 32 31 5 1 150 13 35 32 7 1 151 10 38 39 6 2 152 15 42 37 7 2 153 16 34 38 10 1 154 16 35 39 6 2 155 14 35 34 8 2 156 10 33 31 4 2 157 17 36 32 5 2 158 13 32 37 6 2 159 15 33 36 7 2 160 16 34 32 7 2 161 12 32 35 6 2 162 13 34 36 6 2 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Conected Seperate Age Gender 9.59343 0.14352 -0.01734 0.02521 0.51320 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -7.2532 -1.1699 0.4343 1.1805 5.1159 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 9.59343 2.18771 4.385 2.11e-05 *** Conected 0.14352 0.05613 2.557 0.0115 * Seperate -0.01734 0.05447 -0.318 0.7507 Age 0.02521 0.15280 0.165 0.8692 Gender 0.51320 0.37128 1.382 0.1689 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 2.218 on 157 degrees of freedom Multiple R-squared: 0.0575, Adjusted R-squared: 0.03349 F-statistic: 2.395 on 4 and 157 DF, p-value: 0.05279 > 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.58500911 0.82998179 0.4149909 [2,] 0.70421599 0.59156802 0.2957840 [3,] 0.66321831 0.67356337 0.3367817 [4,] 0.61063434 0.77873132 0.3893657 [5,] 0.49410843 0.98821686 0.5058916 [6,] 0.39310889 0.78621778 0.6068911 [7,] 0.33089932 0.66179865 0.6691007 [8,] 0.33794182 0.67588365 0.6620582 [9,] 0.25988593 0.51977187 0.7401141 [10,] 0.19211587 0.38423174 0.8078841 [11,] 0.44920127 0.89840254 0.5507987 [12,] 0.49126752 0.98253504 0.5087325 [13,] 0.42464295 0.84928590 0.5753571 [14,] 0.35438101 0.70876202 0.6456190 [15,] 0.28946425 0.57892850 0.7105358 [16,] 0.33896945 0.67793890 0.6610306 [17,] 0.27903143 0.55806286 0.7209686 [18,] 0.23656549 0.47313097 0.7634345 [19,] 0.19030097 0.38060193 0.8096990 [20,] 0.15134542 0.30269085 0.8486546 [21,] 0.12372117 0.24744234 0.8762788 [22,] 0.09374034 0.18748067 0.9062597 [23,] 0.08793148 0.17586295 0.9120685 [24,] 0.06473499 0.12946998 0.9352650 [25,] 0.07712994 0.15425987 0.9228701 [26,] 0.07191475 0.14382950 0.9280853 [27,] 0.05357500 0.10714999 0.9464250 [28,] 0.04175525 0.08351051 0.9582447 [29,] 0.48938985 0.97877969 0.5106102 [30,] 0.56439543 0.87120913 0.4356046 [31,] 0.51422015 0.97155970 0.4857799 [32,] 0.49132364 0.98264727 0.5086764 [33,] 0.46060430 0.92120859 0.5393957 [34,] 0.41942352 0.83884704 0.5805765 [35,] 0.39000465 0.78000929 0.6099954 [36,] 0.57355883 0.85288235 0.4264412 [37,] 0.52850692 0.94298616 0.4714931 [38,] 0.50729790 0.98540419 0.4927021 [39,] 0.68605930 0.62788139 0.3139407 [40,] 0.69161729 0.61676541 0.3083827 [41,] 0.64546748 0.70906504 0.3545325 [42,] 0.60065815 0.79868371 0.3993419 [43,] 0.56833055 0.86333890 0.4316694 [44,] 0.52842158 0.94315684 0.4715784 [45,] 0.47880121 0.95760241 0.5211988 [46,] 0.47871665 0.95743329 0.5212834 [47,] 0.43526471 0.87052942 0.5647353 [48,] 0.63723830 0.72552340 0.3627617 [49,] 0.61419659 0.77160683 0.3858034 [50,] 0.56830154 0.86339692 0.4316985 [51,] 0.54847061 0.90305878 0.4515294 [52,] 0.50059810 0.99880379 0.4994019 [53,] 0.45790468 0.91580936 0.5420953 [54,] 0.43792511 0.87585022 0.5620749 [55,] 0.39815096 0.79630192 0.6018490 [56,] 0.35961375 0.71922750 0.6403863 [57,] 0.31925636 0.63851272 0.6807436 [58,] 0.28756510 0.57513020 0.7124349 [59,] 0.28486247 0.56972494 0.7151375 [60,] 0.29684300 0.59368601 0.7031570 [61,] 0.42839962 0.85679924 0.5716004 [62,] 0.53122963 0.93754074 0.4687704 [63,] 0.50021720 0.99956559 0.4997828 [64,] 0.68475237 0.63049525 0.3152476 [65,] 0.64629949 0.70740101 0.3537005 [66,] 0.67978436 0.64043128 0.3202156 [67,] 0.70611834 0.58776332 0.2938817 [68,] 0.68307077 0.63385846 0.3169292 [69,] 0.65292706 0.69414589 0.3470729 [70,] 0.61354376 0.77291248 0.3864562 [71,] 0.57558012 0.84883976 0.4244199 [72,] 0.53511792 0.92976416 0.4648821 [73,] 0.49717852 0.99435704 0.5028215 [74,] 0.47388529 0.94777058 0.5261147 [75,] 0.66618588 0.66762824 0.3338141 [76,] 0.63264180 0.73471641 0.3673582 [77,] 0.58986524 0.82026951 0.4101348 [78,] 0.54492490 0.91015020 0.4550751 [79,] 0.50727155 0.98545689 0.4927284 [80,] 0.47321403 0.94642806 0.5267860 [81,] 0.44061383 0.88122765 0.5593862 [82,] 0.41930343 0.83860687 0.5806966 [83,] 0.37603655 0.75207311 0.6239634 [84,] 0.38995374 0.77990747 0.6100463 [85,] 0.37483150 0.74966300 0.6251685 [86,] 0.34517155 0.69034310 0.6548284 [87,] 0.30398047 0.60796093 0.6960195 [88,] 0.27922666 0.55845332 0.7207733 [89,] 0.24591438 0.49182875 0.7540856 [90,] 0.21689114 0.43378228 0.7831089 [91,] 0.18967954 0.37935909 0.8103205 [92,] 0.17004488 0.34008975 0.8299551 [93,] 0.14248104 0.28496208 0.8575190 [94,] 0.12286514 0.24573027 0.8771349 [95,] 0.10820767 0.21641534 0.8917923 [96,] 0.22655315 0.45310630 0.7734469 [97,] 0.19584604 0.39169207 0.8041540 [98,] 0.18778535 0.37557069 0.8122147 [99,] 0.18204810 0.36409620 0.8179519 [100,] 0.18174301 0.36348601 0.8182570 [101,] 0.16200580 0.32401160 0.8379942 [102,] 0.15027795 0.30055590 0.8497221 [103,] 0.22314761 0.44629522 0.7768524 [104,] 0.20869984 0.41739969 0.7913002 [105,] 0.19320363 0.38640726 0.8067964 [106,] 0.24900869 0.49801737 0.7509913 [107,] 0.21946334 0.43892668 0.7805367 [108,] 0.24430997 0.48861995 0.7556900 [109,] 0.26947860 0.53895720 0.7305214 [110,] 0.23463194 0.46926388 0.7653681 [111,] 0.20574145 0.41148291 0.7942585 [112,] 0.18859575 0.37719150 0.8114042 [113,] 0.16659051 0.33318102 0.8334095 [114,] 0.14611774 0.29223548 0.8538823 [115,] 0.11990891 0.23981783 0.8800911 [116,] 0.11296542 0.22593084 0.8870346 [117,] 0.10104068 0.20208136 0.8989593 [118,] 0.08149226 0.16298452 0.9185077 [119,] 0.08066192 0.16132384 0.9193381 [120,] 0.06215968 0.12431936 0.9378403 [121,] 0.06350238 0.12700475 0.9364976 [122,] 0.04967455 0.09934909 0.9503255 [123,] 0.04903608 0.09807215 0.9509639 [124,] 0.05262068 0.10524135 0.9473793 [125,] 0.07075612 0.14151225 0.9292439 [126,] 0.06878056 0.13756113 0.9312194 [127,] 0.05839244 0.11678489 0.9416076 [128,] 0.04871605 0.09743211 0.9512839 [129,] 0.03489556 0.06979112 0.9651044 [130,] 0.03686471 0.07372943 0.9631353 [131,] 0.02774535 0.05549070 0.9722546 [132,] 0.05390925 0.10781850 0.9460908 [133,] 0.05286838 0.10573677 0.9471316 [134,] 0.24418755 0.48837510 0.7558125 [135,] 0.19192318 0.38384636 0.8080768 [136,] 0.14587744 0.29175488 0.8541226 [137,] 0.14878376 0.29756752 0.8512162 [138,] 0.11020170 0.22040341 0.8897983 [139,] 0.26029161 0.52058322 0.7397084 [140,] 0.33047856 0.66095712 0.6695214 [141,] 0.25360209 0.50720419 0.7463979 [142,] 0.30570875 0.61141749 0.6942913 [143,] 0.23495915 0.46991829 0.7650409 [144,] 0.43376892 0.86753785 0.5662311 [145,] 0.65566202 0.68867597 0.3443380 [146,] 0.51088102 0.97823797 0.4891190 [147,] 0.34859177 0.69718353 0.6514082 > postscript(file="/var/wessaorg/rcomp/tmp/1b5sd1352126050.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/2sphs1352126050.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/38v511352126050.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/4hkn11352126050.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/5htz11352126050.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 -3.02177485 0.21166341 4.55534901 0.89035481 -1.05969121 -2.29148580 7 8 9 10 11 12 3.19432575 -0.02660298 -1.30576606 -0.37205931 0.82583228 0.67689627 13 14 15 16 17 18 0.92039588 0.29047645 2.10904092 0.72162268 0.10499536 4.43399563 19 20 21 22 23 24 2.75325086 1.16587178 1.74683563 1.34247918 3.26526351 0.56963953 25 26 27 28 29 30 1.72486371 0.94983800 1.08136953 0.13425386 1.09011615 -0.54020273 31 32 33 34 35 36 0.29046619 -1.55290614 -1.54384884 1.01594762 -0.59221572 -7.25316437 37 38 39 40 41 42 -3.85728216 -0.82724109 1.62951754 1.31627809 1.01190207 -1.10382891 43 44 45 46 47 48 4.86838289 -0.70893485 -1.76459395 -4.49971113 -1.52345377 0.10745381 49 50 51 52 53 54 0.77145987 -1.13161711 1.34553659 -0.30517736 -2.25316437 0.98285940 55 56 57 58 59 60 -5.27050204 -1.50129823 0.22112580 1.70674347 0.05603978 0.79520251 61 62 63 64 65 66 -2.05281433 0.85263233 0.95605935 -0.66380899 0.86149576 2.38562874 67 68 69 70 71 72 2.66902100 3.90463506 -3.64963528 1.38562874 -5.06226646 -0.53615718 73 74 75 76 77 78 3.07583589 2.99920891 1.33055835 1.15177514 0.56017714 0.86149576 79 80 81 82 83 84 -0.71376298 0.87478787 1.63011649 5.11592805 0.87242844 0.05445267 85 86 87 88 89 90 0.17533416 0.97980200 -1.01025347 1.10745381 1.62164226 0.11532909 91 92 93 94 95 96 -2.57083250 1.64222095 0.94177909 0.14694701 -1.41303307 0.25580112 97 98 99 100 101 102 0.55071476 0.74318952 1.04657739 -0.25157727 0.42453324 1.03870212 103 104 105 106 107 108 4.70369632 0.63493437 1.21935507 -2.41865547 1.40719558 0.50876311 109 110 111 112 113 114 1.18222129 -4.28988844 1.51279841 1.35194156 2.37233663 -1.27837732 115 116 117 118 119 120 -3.46662290 2.93626324 -0.83894609 -0.93203939 -1.92563441 0.39932030 121 122 123 124 125 126 -1.86574614 1.17227676 -2.57387965 0.57751481 0.05544082 1.37715451 127 128 129 130 131 132 -0.30034923 0.59021822 0.09170325 -3.19692221 1.74683563 -3.69642532 133 134 135 136 137 138 0.12961961 -1.56236853 -0.88407195 0.11385879 -0.86980195 0.44404671 139 140 141 142 143 144 -3.49507687 -3.20479749 -6.07496987 1.17533416 1.05121165 2.55534901 145 146 147 148 149 150 1.71697818 -5.97440637 3.15482229 -1.77522810 1.71216030 -1.75148546 151 152 153 154 155 156 -5.54866671 -1.18263169 1.42042087 0.88189083 -1.25522337 -4.91934623 157 158 159 160 161 162 1.64222095 -1.72222696 0.09170325 0.87883342 -2.75690229 -2.02660298 > postscript(file="/var/wessaorg/rcomp/tmp/68wmr1352126050.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 -3.02177485 NA 1 0.21166341 -3.02177485 2 4.55534901 0.21166341 3 0.89035481 4.55534901 4 -1.05969121 0.89035481 5 -2.29148580 -1.05969121 6 3.19432575 -2.29148580 7 -0.02660298 3.19432575 8 -1.30576606 -0.02660298 9 -0.37205931 -1.30576606 10 0.82583228 -0.37205931 11 0.67689627 0.82583228 12 0.92039588 0.67689627 13 0.29047645 0.92039588 14 2.10904092 0.29047645 15 0.72162268 2.10904092 16 0.10499536 0.72162268 17 4.43399563 0.10499536 18 2.75325086 4.43399563 19 1.16587178 2.75325086 20 1.74683563 1.16587178 21 1.34247918 1.74683563 22 3.26526351 1.34247918 23 0.56963953 3.26526351 24 1.72486371 0.56963953 25 0.94983800 1.72486371 26 1.08136953 0.94983800 27 0.13425386 1.08136953 28 1.09011615 0.13425386 29 -0.54020273 1.09011615 30 0.29046619 -0.54020273 31 -1.55290614 0.29046619 32 -1.54384884 -1.55290614 33 1.01594762 -1.54384884 34 -0.59221572 1.01594762 35 -7.25316437 -0.59221572 36 -3.85728216 -7.25316437 37 -0.82724109 -3.85728216 38 1.62951754 -0.82724109 39 1.31627809 1.62951754 40 1.01190207 1.31627809 41 -1.10382891 1.01190207 42 4.86838289 -1.10382891 43 -0.70893485 4.86838289 44 -1.76459395 -0.70893485 45 -4.49971113 -1.76459395 46 -1.52345377 -4.49971113 47 0.10745381 -1.52345377 48 0.77145987 0.10745381 49 -1.13161711 0.77145987 50 1.34553659 -1.13161711 51 -0.30517736 1.34553659 52 -2.25316437 -0.30517736 53 0.98285940 -2.25316437 54 -5.27050204 0.98285940 55 -1.50129823 -5.27050204 56 0.22112580 -1.50129823 57 1.70674347 0.22112580 58 0.05603978 1.70674347 59 0.79520251 0.05603978 60 -2.05281433 0.79520251 61 0.85263233 -2.05281433 62 0.95605935 0.85263233 63 -0.66380899 0.95605935 64 0.86149576 -0.66380899 65 2.38562874 0.86149576 66 2.66902100 2.38562874 67 3.90463506 2.66902100 68 -3.64963528 3.90463506 69 1.38562874 -3.64963528 70 -5.06226646 1.38562874 71 -0.53615718 -5.06226646 72 3.07583589 -0.53615718 73 2.99920891 3.07583589 74 1.33055835 2.99920891 75 1.15177514 1.33055835 76 0.56017714 1.15177514 77 0.86149576 0.56017714 78 -0.71376298 0.86149576 79 0.87478787 -0.71376298 80 1.63011649 0.87478787 81 5.11592805 1.63011649 82 0.87242844 5.11592805 83 0.05445267 0.87242844 84 0.17533416 0.05445267 85 0.97980200 0.17533416 86 -1.01025347 0.97980200 87 1.10745381 -1.01025347 88 1.62164226 1.10745381 89 0.11532909 1.62164226 90 -2.57083250 0.11532909 91 1.64222095 -2.57083250 92 0.94177909 1.64222095 93 0.14694701 0.94177909 94 -1.41303307 0.14694701 95 0.25580112 -1.41303307 96 0.55071476 0.25580112 97 0.74318952 0.55071476 98 1.04657739 0.74318952 99 -0.25157727 1.04657739 100 0.42453324 -0.25157727 101 1.03870212 0.42453324 102 4.70369632 1.03870212 103 0.63493437 4.70369632 104 1.21935507 0.63493437 105 -2.41865547 1.21935507 106 1.40719558 -2.41865547 107 0.50876311 1.40719558 108 1.18222129 0.50876311 109 -4.28988844 1.18222129 110 1.51279841 -4.28988844 111 1.35194156 1.51279841 112 2.37233663 1.35194156 113 -1.27837732 2.37233663 114 -3.46662290 -1.27837732 115 2.93626324 -3.46662290 116 -0.83894609 2.93626324 117 -0.93203939 -0.83894609 118 -1.92563441 -0.93203939 119 0.39932030 -1.92563441 120 -1.86574614 0.39932030 121 1.17227676 -1.86574614 122 -2.57387965 1.17227676 123 0.57751481 -2.57387965 124 0.05544082 0.57751481 125 1.37715451 0.05544082 126 -0.30034923 1.37715451 127 0.59021822 -0.30034923 128 0.09170325 0.59021822 129 -3.19692221 0.09170325 130 1.74683563 -3.19692221 131 -3.69642532 1.74683563 132 0.12961961 -3.69642532 133 -1.56236853 0.12961961 134 -0.88407195 -1.56236853 135 0.11385879 -0.88407195 136 -0.86980195 0.11385879 137 0.44404671 -0.86980195 138 -3.49507687 0.44404671 139 -3.20479749 -3.49507687 140 -6.07496987 -3.20479749 141 1.17533416 -6.07496987 142 1.05121165 1.17533416 143 2.55534901 1.05121165 144 1.71697818 2.55534901 145 -5.97440637 1.71697818 146 3.15482229 -5.97440637 147 -1.77522810 3.15482229 148 1.71216030 -1.77522810 149 -1.75148546 1.71216030 150 -5.54866671 -1.75148546 151 -1.18263169 -5.54866671 152 1.42042087 -1.18263169 153 0.88189083 1.42042087 154 -1.25522337 0.88189083 155 -4.91934623 -1.25522337 156 1.64222095 -4.91934623 157 -1.72222696 1.64222095 158 0.09170325 -1.72222696 159 0.87883342 0.09170325 160 -2.75690229 0.87883342 161 -2.02660298 -2.75690229 162 NA -2.02660298 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.21166341 -3.02177485 [2,] 4.55534901 0.21166341 [3,] 0.89035481 4.55534901 [4,] -1.05969121 0.89035481 [5,] -2.29148580 -1.05969121 [6,] 3.19432575 -2.29148580 [7,] -0.02660298 3.19432575 [8,] -1.30576606 -0.02660298 [9,] -0.37205931 -1.30576606 [10,] 0.82583228 -0.37205931 [11,] 0.67689627 0.82583228 [12,] 0.92039588 0.67689627 [13,] 0.29047645 0.92039588 [14,] 2.10904092 0.29047645 [15,] 0.72162268 2.10904092 [16,] 0.10499536 0.72162268 [17,] 4.43399563 0.10499536 [18,] 2.75325086 4.43399563 [19,] 1.16587178 2.75325086 [20,] 1.74683563 1.16587178 [21,] 1.34247918 1.74683563 [22,] 3.26526351 1.34247918 [23,] 0.56963953 3.26526351 [24,] 1.72486371 0.56963953 [25,] 0.94983800 1.72486371 [26,] 1.08136953 0.94983800 [27,] 0.13425386 1.08136953 [28,] 1.09011615 0.13425386 [29,] -0.54020273 1.09011615 [30,] 0.29046619 -0.54020273 [31,] -1.55290614 0.29046619 [32,] -1.54384884 -1.55290614 [33,] 1.01594762 -1.54384884 [34,] -0.59221572 1.01594762 [35,] -7.25316437 -0.59221572 [36,] -3.85728216 -7.25316437 [37,] -0.82724109 -3.85728216 [38,] 1.62951754 -0.82724109 [39,] 1.31627809 1.62951754 [40,] 1.01190207 1.31627809 [41,] -1.10382891 1.01190207 [42,] 4.86838289 -1.10382891 [43,] -0.70893485 4.86838289 [44,] -1.76459395 -0.70893485 [45,] -4.49971113 -1.76459395 [46,] -1.52345377 -4.49971113 [47,] 0.10745381 -1.52345377 [48,] 0.77145987 0.10745381 [49,] -1.13161711 0.77145987 [50,] 1.34553659 -1.13161711 [51,] -0.30517736 1.34553659 [52,] -2.25316437 -0.30517736 [53,] 0.98285940 -2.25316437 [54,] -5.27050204 0.98285940 [55,] -1.50129823 -5.27050204 [56,] 0.22112580 -1.50129823 [57,] 1.70674347 0.22112580 [58,] 0.05603978 1.70674347 [59,] 0.79520251 0.05603978 [60,] -2.05281433 0.79520251 [61,] 0.85263233 -2.05281433 [62,] 0.95605935 0.85263233 [63,] -0.66380899 0.95605935 [64,] 0.86149576 -0.66380899 [65,] 2.38562874 0.86149576 [66,] 2.66902100 2.38562874 [67,] 3.90463506 2.66902100 [68,] -3.64963528 3.90463506 [69,] 1.38562874 -3.64963528 [70,] -5.06226646 1.38562874 [71,] -0.53615718 -5.06226646 [72,] 3.07583589 -0.53615718 [73,] 2.99920891 3.07583589 [74,] 1.33055835 2.99920891 [75,] 1.15177514 1.33055835 [76,] 0.56017714 1.15177514 [77,] 0.86149576 0.56017714 [78,] -0.71376298 0.86149576 [79,] 0.87478787 -0.71376298 [80,] 1.63011649 0.87478787 [81,] 5.11592805 1.63011649 [82,] 0.87242844 5.11592805 [83,] 0.05445267 0.87242844 [84,] 0.17533416 0.05445267 [85,] 0.97980200 0.17533416 [86,] -1.01025347 0.97980200 [87,] 1.10745381 -1.01025347 [88,] 1.62164226 1.10745381 [89,] 0.11532909 1.62164226 [90,] -2.57083250 0.11532909 [91,] 1.64222095 -2.57083250 [92,] 0.94177909 1.64222095 [93,] 0.14694701 0.94177909 [94,] -1.41303307 0.14694701 [95,] 0.25580112 -1.41303307 [96,] 0.55071476 0.25580112 [97,] 0.74318952 0.55071476 [98,] 1.04657739 0.74318952 [99,] -0.25157727 1.04657739 [100,] 0.42453324 -0.25157727 [101,] 1.03870212 0.42453324 [102,] 4.70369632 1.03870212 [103,] 0.63493437 4.70369632 [104,] 1.21935507 0.63493437 [105,] -2.41865547 1.21935507 [106,] 1.40719558 -2.41865547 [107,] 0.50876311 1.40719558 [108,] 1.18222129 0.50876311 [109,] -4.28988844 1.18222129 [110,] 1.51279841 -4.28988844 [111,] 1.35194156 1.51279841 [112,] 2.37233663 1.35194156 [113,] -1.27837732 2.37233663 [114,] -3.46662290 -1.27837732 [115,] 2.93626324 -3.46662290 [116,] -0.83894609 2.93626324 [117,] -0.93203939 -0.83894609 [118,] -1.92563441 -0.93203939 [119,] 0.39932030 -1.92563441 [120,] -1.86574614 0.39932030 [121,] 1.17227676 -1.86574614 [122,] -2.57387965 1.17227676 [123,] 0.57751481 -2.57387965 [124,] 0.05544082 0.57751481 [125,] 1.37715451 0.05544082 [126,] -0.30034923 1.37715451 [127,] 0.59021822 -0.30034923 [128,] 0.09170325 0.59021822 [129,] -3.19692221 0.09170325 [130,] 1.74683563 -3.19692221 [131,] -3.69642532 1.74683563 [132,] 0.12961961 -3.69642532 [133,] -1.56236853 0.12961961 [134,] -0.88407195 -1.56236853 [135,] 0.11385879 -0.88407195 [136,] -0.86980195 0.11385879 [137,] 0.44404671 -0.86980195 [138,] -3.49507687 0.44404671 [139,] -3.20479749 -3.49507687 [140,] -6.07496987 -3.20479749 [141,] 1.17533416 -6.07496987 [142,] 1.05121165 1.17533416 [143,] 2.55534901 1.05121165 [144,] 1.71697818 2.55534901 [145,] -5.97440637 1.71697818 [146,] 3.15482229 -5.97440637 [147,] -1.77522810 3.15482229 [148,] 1.71216030 -1.77522810 [149,] -1.75148546 1.71216030 [150,] -5.54866671 -1.75148546 [151,] -1.18263169 -5.54866671 [152,] 1.42042087 -1.18263169 [153,] 0.88189083 1.42042087 [154,] -1.25522337 0.88189083 [155,] -4.91934623 -1.25522337 [156,] 1.64222095 -4.91934623 [157,] -1.72222696 1.64222095 [158,] 0.09170325 -1.72222696 [159,] 0.87883342 0.09170325 [160,] -2.75690229 0.87883342 [161,] -2.02660298 -2.75690229 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.21166341 -3.02177485 2 4.55534901 0.21166341 3 0.89035481 4.55534901 4 -1.05969121 0.89035481 5 -2.29148580 -1.05969121 6 3.19432575 -2.29148580 7 -0.02660298 3.19432575 8 -1.30576606 -0.02660298 9 -0.37205931 -1.30576606 10 0.82583228 -0.37205931 11 0.67689627 0.82583228 12 0.92039588 0.67689627 13 0.29047645 0.92039588 14 2.10904092 0.29047645 15 0.72162268 2.10904092 16 0.10499536 0.72162268 17 4.43399563 0.10499536 18 2.75325086 4.43399563 19 1.16587178 2.75325086 20 1.74683563 1.16587178 21 1.34247918 1.74683563 22 3.26526351 1.34247918 23 0.56963953 3.26526351 24 1.72486371 0.56963953 25 0.94983800 1.72486371 26 1.08136953 0.94983800 27 0.13425386 1.08136953 28 1.09011615 0.13425386 29 -0.54020273 1.09011615 30 0.29046619 -0.54020273 31 -1.55290614 0.29046619 32 -1.54384884 -1.55290614 33 1.01594762 -1.54384884 34 -0.59221572 1.01594762 35 -7.25316437 -0.59221572 36 -3.85728216 -7.25316437 37 -0.82724109 -3.85728216 38 1.62951754 -0.82724109 39 1.31627809 1.62951754 40 1.01190207 1.31627809 41 -1.10382891 1.01190207 42 4.86838289 -1.10382891 43 -0.70893485 4.86838289 44 -1.76459395 -0.70893485 45 -4.49971113 -1.76459395 46 -1.52345377 -4.49971113 47 0.10745381 -1.52345377 48 0.77145987 0.10745381 49 -1.13161711 0.77145987 50 1.34553659 -1.13161711 51 -0.30517736 1.34553659 52 -2.25316437 -0.30517736 53 0.98285940 -2.25316437 54 -5.27050204 0.98285940 55 -1.50129823 -5.27050204 56 0.22112580 -1.50129823 57 1.70674347 0.22112580 58 0.05603978 1.70674347 59 0.79520251 0.05603978 60 -2.05281433 0.79520251 61 0.85263233 -2.05281433 62 0.95605935 0.85263233 63 -0.66380899 0.95605935 64 0.86149576 -0.66380899 65 2.38562874 0.86149576 66 2.66902100 2.38562874 67 3.90463506 2.66902100 68 -3.64963528 3.90463506 69 1.38562874 -3.64963528 70 -5.06226646 1.38562874 71 -0.53615718 -5.06226646 72 3.07583589 -0.53615718 73 2.99920891 3.07583589 74 1.33055835 2.99920891 75 1.15177514 1.33055835 76 0.56017714 1.15177514 77 0.86149576 0.56017714 78 -0.71376298 0.86149576 79 0.87478787 -0.71376298 80 1.63011649 0.87478787 81 5.11592805 1.63011649 82 0.87242844 5.11592805 83 0.05445267 0.87242844 84 0.17533416 0.05445267 85 0.97980200 0.17533416 86 -1.01025347 0.97980200 87 1.10745381 -1.01025347 88 1.62164226 1.10745381 89 0.11532909 1.62164226 90 -2.57083250 0.11532909 91 1.64222095 -2.57083250 92 0.94177909 1.64222095 93 0.14694701 0.94177909 94 -1.41303307 0.14694701 95 0.25580112 -1.41303307 96 0.55071476 0.25580112 97 0.74318952 0.55071476 98 1.04657739 0.74318952 99 -0.25157727 1.04657739 100 0.42453324 -0.25157727 101 1.03870212 0.42453324 102 4.70369632 1.03870212 103 0.63493437 4.70369632 104 1.21935507 0.63493437 105 -2.41865547 1.21935507 106 1.40719558 -2.41865547 107 0.50876311 1.40719558 108 1.18222129 0.50876311 109 -4.28988844 1.18222129 110 1.51279841 -4.28988844 111 1.35194156 1.51279841 112 2.37233663 1.35194156 113 -1.27837732 2.37233663 114 -3.46662290 -1.27837732 115 2.93626324 -3.46662290 116 -0.83894609 2.93626324 117 -0.93203939 -0.83894609 118 -1.92563441 -0.93203939 119 0.39932030 -1.92563441 120 -1.86574614 0.39932030 121 1.17227676 -1.86574614 122 -2.57387965 1.17227676 123 0.57751481 -2.57387965 124 0.05544082 0.57751481 125 1.37715451 0.05544082 126 -0.30034923 1.37715451 127 0.59021822 -0.30034923 128 0.09170325 0.59021822 129 -3.19692221 0.09170325 130 1.74683563 -3.19692221 131 -3.69642532 1.74683563 132 0.12961961 -3.69642532 133 -1.56236853 0.12961961 134 -0.88407195 -1.56236853 135 0.11385879 -0.88407195 136 -0.86980195 0.11385879 137 0.44404671 -0.86980195 138 -3.49507687 0.44404671 139 -3.20479749 -3.49507687 140 -6.07496987 -3.20479749 141 1.17533416 -6.07496987 142 1.05121165 1.17533416 143 2.55534901 1.05121165 144 1.71697818 2.55534901 145 -5.97440637 1.71697818 146 3.15482229 -5.97440637 147 -1.77522810 3.15482229 148 1.71216030 -1.77522810 149 -1.75148546 1.71216030 150 -5.54866671 -1.75148546 151 -1.18263169 -5.54866671 152 1.42042087 -1.18263169 153 0.88189083 1.42042087 154 -1.25522337 0.88189083 155 -4.91934623 -1.25522337 156 1.64222095 -4.91934623 157 -1.72222696 1.64222095 158 0.09170325 -1.72222696 159 0.87883342 0.09170325 160 -2.75690229 0.87883342 161 -2.02660298 -2.75690229 > 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/7h5ux1352126050.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/880151352126050.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/9ubfd1352126050.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/10csbt1352126050.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/11h0oi1352126050.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/12l4ea1352126050.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/13sye01352126050.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/142s861352126050.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/15rrlu1352126050.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/16q2at1352126050.tab") + } > > try(system("convert tmp/1b5sd1352126050.ps tmp/1b5sd1352126050.png",intern=TRUE)) character(0) > try(system("convert tmp/2sphs1352126050.ps tmp/2sphs1352126050.png",intern=TRUE)) character(0) > try(system("convert tmp/38v511352126050.ps tmp/38v511352126050.png",intern=TRUE)) character(0) > try(system("convert tmp/4hkn11352126050.ps tmp/4hkn11352126050.png",intern=TRUE)) character(0) > try(system("convert tmp/5htz11352126050.ps tmp/5htz11352126050.png",intern=TRUE)) character(0) > try(system("convert tmp/68wmr1352126050.ps tmp/68wmr1352126050.png",intern=TRUE)) character(0) > try(system("convert tmp/7h5ux1352126050.ps tmp/7h5ux1352126050.png",intern=TRUE)) character(0) > try(system("convert tmp/880151352126050.ps tmp/880151352126050.png",intern=TRUE)) character(0) > try(system("convert tmp/9ubfd1352126050.ps tmp/9ubfd1352126050.png",intern=TRUE)) character(0) > try(system("convert tmp/10csbt1352126050.ps tmp/10csbt1352126050.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 8.350 1.227 9.565