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(612613,0,611324,0,594167,0,595454,0,590865,0,589379,0,584428,0,573100,0,567456,0,569028,0,620735,0,628884,0,628232,0,612117,0,595404,0,597141,0,593408,0,590072,0,579799,0,574205,0,572775,0,572942,0,619567,0,625809,0,619916,0,587625,0,565742,0,557274,0,560576,1,548854,1,531673,1,525919,1,511038,1,498662,1,555362,1,564591,1,541657,1,527070,1,509846,1,514258,1,516922,1,507561,1,492622,1,490243,1,469357,1,477580,1,528379,1,533590,1,517945,1,506174,1,501866,1,516141,1,528222,1,532638,1,536322,1,536535,1,523597,1,536214,1,586570,1,596594,1),dim=c(2,60),dimnames=list(c('wlh','dummies'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('wlh','dummies'),1:60)) > 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 wlh dummies 1 612613 0 2 611324 0 3 594167 0 4 595454 0 5 590865 0 6 589379 0 7 584428 0 8 573100 0 9 567456 0 10 569028 0 11 620735 0 12 628884 0 13 628232 0 14 612117 0 15 595404 0 16 597141 0 17 593408 0 18 590072 0 19 579799 0 20 574205 0 21 572775 0 22 572942 0 23 619567 0 24 625809 0 25 619916 0 26 587625 0 27 565742 0 28 557274 0 29 560576 1 30 548854 1 31 531673 1 32 525919 1 33 511038 1 34 498662 1 35 555362 1 36 564591 1 37 541657 1 38 527070 1 39 509846 1 40 514258 1 41 516922 1 42 507561 1 43 492622 1 44 490243 1 45 469357 1 46 477580 1 47 528379 1 48 533590 1 49 517945 1 50 506174 1 51 501866 1 52 516141 1 53 528222 1 54 532638 1 55 536322 1 56 536535 1 57 523597 1 58 536214 1 59 586570 1 60 596594 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) dummies 593909 -68141 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -56411.1 -18553.8 -175.2 16270.4 70825.9 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 593909 4729 125.58 < 2e-16 *** dummies -68141 6476 -10.52 4.54e-15 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 25020 on 58 degrees of freedom Multiple R-squared: 0.6562, Adjusted R-squared: 0.6503 F-statistic: 110.7 on 1 and 58 DF, p-value: 4.544e-15 > 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.11038937 0.22077875 0.8896106 [2,] 0.05967425 0.11934851 0.9403257 [3,] 0.04096991 0.08193981 0.9590301 [4,] 0.05945767 0.11891534 0.9405423 [5,] 0.08619361 0.17238722 0.9138064 [6,] 0.08707604 0.17415208 0.9129240 [7,] 0.13626899 0.27253797 0.8637310 [8,] 0.23182847 0.46365693 0.7681715 [9,] 0.30119676 0.60239352 0.6988032 [10,] 0.25252527 0.50505054 0.7474747 [11,] 0.18329625 0.36659250 0.8167037 [12,] 0.12833047 0.25666095 0.8716695 [13,] 0.08740199 0.17480398 0.9125980 [14,] 0.05892949 0.11785898 0.9410705 [15,] 0.04667785 0.09335570 0.9533221 [16,] 0.04277318 0.08554637 0.9572268 [17,] 0.04003191 0.08006381 0.9599681 [18,] 0.03663405 0.07326811 0.9633659 [19,] 0.03994963 0.07989926 0.9600504 [20,] 0.05833848 0.11667696 0.9416615 [21,] 0.07338811 0.14677622 0.9266119 [22,] 0.05656212 0.11312425 0.9434379 [23,] 0.05972883 0.11945767 0.9402712 [24,] 0.07452849 0.14905698 0.9254715 [25,] 0.06641888 0.13283776 0.9335811 [26,] 0.05326233 0.10652466 0.9467377 [27,] 0.04220201 0.08440403 0.9577980 [28,] 0.03219911 0.06439822 0.9678009 [29,] 0.03041168 0.06082335 0.9695883 [30,] 0.03766538 0.07533075 0.9623346 [31,] 0.03993927 0.07987855 0.9600607 [32,] 0.05827568 0.11655136 0.9417243 [33,] 0.04418242 0.08836485 0.9558176 [34,] 0.03019442 0.06038884 0.9698056 [35,] 0.02534220 0.05068439 0.9746578 [36,] 0.01834386 0.03668773 0.9816561 [37,] 0.01216616 0.02433232 0.9878338 [38,] 0.00949640 0.01899280 0.9905036 [39,] 0.01279122 0.02558244 0.9872088 [40,] 0.01859144 0.03718287 0.9814086 [41,] 0.08827936 0.17655872 0.9117206 [42,] 0.22902904 0.45805807 0.7709710 [43,] 0.16912517 0.33825033 0.8308748 [44,] 0.11925023 0.23850047 0.8807498 [45,] 0.08899551 0.17799102 0.9110045 [46,] 0.09189799 0.18379599 0.9081020 [47,] 0.13035947 0.26071894 0.8696405 [48,] 0.12806740 0.25613480 0.8719326 [49,] 0.09739833 0.19479665 0.9026017 [50,] 0.06743887 0.13487774 0.9325611 [51,] 0.04185931 0.08371862 0.9581407 > postscript(file="/var/www/html/rcomp/tmp/14lie1261840856.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/29f1v1261840856.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/3ktgj1261840856.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/45uxw1261840856.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/5vyw21261840856.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 = 60 Frequency = 1 1 2 3 4 5 6 18703.6786 17414.6786 257.6786 1544.6786 -3044.3214 -4530.3214 7 8 9 10 11 12 -9481.3214 -20809.3214 -26453.3214 -24881.3214 26825.6786 34974.6786 13 14 15 16 17 18 34322.6786 18207.6786 1494.6786 3231.6786 -501.3214 -3837.3214 19 20 21 22 23 24 -14110.3214 -19704.3214 -21134.3214 -20967.3214 25657.6786 31899.6786 25 26 27 28 29 30 26006.6786 -6284.3214 -28167.3214 -36635.3214 34807.9375 23085.9375 31 32 33 34 35 36 5904.9375 150.9375 -14730.0625 -27106.0625 29593.9375 38822.9375 37 38 39 40 41 42 15888.9375 1301.9375 -15922.0625 -11510.0625 -8846.0625 -18207.0625 43 44 45 46 47 48 -33146.0625 -35525.0625 -56411.0625 -48188.0625 2610.9375 7821.9375 49 50 51 52 53 54 -7823.0625 -19594.0625 -23902.0625 -9627.0625 2453.9375 6869.9375 55 56 57 58 59 60 10553.9375 10766.9375 -2171.0625 10445.9375 60801.9375 70825.9375 > postscript(file="/var/www/html/rcomp/tmp/6d0sr1261840856.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 = 60 Frequency = 1 lag(myerror, k = 1) myerror 0 18703.6786 NA 1 17414.6786 18703.6786 2 257.6786 17414.6786 3 1544.6786 257.6786 4 -3044.3214 1544.6786 5 -4530.3214 -3044.3214 6 -9481.3214 -4530.3214 7 -20809.3214 -9481.3214 8 -26453.3214 -20809.3214 9 -24881.3214 -26453.3214 10 26825.6786 -24881.3214 11 34974.6786 26825.6786 12 34322.6786 34974.6786 13 18207.6786 34322.6786 14 1494.6786 18207.6786 15 3231.6786 1494.6786 16 -501.3214 3231.6786 17 -3837.3214 -501.3214 18 -14110.3214 -3837.3214 19 -19704.3214 -14110.3214 20 -21134.3214 -19704.3214 21 -20967.3214 -21134.3214 22 25657.6786 -20967.3214 23 31899.6786 25657.6786 24 26006.6786 31899.6786 25 -6284.3214 26006.6786 26 -28167.3214 -6284.3214 27 -36635.3214 -28167.3214 28 34807.9375 -36635.3214 29 23085.9375 34807.9375 30 5904.9375 23085.9375 31 150.9375 5904.9375 32 -14730.0625 150.9375 33 -27106.0625 -14730.0625 34 29593.9375 -27106.0625 35 38822.9375 29593.9375 36 15888.9375 38822.9375 37 1301.9375 15888.9375 38 -15922.0625 1301.9375 39 -11510.0625 -15922.0625 40 -8846.0625 -11510.0625 41 -18207.0625 -8846.0625 42 -33146.0625 -18207.0625 43 -35525.0625 -33146.0625 44 -56411.0625 -35525.0625 45 -48188.0625 -56411.0625 46 2610.9375 -48188.0625 47 7821.9375 2610.9375 48 -7823.0625 7821.9375 49 -19594.0625 -7823.0625 50 -23902.0625 -19594.0625 51 -9627.0625 -23902.0625 52 2453.9375 -9627.0625 53 6869.9375 2453.9375 54 10553.9375 6869.9375 55 10766.9375 10553.9375 56 -2171.0625 10766.9375 57 10445.9375 -2171.0625 58 60801.9375 10445.9375 59 70825.9375 60801.9375 60 NA 70825.9375 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 17414.6786 18703.6786 [2,] 257.6786 17414.6786 [3,] 1544.6786 257.6786 [4,] -3044.3214 1544.6786 [5,] -4530.3214 -3044.3214 [6,] -9481.3214 -4530.3214 [7,] -20809.3214 -9481.3214 [8,] -26453.3214 -20809.3214 [9,] -24881.3214 -26453.3214 [10,] 26825.6786 -24881.3214 [11,] 34974.6786 26825.6786 [12,] 34322.6786 34974.6786 [13,] 18207.6786 34322.6786 [14,] 1494.6786 18207.6786 [15,] 3231.6786 1494.6786 [16,] -501.3214 3231.6786 [17,] -3837.3214 -501.3214 [18,] -14110.3214 -3837.3214 [19,] -19704.3214 -14110.3214 [20,] -21134.3214 -19704.3214 [21,] -20967.3214 -21134.3214 [22,] 25657.6786 -20967.3214 [23,] 31899.6786 25657.6786 [24,] 26006.6786 31899.6786 [25,] -6284.3214 26006.6786 [26,] -28167.3214 -6284.3214 [27,] -36635.3214 -28167.3214 [28,] 34807.9375 -36635.3214 [29,] 23085.9375 34807.9375 [30,] 5904.9375 23085.9375 [31,] 150.9375 5904.9375 [32,] -14730.0625 150.9375 [33,] -27106.0625 -14730.0625 [34,] 29593.9375 -27106.0625 [35,] 38822.9375 29593.9375 [36,] 15888.9375 38822.9375 [37,] 1301.9375 15888.9375 [38,] -15922.0625 1301.9375 [39,] -11510.0625 -15922.0625 [40,] -8846.0625 -11510.0625 [41,] -18207.0625 -8846.0625 [42,] -33146.0625 -18207.0625 [43,] -35525.0625 -33146.0625 [44,] -56411.0625 -35525.0625 [45,] -48188.0625 -56411.0625 [46,] 2610.9375 -48188.0625 [47,] 7821.9375 2610.9375 [48,] -7823.0625 7821.9375 [49,] -19594.0625 -7823.0625 [50,] -23902.0625 -19594.0625 [51,] -9627.0625 -23902.0625 [52,] 2453.9375 -9627.0625 [53,] 6869.9375 2453.9375 [54,] 10553.9375 6869.9375 [55,] 10766.9375 10553.9375 [56,] -2171.0625 10766.9375 [57,] 10445.9375 -2171.0625 [58,] 60801.9375 10445.9375 [59,] 70825.9375 60801.9375 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 17414.6786 18703.6786 2 257.6786 17414.6786 3 1544.6786 257.6786 4 -3044.3214 1544.6786 5 -4530.3214 -3044.3214 6 -9481.3214 -4530.3214 7 -20809.3214 -9481.3214 8 -26453.3214 -20809.3214 9 -24881.3214 -26453.3214 10 26825.6786 -24881.3214 11 34974.6786 26825.6786 12 34322.6786 34974.6786 13 18207.6786 34322.6786 14 1494.6786 18207.6786 15 3231.6786 1494.6786 16 -501.3214 3231.6786 17 -3837.3214 -501.3214 18 -14110.3214 -3837.3214 19 -19704.3214 -14110.3214 20 -21134.3214 -19704.3214 21 -20967.3214 -21134.3214 22 25657.6786 -20967.3214 23 31899.6786 25657.6786 24 26006.6786 31899.6786 25 -6284.3214 26006.6786 26 -28167.3214 -6284.3214 27 -36635.3214 -28167.3214 28 34807.9375 -36635.3214 29 23085.9375 34807.9375 30 5904.9375 23085.9375 31 150.9375 5904.9375 32 -14730.0625 150.9375 33 -27106.0625 -14730.0625 34 29593.9375 -27106.0625 35 38822.9375 29593.9375 36 15888.9375 38822.9375 37 1301.9375 15888.9375 38 -15922.0625 1301.9375 39 -11510.0625 -15922.0625 40 -8846.0625 -11510.0625 41 -18207.0625 -8846.0625 42 -33146.0625 -18207.0625 43 -35525.0625 -33146.0625 44 -56411.0625 -35525.0625 45 -48188.0625 -56411.0625 46 2610.9375 -48188.0625 47 7821.9375 2610.9375 48 -7823.0625 7821.9375 49 -19594.0625 -7823.0625 50 -23902.0625 -19594.0625 51 -9627.0625 -23902.0625 52 2453.9375 -9627.0625 53 6869.9375 2453.9375 54 10553.9375 6869.9375 55 10766.9375 10553.9375 56 -2171.0625 10766.9375 57 10445.9375 -2171.0625 58 60801.9375 10445.9375 59 70825.9375 60801.9375 > 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/71y8o1261840856.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/8qmpv1261840856.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/9llua1261840856.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/107kkf1261840856.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/11rhyd1261840856.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/12qkdu1261840856.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/13n9me1261840856.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/14ht6g1261840856.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/15pxpi1261840856.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/160mdq1261840856.tab") + } > > try(system("convert tmp/14lie1261840856.ps tmp/14lie1261840856.png",intern=TRUE)) character(0) > try(system("convert tmp/29f1v1261840856.ps tmp/29f1v1261840856.png",intern=TRUE)) character(0) > try(system("convert tmp/3ktgj1261840856.ps tmp/3ktgj1261840856.png",intern=TRUE)) character(0) > try(system("convert tmp/45uxw1261840856.ps tmp/45uxw1261840856.png",intern=TRUE)) character(0) > try(system("convert tmp/5vyw21261840856.ps tmp/5vyw21261840856.png",intern=TRUE)) character(0) > try(system("convert tmp/6d0sr1261840856.ps tmp/6d0sr1261840856.png",intern=TRUE)) character(0) > try(system("convert tmp/71y8o1261840856.ps tmp/71y8o1261840856.png",intern=TRUE)) character(0) > try(system("convert tmp/8qmpv1261840856.ps tmp/8qmpv1261840856.png",intern=TRUE)) character(0) > try(system("convert tmp/9llua1261840856.ps tmp/9llua1261840856.png",intern=TRUE)) character(0) > try(system("convert tmp/107kkf1261840856.ps tmp/107kkf1261840856.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.502 1.612 11.160