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(19,80.2,18,74.8,19,77.8,19,73,22,72,23,75.8,20,72.6,14,71.9,14,74.8,14,72.9,15,72.9,11,79.9,17,74,16,76,20,69.6,24,77.3,23,75.2,20,75.8,21,77.6,19,76.7,23,77,23,77.9,23,76.7,23,71.9,27,73.4,26,72.5,17,73.7,24,69.5,26,74.7,24,72.5,27,72.1,27,70.7,26,71.4,24,69.5,23,73.5,23,72.4,24,74.5,17,72.2,21,73,19,73.3,22,71.3,22,73.6,18,71.3,16,71.2,14,81.4,12,76.1,14,71.1,16,75.7,8,70,3,68.5,0,56.7,5,57.9,1,58.8,1,59.3,3,61.3,6,62.9,7,61.4,8,64.5,14,63.8,14,61.6,13,64.7),dim=c(2,61),dimnames=list(c('indcvtr','dzcg '),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('indcvtr','dzcg '),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 = '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 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 dzcg\r indcvtr 1 80.2 19 2 74.8 18 3 77.8 19 4 73.0 19 5 72.0 22 6 75.8 23 7 72.6 20 8 71.9 14 9 74.8 14 10 72.9 14 11 72.9 15 12 79.9 11 13 74.0 17 14 76.0 16 15 69.6 20 16 77.3 24 17 75.2 23 18 75.8 20 19 77.6 21 20 76.7 19 21 77.0 23 22 77.9 23 23 76.7 23 24 71.9 23 25 73.4 27 26 72.5 26 27 73.7 17 28 69.5 24 29 74.7 26 30 72.5 24 31 72.1 27 32 70.7 27 33 71.4 26 34 69.5 24 35 73.5 23 36 72.4 23 37 74.5 24 38 72.2 17 39 73.0 21 40 73.3 19 41 71.3 22 42 73.6 22 43 71.3 18 44 71.2 16 45 81.4 14 46 76.1 12 47 71.1 14 48 75.7 16 49 70.0 8 50 68.5 3 51 56.7 0 52 57.9 5 53 58.8 1 54 59.3 1 55 61.3 3 56 62.9 6 57 61.4 7 58 64.5 8 59 63.8 14 60 61.6 14 61 64.7 13 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) indcvtr 62.7286 0.5132 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -8.313 -3.184 -0.392 2.808 11.527 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 62.72862 1.46519 42.813 < 2e-16 *** indcvtr 0.51317 0.07852 6.535 1.65e-08 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 4.369 on 59 degrees of freedom Multiple R-squared: 0.4199, Adjusted R-squared: 0.4101 F-statistic: 42.71 on 1 and 59 DF, p-value: 1.647e-08 > 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,] 3.999484e-01 0.7998967692 0.600051615 [2,] 2.988143e-01 0.5976286955 0.701185652 [3,] 2.317774e-01 0.4635547948 0.768222603 [4,] 2.107813e-01 0.4215626794 0.789218660 [5,] 1.370906e-01 0.2741812554 0.862909372 [6,] 8.623333e-02 0.1724666542 0.913766673 [7,] 5.156298e-02 0.1031259638 0.948437018 [8,] 1.546681e-01 0.3093362055 0.845331897 [9,] 1.068128e-01 0.2136255838 0.893187208 [10,] 8.106224e-02 0.1621244775 0.918937761 [11,] 1.082443e-01 0.2164886068 0.891755697 [12,] 1.030634e-01 0.2061267475 0.896936626 [13,] 6.908950e-02 0.1381789917 0.930910504 [14,] 4.931928e-02 0.0986385620 0.950680719 [15,] 4.678881e-02 0.0935776128 0.953211194 [16,] 3.953047e-02 0.0790609394 0.960469530 [17,] 3.067383e-02 0.0613476635 0.969326168 [18,] 2.828178e-02 0.0565635627 0.971718219 [19,] 2.059707e-02 0.0411941360 0.979402932 [20,] 1.983136e-02 0.0396627115 0.980168644 [21,] 1.376813e-02 0.0275362642 0.986231868 [22,] 1.037876e-02 0.0207575198 0.989621240 [23,] 7.634090e-03 0.0152681792 0.992365910 [24,] 1.288095e-02 0.0257618928 0.987119054 [25,] 7.693983e-03 0.0153879668 0.992306017 [26,] 5.071564e-03 0.0101431280 0.994928436 [27,] 3.663730e-03 0.0073274593 0.996336270 [28,] 3.937154e-03 0.0078743087 0.996062846 [29,] 3.417479e-03 0.0068349576 0.996582521 [30,] 5.571862e-03 0.0111437246 0.994428138 [31,] 3.290778e-03 0.0065815557 0.996709222 [32,] 2.211553e-03 0.0044231059 0.997788447 [33,] 1.293418e-03 0.0025868354 0.998706582 [34,] 8.851393e-04 0.0017702786 0.999114861 [35,] 4.876796e-04 0.0009753591 0.999512320 [36,] 2.529496e-04 0.0005058992 0.999747050 [37,] 2.243350e-04 0.0004486701 0.999775665 [38,] 1.248395e-04 0.0002496789 0.999875161 [39,] 9.645404e-05 0.0001929081 0.999903546 [40,] 7.001945e-05 0.0001400389 0.999929981 [41,] 2.801262e-03 0.0056025245 0.997198738 [42,] 1.242031e-02 0.0248406206 0.987579690 [43,] 1.383326e-02 0.0276665233 0.986166738 [44,] 6.913752e-02 0.1382750363 0.930862482 [45,] 2.929842e-01 0.5859684617 0.707015769 [46,] 9.235822e-01 0.1528356241 0.076417812 [47,] 9.766943e-01 0.0466114777 0.023305739 [48,] 9.930579e-01 0.0138842429 0.006942121 [49,] 9.901760e-01 0.0196479687 0.009823984 [50,] 9.863513e-01 0.0272973931 0.013648697 [51,] 9.663390e-01 0.0673220265 0.033661013 [52,] 9.044471e-01 0.1911057321 0.095552866 > postscript(file="/var/www/html/rcomp/tmp/1izax1260640075.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/2k54c1260640075.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/3e63c1260640075.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/4eow81260640075.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/527eg1260640075.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 7 7.7211616 2.8343311 5.3211616 0.5211616 -2.0183472 1.2684833 -0.3920080 8 9 10 11 12 13 14 1.9870094 4.8870094 2.9870094 2.4738399 11.5265182 2.5475007 5.0606703 15 16 17 18 19 20 21 -3.3920080 2.2553137 0.6684833 2.8079920 4.0948224 4.2211616 2.4684833 22 23 24 25 26 27 28 3.3684833 2.1684833 -2.6315167 -3.1841950 -3.5710255 2.2475007 -5.5446863 29 30 31 32 33 34 35 -1.3710255 -2.5446863 -4.4841950 -5.8841950 -4.6710255 -5.5446863 -1.0315167 36 37 38 39 40 41 42 -2.1315167 -0.5446863 0.7475007 -0.5051776 0.8211616 -2.7183472 -0.4183472 43 44 45 46 47 48 49 -0.6656689 0.2606703 11.4870094 7.2133486 1.1870094 4.7606703 3.1660269 50 51 52 53 54 55 56 4.2318748 -6.0286165 -7.3944644 -4.4417861 -3.9417861 -2.9681252 -2.9076340 57 58 59 60 61 -4.9208035 -2.3339731 -6.1129906 -8.3129906 -4.6998210 > postscript(file="/var/www/html/rcomp/tmp/6n5ar1260640075.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 7.7211616 NA 1 2.8343311 7.7211616 2 5.3211616 2.8343311 3 0.5211616 5.3211616 4 -2.0183472 0.5211616 5 1.2684833 -2.0183472 6 -0.3920080 1.2684833 7 1.9870094 -0.3920080 8 4.8870094 1.9870094 9 2.9870094 4.8870094 10 2.4738399 2.9870094 11 11.5265182 2.4738399 12 2.5475007 11.5265182 13 5.0606703 2.5475007 14 -3.3920080 5.0606703 15 2.2553137 -3.3920080 16 0.6684833 2.2553137 17 2.8079920 0.6684833 18 4.0948224 2.8079920 19 4.2211616 4.0948224 20 2.4684833 4.2211616 21 3.3684833 2.4684833 22 2.1684833 3.3684833 23 -2.6315167 2.1684833 24 -3.1841950 -2.6315167 25 -3.5710255 -3.1841950 26 2.2475007 -3.5710255 27 -5.5446863 2.2475007 28 -1.3710255 -5.5446863 29 -2.5446863 -1.3710255 30 -4.4841950 -2.5446863 31 -5.8841950 -4.4841950 32 -4.6710255 -5.8841950 33 -5.5446863 -4.6710255 34 -1.0315167 -5.5446863 35 -2.1315167 -1.0315167 36 -0.5446863 -2.1315167 37 0.7475007 -0.5446863 38 -0.5051776 0.7475007 39 0.8211616 -0.5051776 40 -2.7183472 0.8211616 41 -0.4183472 -2.7183472 42 -0.6656689 -0.4183472 43 0.2606703 -0.6656689 44 11.4870094 0.2606703 45 7.2133486 11.4870094 46 1.1870094 7.2133486 47 4.7606703 1.1870094 48 3.1660269 4.7606703 49 4.2318748 3.1660269 50 -6.0286165 4.2318748 51 -7.3944644 -6.0286165 52 -4.4417861 -7.3944644 53 -3.9417861 -4.4417861 54 -2.9681252 -3.9417861 55 -2.9076340 -2.9681252 56 -4.9208035 -2.9076340 57 -2.3339731 -4.9208035 58 -6.1129906 -2.3339731 59 -8.3129906 -6.1129906 60 -4.6998210 -8.3129906 61 NA -4.6998210 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 2.8343311 7.7211616 [2,] 5.3211616 2.8343311 [3,] 0.5211616 5.3211616 [4,] -2.0183472 0.5211616 [5,] 1.2684833 -2.0183472 [6,] -0.3920080 1.2684833 [7,] 1.9870094 -0.3920080 [8,] 4.8870094 1.9870094 [9,] 2.9870094 4.8870094 [10,] 2.4738399 2.9870094 [11,] 11.5265182 2.4738399 [12,] 2.5475007 11.5265182 [13,] 5.0606703 2.5475007 [14,] -3.3920080 5.0606703 [15,] 2.2553137 -3.3920080 [16,] 0.6684833 2.2553137 [17,] 2.8079920 0.6684833 [18,] 4.0948224 2.8079920 [19,] 4.2211616 4.0948224 [20,] 2.4684833 4.2211616 [21,] 3.3684833 2.4684833 [22,] 2.1684833 3.3684833 [23,] -2.6315167 2.1684833 [24,] -3.1841950 -2.6315167 [25,] -3.5710255 -3.1841950 [26,] 2.2475007 -3.5710255 [27,] -5.5446863 2.2475007 [28,] -1.3710255 -5.5446863 [29,] -2.5446863 -1.3710255 [30,] -4.4841950 -2.5446863 [31,] -5.8841950 -4.4841950 [32,] -4.6710255 -5.8841950 [33,] -5.5446863 -4.6710255 [34,] -1.0315167 -5.5446863 [35,] -2.1315167 -1.0315167 [36,] -0.5446863 -2.1315167 [37,] 0.7475007 -0.5446863 [38,] -0.5051776 0.7475007 [39,] 0.8211616 -0.5051776 [40,] -2.7183472 0.8211616 [41,] -0.4183472 -2.7183472 [42,] -0.6656689 -0.4183472 [43,] 0.2606703 -0.6656689 [44,] 11.4870094 0.2606703 [45,] 7.2133486 11.4870094 [46,] 1.1870094 7.2133486 [47,] 4.7606703 1.1870094 [48,] 3.1660269 4.7606703 [49,] 4.2318748 3.1660269 [50,] -6.0286165 4.2318748 [51,] -7.3944644 -6.0286165 [52,] -4.4417861 -7.3944644 [53,] -3.9417861 -4.4417861 [54,] -2.9681252 -3.9417861 [55,] -2.9076340 -2.9681252 [56,] -4.9208035 -2.9076340 [57,] -2.3339731 -4.9208035 [58,] -6.1129906 -2.3339731 [59,] -8.3129906 -6.1129906 [60,] -4.6998210 -8.3129906 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 2.8343311 7.7211616 2 5.3211616 2.8343311 3 0.5211616 5.3211616 4 -2.0183472 0.5211616 5 1.2684833 -2.0183472 6 -0.3920080 1.2684833 7 1.9870094 -0.3920080 8 4.8870094 1.9870094 9 2.9870094 4.8870094 10 2.4738399 2.9870094 11 11.5265182 2.4738399 12 2.5475007 11.5265182 13 5.0606703 2.5475007 14 -3.3920080 5.0606703 15 2.2553137 -3.3920080 16 0.6684833 2.2553137 17 2.8079920 0.6684833 18 4.0948224 2.8079920 19 4.2211616 4.0948224 20 2.4684833 4.2211616 21 3.3684833 2.4684833 22 2.1684833 3.3684833 23 -2.6315167 2.1684833 24 -3.1841950 -2.6315167 25 -3.5710255 -3.1841950 26 2.2475007 -3.5710255 27 -5.5446863 2.2475007 28 -1.3710255 -5.5446863 29 -2.5446863 -1.3710255 30 -4.4841950 -2.5446863 31 -5.8841950 -4.4841950 32 -4.6710255 -5.8841950 33 -5.5446863 -4.6710255 34 -1.0315167 -5.5446863 35 -2.1315167 -1.0315167 36 -0.5446863 -2.1315167 37 0.7475007 -0.5446863 38 -0.5051776 0.7475007 39 0.8211616 -0.5051776 40 -2.7183472 0.8211616 41 -0.4183472 -2.7183472 42 -0.6656689 -0.4183472 43 0.2606703 -0.6656689 44 11.4870094 0.2606703 45 7.2133486 11.4870094 46 1.1870094 7.2133486 47 4.7606703 1.1870094 48 3.1660269 4.7606703 49 4.2318748 3.1660269 50 -6.0286165 4.2318748 51 -7.3944644 -6.0286165 52 -4.4417861 -7.3944644 53 -3.9417861 -4.4417861 54 -2.9681252 -3.9417861 55 -2.9076340 -2.9681252 56 -4.9208035 -2.9076340 57 -2.3339731 -4.9208035 58 -6.1129906 -2.3339731 59 -8.3129906 -6.1129906 60 -4.6998210 -8.3129906 > 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/7h8ph1260640075.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/8c4tn1260640075.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/9mdbu1260640075.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/10kwqn1260640075.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/11xgh91260640075.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/12f6ph1260640075.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/13jz811260640075.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/14t7ji1260640075.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/15glr41260640075.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/16prw31260640075.tab") + } > > try(system("convert tmp/1izax1260640075.ps tmp/1izax1260640075.png",intern=TRUE)) character(0) > try(system("convert tmp/2k54c1260640075.ps tmp/2k54c1260640075.png",intern=TRUE)) character(0) > try(system("convert tmp/3e63c1260640075.ps tmp/3e63c1260640075.png",intern=TRUE)) character(0) > try(system("convert tmp/4eow81260640075.ps tmp/4eow81260640075.png",intern=TRUE)) character(0) > try(system("convert tmp/527eg1260640075.ps tmp/527eg1260640075.png",intern=TRUE)) character(0) > try(system("convert tmp/6n5ar1260640075.ps tmp/6n5ar1260640075.png",intern=TRUE)) character(0) > try(system("convert tmp/7h8ph1260640075.ps tmp/7h8ph1260640075.png",intern=TRUE)) character(0) > try(system("convert tmp/8c4tn1260640075.ps tmp/8c4tn1260640075.png",intern=TRUE)) character(0) > try(system("convert tmp/9mdbu1260640075.ps tmp/9mdbu1260640075.png",intern=TRUE)) character(0) > try(system("convert tmp/10kwqn1260640075.ps tmp/10kwqn1260640075.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.442 1.550 2.856