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(21,2472.81,19,2407.6,25,2454.62,21,2448.05,23,2497.84,23,2645.64,19,2756.76,18,2849.27,19,2921.44,19,2981.85,22,3080.58,23,3106.22,20,3119.31,14,3061.26,14,3097.31,14,3161.69,15,3257.16,11,3277.01,17,3295.32,16,3363.99,20,3494.17,24,3667.03,23,3813.06,20,3917.96,21,3895.51,19,3801.06,23,3570.12,23,3701.61,23,3862.27,23,3970.1,27,4138.52,26,4199.75,17,4290.89,24,4443.91,26,4502.64,24,4356.98,27,4591.27,27,4696.96,26,4621.4,24,4562.84,23,4202.52,23,4296.49,24,4435.23,17,4105.18,21,4116.68,19,3844.49,22,3720.98,22,3674.4,18,3857.62,16,3801.06,14,3504.37,12,3032.6,14,3047.03,16,2962.34,8,2197.82,3,2014.45,0,1862.83,5,1905.41,1,1810.99,1,1670.07,3,1864.44),dim=c(2,61),dimnames=list(c('Consvertr','Aand'),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('Consvertr','Aand'),1:61)) > 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 Consvertr Aand 1 21 2472.81 2 19 2407.60 3 25 2454.62 4 21 2448.05 5 23 2497.84 6 23 2645.64 7 19 2756.76 8 18 2849.27 9 19 2921.44 10 19 2981.85 11 22 3080.58 12 23 3106.22 13 20 3119.31 14 14 3061.26 15 14 3097.31 16 14 3161.69 17 15 3257.16 18 11 3277.01 19 17 3295.32 20 16 3363.99 21 20 3494.17 22 24 3667.03 23 23 3813.06 24 20 3917.96 25 21 3895.51 26 19 3801.06 27 23 3570.12 28 23 3701.61 29 23 3862.27 30 23 3970.10 31 27 4138.52 32 26 4199.75 33 17 4290.89 34 24 4443.91 35 26 4502.64 36 24 4356.98 37 27 4591.27 38 27 4696.96 39 26 4621.40 40 24 4562.84 41 23 4202.52 42 23 4296.49 43 24 4435.23 44 17 4105.18 45 21 4116.68 46 19 3844.49 47 22 3720.98 48 22 3674.40 49 18 3857.62 50 16 3801.06 51 14 3504.37 52 12 3032.60 53 14 3047.03 54 16 2962.34 55 8 2197.82 56 3 2014.45 57 0 1862.83 58 5 1905.41 59 1 1810.99 60 1 1670.07 61 3 1864.44 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Aand -2.489121 0.006175 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -9.0143 -2.6376 -0.4625 2.8942 12.3312 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -2.4891208 2.5712903 -0.968 0.337 Aand 0.0061753 0.0007395 8.351 1.40e-11 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 4.677 on 59 degrees of freedom Multiple R-squared: 0.5417, Adjusted R-squared: 0.5339 F-statistic: 69.74 on 1 and 59 DF, p-value: 1.398e-11 > 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.19706308 0.394126161 0.802936920 [2,] 0.17796047 0.355920949 0.822039525 [3,] 0.22935624 0.458712488 0.770643756 [4,] 0.17586752 0.351735035 0.824132483 [5,] 0.11788960 0.235779205 0.882110397 [6,] 0.07866443 0.157328864 0.921335568 [7,] 0.14160082 0.283201630 0.858399185 [8,] 0.25904900 0.518097992 0.740951004 [9,] 0.23782757 0.475655145 0.762172428 [10,] 0.52784371 0.944312578 0.472156289 [11,] 0.64404370 0.711912591 0.355956295 [12,] 0.66649147 0.667017053 0.333508526 [13,] 0.60513953 0.789720939 0.394860469 [14,] 0.73516645 0.529667106 0.264833553 [15,] 0.68179514 0.636409713 0.318204856 [16,] 0.61011951 0.779760981 0.389880490 [17,] 0.70945839 0.581083213 0.290541606 [18,] 0.93582264 0.128354722 0.064177361 [19,] 0.96545414 0.069091719 0.034545859 [20,] 0.95374838 0.092503247 0.046251623 [21,] 0.94119170 0.117616591 0.058808295 [22,] 0.91606898 0.167862032 0.083931016 [23,] 0.95019584 0.099608328 0.049804164 [24,] 0.96499299 0.070014026 0.035007013 [25,] 0.96764525 0.064709497 0.032354749 [26,] 0.96434945 0.071301097 0.035650548 [27,] 0.98828040 0.023439196 0.011719598 [28,] 0.99254998 0.014900042 0.007450021 [29,] 0.99869920 0.002601600 0.001300800 [30,] 0.99775742 0.004485158 0.002242579 [31,] 0.99692878 0.006142446 0.003071223 [32,] 0.99468388 0.010632241 0.005316120 [33,] 0.99330965 0.013380708 0.006690354 [34,] 0.99002925 0.019941492 0.009970746 [35,] 0.98394180 0.032116404 0.016058202 [36,] 0.97445402 0.051091964 0.025545982 [37,] 0.96020760 0.079584809 0.039792404 [38,] 0.93772970 0.124540594 0.062270297 [39,] 0.90587507 0.188249854 0.094124927 [40,] 0.95159172 0.096816555 0.048408278 [41,] 0.92819934 0.143601321 0.071800661 [42,] 0.89807935 0.203841304 0.101920652 [43,] 0.90219246 0.195615073 0.097807537 [44,] 0.94603905 0.107921897 0.053960949 [45,] 0.91744234 0.165115324 0.082557662 [46,] 0.92749722 0.145005556 0.072502778 [47,] 0.96896515 0.062069692 0.031034846 [48,] 0.97913769 0.041724618 0.020862309 [49,] 0.97860978 0.042780448 0.021390224 [50,] 0.95003300 0.099934001 0.049967000 [51,] 0.93058123 0.138837548 0.069418774 [52,] 0.87114434 0.257711326 0.128855663 > postscript(file="/var/www/html/rcomp/tmp/1rhaf1258526123.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/2mrin1258526123.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/3lh4r1258526123.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/4vf1h1258526123.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/5sk8s1258526123.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 = 61 Frequency = 1 1 2 3 4 5 6 8.21888908 6.62157745 12.33121697 8.37178839 10.06432245 9.15161980 7 8 9 10 11 12 4.46542549 2.89415267 3.44848453 3.07543739 5.46575449 6.30742096 13 14 15 16 17 18 3.22658687 -2.41493959 -2.63755752 -3.03512042 -2.62467200 -6.74725080 19 20 21 22 23 24 -0.86031972 -2.28437446 0.91173087 3.84427633 1.94250388 -1.70528035 25 26 27 28 29 30 -0.56664588 -1.98339307 3.44272027 2.63073602 1.63861959 0.97274187 31 32 33 34 35 36 3.93270546 2.55459461 -7.00821811 -0.95315559 0.68417169 -0.41634070 37 38 39 40 41 42 1.13685886 0.48419619 -0.04920156 -1.68757864 -0.46251084 -1.04279954 43 44 45 46 47 48 -0.89955438 -5.86141155 -1.93242698 -2.25158438 1.51112134 1.79876470 49 50 51 52 53 54 -3.33266548 -4.98339307 -5.15125673 -4.23795679 -2.32706571 0.19591661 55 56 57 58 59 60 -3.08297761 -6.95062114 -9.01432901 -4.27727136 -7.69420381 -6.82398690 61 -6.02427117 > postscript(file="/var/www/html/rcomp/tmp/68q6e1258526123.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 = 61 Frequency = 1 lag(myerror, k = 1) myerror 0 8.21888908 NA 1 6.62157745 8.21888908 2 12.33121697 6.62157745 3 8.37178839 12.33121697 4 10.06432245 8.37178839 5 9.15161980 10.06432245 6 4.46542549 9.15161980 7 2.89415267 4.46542549 8 3.44848453 2.89415267 9 3.07543739 3.44848453 10 5.46575449 3.07543739 11 6.30742096 5.46575449 12 3.22658687 6.30742096 13 -2.41493959 3.22658687 14 -2.63755752 -2.41493959 15 -3.03512042 -2.63755752 16 -2.62467200 -3.03512042 17 -6.74725080 -2.62467200 18 -0.86031972 -6.74725080 19 -2.28437446 -0.86031972 20 0.91173087 -2.28437446 21 3.84427633 0.91173087 22 1.94250388 3.84427633 23 -1.70528035 1.94250388 24 -0.56664588 -1.70528035 25 -1.98339307 -0.56664588 26 3.44272027 -1.98339307 27 2.63073602 3.44272027 28 1.63861959 2.63073602 29 0.97274187 1.63861959 30 3.93270546 0.97274187 31 2.55459461 3.93270546 32 -7.00821811 2.55459461 33 -0.95315559 -7.00821811 34 0.68417169 -0.95315559 35 -0.41634070 0.68417169 36 1.13685886 -0.41634070 37 0.48419619 1.13685886 38 -0.04920156 0.48419619 39 -1.68757864 -0.04920156 40 -0.46251084 -1.68757864 41 -1.04279954 -0.46251084 42 -0.89955438 -1.04279954 43 -5.86141155 -0.89955438 44 -1.93242698 -5.86141155 45 -2.25158438 -1.93242698 46 1.51112134 -2.25158438 47 1.79876470 1.51112134 48 -3.33266548 1.79876470 49 -4.98339307 -3.33266548 50 -5.15125673 -4.98339307 51 -4.23795679 -5.15125673 52 -2.32706571 -4.23795679 53 0.19591661 -2.32706571 54 -3.08297761 0.19591661 55 -6.95062114 -3.08297761 56 -9.01432901 -6.95062114 57 -4.27727136 -9.01432901 58 -7.69420381 -4.27727136 59 -6.82398690 -7.69420381 60 -6.02427117 -6.82398690 61 NA -6.02427117 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 6.62157745 8.21888908 [2,] 12.33121697 6.62157745 [3,] 8.37178839 12.33121697 [4,] 10.06432245 8.37178839 [5,] 9.15161980 10.06432245 [6,] 4.46542549 9.15161980 [7,] 2.89415267 4.46542549 [8,] 3.44848453 2.89415267 [9,] 3.07543739 3.44848453 [10,] 5.46575449 3.07543739 [11,] 6.30742096 5.46575449 [12,] 3.22658687 6.30742096 [13,] -2.41493959 3.22658687 [14,] -2.63755752 -2.41493959 [15,] -3.03512042 -2.63755752 [16,] -2.62467200 -3.03512042 [17,] -6.74725080 -2.62467200 [18,] -0.86031972 -6.74725080 [19,] -2.28437446 -0.86031972 [20,] 0.91173087 -2.28437446 [21,] 3.84427633 0.91173087 [22,] 1.94250388 3.84427633 [23,] -1.70528035 1.94250388 [24,] -0.56664588 -1.70528035 [25,] -1.98339307 -0.56664588 [26,] 3.44272027 -1.98339307 [27,] 2.63073602 3.44272027 [28,] 1.63861959 2.63073602 [29,] 0.97274187 1.63861959 [30,] 3.93270546 0.97274187 [31,] 2.55459461 3.93270546 [32,] -7.00821811 2.55459461 [33,] -0.95315559 -7.00821811 [34,] 0.68417169 -0.95315559 [35,] -0.41634070 0.68417169 [36,] 1.13685886 -0.41634070 [37,] 0.48419619 1.13685886 [38,] -0.04920156 0.48419619 [39,] -1.68757864 -0.04920156 [40,] -0.46251084 -1.68757864 [41,] -1.04279954 -0.46251084 [42,] -0.89955438 -1.04279954 [43,] -5.86141155 -0.89955438 [44,] -1.93242698 -5.86141155 [45,] -2.25158438 -1.93242698 [46,] 1.51112134 -2.25158438 [47,] 1.79876470 1.51112134 [48,] -3.33266548 1.79876470 [49,] -4.98339307 -3.33266548 [50,] -5.15125673 -4.98339307 [51,] -4.23795679 -5.15125673 [52,] -2.32706571 -4.23795679 [53,] 0.19591661 -2.32706571 [54,] -3.08297761 0.19591661 [55,] -6.95062114 -3.08297761 [56,] -9.01432901 -6.95062114 [57,] -4.27727136 -9.01432901 [58,] -7.69420381 -4.27727136 [59,] -6.82398690 -7.69420381 [60,] -6.02427117 -6.82398690 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 6.62157745 8.21888908 2 12.33121697 6.62157745 3 8.37178839 12.33121697 4 10.06432245 8.37178839 5 9.15161980 10.06432245 6 4.46542549 9.15161980 7 2.89415267 4.46542549 8 3.44848453 2.89415267 9 3.07543739 3.44848453 10 5.46575449 3.07543739 11 6.30742096 5.46575449 12 3.22658687 6.30742096 13 -2.41493959 3.22658687 14 -2.63755752 -2.41493959 15 -3.03512042 -2.63755752 16 -2.62467200 -3.03512042 17 -6.74725080 -2.62467200 18 -0.86031972 -6.74725080 19 -2.28437446 -0.86031972 20 0.91173087 -2.28437446 21 3.84427633 0.91173087 22 1.94250388 3.84427633 23 -1.70528035 1.94250388 24 -0.56664588 -1.70528035 25 -1.98339307 -0.56664588 26 3.44272027 -1.98339307 27 2.63073602 3.44272027 28 1.63861959 2.63073602 29 0.97274187 1.63861959 30 3.93270546 0.97274187 31 2.55459461 3.93270546 32 -7.00821811 2.55459461 33 -0.95315559 -7.00821811 34 0.68417169 -0.95315559 35 -0.41634070 0.68417169 36 1.13685886 -0.41634070 37 0.48419619 1.13685886 38 -0.04920156 0.48419619 39 -1.68757864 -0.04920156 40 -0.46251084 -1.68757864 41 -1.04279954 -0.46251084 42 -0.89955438 -1.04279954 43 -5.86141155 -0.89955438 44 -1.93242698 -5.86141155 45 -2.25158438 -1.93242698 46 1.51112134 -2.25158438 47 1.79876470 1.51112134 48 -3.33266548 1.79876470 49 -4.98339307 -3.33266548 50 -5.15125673 -4.98339307 51 -4.23795679 -5.15125673 52 -2.32706571 -4.23795679 53 0.19591661 -2.32706571 54 -3.08297761 0.19591661 55 -6.95062114 -3.08297761 56 -9.01432901 -6.95062114 57 -4.27727136 -9.01432901 58 -7.69420381 -4.27727136 59 -6.82398690 -7.69420381 60 -6.02427117 -6.82398690 > 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/78nyf1258526123.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/8kxy01258526123.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/9ffvo1258526123.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/105u041258526123.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/11ciwc1258526123.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/12v3zd1258526123.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/138djp1258526123.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/1495at1258526124.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/150yb91258526124.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/16iqir1258526124.tab") + } > > system("convert tmp/1rhaf1258526123.ps tmp/1rhaf1258526123.png") > system("convert tmp/2mrin1258526123.ps tmp/2mrin1258526123.png") > system("convert tmp/3lh4r1258526123.ps tmp/3lh4r1258526123.png") > system("convert tmp/4vf1h1258526123.ps tmp/4vf1h1258526123.png") > system("convert tmp/5sk8s1258526123.ps tmp/5sk8s1258526123.png") > system("convert tmp/68q6e1258526123.ps tmp/68q6e1258526123.png") > system("convert tmp/78nyf1258526123.ps tmp/78nyf1258526123.png") > system("convert tmp/8kxy01258526123.ps tmp/8kxy01258526123.png") > system("convert tmp/9ffvo1258526123.ps tmp/9ffvo1258526123.png") > system("convert tmp/105u041258526123.ps tmp/105u041258526123.png") > > > proc.time() user system elapsed 2.410 1.511 3.897