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 + ,41 + ,53 + ,12 + ,18 + ,39 + ,86 + ,11 + ,11 + ,30 + ,66 + ,15 + ,12 + ,31 + ,67 + ,6 + ,16 + ,34 + ,76 + ,13 + ,18 + ,35 + ,78 + ,10 + ,14 + ,39 + ,53 + ,12 + ,14 + ,34 + ,80 + ,14 + ,15 + ,36 + ,74 + ,12 + ,15 + ,37 + ,76 + ,6 + ,17 + ,38 + ,79 + ,10 + ,19 + ,36 + ,54 + ,12 + ,10 + ,38 + ,67 + ,12 + ,16 + ,39 + ,54 + ,11 + ,18 + ,33 + ,87 + ,15 + ,14 + ,32 + ,58 + ,12 + ,14 + ,36 + ,75 + ,10 + ,17 + ,38 + ,88 + ,12 + ,14 + ,39 + ,64 + ,11 + ,16 + ,32 + ,57 + ,12 + ,18 + ,32 + ,66 + ,11 + ,11 + ,31 + ,68 + ,12 + ,14 + ,39 + ,54 + ,13 + ,12 + ,37 + ,56 + ,11 + ,17 + ,39 + ,86 + ,9 + ,9 + ,41 + ,80 + ,13 + ,16 + ,36 + ,76 + ,10 + ,14 + ,33 + ,69 + ,14 + ,15 + ,33 + ,78 + ,12 + ,11 + ,34 + ,67 + ,10 + ,16 + ,31 + ,80 + ,12 + ,13 + ,27 + ,54 + ,8 + ,17 + ,37 + ,71 + ,10 + ,15 + ,34 + ,84 + ,12 + ,14 + ,34 + ,74 + ,12 + ,16 + ,32 + ,71 + ,7 + ,9 + ,29 + ,63 + ,6 + ,15 + ,36 + ,71 + ,12 + ,17 + ,29 + ,76 + ,10 + ,13 + ,35 + ,69 + ,10 + ,15 + ,37 + ,74 + ,10 + ,16 + ,34 + ,75 + ,12 + ,16 + ,38 + ,54 + ,15 + ,12 + ,35 + ,52 + ,10 + ,12 + ,38 + ,69 + ,10 + ,11 + ,37 + ,68 + ,12 + ,15 + ,38 + ,65 + ,13 + ,15 + ,33 + ,75 + ,11 + ,17 + ,36 + ,74 + ,11 + ,13 + ,38 + ,75 + ,12 + ,16 + ,32 + ,72 + ,14 + ,14 + ,32 + ,67 + ,10 + ,11 + ,32 + ,63 + ,12 + ,12 + ,34 + ,62 + ,13 + ,12 + ,32 + ,63 + ,5 + ,15 + ,37 + ,76 + ,6 + ,16 + ,39 + ,74 + ,12 + ,15 + ,29 + ,67 + ,12 + ,12 + ,37 + ,73 + ,11 + ,12 + ,35 + ,70 + ,10 + ,8 + ,30 + ,53 + ,7 + ,13 + ,38 + ,77 + ,12 + ,11 + ,34 + ,77 + ,14 + ,14 + ,31 + ,52 + ,11 + ,15 + ,34 + ,54 + ,12 + ,10 + ,35 + ,80 + ,13 + ,11 + ,36 + ,66 + ,14 + ,12 + ,30 + ,73 + ,11 + ,15 + ,39 + ,63 + ,12 + ,15 + ,35 + ,69 + ,12 + ,14 + ,38 + ,67 + ,8 + ,16 + ,31 + ,54 + ,11 + ,15 + ,34 + ,81 + ,14 + ,15 + ,38 + ,69 + ,14 + ,13 + ,34 + ,84 + ,12 + ,12 + ,39 + ,80 + ,9 + ,17 + ,37 + ,70 + ,13 + ,13 + ,34 + ,69 + ,11 + ,15 + ,28 + ,77 + ,12 + ,13 + ,37 + ,54 + ,12 + ,15 + ,33 + ,79 + ,12 + ,16 + ,37 + ,30 + ,12 + ,15 + ,35 + ,71 + ,12 + ,16 + ,37 + ,73 + ,12 + ,15 + ,32 + ,72 + ,11 + ,14 + ,33 + ,77 + ,10 + ,15 + ,38 + ,75 + ,9 + ,14 + ,33 + ,69 + ,12 + ,13 + ,29 + ,54 + ,12 + ,7 + ,33 + ,70 + ,12 + ,17 + ,31 + ,73 + ,9 + ,13 + ,36 + ,54 + ,15 + ,15 + ,35 + ,77 + ,12 + ,14 + ,32 + ,82 + ,12 + ,13 + ,29 + ,80 + ,12 + ,16 + ,39 + ,80 + ,10 + ,12 + ,37 + ,69 + ,13 + ,14 + ,35 + ,78 + ,9 + ,17 + ,37 + ,81 + ,12 + ,15 + ,32 + ,76 + ,10 + ,17 + ,38 + ,76 + ,14 + ,12 + ,37 + ,73 + ,11 + ,16 + ,36 + ,85 + ,15 + ,11 + ,32 + ,66 + ,11 + ,15 + ,33 + ,79 + ,11 + ,9 + ,40 + ,68 + ,12 + ,16 + ,38 + ,76 + ,12 + ,15 + ,41 + ,71 + ,12 + ,10 + ,36 + ,54 + ,11 + ,10 + ,43 + ,46 + ,7 + ,15 + ,30 + ,82 + ,12 + ,11 + ,31 + ,74 + ,14 + ,13 + ,32 + ,88 + ,11 + ,14 + ,32 + ,38 + ,11 + ,18 + ,37 + ,76 + ,10 + ,16 + ,37 + ,86 + ,13 + ,14 + ,33 + ,54 + ,13 + ,14 + ,34 + ,70 + ,8 + ,14 + ,33 + ,69 + ,11 + ,14 + ,38 + ,90 + ,12 + ,12 + ,33 + ,54 + ,11 + ,14 + ,31 + ,76 + ,13 + ,15 + ,38 + ,89 + ,12 + ,15 + ,37 + ,76 + ,14 + ,15 + ,33 + ,73 + ,13 + ,13 + ,31 + ,79 + ,15 + ,17 + ,39 + ,90 + ,10 + ,17 + ,44 + ,74 + ,11 + ,19 + ,33 + ,81 + ,9 + ,15 + ,35 + ,72 + ,11 + ,13 + ,32 + ,71 + ,10 + ,9 + ,28 + ,66 + ,11 + ,15 + ,40 + ,77 + ,8 + ,15 + ,27 + ,65 + ,11 + ,15 + ,37 + ,74 + ,12 + ,16 + ,32 + ,82 + ,12 + ,11 + ,28 + ,54 + ,9 + ,14 + ,34 + ,63 + ,11 + ,11 + ,30 + ,54 + ,10 + ,15 + ,35 + ,64 + ,8 + ,13 + ,31 + ,69 + ,9 + ,15 + ,32 + ,54 + ,8 + ,16 + ,30 + ,84 + ,9 + ,14 + ,30 + ,86 + ,15 + ,15 + ,31 + ,77 + ,11 + ,16 + ,40 + ,89 + ,8 + ,16 + ,32 + ,76 + ,13 + ,11 + ,36 + ,60 + ,12 + ,12 + ,32 + ,75 + ,12 + ,9 + ,35 + ,73 + ,9 + ,16 + ,38 + ,85 + ,7 + ,13 + ,42 + ,79 + ,13 + ,16 + ,34 + ,71 + ,9 + ,12 + ,35 + ,72 + ,6 + ,9 + ,35 + ,69 + ,8 + ,13 + ,33 + ,78 + ,8 + ,13 + ,36 + ,54 + ,15 + ,14 + ,32 + ,69 + ,6 + ,19 + ,33 + ,81 + ,9 + ,13 + ,34 + ,84 + ,11 + ,12 + ,32 + ,84 + ,8 + ,13 + ,34 + ,69 + ,8) + ,dim=c(4 + ,162) + ,dimnames=list(c('Happiness' + ,'Connected' + ,'Belonging' + ,'Software') + ,1:162)) > y <- array(NA,dim=c(4,162),dimnames=list(c('Happiness','Connected','Belonging','Software'),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' > #'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 Happiness Connected Belonging Software 1 14 41 53 12 2 18 39 86 11 3 11 30 66 15 4 12 31 67 6 5 16 34 76 13 6 18 35 78 10 7 14 39 53 12 8 14 34 80 14 9 15 36 74 12 10 15 37 76 6 11 17 38 79 10 12 19 36 54 12 13 10 38 67 12 14 16 39 54 11 15 18 33 87 15 16 14 32 58 12 17 14 36 75 10 18 17 38 88 12 19 14 39 64 11 20 16 32 57 12 21 18 32 66 11 22 11 31 68 12 23 14 39 54 13 24 12 37 56 11 25 17 39 86 9 26 9 41 80 13 27 16 36 76 10 28 14 33 69 14 29 15 33 78 12 30 11 34 67 10 31 16 31 80 12 32 13 27 54 8 33 17 37 71 10 34 15 34 84 12 35 14 34 74 12 36 16 32 71 7 37 9 29 63 6 38 15 36 71 12 39 17 29 76 10 40 13 35 69 10 41 15 37 74 10 42 16 34 75 12 43 16 38 54 15 44 12 35 52 10 45 12 38 69 10 46 11 37 68 12 47 15 38 65 13 48 15 33 75 11 49 17 36 74 11 50 13 38 75 12 51 16 32 72 14 52 14 32 67 10 53 11 32 63 12 54 12 34 62 13 55 12 32 63 5 56 15 37 76 6 57 16 39 74 12 58 15 29 67 12 59 12 37 73 11 60 12 35 70 10 61 8 30 53 7 62 13 38 77 12 63 11 34 77 14 64 14 31 52 11 65 15 34 54 12 66 10 35 80 13 67 11 36 66 14 68 12 30 73 11 69 15 39 63 12 70 15 35 69 12 71 14 38 67 8 72 16 31 54 11 73 15 34 81 14 74 15 38 69 14 75 13 34 84 12 76 12 39 80 9 77 17 37 70 13 78 13 34 69 11 79 15 28 77 12 80 13 37 54 12 81 15 33 79 12 82 16 37 30 12 83 15 35 71 12 84 16 37 73 12 85 15 32 72 11 86 14 33 77 10 87 15 38 75 9 88 14 33 69 12 89 13 29 54 12 90 7 33 70 12 91 17 31 73 9 92 13 36 54 15 93 15 35 77 12 94 14 32 82 12 95 13 29 80 12 96 16 39 80 10 97 12 37 69 13 98 14 35 78 9 99 17 37 81 12 100 15 32 76 10 101 17 38 76 14 102 12 37 73 11 103 16 36 85 15 104 11 32 66 11 105 15 33 79 11 106 9 40 68 12 107 16 38 76 12 108 15 41 71 12 109 10 36 54 11 110 10 43 46 7 111 15 30 82 12 112 11 31 74 14 113 13 32 88 11 114 14 32 38 11 115 18 37 76 10 116 16 37 86 13 117 14 33 54 13 118 14 34 70 8 119 14 33 69 11 120 14 38 90 12 121 12 33 54 11 122 14 31 76 13 123 15 38 89 12 124 15 37 76 14 125 15 33 73 13 126 13 31 79 15 127 17 39 90 10 128 17 44 74 11 129 19 33 81 9 130 15 35 72 11 131 13 32 71 10 132 9 28 66 11 133 15 40 77 8 134 15 27 65 11 135 15 37 74 12 136 16 32 82 12 137 11 28 54 9 138 14 34 63 11 139 11 30 54 10 140 15 35 64 8 141 13 31 69 9 142 15 32 54 8 143 16 30 84 9 144 14 30 86 15 145 15 31 77 11 146 16 40 89 8 147 16 32 76 13 148 11 36 60 12 149 12 32 75 12 150 9 35 73 9 151 16 38 85 7 152 13 42 79 13 153 16 34 71 9 154 12 35 72 6 155 9 35 69 8 156 13 33 78 8 157 13 36 54 15 158 14 32 69 6 159 19 33 81 9 160 13 34 84 11 161 12 32 84 8 162 13 34 69 8 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Connected Belonging Software 6.32453 0.08112 0.05974 0.06147 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -6.9210 -1.5113 0.4699 1.5011 5.7915 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 6.32453 2.22273 2.845 0.005024 ** Connected 0.08112 0.05256 1.543 0.124752 Belonging 0.05974 0.01652 3.616 0.000402 *** Software 0.06147 0.08262 0.744 0.457992 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 2.24 on 158 degrees of freedom Multiple R-squared: 0.09916, Adjusted R-squared: 0.08205 F-statistic: 5.797 on 3 and 158 DF, p-value: 0.000874 > 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.28358450 0.56716900 0.71641550 [2,] 0.23835207 0.47670413 0.76164793 [3,] 0.13702442 0.27404883 0.86297558 [4,] 0.11043546 0.22087091 0.88956454 [5,] 0.05975624 0.11951249 0.94024376 [6,] 0.64646667 0.70706665 0.35353333 [7,] 0.90818294 0.18363413 0.09181706 [8,] 0.88241821 0.23516358 0.11758179 [9,] 0.88449316 0.23101369 0.11550684 [10,] 0.84589948 0.30820104 0.15410052 [11,] 0.81090603 0.37818794 0.18909397 [12,] 0.75670502 0.48658996 0.24329498 [13,] 0.71025682 0.57948636 0.28974318 [14,] 0.72903811 0.54192377 0.27096189 [15,] 0.81132073 0.37735853 0.18867927 [16,] 0.85465206 0.29069589 0.14534794 [17,] 0.81614398 0.36771205 0.18385602 [18,] 0.80723717 0.38552566 0.19276283 [19,] 0.76627258 0.46745484 0.23372742 [20,] 0.96561236 0.06877527 0.03438764 [21,] 0.95492977 0.09014047 0.04507023 [22,] 0.93894465 0.12211070 0.06105535 [23,] 0.91902518 0.16194964 0.08097482 [24,] 0.93960436 0.12079129 0.06039564 [25,] 0.92512312 0.14975377 0.07487688 [26,] 0.90472074 0.19055851 0.09527926 [27,] 0.90431227 0.19137546 0.09568773 [28,] 0.87892757 0.24214486 0.12107243 [29,] 0.85133611 0.29732779 0.14866389 [30,] 0.83372621 0.33254758 0.16627379 [31,] 0.91266414 0.17467171 0.08733586 [32,] 0.89052914 0.21894173 0.10947086 [33,] 0.90064995 0.19870011 0.09935005 [34,] 0.88409109 0.23181781 0.11590891 [35,] 0.85747030 0.28505940 0.14252970 [36,] 0.83734378 0.32531243 0.16265622 [37,] 0.83492294 0.33015412 0.16507706 [38,] 0.81040482 0.37919036 0.18959518 [39,] 0.81488014 0.37023972 0.18511986 [40,] 0.85174268 0.29651465 0.14825732 [41,] 0.82427519 0.35144961 0.17572481 [42,] 0.79259600 0.41480799 0.20740400 [43,] 0.79609830 0.40780340 0.20390170 [44,] 0.78512062 0.42975875 0.21487938 [45,] 0.76609905 0.46780189 0.23390095 [46,] 0.72809990 0.54380019 0.27190010 [47,] 0.74510978 0.50978044 0.25489022 [48,] 0.72942523 0.54114955 0.27057477 [49,] 0.69787688 0.60424623 0.30212312 [50,] 0.65809845 0.68380309 0.34190155 [51,] 0.62581406 0.74837188 0.37418594 [52,] 0.59672962 0.80654075 0.40327038 [53,] 0.60992966 0.78014068 0.39007034 [54,] 0.60410420 0.79179159 0.39589580 [55,] 0.71274635 0.57450730 0.28725365 [56,] 0.70312128 0.59375743 0.29687872 [57,] 0.77122882 0.45754237 0.22877118 [58,] 0.74912567 0.50174867 0.25087433 [59,] 0.73958532 0.52082936 0.26041468 [60,] 0.85365650 0.29268699 0.14634350 [61,] 0.87387433 0.25225133 0.12612567 [62,] 0.86515731 0.26968538 0.13484269 [63,] 0.84397339 0.31205323 0.15602661 [64,] 0.82024966 0.35950068 0.17975034 [65,] 0.78855728 0.42288544 0.21144272 [66,] 0.82154864 0.35690272 0.17845136 [67,] 0.79031936 0.41936129 0.20968064 [68,] 0.75864000 0.48272000 0.24136000 [69,] 0.74617842 0.50764316 0.25382158 [70,] 0.76438433 0.47123135 0.23561567 [71,] 0.77945441 0.44109117 0.22054559 [72,] 0.74949261 0.50101478 0.25050739 [73,] 0.72027486 0.55945027 0.27972514 [74,] 0.68168266 0.63663468 0.31831734 [75,] 0.64242657 0.71514687 0.35757343 [76,] 0.75450925 0.49098149 0.24549075 [77,] 0.72454119 0.55091762 0.27545881 [78,] 0.70847749 0.58304502 0.29152251 [79,] 0.67914349 0.64171303 0.32085651 [80,] 0.63733566 0.72532868 0.36266434 [81,] 0.59707541 0.80584918 0.40292459 [82,] 0.55362274 0.89275451 0.44637726 [83,] 0.51594858 0.96810284 0.48405142 [84,] 0.83921964 0.32156072 0.16078036 [85,] 0.87007687 0.25984626 0.12992313 [86,] 0.84714547 0.30570905 0.15285453 [87,] 0.82018298 0.35963404 0.17981702 [88,] 0.79004524 0.41990953 0.20995476 [89,] 0.76551294 0.46897411 0.23448706 [90,] 0.73842009 0.52315983 0.26157991 [91,] 0.73154279 0.53691442 0.26845721 [92,] 0.69255453 0.61489094 0.30744547 [93,] 0.68956347 0.62087306 0.31043653 [94,] 0.65425934 0.69148133 0.34574066 [95,] 0.66338081 0.67323838 0.33661919 [96,] 0.66142125 0.67715750 0.33857875 [97,] 0.62450968 0.75098065 0.37549032 [98,] 0.62948750 0.74102501 0.37051250 [99,] 0.58676088 0.82647823 0.41323912 [100,] 0.76653158 0.46693683 0.23346842 [101,] 0.74383495 0.51233010 0.25616505 [102,] 0.70600628 0.58798744 0.29399372 [103,] 0.73186077 0.53627845 0.26813923 [104,] 0.76487102 0.47025796 0.23512898 [105,] 0.73119082 0.53761836 0.26880918 [106,] 0.75839442 0.48321116 0.24160558 [107,] 0.74440868 0.51118264 0.25559132 [108,] 0.75566522 0.48866956 0.24433478 [109,] 0.81233110 0.37533781 0.18766890 [110,] 0.77912451 0.44175098 0.22087549 [111,] 0.75987279 0.48025442 0.24012721 [112,] 0.71772796 0.56454407 0.28227204 [113,] 0.67329297 0.65341406 0.32670703 [114,] 0.65413018 0.69173963 0.34586982 [115,] 0.60611362 0.78777277 0.39388638 [116,] 0.55320902 0.89358195 0.44679098 [117,] 0.50556499 0.98887003 0.49443501 [118,] 0.45258626 0.90517252 0.54741374 [119,] 0.41063222 0.82126443 0.58936778 [120,] 0.37561224 0.75122448 0.62438776 [121,] 0.33642667 0.67285335 0.66357333 [122,] 0.34350268 0.68700536 0.65649732 [123,] 0.50675431 0.98649138 0.49324569 [124,] 0.46663059 0.93326118 0.53336941 [125,] 0.41103741 0.82207482 0.58896259 [126,] 0.55712215 0.88575571 0.44287785 [127,] 0.51241224 0.97517552 0.48758776 [128,] 0.48359828 0.96719657 0.51640172 [129,] 0.43871337 0.87742674 0.56128663 [130,] 0.40315548 0.80631097 0.59684452 [131,] 0.36275523 0.72551046 0.63724477 [132,] 0.31631105 0.63262210 0.68368895 [133,] 0.28132933 0.56265866 0.71867067 [134,] 0.26885814 0.53771627 0.73114186 [135,] 0.21636496 0.43272992 0.78363504 [136,] 0.26200409 0.52400818 0.73799591 [137,] 0.22178613 0.44357227 0.77821387 [138,] 0.19060384 0.38120769 0.80939616 [139,] 0.14644115 0.29288230 0.85355885 [140,] 0.12064681 0.24129362 0.87935319 [141,] 0.10626208 0.21252416 0.89373792 [142,] 0.07827504 0.15655007 0.92172496 [143,] 0.06380544 0.12761088 0.93619456 [144,] 0.13977297 0.27954594 0.86022703 [145,] 0.15216843 0.30433685 0.84783157 [146,] 0.13140469 0.26280939 0.86859531 [147,] 0.14565893 0.29131786 0.85434107 [148,] 0.11573308 0.23146617 0.88426692 [149,] 0.10137074 0.20274147 0.89862926 > postscript(file="/var/wessaorg/rcomp/tmp/1qfi51322132378.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/2o1wd1322132378.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/3603l1322132378.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/45p1t1322132378.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/5e4t51322132378.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 0.44568551 2.69789702 -2.62307190 -1.21071854 1.57797145 3.56177374 7 8 9 10 11 12 0.60792105 -0.72246545 0.59668843 0.76489516 2.25867825 5.79153217 13 14 15 16 17 18 -4.14735180 2.60964701 2.87898886 0.87703450 -0.34011747 1.59806227 19 20 21 22 23 24 0.01222514 2.93677669 4.46056515 -2.63926960 0.48671071 -1.34760183 25 26 27 28 29 30 1.82083331 -6.22882169 1.60014035 0.01581638 0.60107299 -2.69994443 31 32 33 34 35 36 1.64382415 0.76746468 2.81773351 0.16150210 -0.24107603 2.40772680 37 38 39 40 41 42 -3.80951425 0.77591499 3.16796473 -0.90054657 0.63850695 1.69918178 43 44 45 46 47 48 2.44489219 -0.88492939 -2.14389988 -3.12597622 0.91066443 0.84176770 49 50 51 52 53 54 2.65815657 -1.62528930 1.91770759 0.46229111 -2.42167644 -1.58563794 55 56 57 58 59 60 -0.99139941 0.76489516 1.35333512 1.58270812 -2.36321901 -1.96028876 61 62 63 64 65 66 -4.35467830 -1.74477367 -3.54323889 1.37807354 1.95376771 -4.74211507 67 68 69 70 71 72 -3.04831037 -1.79539462 1.01049918 0.97651713 0.09852078 3.25858916 73 74 75 76 77 78 0.21779236 0.61022753 -1.83849790 -2.82071356 2.69307126 -0.88089695 79 80 81 82 83 84 1.06640402 -0.28958560 0.54133080 4.14422689 0.85703276 1.57531285 85 86 87 88 89 90 1.10211203 -0.21624853 0.55911514 0.13875267 0.35935655 -6.92098952 91 92 93 94 95 96 3.24642390 -0.39287227 0.49857964 -0.55677799 -1.19394031 1.11781829 97 98 99 100 101 102 -2.24718655 -0.37675811 2.09737535 0.92461142 2.19203222 -2.36321901 103 104 105 106 107 108 0.75511993 -2.53943485 0.60279895 -5.36932953 1.31496852 0.37032614 109 110 111 112 113 114 -3.14699968 -2.99101399 0.60545755 -3.12065902 -1.85376297 2.13334639 115 116 117 118 119 120 3.51902258 0.73719627 0.97341733 0.24376530 0.20022082 -1.52142210 121 122 123 124 125 126 -0.90364638 -0.17867525 -0.46167992 0.27314999 0.83831578 -1.48083810 127 128 129 130 131 132 1.52039642 2.00921442 4.60625087 0.85875872 -0.77667764 -4.21496377 133 134 135 136 137 138 0.33886338 1.92589618 0.51557066 1.44322201 -1.37512124 0.47755617 139 140 141 142 143 144 -1.59882492 1.52110065 -0.51460735 2.36187583 1.67037761 -0.81791564 145 146 147 148 149 150 0.88451886 0.62195713 1.74020698 -2.56692095 -2.13858268 -5.07804718 151 152 153 154 155 156 1.08462956 -2.25019727 2.12255497 -1.83390055 -4.77761028 -1.15305443 157 158 159 160 161 162 -0.39287227 0.58867932 4.60625087 -1.77702976 -2.43038978 -0.69649251 > postscript(file="/var/wessaorg/rcomp/tmp/6fv791322132378.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 0.44568551 NA 1 2.69789702 0.44568551 2 -2.62307190 2.69789702 3 -1.21071854 -2.62307190 4 1.57797145 -1.21071854 5 3.56177374 1.57797145 6 0.60792105 3.56177374 7 -0.72246545 0.60792105 8 0.59668843 -0.72246545 9 0.76489516 0.59668843 10 2.25867825 0.76489516 11 5.79153217 2.25867825 12 -4.14735180 5.79153217 13 2.60964701 -4.14735180 14 2.87898886 2.60964701 15 0.87703450 2.87898886 16 -0.34011747 0.87703450 17 1.59806227 -0.34011747 18 0.01222514 1.59806227 19 2.93677669 0.01222514 20 4.46056515 2.93677669 21 -2.63926960 4.46056515 22 0.48671071 -2.63926960 23 -1.34760183 0.48671071 24 1.82083331 -1.34760183 25 -6.22882169 1.82083331 26 1.60014035 -6.22882169 27 0.01581638 1.60014035 28 0.60107299 0.01581638 29 -2.69994443 0.60107299 30 1.64382415 -2.69994443 31 0.76746468 1.64382415 32 2.81773351 0.76746468 33 0.16150210 2.81773351 34 -0.24107603 0.16150210 35 2.40772680 -0.24107603 36 -3.80951425 2.40772680 37 0.77591499 -3.80951425 38 3.16796473 0.77591499 39 -0.90054657 3.16796473 40 0.63850695 -0.90054657 41 1.69918178 0.63850695 42 2.44489219 1.69918178 43 -0.88492939 2.44489219 44 -2.14389988 -0.88492939 45 -3.12597622 -2.14389988 46 0.91066443 -3.12597622 47 0.84176770 0.91066443 48 2.65815657 0.84176770 49 -1.62528930 2.65815657 50 1.91770759 -1.62528930 51 0.46229111 1.91770759 52 -2.42167644 0.46229111 53 -1.58563794 -2.42167644 54 -0.99139941 -1.58563794 55 0.76489516 -0.99139941 56 1.35333512 0.76489516 57 1.58270812 1.35333512 58 -2.36321901 1.58270812 59 -1.96028876 -2.36321901 60 -4.35467830 -1.96028876 61 -1.74477367 -4.35467830 62 -3.54323889 -1.74477367 63 1.37807354 -3.54323889 64 1.95376771 1.37807354 65 -4.74211507 1.95376771 66 -3.04831037 -4.74211507 67 -1.79539462 -3.04831037 68 1.01049918 -1.79539462 69 0.97651713 1.01049918 70 0.09852078 0.97651713 71 3.25858916 0.09852078 72 0.21779236 3.25858916 73 0.61022753 0.21779236 74 -1.83849790 0.61022753 75 -2.82071356 -1.83849790 76 2.69307126 -2.82071356 77 -0.88089695 2.69307126 78 1.06640402 -0.88089695 79 -0.28958560 1.06640402 80 0.54133080 -0.28958560 81 4.14422689 0.54133080 82 0.85703276 4.14422689 83 1.57531285 0.85703276 84 1.10211203 1.57531285 85 -0.21624853 1.10211203 86 0.55911514 -0.21624853 87 0.13875267 0.55911514 88 0.35935655 0.13875267 89 -6.92098952 0.35935655 90 3.24642390 -6.92098952 91 -0.39287227 3.24642390 92 0.49857964 -0.39287227 93 -0.55677799 0.49857964 94 -1.19394031 -0.55677799 95 1.11781829 -1.19394031 96 -2.24718655 1.11781829 97 -0.37675811 -2.24718655 98 2.09737535 -0.37675811 99 0.92461142 2.09737535 100 2.19203222 0.92461142 101 -2.36321901 2.19203222 102 0.75511993 -2.36321901 103 -2.53943485 0.75511993 104 0.60279895 -2.53943485 105 -5.36932953 0.60279895 106 1.31496852 -5.36932953 107 0.37032614 1.31496852 108 -3.14699968 0.37032614 109 -2.99101399 -3.14699968 110 0.60545755 -2.99101399 111 -3.12065902 0.60545755 112 -1.85376297 -3.12065902 113 2.13334639 -1.85376297 114 3.51902258 2.13334639 115 0.73719627 3.51902258 116 0.97341733 0.73719627 117 0.24376530 0.97341733 118 0.20022082 0.24376530 119 -1.52142210 0.20022082 120 -0.90364638 -1.52142210 121 -0.17867525 -0.90364638 122 -0.46167992 -0.17867525 123 0.27314999 -0.46167992 124 0.83831578 0.27314999 125 -1.48083810 0.83831578 126 1.52039642 -1.48083810 127 2.00921442 1.52039642 128 4.60625087 2.00921442 129 0.85875872 4.60625087 130 -0.77667764 0.85875872 131 -4.21496377 -0.77667764 132 0.33886338 -4.21496377 133 1.92589618 0.33886338 134 0.51557066 1.92589618 135 1.44322201 0.51557066 136 -1.37512124 1.44322201 137 0.47755617 -1.37512124 138 -1.59882492 0.47755617 139 1.52110065 -1.59882492 140 -0.51460735 1.52110065 141 2.36187583 -0.51460735 142 1.67037761 2.36187583 143 -0.81791564 1.67037761 144 0.88451886 -0.81791564 145 0.62195713 0.88451886 146 1.74020698 0.62195713 147 -2.56692095 1.74020698 148 -2.13858268 -2.56692095 149 -5.07804718 -2.13858268 150 1.08462956 -5.07804718 151 -2.25019727 1.08462956 152 2.12255497 -2.25019727 153 -1.83390055 2.12255497 154 -4.77761028 -1.83390055 155 -1.15305443 -4.77761028 156 -0.39287227 -1.15305443 157 0.58867932 -0.39287227 158 4.60625087 0.58867932 159 -1.77702976 4.60625087 160 -2.43038978 -1.77702976 161 -0.69649251 -2.43038978 162 NA -0.69649251 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 2.69789702 0.44568551 [2,] -2.62307190 2.69789702 [3,] -1.21071854 -2.62307190 [4,] 1.57797145 -1.21071854 [5,] 3.56177374 1.57797145 [6,] 0.60792105 3.56177374 [7,] -0.72246545 0.60792105 [8,] 0.59668843 -0.72246545 [9,] 0.76489516 0.59668843 [10,] 2.25867825 0.76489516 [11,] 5.79153217 2.25867825 [12,] -4.14735180 5.79153217 [13,] 2.60964701 -4.14735180 [14,] 2.87898886 2.60964701 [15,] 0.87703450 2.87898886 [16,] -0.34011747 0.87703450 [17,] 1.59806227 -0.34011747 [18,] 0.01222514 1.59806227 [19,] 2.93677669 0.01222514 [20,] 4.46056515 2.93677669 [21,] -2.63926960 4.46056515 [22,] 0.48671071 -2.63926960 [23,] -1.34760183 0.48671071 [24,] 1.82083331 -1.34760183 [25,] -6.22882169 1.82083331 [26,] 1.60014035 -6.22882169 [27,] 0.01581638 1.60014035 [28,] 0.60107299 0.01581638 [29,] -2.69994443 0.60107299 [30,] 1.64382415 -2.69994443 [31,] 0.76746468 1.64382415 [32,] 2.81773351 0.76746468 [33,] 0.16150210 2.81773351 [34,] -0.24107603 0.16150210 [35,] 2.40772680 -0.24107603 [36,] -3.80951425 2.40772680 [37,] 0.77591499 -3.80951425 [38,] 3.16796473 0.77591499 [39,] -0.90054657 3.16796473 [40,] 0.63850695 -0.90054657 [41,] 1.69918178 0.63850695 [42,] 2.44489219 1.69918178 [43,] -0.88492939 2.44489219 [44,] -2.14389988 -0.88492939 [45,] -3.12597622 -2.14389988 [46,] 0.91066443 -3.12597622 [47,] 0.84176770 0.91066443 [48,] 2.65815657 0.84176770 [49,] -1.62528930 2.65815657 [50,] 1.91770759 -1.62528930 [51,] 0.46229111 1.91770759 [52,] -2.42167644 0.46229111 [53,] -1.58563794 -2.42167644 [54,] -0.99139941 -1.58563794 [55,] 0.76489516 -0.99139941 [56,] 1.35333512 0.76489516 [57,] 1.58270812 1.35333512 [58,] -2.36321901 1.58270812 [59,] -1.96028876 -2.36321901 [60,] -4.35467830 -1.96028876 [61,] -1.74477367 -4.35467830 [62,] -3.54323889 -1.74477367 [63,] 1.37807354 -3.54323889 [64,] 1.95376771 1.37807354 [65,] -4.74211507 1.95376771 [66,] -3.04831037 -4.74211507 [67,] -1.79539462 -3.04831037 [68,] 1.01049918 -1.79539462 [69,] 0.97651713 1.01049918 [70,] 0.09852078 0.97651713 [71,] 3.25858916 0.09852078 [72,] 0.21779236 3.25858916 [73,] 0.61022753 0.21779236 [74,] -1.83849790 0.61022753 [75,] -2.82071356 -1.83849790 [76,] 2.69307126 -2.82071356 [77,] -0.88089695 2.69307126 [78,] 1.06640402 -0.88089695 [79,] -0.28958560 1.06640402 [80,] 0.54133080 -0.28958560 [81,] 4.14422689 0.54133080 [82,] 0.85703276 4.14422689 [83,] 1.57531285 0.85703276 [84,] 1.10211203 1.57531285 [85,] -0.21624853 1.10211203 [86,] 0.55911514 -0.21624853 [87,] 0.13875267 0.55911514 [88,] 0.35935655 0.13875267 [89,] -6.92098952 0.35935655 [90,] 3.24642390 -6.92098952 [91,] -0.39287227 3.24642390 [92,] 0.49857964 -0.39287227 [93,] -0.55677799 0.49857964 [94,] -1.19394031 -0.55677799 [95,] 1.11781829 -1.19394031 [96,] -2.24718655 1.11781829 [97,] -0.37675811 -2.24718655 [98,] 2.09737535 -0.37675811 [99,] 0.92461142 2.09737535 [100,] 2.19203222 0.92461142 [101,] -2.36321901 2.19203222 [102,] 0.75511993 -2.36321901 [103,] -2.53943485 0.75511993 [104,] 0.60279895 -2.53943485 [105,] -5.36932953 0.60279895 [106,] 1.31496852 -5.36932953 [107,] 0.37032614 1.31496852 [108,] -3.14699968 0.37032614 [109,] -2.99101399 -3.14699968 [110,] 0.60545755 -2.99101399 [111,] -3.12065902 0.60545755 [112,] -1.85376297 -3.12065902 [113,] 2.13334639 -1.85376297 [114,] 3.51902258 2.13334639 [115,] 0.73719627 3.51902258 [116,] 0.97341733 0.73719627 [117,] 0.24376530 0.97341733 [118,] 0.20022082 0.24376530 [119,] -1.52142210 0.20022082 [120,] -0.90364638 -1.52142210 [121,] -0.17867525 -0.90364638 [122,] -0.46167992 -0.17867525 [123,] 0.27314999 -0.46167992 [124,] 0.83831578 0.27314999 [125,] -1.48083810 0.83831578 [126,] 1.52039642 -1.48083810 [127,] 2.00921442 1.52039642 [128,] 4.60625087 2.00921442 [129,] 0.85875872 4.60625087 [130,] -0.77667764 0.85875872 [131,] -4.21496377 -0.77667764 [132,] 0.33886338 -4.21496377 [133,] 1.92589618 0.33886338 [134,] 0.51557066 1.92589618 [135,] 1.44322201 0.51557066 [136,] -1.37512124 1.44322201 [137,] 0.47755617 -1.37512124 [138,] -1.59882492 0.47755617 [139,] 1.52110065 -1.59882492 [140,] -0.51460735 1.52110065 [141,] 2.36187583 -0.51460735 [142,] 1.67037761 2.36187583 [143,] -0.81791564 1.67037761 [144,] 0.88451886 -0.81791564 [145,] 0.62195713 0.88451886 [146,] 1.74020698 0.62195713 [147,] -2.56692095 1.74020698 [148,] -2.13858268 -2.56692095 [149,] -5.07804718 -2.13858268 [150,] 1.08462956 -5.07804718 [151,] -2.25019727 1.08462956 [152,] 2.12255497 -2.25019727 [153,] -1.83390055 2.12255497 [154,] -4.77761028 -1.83390055 [155,] -1.15305443 -4.77761028 [156,] -0.39287227 -1.15305443 [157,] 0.58867932 -0.39287227 [158,] 4.60625087 0.58867932 [159,] -1.77702976 4.60625087 [160,] -2.43038978 -1.77702976 [161,] -0.69649251 -2.43038978 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 2.69789702 0.44568551 2 -2.62307190 2.69789702 3 -1.21071854 -2.62307190 4 1.57797145 -1.21071854 5 3.56177374 1.57797145 6 0.60792105 3.56177374 7 -0.72246545 0.60792105 8 0.59668843 -0.72246545 9 0.76489516 0.59668843 10 2.25867825 0.76489516 11 5.79153217 2.25867825 12 -4.14735180 5.79153217 13 2.60964701 -4.14735180 14 2.87898886 2.60964701 15 0.87703450 2.87898886 16 -0.34011747 0.87703450 17 1.59806227 -0.34011747 18 0.01222514 1.59806227 19 2.93677669 0.01222514 20 4.46056515 2.93677669 21 -2.63926960 4.46056515 22 0.48671071 -2.63926960 23 -1.34760183 0.48671071 24 1.82083331 -1.34760183 25 -6.22882169 1.82083331 26 1.60014035 -6.22882169 27 0.01581638 1.60014035 28 0.60107299 0.01581638 29 -2.69994443 0.60107299 30 1.64382415 -2.69994443 31 0.76746468 1.64382415 32 2.81773351 0.76746468 33 0.16150210 2.81773351 34 -0.24107603 0.16150210 35 2.40772680 -0.24107603 36 -3.80951425 2.40772680 37 0.77591499 -3.80951425 38 3.16796473 0.77591499 39 -0.90054657 3.16796473 40 0.63850695 -0.90054657 41 1.69918178 0.63850695 42 2.44489219 1.69918178 43 -0.88492939 2.44489219 44 -2.14389988 -0.88492939 45 -3.12597622 -2.14389988 46 0.91066443 -3.12597622 47 0.84176770 0.91066443 48 2.65815657 0.84176770 49 -1.62528930 2.65815657 50 1.91770759 -1.62528930 51 0.46229111 1.91770759 52 -2.42167644 0.46229111 53 -1.58563794 -2.42167644 54 -0.99139941 -1.58563794 55 0.76489516 -0.99139941 56 1.35333512 0.76489516 57 1.58270812 1.35333512 58 -2.36321901 1.58270812 59 -1.96028876 -2.36321901 60 -4.35467830 -1.96028876 61 -1.74477367 -4.35467830 62 -3.54323889 -1.74477367 63 1.37807354 -3.54323889 64 1.95376771 1.37807354 65 -4.74211507 1.95376771 66 -3.04831037 -4.74211507 67 -1.79539462 -3.04831037 68 1.01049918 -1.79539462 69 0.97651713 1.01049918 70 0.09852078 0.97651713 71 3.25858916 0.09852078 72 0.21779236 3.25858916 73 0.61022753 0.21779236 74 -1.83849790 0.61022753 75 -2.82071356 -1.83849790 76 2.69307126 -2.82071356 77 -0.88089695 2.69307126 78 1.06640402 -0.88089695 79 -0.28958560 1.06640402 80 0.54133080 -0.28958560 81 4.14422689 0.54133080 82 0.85703276 4.14422689 83 1.57531285 0.85703276 84 1.10211203 1.57531285 85 -0.21624853 1.10211203 86 0.55911514 -0.21624853 87 0.13875267 0.55911514 88 0.35935655 0.13875267 89 -6.92098952 0.35935655 90 3.24642390 -6.92098952 91 -0.39287227 3.24642390 92 0.49857964 -0.39287227 93 -0.55677799 0.49857964 94 -1.19394031 -0.55677799 95 1.11781829 -1.19394031 96 -2.24718655 1.11781829 97 -0.37675811 -2.24718655 98 2.09737535 -0.37675811 99 0.92461142 2.09737535 100 2.19203222 0.92461142 101 -2.36321901 2.19203222 102 0.75511993 -2.36321901 103 -2.53943485 0.75511993 104 0.60279895 -2.53943485 105 -5.36932953 0.60279895 106 1.31496852 -5.36932953 107 0.37032614 1.31496852 108 -3.14699968 0.37032614 109 -2.99101399 -3.14699968 110 0.60545755 -2.99101399 111 -3.12065902 0.60545755 112 -1.85376297 -3.12065902 113 2.13334639 -1.85376297 114 3.51902258 2.13334639 115 0.73719627 3.51902258 116 0.97341733 0.73719627 117 0.24376530 0.97341733 118 0.20022082 0.24376530 119 -1.52142210 0.20022082 120 -0.90364638 -1.52142210 121 -0.17867525 -0.90364638 122 -0.46167992 -0.17867525 123 0.27314999 -0.46167992 124 0.83831578 0.27314999 125 -1.48083810 0.83831578 126 1.52039642 -1.48083810 127 2.00921442 1.52039642 128 4.60625087 2.00921442 129 0.85875872 4.60625087 130 -0.77667764 0.85875872 131 -4.21496377 -0.77667764 132 0.33886338 -4.21496377 133 1.92589618 0.33886338 134 0.51557066 1.92589618 135 1.44322201 0.51557066 136 -1.37512124 1.44322201 137 0.47755617 -1.37512124 138 -1.59882492 0.47755617 139 1.52110065 -1.59882492 140 -0.51460735 1.52110065 141 2.36187583 -0.51460735 142 1.67037761 2.36187583 143 -0.81791564 1.67037761 144 0.88451886 -0.81791564 145 0.62195713 0.88451886 146 1.74020698 0.62195713 147 -2.56692095 1.74020698 148 -2.13858268 -2.56692095 149 -5.07804718 -2.13858268 150 1.08462956 -5.07804718 151 -2.25019727 1.08462956 152 2.12255497 -2.25019727 153 -1.83390055 2.12255497 154 -4.77761028 -1.83390055 155 -1.15305443 -4.77761028 156 -0.39287227 -1.15305443 157 0.58867932 -0.39287227 158 4.60625087 0.58867932 159 -1.77702976 4.60625087 160 -2.43038978 -1.77702976 161 -0.69649251 -2.43038978 > 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/7za291322132378.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/8f6v51322132378.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/9leb91322132378.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/10f7nm1322132378.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/118q7e1322132378.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/12g97u1322132378.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/13e10t1322132378.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/14w83w1322132378.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/15i56x1322132378.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/16c23x1322132378.tab") + } > > try(system("convert tmp/1qfi51322132378.ps tmp/1qfi51322132378.png",intern=TRUE)) character(0) > try(system("convert tmp/2o1wd1322132378.ps tmp/2o1wd1322132378.png",intern=TRUE)) character(0) > try(system("convert tmp/3603l1322132378.ps tmp/3603l1322132378.png",intern=TRUE)) character(0) > try(system("convert tmp/45p1t1322132378.ps tmp/45p1t1322132378.png",intern=TRUE)) character(0) > try(system("convert tmp/5e4t51322132378.ps tmp/5e4t51322132378.png",intern=TRUE)) character(0) > try(system("convert tmp/6fv791322132378.ps tmp/6fv791322132378.png",intern=TRUE)) character(0) > try(system("convert tmp/7za291322132378.ps tmp/7za291322132378.png",intern=TRUE)) character(0) > try(system("convert tmp/8f6v51322132378.ps tmp/8f6v51322132378.png",intern=TRUE)) character(0) > try(system("convert tmp/9leb91322132378.ps tmp/9leb91322132378.png",intern=TRUE)) character(0) > try(system("convert tmp/10f7nm1322132378.ps tmp/10f7nm1322132378.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.710 0.473 5.197