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(1 + ,3 + ,8 + ,9 + ,0 + ,0 + ,6 + ,0 + ,5 + ,8 + ,9 + ,0 + ,0 + ,7 + ,0 + ,5 + ,8 + ,9 + ,0 + ,0 + ,7 + ,0 + ,5 + ,8 + ,9 + ,0 + ,0 + ,7 + ,0 + ,5 + ,8 + ,9 + ,0 + ,0 + ,7 + ,1 + ,5 + ,8 + ,9 + ,0 + ,1 + ,6 + ,0 + ,5 + ,8 + ,9 + ,0 + ,0 + ,7 + ,0 + ,3 + ,8 + ,9 + ,0 + ,0 + ,7 + ,0 + ,5 + ,8 + ,9 + ,0 + ,0 + ,6 + ,1 + ,5 + ,8 + ,9 + ,0 + ,0 + ,7 + ,1 + ,3 + ,8 + ,9 + ,0 + ,0 + ,7 + ,0 + ,5 + ,8 + ,9 + ,0 + ,0 + ,7 + ,0 + ,5 + ,8 + ,10 + ,0 + ,1 + ,7 + ,1 + ,3 + ,8 + ,9 + ,0 + ,0 + ,7 + ,0 + ,5 + ,8 + ,10 + ,0 + ,1 + ,6 + ,0 + ,3 + ,8 + ,10 + ,0 + ,1 + ,6 + ,1 + ,3 + ,8 + ,10 + ,1 + ,1 + ,7 + ,1 + ,3 + ,8 + ,9 + ,0 + ,0 + ,7 + ,0 + ,5 + ,8 + ,9 + ,0 + ,0 + ,6 + ,0 + ,3 + ,8 + ,10 + ,1 + ,1 + ,6 + ,1 + ,5 + ,8 + ,9 + ,0 + ,1 + ,7 + ,1 + ,5 + ,8 + ,10 + ,0 + ,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,8 + ,9 + ,0 + ,0 + ,7 + ,1 + ,5 + ,8 + ,10 + ,0 + ,0 + ,6 + ,0 + ,5 + ,8 + ,9 + ,0 + ,0 + ,7 + ,0 + ,5 + ,8 + ,10 + ,1 + ,0 + ,7 + ,0 + ,5 + ,8 + ,9 + ,0 + ,1 + ,6 + ,1 + ,5 + ,8 + ,9 + ,0 + ,0 + ,7) + ,dim=c(7 + ,86) + ,dimnames=list(c('UseLimit' + ,'T40' + ,'T20' + ,'Used' + ,'CorrectAnalysis' + ,'Useful' + ,'Outcome') + ,1:86)) > y <- array(NA,dim=c(7,86),dimnames=list(c('UseLimit','T40','T20','Used','CorrectAnalysis','Useful','Outcome'),1:86)) > 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 = '7' > par3 <- 'No Linear Trend' > par2 <- 'Do not include Seasonal Dummies' > par1 <- '7' > #'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 Outcome UseLimit T40 T20 Used CorrectAnalysis Useful 1 6 1 3 8 9 0 0 2 7 0 5 8 9 0 0 3 7 0 5 8 9 0 0 4 7 0 5 8 9 0 0 5 7 0 5 8 9 0 0 6 6 1 5 8 9 0 1 7 7 0 5 8 9 0 0 8 7 0 3 8 9 0 0 9 6 0 5 8 9 0 0 10 7 1 5 8 9 0 0 11 7 1 3 8 9 0 0 12 7 0 5 8 9 0 0 13 7 0 5 8 10 0 1 14 7 1 3 8 9 0 0 15 6 0 5 8 10 0 1 16 6 0 3 8 10 0 1 17 7 1 3 8 10 1 1 18 7 1 3 8 9 0 0 19 6 0 5 8 9 0 0 20 6 0 3 8 10 1 1 21 7 1 5 8 9 0 1 22 6 1 5 8 10 0 1 23 6 0 5 8 9 0 1 24 6 1 5 8 9 0 1 25 6 0 3 8 10 0 0 26 7 0 5 8 10 0 1 27 6 1 5 8 9 0 0 28 7 0 5 8 10 0 0 29 6 0 5 8 9 0 0 30 7 0 5 8 9 0 1 31 7 0 5 8 9 0 0 32 7 1 5 8 9 0 0 33 7 1 5 8 9 0 1 34 6 0 3 8 9 0 0 35 7 0 5 8 9 0 0 36 7 0 5 8 9 0 0 37 7 1 3 8 10 0 1 38 6 0 5 8 10 0 0 39 6 0 5 8 9 0 1 40 7 0 3 8 9 0 1 41 6 0 5 8 10 1 1 42 6 0 5 8 10 0 0 43 6 1 5 8 9 0 1 44 7 1 3 8 9 0 0 45 7 0 5 8 9 0 1 46 6 0 5 8 9 0 1 47 7 0 5 8 9 0 0 48 6 0 5 8 9 0 0 49 6 0 5 8 9 0 1 50 7 0 5 8 9 0 0 51 7 0 3 8 10 0 0 52 7 1 3 8 10 1 1 53 6 0 5 8 9 0 0 54 7 0 5 8 10 1 0 55 7 0 5 8 9 0 0 56 6 0 3 8 10 0 0 57 6 0 5 8 10 0 1 58 6 0 5 8 9 0 0 59 6 0 5 8 9 0 0 60 6 1 3 8 10 1 1 61 6 1 3 8 9 0 0 62 7 0 5 8 10 0 1 63 7 0 5 8 9 0 0 64 6 1 3 8 9 0 0 65 7 0 5 8 9 0 0 66 7 0 5 8 9 0 0 67 7 0 3 8 10 1 1 68 7 1 5 8 9 0 0 69 6 0 5 8 9 0 0 70 7 0 5 8 10 0 0 71 7 0 5 8 9 0 0 72 6 0 5 8 9 0 0 73 6 0 5 8 10 0 0 74 7 1 5 8 10 0 0 75 6 0 5 8 9 0 0 76 6 0 3 8 9 0 1 77 6 0 5 8 9 0 0 78 6 0 5 8 10 0 1 79 6 0 3 8 10 1 0 80 7 0 3 8 9 0 1 81 7 0 5 8 9 0 0 82 6 1 5 8 10 0 0 83 7 0 5 8 9 0 0 84 7 0 5 8 10 1 0 85 6 0 5 8 9 0 1 86 7 1 5 8 9 0 0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) UseLimit T40 T20 7.45430 0.08160 0.01794 NA Used CorrectAnalysis Useful -0.10570 0.16898 -0.15555 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -0.6743 -0.5142 0.3257 0.4073 0.6685 Coefficients: (1 not defined because of singularities) Estimate Std. Error t value Pr(>|t|) (Intercept) 7.45430 1.33158 5.598 2.95e-07 *** UseLimit 0.08160 0.12779 0.639 0.525 T40 0.01794 0.06763 0.265 0.791 T20 NA NA NA NA Used -0.10570 0.13749 -0.769 0.444 CorrectAnalysis 0.16898 0.21291 0.794 0.430 Useful -0.15555 0.12059 -1.290 0.201 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.5071 on 80 degrees of freedom Multiple R-squared: 0.03833, Adjusted R-squared: -0.02178 F-statistic: 0.6377 on 5 and 80 DF, p-value: 0.6716 > 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.80032747 0.3993451 0.1996725 [2,] 0.75848883 0.4830223 0.2415112 [3,] 0.64780159 0.7043968 0.3521984 [4,] 0.53641761 0.9271648 0.4635824 [5,] 0.46187623 0.9237525 0.5381238 [6,] 0.54241538 0.9151692 0.4575846 [7,] 0.46860512 0.9372102 0.5313949 [8,] 0.37597334 0.7519467 0.6240267 [9,] 0.31554967 0.6310993 0.6844503 [10,] 0.45353289 0.9070658 0.5464671 [11,] 0.46178570 0.9235714 0.5382143 [12,] 0.51850378 0.9629924 0.4814962 [13,] 0.50751816 0.9849637 0.4924818 [14,] 0.45710906 0.9142181 0.5428909 [15,] 0.42282984 0.8456597 0.5771702 [16,] 0.43564235 0.8712847 0.5643576 [17,] 0.50626812 0.9874638 0.4937319 [18,] 0.58687366 0.8262527 0.4131263 [19,] 0.55238217 0.8952357 0.4476178 [20,] 0.58995644 0.8200871 0.4100436 [21,] 0.60644541 0.7871092 0.3935546 [22,] 0.56684745 0.8663051 0.4331526 [23,] 0.51801764 0.9639647 0.4819824 [24,] 0.50953980 0.9809204 0.4904602 [25,] 0.51563787 0.9687243 0.4843621 [26,] 0.47845071 0.9569014 0.5215493 [27,] 0.44255691 0.8851138 0.5574431 [28,] 0.47922608 0.9584522 0.5207739 [29,] 0.48582745 0.9716549 0.5141725 [30,] 0.46400469 0.9280094 0.5359953 [31,] 0.48499088 0.9699818 0.5150091 [32,] 0.47210787 0.9442157 0.5278921 [33,] 0.46001017 0.9200203 0.5399898 [34,] 0.45691535 0.9138307 0.5430846 [35,] 0.43831078 0.8766216 0.5616892 [36,] 0.44383366 0.8876673 0.5561663 [37,] 0.42617683 0.8523537 0.5738232 [38,] 0.40284059 0.8056812 0.5971594 [39,] 0.41607093 0.8321419 0.5839291 [40,] 0.39843649 0.7968730 0.6015635 [41,] 0.37549972 0.7509994 0.6245003 [42,] 0.43190561 0.8638112 0.5680944 [43,] 0.41669879 0.8333976 0.5833012 [44,] 0.43242599 0.8648520 0.5675740 [45,] 0.38322427 0.7664485 0.6167757 [46,] 0.35866329 0.7173266 0.6413367 [47,] 0.32026465 0.6405293 0.6797353 [48,] 0.29466167 0.5893233 0.7053383 [49,] 0.30559791 0.6111958 0.6944021 [50,] 0.32226384 0.6445277 0.6777362 [51,] 0.33266139 0.6653228 0.6673386 [52,] 0.31269132 0.6253826 0.6873087 [53,] 0.32497055 0.6499411 0.6750295 [54,] 0.29631221 0.5926244 0.7036878 [55,] 0.30736252 0.6147250 0.6926375 [56,] 0.28341361 0.5668272 0.7165864 [57,] 0.26842894 0.5368579 0.7315711 [58,] 0.25565677 0.5113135 0.7443432 [59,] 0.19882546 0.3976509 0.8011745 [60,] 0.19178632 0.3835726 0.8082137 [61,] 0.24740372 0.4948074 0.7525963 [62,] 0.23630624 0.4726125 0.7636938 [63,] 0.21174989 0.4234998 0.7882501 [64,] 0.14566876 0.2913375 0.8543312 [65,] 0.14991512 0.2998302 0.8500849 [66,] 0.14209932 0.2841986 0.8579007 [67,] 0.09711393 0.1942279 0.9028861 > postscript(file="/var/wessaorg/rcomp/tmp/1p4pp1356133056.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/2ew1m1356133056.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/3ci551356133056.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/4k8ou1356133056.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/5jddu1356133056.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 = 86 Frequency = 1 1 2 3 4 5 6 7 -0.6384151 0.4072979 0.4072979 0.4072979 0.4072979 -0.5187501 0.4072979 8 9 10 11 12 13 14 0.4431845 -0.5927021 0.3256984 0.3615849 0.4072979 0.6685516 0.3615849 15 16 17 18 19 20 21 -0.3314484 -0.2955618 0.4538574 0.3615849 -0.5927021 -0.4645430 0.4812499 22 23 24 25 26 27 28 -0.4130479 -0.4371505 -0.5187501 -0.4511134 0.6685516 -0.6743016 0.5130001 29 30 31 32 33 34 35 -0.5927021 0.5628495 0.4072979 0.3256984 0.4812499 -0.5568155 0.4072979 36 37 38 39 40 41 42 0.4072979 0.6228386 -0.4869999 -0.4371505 0.5987361 -0.5004295 -0.4869999 43 44 45 46 47 48 49 -0.5187501 0.3615849 0.5628495 -0.4371505 0.4072979 -0.5927021 -0.4371505 50 51 52 53 54 55 56 0.4072979 0.5488866 0.4538574 -0.5927021 0.3440189 0.4072979 -0.4511134 57 58 59 60 61 62 63 -0.3314484 -0.5927021 -0.5927021 -0.5461426 -0.6384151 0.6685516 0.4072979 64 65 66 67 68 69 70 -0.6384151 0.4072979 0.4072979 0.5354570 0.3256984 -0.5927021 0.5130001 71 72 73 74 75 76 77 0.4072979 -0.5927021 -0.4869999 0.4314005 -0.5927021 -0.4012639 -0.5927021 78 79 80 81 82 83 84 -0.3314484 -0.6200946 0.5987361 0.4072979 -0.5685995 0.4072979 0.3440189 85 86 -0.4371505 0.3256984 > postscript(file="/var/wessaorg/rcomp/tmp/6kdyg1356133056.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 = 86 Frequency = 1 lag(myerror, k = 1) myerror 0 -0.6384151 NA 1 0.4072979 -0.6384151 2 0.4072979 0.4072979 3 0.4072979 0.4072979 4 0.4072979 0.4072979 5 -0.5187501 0.4072979 6 0.4072979 -0.5187501 7 0.4431845 0.4072979 8 -0.5927021 0.4431845 9 0.3256984 -0.5927021 10 0.3615849 0.3256984 11 0.4072979 0.3615849 12 0.6685516 0.4072979 13 0.3615849 0.6685516 14 -0.3314484 0.3615849 15 -0.2955618 -0.3314484 16 0.4538574 -0.2955618 17 0.3615849 0.4538574 18 -0.5927021 0.3615849 19 -0.4645430 -0.5927021 20 0.4812499 -0.4645430 21 -0.4130479 0.4812499 22 -0.4371505 -0.4130479 23 -0.5187501 -0.4371505 24 -0.4511134 -0.5187501 25 0.6685516 -0.4511134 26 -0.6743016 0.6685516 27 0.5130001 -0.6743016 28 -0.5927021 0.5130001 29 0.5628495 -0.5927021 30 0.4072979 0.5628495 31 0.3256984 0.4072979 32 0.4812499 0.3256984 33 -0.5568155 0.4812499 34 0.4072979 -0.5568155 35 0.4072979 0.4072979 36 0.6228386 0.4072979 37 -0.4869999 0.6228386 38 -0.4371505 -0.4869999 39 0.5987361 -0.4371505 40 -0.5004295 0.5987361 41 -0.4869999 -0.5004295 42 -0.5187501 -0.4869999 43 0.3615849 -0.5187501 44 0.5628495 0.3615849 45 -0.4371505 0.5628495 46 0.4072979 -0.4371505 47 -0.5927021 0.4072979 48 -0.4371505 -0.5927021 49 0.4072979 -0.4371505 50 0.5488866 0.4072979 51 0.4538574 0.5488866 52 -0.5927021 0.4538574 53 0.3440189 -0.5927021 54 0.4072979 0.3440189 55 -0.4511134 0.4072979 56 -0.3314484 -0.4511134 57 -0.5927021 -0.3314484 58 -0.5927021 -0.5927021 59 -0.5461426 -0.5927021 60 -0.6384151 -0.5461426 61 0.6685516 -0.6384151 62 0.4072979 0.6685516 63 -0.6384151 0.4072979 64 0.4072979 -0.6384151 65 0.4072979 0.4072979 66 0.5354570 0.4072979 67 0.3256984 0.5354570 68 -0.5927021 0.3256984 69 0.5130001 -0.5927021 70 0.4072979 0.5130001 71 -0.5927021 0.4072979 72 -0.4869999 -0.5927021 73 0.4314005 -0.4869999 74 -0.5927021 0.4314005 75 -0.4012639 -0.5927021 76 -0.5927021 -0.4012639 77 -0.3314484 -0.5927021 78 -0.6200946 -0.3314484 79 0.5987361 -0.6200946 80 0.4072979 0.5987361 81 -0.5685995 0.4072979 82 0.4072979 -0.5685995 83 0.3440189 0.4072979 84 -0.4371505 0.3440189 85 0.3256984 -0.4371505 86 NA 0.3256984 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.4072979 -0.6384151 [2,] 0.4072979 0.4072979 [3,] 0.4072979 0.4072979 [4,] 0.4072979 0.4072979 [5,] -0.5187501 0.4072979 [6,] 0.4072979 -0.5187501 [7,] 0.4431845 0.4072979 [8,] -0.5927021 0.4431845 [9,] 0.3256984 -0.5927021 [10,] 0.3615849 0.3256984 [11,] 0.4072979 0.3615849 [12,] 0.6685516 0.4072979 [13,] 0.3615849 0.6685516 [14,] -0.3314484 0.3615849 [15,] -0.2955618 -0.3314484 [16,] 0.4538574 -0.2955618 [17,] 0.3615849 0.4538574 [18,] -0.5927021 0.3615849 [19,] -0.4645430 -0.5927021 [20,] 0.4812499 -0.4645430 [21,] -0.4130479 0.4812499 [22,] -0.4371505 -0.4130479 [23,] -0.5187501 -0.4371505 [24,] -0.4511134 -0.5187501 [25,] 0.6685516 -0.4511134 [26,] -0.6743016 0.6685516 [27,] 0.5130001 -0.6743016 [28,] -0.5927021 0.5130001 [29,] 0.5628495 -0.5927021 [30,] 0.4072979 0.5628495 [31,] 0.3256984 0.4072979 [32,] 0.4812499 0.3256984 [33,] -0.5568155 0.4812499 [34,] 0.4072979 -0.5568155 [35,] 0.4072979 0.4072979 [36,] 0.6228386 0.4072979 [37,] -0.4869999 0.6228386 [38,] -0.4371505 -0.4869999 [39,] 0.5987361 -0.4371505 [40,] -0.5004295 0.5987361 [41,] -0.4869999 -0.5004295 [42,] -0.5187501 -0.4869999 [43,] 0.3615849 -0.5187501 [44,] 0.5628495 0.3615849 [45,] -0.4371505 0.5628495 [46,] 0.4072979 -0.4371505 [47,] -0.5927021 0.4072979 [48,] -0.4371505 -0.5927021 [49,] 0.4072979 -0.4371505 [50,] 0.5488866 0.4072979 [51,] 0.4538574 0.5488866 [52,] -0.5927021 0.4538574 [53,] 0.3440189 -0.5927021 [54,] 0.4072979 0.3440189 [55,] -0.4511134 0.4072979 [56,] -0.3314484 -0.4511134 [57,] -0.5927021 -0.3314484 [58,] -0.5927021 -0.5927021 [59,] -0.5461426 -0.5927021 [60,] -0.6384151 -0.5461426 [61,] 0.6685516 -0.6384151 [62,] 0.4072979 0.6685516 [63,] -0.6384151 0.4072979 [64,] 0.4072979 -0.6384151 [65,] 0.4072979 0.4072979 [66,] 0.5354570 0.4072979 [67,] 0.3256984 0.5354570 [68,] -0.5927021 0.3256984 [69,] 0.5130001 -0.5927021 [70,] 0.4072979 0.5130001 [71,] -0.5927021 0.4072979 [72,] -0.4869999 -0.5927021 [73,] 0.4314005 -0.4869999 [74,] -0.5927021 0.4314005 [75,] -0.4012639 -0.5927021 [76,] -0.5927021 -0.4012639 [77,] -0.3314484 -0.5927021 [78,] -0.6200946 -0.3314484 [79,] 0.5987361 -0.6200946 [80,] 0.4072979 0.5987361 [81,] -0.5685995 0.4072979 [82,] 0.4072979 -0.5685995 [83,] 0.3440189 0.4072979 [84,] -0.4371505 0.3440189 [85,] 0.3256984 -0.4371505 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.4072979 -0.6384151 2 0.4072979 0.4072979 3 0.4072979 0.4072979 4 0.4072979 0.4072979 5 -0.5187501 0.4072979 6 0.4072979 -0.5187501 7 0.4431845 0.4072979 8 -0.5927021 0.4431845 9 0.3256984 -0.5927021 10 0.3615849 0.3256984 11 0.4072979 0.3615849 12 0.6685516 0.4072979 13 0.3615849 0.6685516 14 -0.3314484 0.3615849 15 -0.2955618 -0.3314484 16 0.4538574 -0.2955618 17 0.3615849 0.4538574 18 -0.5927021 0.3615849 19 -0.4645430 -0.5927021 20 0.4812499 -0.4645430 21 -0.4130479 0.4812499 22 -0.4371505 -0.4130479 23 -0.5187501 -0.4371505 24 -0.4511134 -0.5187501 25 0.6685516 -0.4511134 26 -0.6743016 0.6685516 27 0.5130001 -0.6743016 28 -0.5927021 0.5130001 29 0.5628495 -0.5927021 30 0.4072979 0.5628495 31 0.3256984 0.4072979 32 0.4812499 0.3256984 33 -0.5568155 0.4812499 34 0.4072979 -0.5568155 35 0.4072979 0.4072979 36 0.6228386 0.4072979 37 -0.4869999 0.6228386 38 -0.4371505 -0.4869999 39 0.5987361 -0.4371505 40 -0.5004295 0.5987361 41 -0.4869999 -0.5004295 42 -0.5187501 -0.4869999 43 0.3615849 -0.5187501 44 0.5628495 0.3615849 45 -0.4371505 0.5628495 46 0.4072979 -0.4371505 47 -0.5927021 0.4072979 48 -0.4371505 -0.5927021 49 0.4072979 -0.4371505 50 0.5488866 0.4072979 51 0.4538574 0.5488866 52 -0.5927021 0.4538574 53 0.3440189 -0.5927021 54 0.4072979 0.3440189 55 -0.4511134 0.4072979 56 -0.3314484 -0.4511134 57 -0.5927021 -0.3314484 58 -0.5927021 -0.5927021 59 -0.5461426 -0.5927021 60 -0.6384151 -0.5461426 61 0.6685516 -0.6384151 62 0.4072979 0.6685516 63 -0.6384151 0.4072979 64 0.4072979 -0.6384151 65 0.4072979 0.4072979 66 0.5354570 0.4072979 67 0.3256984 0.5354570 68 -0.5927021 0.3256984 69 0.5130001 -0.5927021 70 0.4072979 0.5130001 71 -0.5927021 0.4072979 72 -0.4869999 -0.5927021 73 0.4314005 -0.4869999 74 -0.5927021 0.4314005 75 -0.4012639 -0.5927021 76 -0.5927021 -0.4012639 77 -0.3314484 -0.5927021 78 -0.6200946 -0.3314484 79 0.5987361 -0.6200946 80 0.4072979 0.5987361 81 -0.5685995 0.4072979 82 0.4072979 -0.5685995 83 0.3440189 0.4072979 84 -0.4371505 0.3440189 85 0.3256984 -0.4371505 > 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/7cf441356133056.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/81nh11356133056.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/9tk2z1356133056.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/10j3601356133056.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='') + } + } Error: subscript out of bounds Execution halted