R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(2 + ,210907 + ,79 + ,94 + ,112285 + ,146283 + ,30 + ,-1 + ,4 + ,179321 + ,108 + ,103 + ,101193 + ,96933 + ,30 + ,3 + ,0 + ,149061 + ,43 + ,93 + ,116174 + ,95757 + ,26 + ,0 + ,0 + ,237213 + ,78 + ,123 + ,66198 + ,143983 + ,38 + ,3 + ,-4 + ,173326 + ,86 + ,148 + ,71701 + ,75851 + ,44 + ,4 + ,4 + ,133131 + ,44 + ,90 + ,57793 + ,59238 + ,30 + ,0 + ,4 + ,258873 + ,104 + ,124 + ,80444 + ,93163 + ,40 + ,0 + ,0 + ,324799 + ,158 + ,168 + ,97668 + ,151511 + ,47 + ,7 + ,-1 + ,230964 + ,102 + ,115 + ,133824 + ,136368 + ,30 + ,1 + ,0 + ,236785 + ,77 + ,71 + ,101481 + ,112642 + ,31 + ,0 + ,1 + ,344297 + ,80 + ,108 + ,67654 + ,127766 + ,30 + ,1 + ,0 + ,174724 + ,123 + ,120 + ,69112 + ,85646 + ,34 + ,4 + ,3 + ,174415 + ,73 + ,114 + ,82753 + ,98579 + ,31 + ,1 + ,-1 + ,223632 + ,105 + ,120 + ,72654 + ,131741 + ,33 + ,5 + ,4 + ,294424 + ,107 + ,124 + ,101494 + ,171975 + ,33 + ,13 + ,3 + ,325107 + ,84 + ,126 + ,79215 + ,159676 + ,36 + ,4 + ,1 + ,106408 + ,33 + ,37 + ,31081 + ,58391 + ,14 + ,0 + ,0 + ,96560 + ,42 + ,38 + ,22996 + ,31580 + ,17 + ,0 + ,-2 + ,265769 + ,96 + ,120 + ,83122 + ,136815 + ,32 + ,6 + ,-3 + ,269651 + ,106 + ,93 + ,70106 + ,120642 + ,30 + ,0 + ,-4 + ,149112 + ,56 + ,95 + ,60578 + ,69107 + ,35 + ,1 + ,2 + ,152871 + ,59 + ,90 + ,79892 + ,108016 + ,28 + ,3 + ,2 + ,362301 + ,76 + ,110 + ,100708 + ,79336 + ,34 + ,1 + ,-4 + ,183167 + ,91 + ,138 + ,82875 + ,93176 + ,39 + ,0 + ,3 + ,277965 + ,115 + ,133 + ,139077 + ,161632 + ,39 + ,2 + ,2 + ,218946 + ,76 + ,96 + ,80670 + ,102996 + ,29 + ,3 + ,2 + ,244052 + ,101 + ,164 + ,143558 + ,160604 + ,44 + ,4 + ,0 + ,341570 + ,94 + ,78 + ,117105 + ,158051 + ,21 + ,12 + ,5 + ,233328 + ,92 + ,102 + ,120733 + ,162647 + ,28 + ,0 + ,-2 + ,206161 + ,75 + ,99 + ,73107 + ,60622 + ,28 + ,3 + ,0 + ,311473 + ,128 + ,129 + ,132068 + ,179566 + ,38 + ,0 + ,-2 + ,207176 + ,56 + ,114 + ,87011 + ,96144 + ,32 + ,4 + ,-3 + ,196553 + ,41 + ,99 + ,95260 + ,129847 + ,29 + ,-1 + ,2 + ,143246 + ,67 + ,104 + ,106671 + ,71180 + ,27 + ,2 + ,2 + ,182192 + ,77 + ,138 + ,70054 + ,86767 + ,40 + ,1 + ,2 + ,194979 + ,66 + ,151 + ,74011 + ,93487 + ,40 + ,1 + ,0 + ,167488 + ,69 + ,72 + ,83737 + ,82981 + ,28 + ,0 + ,4 + ,143756 + ,105 + ,120 + ,69094 + ,73815 + ,34 + ,2 + ,4 + ,275541 + ,116 + ,115 + ,93133 + ,94552 + ,33 + ,0 + ,2 + ,152299 + ,62 + ,98 + ,61370 + ,67808 + ,33 + ,2 + ,2 + ,193339 + ,100 + ,71 + ,84651 + ,106175 + ,35 + ,4 + ,-4 + ,130585 + ,67 + ,107 + ,95364 + ,76669 + ,29 + ,0 + ,3 + ,112611 + ,46 + ,73 + ,26706 + ,57283 + ,20 + ,0 + ,3 + ,148446 + ,135 + ,129 + ,126846 + ,72413 + ,37 + ,6 + ,2 + ,182079 + ,124 + ,118 + ,102860 + ,96971 + ,33 + ,13 + ,-1 + ,243060 + ,58 + ,104 + ,111813 + ,120336 + ,29 + ,4 + ,-3 + ,162765 + ,68 + ,107 + ,120293 + ,93913 + ,28 + ,-1 + ,0 + ,85574 + ,37 + ,36 + ,24266 + ,32036 + ,21 + ,3 + ,1 + ,225060 + ,93 + ,139 + ,109825 + ,102255 + ,41 + ,0 + ,-3 + ,133328 + ,56 + ,56 + ,40909 + ,63506 + ,20 + ,2 + ,3 + ,100750 + ,83 + ,93 + ,140867 + ,68370 + ,30 + ,0 + ,0 + ,101523 + ,59 + ,87 + ,61056 + ,50517 + ,22 + ,1 + ,0 + ,243511 + ,133 + ,110 + ,101338 + ,103950 + ,42 + ,1 + ,0 + ,152474 + ,106 + ,83 + ,65567 + ,84396 + ,32 + ,0 + ,3 + ,132487 + ,71 + ,98 + ,40735 + ,55515 + ,36 + ,31 + ,-3 + ,317394 + ,116 + ,82 + ,91413 + ,209056 + ,31 + ,2 + ,0 + ,244749 + ,98 + ,115 + ,76643 + ,142775 + ,33 + ,5 + ,-4 + ,184510 + ,64 + ,140 + ,110681 + ,68847 + ,40 + ,1 + ,2 + ,128423 + ,32 + ,120 + ,92696 + ,20112 + ,38 + ,1 + ,-1 + ,97839 + ,25 + ,66 + ,94785 + ,61023 + ,24 + ,2 + ,3 + ,172494 + ,46 + ,139 + ,86687 + ,112494 + ,43 + ,13 + ,2 + ,229242 + ,63 + ,119 + ,91721 + ,78876 + ,31 + ,5 + ,5 + ,351619 + ,95 + ,141 + ,115168 + ,170745 + ,40 + ,3 + ,2 + ,324598 + ,113 + ,133 + ,135777 + ,122037 + ,37 + ,1 + ,-2 + ,195838 + ,111 + ,98 + ,102372 + ,112283 + ,31 + ,1 + ,0 + ,254488 + ,120 + ,117 + ,103772 + ,120691 + ,39 + ,4 + ,3 + ,199476 + ,87 + ,105 + ,135400 + ,122422 + ,32 + ,2 + ,-2 + ,92499 + ,25 + ,55 + ,21399 + ,25899 + ,18 + ,0 + ,0 + ,224330 + ,131 + ,132 + ,130115 + ,139296 + ,39 + ,4 + ,6 + ,181633 + ,47 + ,73 + ,64466 + ,89455 + ,30 + ,0 + ,-3 + ,271856 + ,109 + ,86 + ,54990 + ,147866 + ,37 + ,0 + ,3 + ,95227 + ,37 + ,48 + ,34777 + ,14336 + ,32 + ,0 + ,0 + ,98146 + ,15 + ,48 + ,27114 + ,30059 + ,17 + ,7 + ,-2 + ,118612 + ,54 + ,43 + ,30080 + ,41907 + ,12 + ,3 + ,1 + ,65475 + ,16 + ,46 + ,69008 + ,35885 + ,13 + ,4 + ,0 + ,108446 + ,22 + ,65 + ,46300 + ,55764 + ,17 + ,1 + ,2 + ,121848 + ,37 + ,52 + ,30594 + ,35619 + ,17 + ,0 + ,2 + ,76302 + ,29 + ,68 + ,30976 + ,40557 + ,20 + ,2 + ,-3 + ,98104 + ,55 + ,47 + ,25568 + ,44197 + ,17 + ,0 + ,-2 + ,30989 + ,5 + ,41 + ,4154 + ,4103 + ,17 + ,0 + ,1 + ,31774 + ,0 + ,47 + ,4143 + ,4694 + ,17 + ,0 + ,-4 + ,150580 + ,27 + ,71 + ,45588 + ,62991 + ,22 + ,2 + ,0 + ,54157 + ,37 + ,30 + ,18625 + ,24261 + ,15 + ,1 + ,1 + ,59382 + ,29 + ,24 + ,26263 + ,21425 + ,12 + ,0 + ,0 + ,84105 + ,17 + ,63 + ,20055 + ,27184 + ,17 + ,0) + ,dim=c(8 + ,85) + ,dimnames=list(c('estscore' + ,'time_in_rfc' + ,'blogged_computations' + ,'feedback_messages_p120' + ,'totsize' + ,'totseconds' + ,'compendiums_reviewed' + ,'difference_hyperlinks-blogs') + ,1:85)) > y <- array(NA,dim=c(8,85),dimnames=list(c('estscore','time_in_rfc','blogged_computations','feedback_messages_p120','totsize','totseconds','compendiums_reviewed','difference_hyperlinks-blogs'),1:85)) > 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 = '2' > #'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 time_in_rfc estscore blogged_computations feedback_messages_p120 totsize 1 210907 2 79 94 112285 2 179321 4 108 103 101193 3 149061 0 43 93 116174 4 237213 0 78 123 66198 5 173326 -4 86 148 71701 6 133131 4 44 90 57793 7 258873 4 104 124 80444 8 324799 0 158 168 97668 9 230964 -1 102 115 133824 10 236785 0 77 71 101481 11 344297 1 80 108 67654 12 174724 0 123 120 69112 13 174415 3 73 114 82753 14 223632 -1 105 120 72654 15 294424 4 107 124 101494 16 325107 3 84 126 79215 17 106408 1 33 37 31081 18 96560 0 42 38 22996 19 265769 -2 96 120 83122 20 269651 -3 106 93 70106 21 149112 -4 56 95 60578 22 152871 2 59 90 79892 23 362301 2 76 110 100708 24 183167 -4 91 138 82875 25 277965 3 115 133 139077 26 218946 2 76 96 80670 27 244052 2 101 164 143558 28 341570 0 94 78 117105 29 233328 5 92 102 120733 30 206161 -2 75 99 73107 31 311473 0 128 129 132068 32 207176 -2 56 114 87011 33 196553 -3 41 99 95260 34 143246 2 67 104 106671 35 182192 2 77 138 70054 36 194979 2 66 151 74011 37 167488 0 69 72 83737 38 143756 4 105 120 69094 39 275541 4 116 115 93133 40 152299 2 62 98 61370 41 193339 2 100 71 84651 42 130585 -4 67 107 95364 43 112611 3 46 73 26706 44 148446 3 135 129 126846 45 182079 2 124 118 102860 46 243060 -1 58 104 111813 47 162765 -3 68 107 120293 48 85574 0 37 36 24266 49 225060 1 93 139 109825 50 133328 -3 56 56 40909 51 100750 3 83 93 140867 52 101523 0 59 87 61056 53 243511 0 133 110 101338 54 152474 0 106 83 65567 55 132487 3 71 98 40735 56 317394 -3 116 82 91413 57 244749 0 98 115 76643 58 184510 -4 64 140 110681 59 128423 2 32 120 92696 60 97839 -1 25 66 94785 61 172494 3 46 139 86687 62 229242 2 63 119 91721 63 351619 5 95 141 115168 64 324598 2 113 133 135777 65 195838 -2 111 98 102372 66 254488 0 120 117 103772 67 199476 3 87 105 135400 68 92499 -2 25 55 21399 69 224330 0 131 132 130115 70 181633 6 47 73 64466 71 271856 -3 109 86 54990 72 95227 3 37 48 34777 73 98146 0 15 48 27114 74 118612 -2 54 43 30080 75 65475 1 16 46 69008 76 108446 0 22 65 46300 77 121848 2 37 52 30594 78 76302 2 29 68 30976 79 98104 -3 55 47 25568 80 30989 -2 5 41 4154 81 31774 1 0 47 4143 82 150580 -4 27 71 45588 83 54157 0 37 30 18625 84 59382 1 29 24 26263 85 84105 0 17 63 20055 totseconds compendiums_reviewed difference_hyperlinks-blogs 1 146283 30 -1 2 96933 30 3 3 95757 26 0 4 143983 38 3 5 75851 44 4 6 59238 30 0 7 93163 40 0 8 151511 47 7 9 136368 30 1 10 112642 31 0 11 127766 30 1 12 85646 34 4 13 98579 31 1 14 131741 33 5 15 171975 33 13 16 159676 36 4 17 58391 14 0 18 31580 17 0 19 136815 32 6 20 120642 30 0 21 69107 35 1 22 108016 28 3 23 79336 34 1 24 93176 39 0 25 161632 39 2 26 102996 29 3 27 160604 44 4 28 158051 21 12 29 162647 28 0 30 60622 28 3 31 179566 38 0 32 96144 32 4 33 129847 29 -1 34 71180 27 2 35 86767 40 1 36 93487 40 1 37 82981 28 0 38 73815 34 2 39 94552 33 0 40 67808 33 2 41 106175 35 4 42 76669 29 0 43 57283 20 0 44 72413 37 6 45 96971 33 13 46 120336 29 4 47 93913 28 -1 48 32036 21 3 49 102255 41 0 50 63506 20 2 51 68370 30 0 52 50517 22 1 53 103950 42 1 54 84396 32 0 55 55515 36 31 56 209056 31 2 57 142775 33 5 58 68847 40 1 59 20112 38 1 60 61023 24 2 61 112494 43 13 62 78876 31 5 63 170745 40 3 64 122037 37 1 65 112283 31 1 66 120691 39 4 67 122422 32 2 68 25899 18 0 69 139296 39 4 70 89455 30 0 71 147866 37 0 72 14336 32 0 73 30059 17 7 74 41907 12 3 75 35885 13 4 76 55764 17 1 77 35619 17 0 78 40557 20 2 79 44197 17 0 80 4103 17 0 81 4694 17 0 82 62991 22 2 83 24261 15 1 84 21425 12 0 85 27184 17 0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) estscore 19762.3662 905.8339 blogged_computations feedback_messages_p120 323.2942 280.6691 totsize totseconds -0.1882 1.2381 compendiums_reviewed `difference_hyperlinks-blogs` 599.3325 -566.5764 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -52140 -23271 -10012 16930 186197 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 19762.3662 16255.0819 1.216 0.228 estscore 905.8339 1817.8234 0.498 0.620 blogged_computations 323.2942 211.3393 1.530 0.130 feedback_messages_p120 280.6691 321.2964 0.874 0.385 totsize -0.1882 0.2019 -0.932 0.354 totseconds 1.2381 0.1547 8.005 9.97e-12 *** compendiums_reviewed 599.3325 1211.1296 0.495 0.622 `difference_hyperlinks-blogs` -566.5764 1048.3054 -0.540 0.590 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 39650 on 77 degrees of freedom Multiple R-squared: 0.7741, Adjusted R-squared: 0.7535 F-statistic: 37.68 on 7 and 77 DF, p-value: < 2.2e-16 > 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.7728962 0.4542076780 2.271038e-01 [2,] 0.9213191 0.1573618512 7.868093e-02 [3,] 0.8762624 0.2474751239 1.237376e-01 [4,] 0.8212800 0.3574400621 1.787200e-01 [5,] 0.8307478 0.3385043294 1.692522e-01 [6,] 0.7785401 0.4429198613 2.214599e-01 [7,] 0.6959812 0.6080375770 3.040188e-01 [8,] 0.6125772 0.7748455322 3.874228e-01 [9,] 0.5432276 0.9135448152 4.567724e-01 [10,] 0.4736865 0.9473729792 5.263135e-01 [11,] 0.3842111 0.7684221995 6.157889e-01 [12,] 0.3805604 0.7611208501 6.194396e-01 [13,] 0.9995594 0.0008812115 4.406057e-04 [14,] 0.9993101 0.0013797533 6.898767e-04 [15,] 0.9989524 0.0020951356 1.047568e-03 [16,] 0.9982618 0.0034763249 1.738162e-03 [17,] 0.9985423 0.0029153988 1.457699e-03 [18,] 0.9998631 0.0002737252 1.368626e-04 [19,] 0.9998432 0.0003135412 1.567706e-04 [20,] 0.9999240 0.0001520267 7.601334e-05 [21,] 0.9998481 0.0003037525 1.518762e-04 [22,] 0.9997490 0.0005019113 2.509557e-04 [23,] 0.9995995 0.0008010681 4.005340e-04 [24,] 0.9993114 0.0013771585 6.885793e-04 [25,] 0.9989570 0.0020860266 1.043013e-03 [26,] 0.9985453 0.0029093492 1.454675e-03 [27,] 0.9976423 0.0047153495 2.357675e-03 [28,] 0.9984146 0.0031708275 1.585414e-03 [29,] 0.9993969 0.0012062131 6.031066e-04 [30,] 0.9989982 0.0020035518 1.001776e-03 [31,] 0.9986149 0.0027701018 1.385051e-03 [32,] 0.9984767 0.0030466825 1.523341e-03 [33,] 0.9979949 0.0040101324 2.005066e-03 [34,] 0.9980277 0.0039446031 1.972302e-03 [35,] 0.9973343 0.0053314244 2.665712e-03 [36,] 0.9973678 0.0052644550 2.632228e-03 [37,] 0.9958099 0.0083801085 4.190054e-03 [38,] 0.9933483 0.0133034339 6.651717e-03 [39,] 0.9896772 0.0206456595 1.032283e-02 [40,] 0.9840109 0.0319781792 1.598909e-02 [41,] 0.9890740 0.0218519020 1.092595e-02 [42,] 0.9887515 0.0224969985 1.124850e-02 [43,] 0.9823820 0.0352359310 1.761797e-02 [44,] 0.9852207 0.0295585684 1.477928e-02 [45,] 0.9823832 0.0352336239 1.761681e-02 [46,] 0.9751271 0.0497457528 2.487288e-02 [47,] 0.9650926 0.0698148947 3.490745e-02 [48,] 0.9482774 0.1034452990 5.172265e-02 [49,] 0.9271531 0.1456938781 7.284694e-02 [50,] 0.8959914 0.2080171504 1.040086e-01 [51,] 0.9303303 0.1393393902 6.966970e-02 [52,] 0.9263161 0.1473678515 7.368393e-02 [53,] 0.9158694 0.1682611068 8.413055e-02 [54,] 0.9979789 0.0040422230 2.021112e-03 [55,] 0.9956554 0.0086891924 4.344596e-03 [56,] 0.9948157 0.0103686681 5.184334e-03 [57,] 0.9888502 0.0222996485 1.114982e-02 [58,] 0.9809926 0.0380147113 1.900736e-02 [59,] 0.9839611 0.0320777314 1.603887e-02 [60,] 0.9684731 0.0630538972 3.152695e-02 [61,] 0.9430354 0.1139291726 5.696459e-02 [62,] 0.9077328 0.1845343903 9.226720e-02 [63,] 0.8622697 0.2754606184 1.377303e-01 [64,] 0.9506586 0.0986827479 4.934137e-02 > postscript(file="/var/wessaorg/rcomp/tmp/1exqg1324320468.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/2zqte1324320468.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/38ra41324320468.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/4nefc1324320468.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/50uxz1324320468.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 = 85 Frequency = 1 1 2 3 4 5 6 -41122.3809 -25140.9624 -22983.7333 -29175.0854 -16679.1119 -10187.6656 7 8 9 10 11 12 42879.8894 13391.6008 -14214.7980 33255.2152 104580.8579 -29629.0338 13 14 15 16 17 18 -28154.0694 -29235.1235 -4596.2721 38004.6732 -10150.6662 7592.8301 19 20 21 22 23 24 13571.0671 38077.9334 -6367.9497 -46821.6103 186197.0982 -24265.2300 25 26 27 28 29 30 -15210.9882 17835.8891 -52140.1605 90089.8473 -44772.7038 59796.1233 31 32 33 34 35 36 -6123.2288 19548.7103 -22320.2142 -12281.8821 -20659.6012 -15540.6063 37 38 39 40 41 42 1446.7200 -44889.2652 63058.0235 -7875.0945 -14729.6578 -31605.8022 43 44 45 46 47 48 -23113.7696 -38445.1321 -25819.5898 33199.8241 -17280.8783 -2238.5352 49 50 51 52 53 54 4803.6825 677.9365 -50785.3427 -25406.6420 15639.5032 -36185.4217 55 56 57 58 59 60 -5533.0150 -19249.1115 -18268.3776 20568.2653 33159.3354 -18590.8410 61 62 63 64 65 66 -45244.1659 57757.3832 45036.3187 82009.3309 -23271.4317 12082.8685 67 68 69 70 71 72 -24738.5132 12202.0669 -43919.0911 4147.3627 530.6338 16929.6774 73 74 75 76 77 78 21725.3269 19417.0310 -10244.7376 -6623.9497 25185.3966 -28971.8085 79 80 81 82 83 84 -10011.9841 -14572.5293 -17306.3819 24320.8290 -20943.8360 -6174.0578 85 1092.7890 > postscript(file="/var/wessaorg/rcomp/tmp/6wab11324320468.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 = 85 Frequency = 1 lag(myerror, k = 1) myerror 0 -41122.3809 NA 1 -25140.9624 -41122.3809 2 -22983.7333 -25140.9624 3 -29175.0854 -22983.7333 4 -16679.1119 -29175.0854 5 -10187.6656 -16679.1119 6 42879.8894 -10187.6656 7 13391.6008 42879.8894 8 -14214.7980 13391.6008 9 33255.2152 -14214.7980 10 104580.8579 33255.2152 11 -29629.0338 104580.8579 12 -28154.0694 -29629.0338 13 -29235.1235 -28154.0694 14 -4596.2721 -29235.1235 15 38004.6732 -4596.2721 16 -10150.6662 38004.6732 17 7592.8301 -10150.6662 18 13571.0671 7592.8301 19 38077.9334 13571.0671 20 -6367.9497 38077.9334 21 -46821.6103 -6367.9497 22 186197.0982 -46821.6103 23 -24265.2300 186197.0982 24 -15210.9882 -24265.2300 25 17835.8891 -15210.9882 26 -52140.1605 17835.8891 27 90089.8473 -52140.1605 28 -44772.7038 90089.8473 29 59796.1233 -44772.7038 30 -6123.2288 59796.1233 31 19548.7103 -6123.2288 32 -22320.2142 19548.7103 33 -12281.8821 -22320.2142 34 -20659.6012 -12281.8821 35 -15540.6063 -20659.6012 36 1446.7200 -15540.6063 37 -44889.2652 1446.7200 38 63058.0235 -44889.2652 39 -7875.0945 63058.0235 40 -14729.6578 -7875.0945 41 -31605.8022 -14729.6578 42 -23113.7696 -31605.8022 43 -38445.1321 -23113.7696 44 -25819.5898 -38445.1321 45 33199.8241 -25819.5898 46 -17280.8783 33199.8241 47 -2238.5352 -17280.8783 48 4803.6825 -2238.5352 49 677.9365 4803.6825 50 -50785.3427 677.9365 51 -25406.6420 -50785.3427 52 15639.5032 -25406.6420 53 -36185.4217 15639.5032 54 -5533.0150 -36185.4217 55 -19249.1115 -5533.0150 56 -18268.3776 -19249.1115 57 20568.2653 -18268.3776 58 33159.3354 20568.2653 59 -18590.8410 33159.3354 60 -45244.1659 -18590.8410 61 57757.3832 -45244.1659 62 45036.3187 57757.3832 63 82009.3309 45036.3187 64 -23271.4317 82009.3309 65 12082.8685 -23271.4317 66 -24738.5132 12082.8685 67 12202.0669 -24738.5132 68 -43919.0911 12202.0669 69 4147.3627 -43919.0911 70 530.6338 4147.3627 71 16929.6774 530.6338 72 21725.3269 16929.6774 73 19417.0310 21725.3269 74 -10244.7376 19417.0310 75 -6623.9497 -10244.7376 76 25185.3966 -6623.9497 77 -28971.8085 25185.3966 78 -10011.9841 -28971.8085 79 -14572.5293 -10011.9841 80 -17306.3819 -14572.5293 81 24320.8290 -17306.3819 82 -20943.8360 24320.8290 83 -6174.0578 -20943.8360 84 1092.7890 -6174.0578 85 NA 1092.7890 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -25140.9624 -41122.3809 [2,] -22983.7333 -25140.9624 [3,] -29175.0854 -22983.7333 [4,] -16679.1119 -29175.0854 [5,] -10187.6656 -16679.1119 [6,] 42879.8894 -10187.6656 [7,] 13391.6008 42879.8894 [8,] -14214.7980 13391.6008 [9,] 33255.2152 -14214.7980 [10,] 104580.8579 33255.2152 [11,] -29629.0338 104580.8579 [12,] -28154.0694 -29629.0338 [13,] -29235.1235 -28154.0694 [14,] -4596.2721 -29235.1235 [15,] 38004.6732 -4596.2721 [16,] -10150.6662 38004.6732 [17,] 7592.8301 -10150.6662 [18,] 13571.0671 7592.8301 [19,] 38077.9334 13571.0671 [20,] -6367.9497 38077.9334 [21,] -46821.6103 -6367.9497 [22,] 186197.0982 -46821.6103 [23,] -24265.2300 186197.0982 [24,] -15210.9882 -24265.2300 [25,] 17835.8891 -15210.9882 [26,] -52140.1605 17835.8891 [27,] 90089.8473 -52140.1605 [28,] -44772.7038 90089.8473 [29,] 59796.1233 -44772.7038 [30,] -6123.2288 59796.1233 [31,] 19548.7103 -6123.2288 [32,] -22320.2142 19548.7103 [33,] -12281.8821 -22320.2142 [34,] -20659.6012 -12281.8821 [35,] -15540.6063 -20659.6012 [36,] 1446.7200 -15540.6063 [37,] -44889.2652 1446.7200 [38,] 63058.0235 -44889.2652 [39,] -7875.0945 63058.0235 [40,] -14729.6578 -7875.0945 [41,] -31605.8022 -14729.6578 [42,] -23113.7696 -31605.8022 [43,] -38445.1321 -23113.7696 [44,] -25819.5898 -38445.1321 [45,] 33199.8241 -25819.5898 [46,] -17280.8783 33199.8241 [47,] -2238.5352 -17280.8783 [48,] 4803.6825 -2238.5352 [49,] 677.9365 4803.6825 [50,] -50785.3427 677.9365 [51,] -25406.6420 -50785.3427 [52,] 15639.5032 -25406.6420 [53,] -36185.4217 15639.5032 [54,] -5533.0150 -36185.4217 [55,] -19249.1115 -5533.0150 [56,] -18268.3776 -19249.1115 [57,] 20568.2653 -18268.3776 [58,] 33159.3354 20568.2653 [59,] -18590.8410 33159.3354 [60,] -45244.1659 -18590.8410 [61,] 57757.3832 -45244.1659 [62,] 45036.3187 57757.3832 [63,] 82009.3309 45036.3187 [64,] -23271.4317 82009.3309 [65,] 12082.8685 -23271.4317 [66,] -24738.5132 12082.8685 [67,] 12202.0669 -24738.5132 [68,] -43919.0911 12202.0669 [69,] 4147.3627 -43919.0911 [70,] 530.6338 4147.3627 [71,] 16929.6774 530.6338 [72,] 21725.3269 16929.6774 [73,] 19417.0310 21725.3269 [74,] -10244.7376 19417.0310 [75,] -6623.9497 -10244.7376 [76,] 25185.3966 -6623.9497 [77,] -28971.8085 25185.3966 [78,] -10011.9841 -28971.8085 [79,] -14572.5293 -10011.9841 [80,] -17306.3819 -14572.5293 [81,] 24320.8290 -17306.3819 [82,] -20943.8360 24320.8290 [83,] -6174.0578 -20943.8360 [84,] 1092.7890 -6174.0578 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -25140.9624 -41122.3809 2 -22983.7333 -25140.9624 3 -29175.0854 -22983.7333 4 -16679.1119 -29175.0854 5 -10187.6656 -16679.1119 6 42879.8894 -10187.6656 7 13391.6008 42879.8894 8 -14214.7980 13391.6008 9 33255.2152 -14214.7980 10 104580.8579 33255.2152 11 -29629.0338 104580.8579 12 -28154.0694 -29629.0338 13 -29235.1235 -28154.0694 14 -4596.2721 -29235.1235 15 38004.6732 -4596.2721 16 -10150.6662 38004.6732 17 7592.8301 -10150.6662 18 13571.0671 7592.8301 19 38077.9334 13571.0671 20 -6367.9497 38077.9334 21 -46821.6103 -6367.9497 22 186197.0982 -46821.6103 23 -24265.2300 186197.0982 24 -15210.9882 -24265.2300 25 17835.8891 -15210.9882 26 -52140.1605 17835.8891 27 90089.8473 -52140.1605 28 -44772.7038 90089.8473 29 59796.1233 -44772.7038 30 -6123.2288 59796.1233 31 19548.7103 -6123.2288 32 -22320.2142 19548.7103 33 -12281.8821 -22320.2142 34 -20659.6012 -12281.8821 35 -15540.6063 -20659.6012 36 1446.7200 -15540.6063 37 -44889.2652 1446.7200 38 63058.0235 -44889.2652 39 -7875.0945 63058.0235 40 -14729.6578 -7875.0945 41 -31605.8022 -14729.6578 42 -23113.7696 -31605.8022 43 -38445.1321 -23113.7696 44 -25819.5898 -38445.1321 45 33199.8241 -25819.5898 46 -17280.8783 33199.8241 47 -2238.5352 -17280.8783 48 4803.6825 -2238.5352 49 677.9365 4803.6825 50 -50785.3427 677.9365 51 -25406.6420 -50785.3427 52 15639.5032 -25406.6420 53 -36185.4217 15639.5032 54 -5533.0150 -36185.4217 55 -19249.1115 -5533.0150 56 -18268.3776 -19249.1115 57 20568.2653 -18268.3776 58 33159.3354 20568.2653 59 -18590.8410 33159.3354 60 -45244.1659 -18590.8410 61 57757.3832 -45244.1659 62 45036.3187 57757.3832 63 82009.3309 45036.3187 64 -23271.4317 82009.3309 65 12082.8685 -23271.4317 66 -24738.5132 12082.8685 67 12202.0669 -24738.5132 68 -43919.0911 12202.0669 69 4147.3627 -43919.0911 70 530.6338 4147.3627 71 16929.6774 530.6338 72 21725.3269 16929.6774 73 19417.0310 21725.3269 74 -10244.7376 19417.0310 75 -6623.9497 -10244.7376 76 25185.3966 -6623.9497 77 -28971.8085 25185.3966 78 -10011.9841 -28971.8085 79 -14572.5293 -10011.9841 80 -17306.3819 -14572.5293 81 24320.8290 -17306.3819 82 -20943.8360 24320.8290 83 -6174.0578 -20943.8360 84 1092.7890 -6174.0578 > 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/7dzvp1324320468.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/8tsb81324320468.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/9q1op1324320468.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/10ri301324320468.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/119d5x1324320468.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/12rkas1324320468.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/13e7ra1324320468.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/14i2bw1324320468.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/1527lw1324320468.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/16zw4p1324320468.tab") + } > > try(system("convert tmp/1exqg1324320468.ps tmp/1exqg1324320468.png",intern=TRUE)) character(0) > try(system("convert tmp/2zqte1324320468.ps tmp/2zqte1324320468.png",intern=TRUE)) character(0) > try(system("convert tmp/38ra41324320468.ps tmp/38ra41324320468.png",intern=TRUE)) character(0) > try(system("convert tmp/4nefc1324320468.ps tmp/4nefc1324320468.png",intern=TRUE)) character(0) > try(system("convert tmp/50uxz1324320468.ps tmp/50uxz1324320468.png",intern=TRUE)) character(0) > try(system("convert tmp/6wab11324320468.ps tmp/6wab11324320468.png",intern=TRUE)) character(0) > try(system("convert tmp/7dzvp1324320468.ps tmp/7dzvp1324320468.png",intern=TRUE)) character(0) > try(system("convert tmp/8tsb81324320468.ps tmp/8tsb81324320468.png",intern=TRUE)) character(0) > try(system("convert tmp/9q1op1324320468.ps tmp/9q1op1324320468.png",intern=TRUE)) character(0) > try(system("convert tmp/10ri301324320468.ps tmp/10ri301324320468.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.666 0.668 4.350