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(100.6,71.7,104.3,77.5,120.4,89.8,107.5,80.3,102.9,78.7,125.6,93.8,107.5,57.6,108.8,60.6,128.4,91,121.1,85.3,119.5,77.4,128.7,77.3,108.7,68.3,105.5,69.9,119.8,81.7,111.3,75.1,110.6,69.9,120.1,84,97.5,54.3,107.7,60,127.3,89.9,117.2,77,119.8,85.3,116.2,77.6,111,69.2,112.4,75.5,130.6,85.7,109.1,72.2,118.8,79.9,123.9,85.3,101.6,52.2,112.8,61.2,128,82.4,129.6,85.4,125.8,78.2,119.5,70.2,115.7,70.2,113.6,69.3,129.7,77.5,112,66.1,116.8,69,127,79.2,112.1,56.2,114.2,63.3,121.1,77.8,131.6,92,125,78.1,120.4,65.1,117.7,71.1,117.5,70.9,120.6,72,127.5,81.9,112.3,70.6,124.5,72.5,115.2,65.1,104.7,54.9,130.9,80,129.2,77.4,113.5,59.6,125.6,57.4,107.6,50.8),dim=c(2,61),dimnames=list(c('Y','X'),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('Y','X'),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 Y X 1 100.6 71.7 2 104.3 77.5 3 120.4 89.8 4 107.5 80.3 5 102.9 78.7 6 125.6 93.8 7 107.5 57.6 8 108.8 60.6 9 128.4 91.0 10 121.1 85.3 11 119.5 77.4 12 128.7 77.3 13 108.7 68.3 14 105.5 69.9 15 119.8 81.7 16 111.3 75.1 17 110.6 69.9 18 120.1 84.0 19 97.5 54.3 20 107.7 60.0 21 127.3 89.9 22 117.2 77.0 23 119.8 85.3 24 116.2 77.6 25 111.0 69.2 26 112.4 75.5 27 130.6 85.7 28 109.1 72.2 29 118.8 79.9 30 123.9 85.3 31 101.6 52.2 32 112.8 61.2 33 128.0 82.4 34 129.6 85.4 35 125.8 78.2 36 119.5 70.2 37 115.7 70.2 38 113.6 69.3 39 129.7 77.5 40 112.0 66.1 41 116.8 69.0 42 127.0 79.2 43 112.1 56.2 44 114.2 63.3 45 121.1 77.8 46 131.6 92.0 47 125.0 78.1 48 120.4 65.1 49 117.7 71.1 50 117.5 70.9 51 120.6 72.0 52 127.5 81.9 53 112.3 70.6 54 124.5 72.5 55 115.2 65.1 56 104.7 54.9 57 130.9 80.0 58 129.2 77.4 59 113.5 59.6 60 125.6 57.4 61 107.6 50.8 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 77.4030 0.5413 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -17.1001 -3.3159 0.3006 4.2782 17.1287 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 77.40302 6.11374 12.660 < 2e-16 *** X 0.54126 0.08243 6.566 1.46e-08 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 6.718 on 59 degrees of freedom Multiple R-squared: 0.4222, Adjusted R-squared: 0.4124 F-statistic: 43.12 on 1 and 59 DF, p-value: 1.460e-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,] 0.11800871 0.23601742 0.88199129 [2,] 0.05342006 0.10684012 0.94657994 [3,] 0.87356149 0.25287702 0.12643851 [4,] 0.87612169 0.24775661 0.12387831 [5,] 0.92870334 0.14259331 0.07129666 [6,] 0.90976547 0.18046906 0.09023453 [7,] 0.90537408 0.18925184 0.09462592 [8,] 0.97835554 0.04328891 0.02164446 [9,] 0.96901392 0.06197215 0.03098608 [10,] 0.97228353 0.05543294 0.02771647 [11,] 0.96149303 0.07701393 0.03850697 [12,] 0.95678324 0.08643351 0.04321676 [13,] 0.94495748 0.11008504 0.05504252 [14,] 0.93095397 0.13809206 0.06904603 [15,] 0.93994142 0.12011717 0.06005858 [16,] 0.92748910 0.14502179 0.07251090 [17,] 0.91305263 0.17389474 0.08694737 [18,] 0.89434628 0.21130743 0.10565372 [19,] 0.88637951 0.22724098 0.11362049 [20,] 0.87502817 0.24994365 0.12497183 [21,] 0.86597648 0.26804703 0.13402352 [22,] 0.89062179 0.21875642 0.10937821 [23,] 0.91409119 0.17181761 0.08590881 [24,] 0.95263486 0.09473028 0.04736514 [25,] 0.95377582 0.09244837 0.04622418 [26,] 0.95161513 0.09676974 0.04838487 [27,] 0.95352369 0.09295263 0.04647631 [28,] 0.95002931 0.09994138 0.04997069 [29,] 0.95048158 0.09903684 0.04951842 [30,] 0.94611163 0.10777674 0.05388837 [31,] 0.94313109 0.11373781 0.05686891 [32,] 0.93279676 0.13440649 0.06720324 [33,] 0.91949741 0.16100517 0.08050259 [34,] 0.91574572 0.16850855 0.08425428 [35,] 0.94385009 0.11229983 0.05614991 [36,] 0.93973597 0.12052806 0.06026403 [37,] 0.92150170 0.15699660 0.07849830 [38,] 0.90568774 0.18862453 0.09431226 [39,] 0.88064108 0.23871784 0.11935892 [40,] 0.84319742 0.31360516 0.15680258 [41,] 0.80681749 0.38636502 0.19318251 [42,] 0.75413881 0.49172239 0.24586119 [43,] 0.69177201 0.61645597 0.30822799 [44,] 0.66116811 0.67766378 0.33883189 [45,] 0.59400084 0.81199832 0.40599916 [46,] 0.52684864 0.94630273 0.47315136 [47,] 0.43639167 0.87278334 0.56360833 [48,] 0.34849263 0.69698526 0.65150737 [49,] 0.49184923 0.98369847 0.50815077 [50,] 0.38439282 0.76878565 0.61560718 [51,] 0.30554923 0.61109846 0.69445077 [52,] 0.37258091 0.74516182 0.62741909 > postscript(file="/var/www/html/rcomp/tmp/1oxvb1258728545.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/2371k1258728545.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/3z2n81258728545.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/4dyfx1258728545.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/54b5l1258728545.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 -15.6112937 -15.0505964 -5.6080833 -13.3661219 -17.1001073 -2.5731197 7 8 9 10 11 12 -1.0795404 -1.4033177 1.7424058 -2.4724174 0.2035295 9.4576554 13 14 15 16 17 18 -5.6710127 -9.7370273 -1.8238846 -6.7515746 -4.6370273 -2.7687805 19 20 21 22 23 24 -9.2933854 -2.1785623 1.2377908 -1.8799669 -3.7724174 -3.2047223 25 26 27 28 29 30 -3.8581459 -5.8680782 6.8110790 -7.3819232 -1.8496182 0.3275826 31 32 33 34 35 36 -4.0567413 2.2719268 5.9972340 5.9734567 6.0705222 4.1005950 37 38 39 40 41 42 0.3005950 -1.3122718 10.3494036 -1.1802427 2.0501059 6.7292631 43 44 45 46 47 48 4.2782223 2.5352827 1.5870259 4.4011467 5.3246481 7.7610164 49 50 51 52 53 54 1.8134618 1.7217136 4.2263286 5.7678636 -3.3159087 7.8556991 55 56 57 58 59 60 2.5610164 -2.4181409 10.1962558 9.9035295 3.8379414 17.1287114 61 2.7010214 > postscript(file="/var/www/html/rcomp/tmp/6wzlq1258728545.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 -15.6112937 NA 1 -15.0505964 -15.6112937 2 -5.6080833 -15.0505964 3 -13.3661219 -5.6080833 4 -17.1001073 -13.3661219 5 -2.5731197 -17.1001073 6 -1.0795404 -2.5731197 7 -1.4033177 -1.0795404 8 1.7424058 -1.4033177 9 -2.4724174 1.7424058 10 0.2035295 -2.4724174 11 9.4576554 0.2035295 12 -5.6710127 9.4576554 13 -9.7370273 -5.6710127 14 -1.8238846 -9.7370273 15 -6.7515746 -1.8238846 16 -4.6370273 -6.7515746 17 -2.7687805 -4.6370273 18 -9.2933854 -2.7687805 19 -2.1785623 -9.2933854 20 1.2377908 -2.1785623 21 -1.8799669 1.2377908 22 -3.7724174 -1.8799669 23 -3.2047223 -3.7724174 24 -3.8581459 -3.2047223 25 -5.8680782 -3.8581459 26 6.8110790 -5.8680782 27 -7.3819232 6.8110790 28 -1.8496182 -7.3819232 29 0.3275826 -1.8496182 30 -4.0567413 0.3275826 31 2.2719268 -4.0567413 32 5.9972340 2.2719268 33 5.9734567 5.9972340 34 6.0705222 5.9734567 35 4.1005950 6.0705222 36 0.3005950 4.1005950 37 -1.3122718 0.3005950 38 10.3494036 -1.3122718 39 -1.1802427 10.3494036 40 2.0501059 -1.1802427 41 6.7292631 2.0501059 42 4.2782223 6.7292631 43 2.5352827 4.2782223 44 1.5870259 2.5352827 45 4.4011467 1.5870259 46 5.3246481 4.4011467 47 7.7610164 5.3246481 48 1.8134618 7.7610164 49 1.7217136 1.8134618 50 4.2263286 1.7217136 51 5.7678636 4.2263286 52 -3.3159087 5.7678636 53 7.8556991 -3.3159087 54 2.5610164 7.8556991 55 -2.4181409 2.5610164 56 10.1962558 -2.4181409 57 9.9035295 10.1962558 58 3.8379414 9.9035295 59 17.1287114 3.8379414 60 2.7010214 17.1287114 61 NA 2.7010214 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -15.0505964 -15.6112937 [2,] -5.6080833 -15.0505964 [3,] -13.3661219 -5.6080833 [4,] -17.1001073 -13.3661219 [5,] -2.5731197 -17.1001073 [6,] -1.0795404 -2.5731197 [7,] -1.4033177 -1.0795404 [8,] 1.7424058 -1.4033177 [9,] -2.4724174 1.7424058 [10,] 0.2035295 -2.4724174 [11,] 9.4576554 0.2035295 [12,] -5.6710127 9.4576554 [13,] -9.7370273 -5.6710127 [14,] -1.8238846 -9.7370273 [15,] -6.7515746 -1.8238846 [16,] -4.6370273 -6.7515746 [17,] -2.7687805 -4.6370273 [18,] -9.2933854 -2.7687805 [19,] -2.1785623 -9.2933854 [20,] 1.2377908 -2.1785623 [21,] -1.8799669 1.2377908 [22,] -3.7724174 -1.8799669 [23,] -3.2047223 -3.7724174 [24,] -3.8581459 -3.2047223 [25,] -5.8680782 -3.8581459 [26,] 6.8110790 -5.8680782 [27,] -7.3819232 6.8110790 [28,] -1.8496182 -7.3819232 [29,] 0.3275826 -1.8496182 [30,] -4.0567413 0.3275826 [31,] 2.2719268 -4.0567413 [32,] 5.9972340 2.2719268 [33,] 5.9734567 5.9972340 [34,] 6.0705222 5.9734567 [35,] 4.1005950 6.0705222 [36,] 0.3005950 4.1005950 [37,] -1.3122718 0.3005950 [38,] 10.3494036 -1.3122718 [39,] -1.1802427 10.3494036 [40,] 2.0501059 -1.1802427 [41,] 6.7292631 2.0501059 [42,] 4.2782223 6.7292631 [43,] 2.5352827 4.2782223 [44,] 1.5870259 2.5352827 [45,] 4.4011467 1.5870259 [46,] 5.3246481 4.4011467 [47,] 7.7610164 5.3246481 [48,] 1.8134618 7.7610164 [49,] 1.7217136 1.8134618 [50,] 4.2263286 1.7217136 [51,] 5.7678636 4.2263286 [52,] -3.3159087 5.7678636 [53,] 7.8556991 -3.3159087 [54,] 2.5610164 7.8556991 [55,] -2.4181409 2.5610164 [56,] 10.1962558 -2.4181409 [57,] 9.9035295 10.1962558 [58,] 3.8379414 9.9035295 [59,] 17.1287114 3.8379414 [60,] 2.7010214 17.1287114 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -15.0505964 -15.6112937 2 -5.6080833 -15.0505964 3 -13.3661219 -5.6080833 4 -17.1001073 -13.3661219 5 -2.5731197 -17.1001073 6 -1.0795404 -2.5731197 7 -1.4033177 -1.0795404 8 1.7424058 -1.4033177 9 -2.4724174 1.7424058 10 0.2035295 -2.4724174 11 9.4576554 0.2035295 12 -5.6710127 9.4576554 13 -9.7370273 -5.6710127 14 -1.8238846 -9.7370273 15 -6.7515746 -1.8238846 16 -4.6370273 -6.7515746 17 -2.7687805 -4.6370273 18 -9.2933854 -2.7687805 19 -2.1785623 -9.2933854 20 1.2377908 -2.1785623 21 -1.8799669 1.2377908 22 -3.7724174 -1.8799669 23 -3.2047223 -3.7724174 24 -3.8581459 -3.2047223 25 -5.8680782 -3.8581459 26 6.8110790 -5.8680782 27 -7.3819232 6.8110790 28 -1.8496182 -7.3819232 29 0.3275826 -1.8496182 30 -4.0567413 0.3275826 31 2.2719268 -4.0567413 32 5.9972340 2.2719268 33 5.9734567 5.9972340 34 6.0705222 5.9734567 35 4.1005950 6.0705222 36 0.3005950 4.1005950 37 -1.3122718 0.3005950 38 10.3494036 -1.3122718 39 -1.1802427 10.3494036 40 2.0501059 -1.1802427 41 6.7292631 2.0501059 42 4.2782223 6.7292631 43 2.5352827 4.2782223 44 1.5870259 2.5352827 45 4.4011467 1.5870259 46 5.3246481 4.4011467 47 7.7610164 5.3246481 48 1.8134618 7.7610164 49 1.7217136 1.8134618 50 4.2263286 1.7217136 51 5.7678636 4.2263286 52 -3.3159087 5.7678636 53 7.8556991 -3.3159087 54 2.5610164 7.8556991 55 -2.4181409 2.5610164 56 10.1962558 -2.4181409 57 9.9035295 10.1962558 58 3.8379414 9.9035295 59 17.1287114 3.8379414 60 2.7010214 17.1287114 > 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/7767x1258728545.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/81del1258728545.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/9n9zm1258728545.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/10wsk41258728545.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/11lj9l1258728545.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/12cahz1258728545.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/13la2z1258728545.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/14lymg1258728545.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/15o8ft1258728545.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/16mp501258728545.tab") + } > system("convert tmp/1oxvb1258728545.ps tmp/1oxvb1258728545.png") > system("convert tmp/2371k1258728545.ps tmp/2371k1258728545.png") > system("convert tmp/3z2n81258728545.ps tmp/3z2n81258728545.png") > system("convert tmp/4dyfx1258728545.ps tmp/4dyfx1258728545.png") > system("convert tmp/54b5l1258728545.ps tmp/54b5l1258728545.png") > system("convert tmp/6wzlq1258728545.ps tmp/6wzlq1258728545.png") > system("convert tmp/7767x1258728545.ps tmp/7767x1258728545.png") > system("convert tmp/81del1258728545.ps tmp/81del1258728545.png") > system("convert tmp/9n9zm1258728545.ps tmp/9n9zm1258728545.png") > system("convert tmp/10wsk41258728545.ps tmp/10wsk41258728545.png") > > > proc.time() user system elapsed 2.484 1.577 2.871