R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(8.3,10,8.2,7,8,5,7.9,9,7.6,10,7.6,9,8.3,8,8.4,7,8.4,10,8.4,9,8.4,11,8.6,12,8.9,12,8.8,12,8.3,12,7.5,12,7.2,11,7.4,12,8.8,11,9.3,12,9.3,11,8.7,13,8.2,10,8.3,11,8.5,12,8.6,12,8.5,11,8.2,9,8.1,8,7.9,9,8.6,9,8.7,8,8.7,6,8.5,10,8.4,10,8.5,11,8.7,12,8.7,12,8.6,11,8.5,11,8.3,9,8,11,8.2,11,8.1,11,8.1,9,8,12,7.9,12,7.9,10,8,12,8,11,7.9,10,8,11,7.7,11,7.2,10,7.5,9,7.3,8,7,9,7,8,7,5,7.2,6,7.3,4,7.1,7,6.8,4,6.4,4,6.1,4,6.5,0,7.7,2,7.9,4,7.5,6,6.9,1,6.6,2,6.9,1),dim=c(2,72),dimnames=list(c('Y','X'),1:72)) > y <- array(NA,dim=c(2,72),dimnames=list(c('Y','X'),1:72)) > 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 Attaching package: 'zoo' The following object(s) are masked from package:base : 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 Y X 1 8.3 10 2 8.2 7 3 8.0 5 4 7.9 9 5 7.6 10 6 7.6 9 7 8.3 8 8 8.4 7 9 8.4 10 10 8.4 9 11 8.4 11 12 8.6 12 13 8.9 12 14 8.8 12 15 8.3 12 16 7.5 12 17 7.2 11 18 7.4 12 19 8.8 11 20 9.3 12 21 9.3 11 22 8.7 13 23 8.2 10 24 8.3 11 25 8.5 12 26 8.6 12 27 8.5 11 28 8.2 9 29 8.1 8 30 7.9 9 31 8.6 9 32 8.7 8 33 8.7 6 34 8.5 10 35 8.4 10 36 8.5 11 37 8.7 12 38 8.7 12 39 8.6 11 40 8.5 11 41 8.3 9 42 8.0 11 43 8.2 11 44 8.1 11 45 8.1 9 46 8.0 12 47 7.9 12 48 7.9 10 49 8.0 12 50 8.0 11 51 7.9 10 52 8.0 11 53 7.7 11 54 7.2 10 55 7.5 9 56 7.3 8 57 7.0 9 58 7.0 8 59 7.0 5 60 7.2 6 61 7.3 4 62 7.1 7 63 6.8 4 64 6.4 4 65 6.1 4 66 6.5 0 67 7.7 2 68 7.9 4 69 7.5 6 70 6.9 1 71 6.6 2 72 6.9 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 6.660 0.145 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.14046 -0.37048 0.09203 0.30825 1.16953 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 6.66044 0.18553 35.899 < 2e-16 *** X 0.14500 0.01964 7.383 2.49e-10 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.5264 on 70 degrees of freedom Multiple R-squared: 0.4378, Adjusted R-squared: 0.4298 F-statistic: 54.51 on 1 and 70 DF, p-value: 2.490e-10 > 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.20163493 0.40326986 0.7983651 [2,] 0.15868069 0.31736137 0.8413193 [3,] 0.12337892 0.24675783 0.8766211 [4,] 0.10027514 0.20055028 0.8997249 [5,] 0.10001857 0.20003714 0.8999814 [6,] 0.07942617 0.15885235 0.9205738 [7,] 0.05837185 0.11674370 0.9416282 [8,] 0.04997589 0.09995177 0.9500241 [9,] 0.06504022 0.13008044 0.9349598 [10,] 0.05239205 0.10478409 0.9476080 [11,] 0.03378593 0.06757186 0.9662141 [12,] 0.12712367 0.25424733 0.8728763 [13,] 0.35488719 0.70977438 0.6451128 [14,] 0.49254787 0.98509573 0.5074521 [15,] 0.52749830 0.94500340 0.4725017 [16,] 0.72385103 0.55229793 0.2761490 [17,] 0.86693571 0.26612857 0.1330643 [18,] 0.83160123 0.33679754 0.1683988 [19,] 0.78281568 0.43436863 0.2171843 [20,] 0.72583624 0.54832752 0.2741638 [21,] 0.66573157 0.66853685 0.3342684 [22,] 0.61043414 0.77913171 0.3895659 [23,] 0.55446505 0.89106991 0.4455350 [24,] 0.49380941 0.98761883 0.5061906 [25,] 0.43757323 0.87514646 0.5624268 [26,] 0.38352280 0.76704560 0.6164772 [27,] 0.39778232 0.79556464 0.6022177 [28,] 0.49074483 0.98148965 0.5092552 [29,] 0.70229408 0.59541184 0.2977059 [30,] 0.69127661 0.61744679 0.3087234 [31,] 0.66576494 0.66847012 0.3342351 [32,] 0.63941788 0.72116423 0.3605821 [33,] 0.63870387 0.72259227 0.3612961 [34,] 0.64765928 0.70468144 0.3523407 [35,] 0.67206187 0.65587626 0.3279381 [36,] 0.68231299 0.63537402 0.3176870 [37,] 0.71229824 0.57540351 0.2877018 [38,] 0.67614448 0.64771104 0.3238555 [39,] 0.64965417 0.70069167 0.3503458 [40,] 0.61624460 0.76751080 0.3837554 [41,] 0.62659023 0.74681954 0.3734098 [42,] 0.58606269 0.82787462 0.4139373 [43,] 0.54674474 0.90651052 0.4532553 [44,] 0.51779893 0.96440213 0.4822011 [45,] 0.47600838 0.95201676 0.5239916 [46,] 0.45331743 0.90663486 0.5466826 [47,] 0.44367375 0.88734750 0.5563262 [48,] 0.45742631 0.91485263 0.5425737 [49,] 0.44745728 0.89491457 0.5525427 [50,] 0.47788263 0.95576526 0.5221174 [51,] 0.45958979 0.91917958 0.5404102 [52,] 0.43905875 0.87811751 0.5609412 [53,] 0.46042395 0.92084790 0.5395761 [54,] 0.45713469 0.91426938 0.5428653 [55,] 0.40086704 0.80173409 0.5991330 [56,] 0.32767475 0.65534949 0.6723253 [57,] 0.26410873 0.52821746 0.7358913 [58,] 0.20631325 0.41262650 0.7936867 [59,] 0.15615369 0.31230737 0.8438463 [60,] 0.19785737 0.39571475 0.8021426 [61,] 0.64691558 0.70616884 0.3530844 [62,] 0.53800048 0.92399905 0.4619995 [63,] 0.62418026 0.75163948 0.3758197 > postscript(file="/var/www/html/rcomp/tmp/13klw1258722468.ps",horizontal=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/www/html/rcomp/tmp/2bhzq1258722468.ps",horizontal=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/www/html/rcomp/tmp/356r51258722468.ps",horizontal=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/www/html/rcomp/tmp/40b761258722468.ps",horizontal=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/www/html/rcomp/tmp/5qhkj1258722468.ps",horizontal=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 = 72 Frequency = 1 1 2 3 4 5 6 0.18950869 0.52452290 0.61453238 -0.06548657 -0.51049131 -0.36548657 7 8 9 10 11 12 0.47951817 0.72452290 0.28950869 0.43451343 0.14450395 0.19949922 13 14 15 16 17 18 0.49949922 0.39949922 -0.10050078 -0.90050078 -1.05549605 -1.00050078 19 20 21 22 23 24 0.54450395 0.89949922 1.04450395 0.15449448 0.08950869 0.04450395 25 26 27 28 29 30 0.09949922 0.19949922 0.24450395 0.23451343 0.27951817 -0.06548657 31 32 33 34 35 36 0.63451343 0.87951817 1.16952764 0.38950869 0.28950869 0.24450395 37 38 39 40 41 42 0.29949922 0.29949922 0.34450395 0.24450395 0.33451343 -0.25549605 43 44 45 46 47 48 -0.05549605 -0.15549605 0.13451343 -0.40050078 -0.50050078 -0.21049131 49 50 51 52 53 54 -0.40050078 -0.25549605 -0.21049131 -0.25549605 -0.55549605 -0.91049131 55 56 57 58 59 60 -0.46548657 -0.52048183 -0.96548657 -0.82048183 -0.38546762 -0.33047236 61 62 63 64 65 66 0.05953711 -0.57547710 -0.44046289 -0.84046289 -1.14046289 -0.16044394 67 68 69 70 71 72 0.74954659 0.65953711 -0.03047236 0.09455133 -0.35045341 0.09455133 > postscript(file="/var/www/html/rcomp/tmp/6yyru1258722468.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 72 Frequency = 1 lag(myerror, k = 1) myerror 0 0.18950869 NA 1 0.52452290 0.18950869 2 0.61453238 0.52452290 3 -0.06548657 0.61453238 4 -0.51049131 -0.06548657 5 -0.36548657 -0.51049131 6 0.47951817 -0.36548657 7 0.72452290 0.47951817 8 0.28950869 0.72452290 9 0.43451343 0.28950869 10 0.14450395 0.43451343 11 0.19949922 0.14450395 12 0.49949922 0.19949922 13 0.39949922 0.49949922 14 -0.10050078 0.39949922 15 -0.90050078 -0.10050078 16 -1.05549605 -0.90050078 17 -1.00050078 -1.05549605 18 0.54450395 -1.00050078 19 0.89949922 0.54450395 20 1.04450395 0.89949922 21 0.15449448 1.04450395 22 0.08950869 0.15449448 23 0.04450395 0.08950869 24 0.09949922 0.04450395 25 0.19949922 0.09949922 26 0.24450395 0.19949922 27 0.23451343 0.24450395 28 0.27951817 0.23451343 29 -0.06548657 0.27951817 30 0.63451343 -0.06548657 31 0.87951817 0.63451343 32 1.16952764 0.87951817 33 0.38950869 1.16952764 34 0.28950869 0.38950869 35 0.24450395 0.28950869 36 0.29949922 0.24450395 37 0.29949922 0.29949922 38 0.34450395 0.29949922 39 0.24450395 0.34450395 40 0.33451343 0.24450395 41 -0.25549605 0.33451343 42 -0.05549605 -0.25549605 43 -0.15549605 -0.05549605 44 0.13451343 -0.15549605 45 -0.40050078 0.13451343 46 -0.50050078 -0.40050078 47 -0.21049131 -0.50050078 48 -0.40050078 -0.21049131 49 -0.25549605 -0.40050078 50 -0.21049131 -0.25549605 51 -0.25549605 -0.21049131 52 -0.55549605 -0.25549605 53 -0.91049131 -0.55549605 54 -0.46548657 -0.91049131 55 -0.52048183 -0.46548657 56 -0.96548657 -0.52048183 57 -0.82048183 -0.96548657 58 -0.38546762 -0.82048183 59 -0.33047236 -0.38546762 60 0.05953711 -0.33047236 61 -0.57547710 0.05953711 62 -0.44046289 -0.57547710 63 -0.84046289 -0.44046289 64 -1.14046289 -0.84046289 65 -0.16044394 -1.14046289 66 0.74954659 -0.16044394 67 0.65953711 0.74954659 68 -0.03047236 0.65953711 69 0.09455133 -0.03047236 70 -0.35045341 0.09455133 71 0.09455133 -0.35045341 72 NA 0.09455133 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.52452290 0.18950869 [2,] 0.61453238 0.52452290 [3,] -0.06548657 0.61453238 [4,] -0.51049131 -0.06548657 [5,] -0.36548657 -0.51049131 [6,] 0.47951817 -0.36548657 [7,] 0.72452290 0.47951817 [8,] 0.28950869 0.72452290 [9,] 0.43451343 0.28950869 [10,] 0.14450395 0.43451343 [11,] 0.19949922 0.14450395 [12,] 0.49949922 0.19949922 [13,] 0.39949922 0.49949922 [14,] -0.10050078 0.39949922 [15,] -0.90050078 -0.10050078 [16,] -1.05549605 -0.90050078 [17,] -1.00050078 -1.05549605 [18,] 0.54450395 -1.00050078 [19,] 0.89949922 0.54450395 [20,] 1.04450395 0.89949922 [21,] 0.15449448 1.04450395 [22,] 0.08950869 0.15449448 [23,] 0.04450395 0.08950869 [24,] 0.09949922 0.04450395 [25,] 0.19949922 0.09949922 [26,] 0.24450395 0.19949922 [27,] 0.23451343 0.24450395 [28,] 0.27951817 0.23451343 [29,] -0.06548657 0.27951817 [30,] 0.63451343 -0.06548657 [31,] 0.87951817 0.63451343 [32,] 1.16952764 0.87951817 [33,] 0.38950869 1.16952764 [34,] 0.28950869 0.38950869 [35,] 0.24450395 0.28950869 [36,] 0.29949922 0.24450395 [37,] 0.29949922 0.29949922 [38,] 0.34450395 0.29949922 [39,] 0.24450395 0.34450395 [40,] 0.33451343 0.24450395 [41,] -0.25549605 0.33451343 [42,] -0.05549605 -0.25549605 [43,] -0.15549605 -0.05549605 [44,] 0.13451343 -0.15549605 [45,] -0.40050078 0.13451343 [46,] -0.50050078 -0.40050078 [47,] -0.21049131 -0.50050078 [48,] -0.40050078 -0.21049131 [49,] -0.25549605 -0.40050078 [50,] -0.21049131 -0.25549605 [51,] -0.25549605 -0.21049131 [52,] -0.55549605 -0.25549605 [53,] -0.91049131 -0.55549605 [54,] -0.46548657 -0.91049131 [55,] -0.52048183 -0.46548657 [56,] -0.96548657 -0.52048183 [57,] -0.82048183 -0.96548657 [58,] -0.38546762 -0.82048183 [59,] -0.33047236 -0.38546762 [60,] 0.05953711 -0.33047236 [61,] -0.57547710 0.05953711 [62,] -0.44046289 -0.57547710 [63,] -0.84046289 -0.44046289 [64,] -1.14046289 -0.84046289 [65,] -0.16044394 -1.14046289 [66,] 0.74954659 -0.16044394 [67,] 0.65953711 0.74954659 [68,] -0.03047236 0.65953711 [69,] 0.09455133 -0.03047236 [70,] -0.35045341 0.09455133 [71,] 0.09455133 -0.35045341 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.52452290 0.18950869 2 0.61453238 0.52452290 3 -0.06548657 0.61453238 4 -0.51049131 -0.06548657 5 -0.36548657 -0.51049131 6 0.47951817 -0.36548657 7 0.72452290 0.47951817 8 0.28950869 0.72452290 9 0.43451343 0.28950869 10 0.14450395 0.43451343 11 0.19949922 0.14450395 12 0.49949922 0.19949922 13 0.39949922 0.49949922 14 -0.10050078 0.39949922 15 -0.90050078 -0.10050078 16 -1.05549605 -0.90050078 17 -1.00050078 -1.05549605 18 0.54450395 -1.00050078 19 0.89949922 0.54450395 20 1.04450395 0.89949922 21 0.15449448 1.04450395 22 0.08950869 0.15449448 23 0.04450395 0.08950869 24 0.09949922 0.04450395 25 0.19949922 0.09949922 26 0.24450395 0.19949922 27 0.23451343 0.24450395 28 0.27951817 0.23451343 29 -0.06548657 0.27951817 30 0.63451343 -0.06548657 31 0.87951817 0.63451343 32 1.16952764 0.87951817 33 0.38950869 1.16952764 34 0.28950869 0.38950869 35 0.24450395 0.28950869 36 0.29949922 0.24450395 37 0.29949922 0.29949922 38 0.34450395 0.29949922 39 0.24450395 0.34450395 40 0.33451343 0.24450395 41 -0.25549605 0.33451343 42 -0.05549605 -0.25549605 43 -0.15549605 -0.05549605 44 0.13451343 -0.15549605 45 -0.40050078 0.13451343 46 -0.50050078 -0.40050078 47 -0.21049131 -0.50050078 48 -0.40050078 -0.21049131 49 -0.25549605 -0.40050078 50 -0.21049131 -0.25549605 51 -0.25549605 -0.21049131 52 -0.55549605 -0.25549605 53 -0.91049131 -0.55549605 54 -0.46548657 -0.91049131 55 -0.52048183 -0.46548657 56 -0.96548657 -0.52048183 57 -0.82048183 -0.96548657 58 -0.38546762 -0.82048183 59 -0.33047236 -0.38546762 60 0.05953711 -0.33047236 61 -0.57547710 0.05953711 62 -0.44046289 -0.57547710 63 -0.84046289 -0.44046289 64 -1.14046289 -0.84046289 65 -0.16044394 -1.14046289 66 0.74954659 -0.16044394 67 0.65953711 0.74954659 68 -0.03047236 0.65953711 69 0.09455133 -0.03047236 70 -0.35045341 0.09455133 71 0.09455133 -0.35045341 > 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/www/html/rcomp/tmp/704t81258722468.ps",horizontal=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/www/html/rcomp/tmp/89z761258722468.ps",horizontal=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/www/html/rcomp/tmp/9muq21258722468.ps",horizontal=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/www/html/rcomp/tmp/109d4u1258722468.ps",horizontal=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/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/www/html/rcomp/tmp/11f6q71258722468.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/www/html/rcomp/tmp/127pj01258722469.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/www/html/rcomp/tmp/13dlmj1258722469.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/www/html/rcomp/tmp/14r3xx1258722469.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/www/html/rcomp/tmp/15m79e1258722469.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/www/html/rcomp/tmp/1643q51258722469.tab") + } > system("convert tmp/13klw1258722468.ps tmp/13klw1258722468.png") > system("convert tmp/2bhzq1258722468.ps tmp/2bhzq1258722468.png") > system("convert tmp/356r51258722468.ps tmp/356r51258722468.png") > system("convert tmp/40b761258722468.ps tmp/40b761258722468.png") > system("convert tmp/5qhkj1258722468.ps tmp/5qhkj1258722468.png") > system("convert tmp/6yyru1258722468.ps tmp/6yyru1258722468.png") > system("convert tmp/704t81258722468.ps tmp/704t81258722468.png") > system("convert tmp/89z761258722468.ps tmp/89z761258722468.png") > system("convert tmp/9muq21258722468.ps tmp/9muq21258722468.png") > system("convert tmp/109d4u1258722468.ps tmp/109d4u1258722468.png") > > > proc.time() user system elapsed 2.641 1.601 5.408