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(286602,0,283042,0,276687,0,277915,0,277128,0,277103,0,275037,0,270150,0,267140,0,264993,0,287259,0,291186,0,292300,0,288186,0,281477,0,282656,0,280190,0,280408,0,276836,0,275216,0,274352,0,271311,0,289802,0,290726,0,292300,0,278506,0,269826,0,265861,0,269034,0,264176,0,255198,0,253353,0,246057,0,235372,0,258556,0,260993,0,254663,0,250643,0,243422,0,247105,0,248541,0,245039,0,237080,0,237085,0,225554,0,226839,0,247934,0,248333,0,246969,1,245098,1,246263,1,255765,1,264319,1,268347,1,273046,1,273963,1,267430,1,271993,1,292710,1,295881,1),dim=c(2,60),dimnames=list(c('Y','X'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Y','X'),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 Y X 1 286602 0 2 283042 0 3 276687 0 4 277915 0 5 277128 0 6 277103 0 7 275037 0 8 270150 0 9 267140 0 10 264993 0 11 287259 0 12 291186 0 13 292300 0 14 288186 0 15 281477 0 16 282656 0 17 280190 0 18 280408 0 19 276836 0 20 275216 0 21 274352 0 22 271311 0 23 289802 0 24 290726 0 25 292300 0 26 278506 0 27 269826 0 28 265861 0 29 269034 0 30 264176 0 31 255198 0 32 253353 0 33 246057 0 34 235372 0 35 258556 0 36 260993 0 37 254663 0 38 250643 0 39 243422 0 40 247105 0 41 248541 0 42 245039 0 43 237080 0 44 237085 0 45 225554 0 46 226839 0 47 247934 0 48 248333 0 49 246969 1 50 245098 1 51 246263 1 52 255765 1 53 264319 1 54 268347 1 55 273046 1 56 273963 1 57 267430 1 58 271993 1 59 292710 1 60 295881 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 266232.8 582.6 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -40679 -16115 3197 12694 29066 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 266232.8 2617.0 101.7 <2e-16 *** X 582.6 5851.7 0.1 0.921 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 18130 on 58 degrees of freedom Multiple R-squared: 0.0001709, Adjusted R-squared: -0.01707 F-statistic: 0.009912 on 1 and 58 DF, p-value: 0.921 > 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,] 2.686368e-02 0.0537273596 0.9731363 [2,] 7.285634e-03 0.0145712688 0.9927144 [3,] 2.496691e-03 0.0049933816 0.9975033 [4,] 2.278275e-03 0.0045565497 0.9977217 [5,] 2.614476e-03 0.0052289524 0.9973855 [6,] 2.907297e-03 0.0058145933 0.9970927 [7,] 3.130538e-03 0.0062610770 0.9968695 [8,] 5.144040e-03 0.0102880796 0.9948560 [9,] 7.622691e-03 0.0152453821 0.9923773 [10,] 6.251462e-03 0.0125029243 0.9937485 [11,] 3.363273e-03 0.0067265454 0.9966367 [12,] 1.900090e-03 0.0038001804 0.9980999 [13,] 9.973108e-04 0.0019946215 0.9990027 [14,] 5.321048e-04 0.0010642097 0.9994679 [15,] 2.836311e-04 0.0005672622 0.9997164 [16,] 1.594414e-04 0.0003188828 0.9998406 [17,] 9.358295e-05 0.0001871659 0.9999064 [18,] 6.730704e-05 0.0001346141 0.9999327 [19,] 1.420157e-04 0.0002840314 0.9998580 [20,] 4.108982e-04 0.0008217965 0.9995891 [21,] 2.019166e-03 0.0040383319 0.9979808 [22,] 2.528665e-03 0.0050573301 0.9974713 [23,] 3.656277e-03 0.0073125537 0.9963437 [24,] 6.513632e-03 0.0130272649 0.9934864 [25,] 1.010522e-02 0.0202104356 0.9898948 [26,] 1.850294e-02 0.0370058702 0.9814971 [27,] 4.858648e-02 0.0971729507 0.9514135 [28,] 9.730850e-02 0.1946170076 0.9026915 [29,] 2.047669e-01 0.4095338749 0.7952331 [30,] 4.558064e-01 0.9116128525 0.5441936 [31,] 4.695232e-01 0.9390464820 0.5304768 [32,] 4.976249e-01 0.9952497196 0.5023751 [33,] 5.177703e-01 0.9644594131 0.4822297 [34,] 5.370184e-01 0.9259632951 0.4629816 [35,] 5.700745e-01 0.8598510006 0.4299255 [36,] 5.737776e-01 0.8524448330 0.4262224 [37,] 5.710196e-01 0.8579608071 0.4289804 [38,] 5.662299e-01 0.8675401533 0.4337701 [39,] 5.766034e-01 0.8467931908 0.4233966 [40,] 5.700889e-01 0.8598222753 0.4299111 [41,] 6.460031e-01 0.7079937194 0.3539969 [42,] 7.150046e-01 0.5699907899 0.2849954 [43,] 6.433403e-01 0.7133194539 0.3566597 [44,] 5.612680e-01 0.8774639073 0.4387320 [45,] 5.709062e-01 0.8581875838 0.4290938 [46,] 6.441132e-01 0.7117736681 0.3558868 [47,] 7.662048e-01 0.4675903159 0.2337952 [48,] 8.027744e-01 0.3944511769 0.1972256 [49,] 7.661497e-01 0.4677005815 0.2338503 [50,] 6.898631e-01 0.6202738948 0.3101369 [51,] 5.529317e-01 0.8941365517 0.4470683 > postscript(file="/var/www/html/rcomp/tmp/1tslq1258641859.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/2zzjx1258641859.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/30vhb1258641859.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/47b8i1258641859.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/5qapu1258641859.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 20369.2500 16809.2500 10454.2500 11682.2500 10895.2500 10870.2500 7 8 9 10 11 12 8804.2500 3917.2500 907.2500 -1239.7500 21026.2500 24953.2500 13 14 15 16 17 18 26067.2500 21953.2500 15244.2500 16423.2500 13957.2500 14175.2500 19 20 21 22 23 24 10603.2500 8983.2500 8119.2500 5078.2500 23569.2500 24493.2500 25 26 27 28 29 30 26067.2500 12273.2500 3593.2500 -371.7500 2801.2500 -2056.7500 31 32 33 34 35 36 -11034.7500 -12879.7500 -20175.7500 -30860.7500 -7676.7500 -5239.7500 37 38 39 40 41 42 -11569.7500 -15589.7500 -22810.7500 -19127.7500 -17691.7500 -21193.7500 43 44 45 46 47 48 -29152.7500 -29147.7500 -40678.7500 -39393.7500 -18298.7500 -17899.7500 49 50 51 52 53 54 -19846.3333 -21717.3333 -20552.3333 -11050.3333 -2496.3333 1531.6667 55 56 57 58 59 60 6230.6667 7147.6667 614.6667 5177.6667 25894.6667 29065.6667 > postscript(file="/var/www/html/rcomp/tmp/6453d1258641859.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 20369.2500 NA 1 16809.2500 20369.2500 2 10454.2500 16809.2500 3 11682.2500 10454.2500 4 10895.2500 11682.2500 5 10870.2500 10895.2500 6 8804.2500 10870.2500 7 3917.2500 8804.2500 8 907.2500 3917.2500 9 -1239.7500 907.2500 10 21026.2500 -1239.7500 11 24953.2500 21026.2500 12 26067.2500 24953.2500 13 21953.2500 26067.2500 14 15244.2500 21953.2500 15 16423.2500 15244.2500 16 13957.2500 16423.2500 17 14175.2500 13957.2500 18 10603.2500 14175.2500 19 8983.2500 10603.2500 20 8119.2500 8983.2500 21 5078.2500 8119.2500 22 23569.2500 5078.2500 23 24493.2500 23569.2500 24 26067.2500 24493.2500 25 12273.2500 26067.2500 26 3593.2500 12273.2500 27 -371.7500 3593.2500 28 2801.2500 -371.7500 29 -2056.7500 2801.2500 30 -11034.7500 -2056.7500 31 -12879.7500 -11034.7500 32 -20175.7500 -12879.7500 33 -30860.7500 -20175.7500 34 -7676.7500 -30860.7500 35 -5239.7500 -7676.7500 36 -11569.7500 -5239.7500 37 -15589.7500 -11569.7500 38 -22810.7500 -15589.7500 39 -19127.7500 -22810.7500 40 -17691.7500 -19127.7500 41 -21193.7500 -17691.7500 42 -29152.7500 -21193.7500 43 -29147.7500 -29152.7500 44 -40678.7500 -29147.7500 45 -39393.7500 -40678.7500 46 -18298.7500 -39393.7500 47 -17899.7500 -18298.7500 48 -19846.3333 -17899.7500 49 -21717.3333 -19846.3333 50 -20552.3333 -21717.3333 51 -11050.3333 -20552.3333 52 -2496.3333 -11050.3333 53 1531.6667 -2496.3333 54 6230.6667 1531.6667 55 7147.6667 6230.6667 56 614.6667 7147.6667 57 5177.6667 614.6667 58 25894.6667 5177.6667 59 29065.6667 25894.6667 60 NA 29065.6667 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 16809.2500 20369.2500 [2,] 10454.2500 16809.2500 [3,] 11682.2500 10454.2500 [4,] 10895.2500 11682.2500 [5,] 10870.2500 10895.2500 [6,] 8804.2500 10870.2500 [7,] 3917.2500 8804.2500 [8,] 907.2500 3917.2500 [9,] -1239.7500 907.2500 [10,] 21026.2500 -1239.7500 [11,] 24953.2500 21026.2500 [12,] 26067.2500 24953.2500 [13,] 21953.2500 26067.2500 [14,] 15244.2500 21953.2500 [15,] 16423.2500 15244.2500 [16,] 13957.2500 16423.2500 [17,] 14175.2500 13957.2500 [18,] 10603.2500 14175.2500 [19,] 8983.2500 10603.2500 [20,] 8119.2500 8983.2500 [21,] 5078.2500 8119.2500 [22,] 23569.2500 5078.2500 [23,] 24493.2500 23569.2500 [24,] 26067.2500 24493.2500 [25,] 12273.2500 26067.2500 [26,] 3593.2500 12273.2500 [27,] -371.7500 3593.2500 [28,] 2801.2500 -371.7500 [29,] -2056.7500 2801.2500 [30,] -11034.7500 -2056.7500 [31,] -12879.7500 -11034.7500 [32,] -20175.7500 -12879.7500 [33,] -30860.7500 -20175.7500 [34,] -7676.7500 -30860.7500 [35,] -5239.7500 -7676.7500 [36,] -11569.7500 -5239.7500 [37,] -15589.7500 -11569.7500 [38,] -22810.7500 -15589.7500 [39,] -19127.7500 -22810.7500 [40,] -17691.7500 -19127.7500 [41,] -21193.7500 -17691.7500 [42,] -29152.7500 -21193.7500 [43,] -29147.7500 -29152.7500 [44,] -40678.7500 -29147.7500 [45,] -39393.7500 -40678.7500 [46,] -18298.7500 -39393.7500 [47,] -17899.7500 -18298.7500 [48,] -19846.3333 -17899.7500 [49,] -21717.3333 -19846.3333 [50,] -20552.3333 -21717.3333 [51,] -11050.3333 -20552.3333 [52,] -2496.3333 -11050.3333 [53,] 1531.6667 -2496.3333 [54,] 6230.6667 1531.6667 [55,] 7147.6667 6230.6667 [56,] 614.6667 7147.6667 [57,] 5177.6667 614.6667 [58,] 25894.6667 5177.6667 [59,] 29065.6667 25894.6667 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 16809.2500 20369.2500 2 10454.2500 16809.2500 3 11682.2500 10454.2500 4 10895.2500 11682.2500 5 10870.2500 10895.2500 6 8804.2500 10870.2500 7 3917.2500 8804.2500 8 907.2500 3917.2500 9 -1239.7500 907.2500 10 21026.2500 -1239.7500 11 24953.2500 21026.2500 12 26067.2500 24953.2500 13 21953.2500 26067.2500 14 15244.2500 21953.2500 15 16423.2500 15244.2500 16 13957.2500 16423.2500 17 14175.2500 13957.2500 18 10603.2500 14175.2500 19 8983.2500 10603.2500 20 8119.2500 8983.2500 21 5078.2500 8119.2500 22 23569.2500 5078.2500 23 24493.2500 23569.2500 24 26067.2500 24493.2500 25 12273.2500 26067.2500 26 3593.2500 12273.2500 27 -371.7500 3593.2500 28 2801.2500 -371.7500 29 -2056.7500 2801.2500 30 -11034.7500 -2056.7500 31 -12879.7500 -11034.7500 32 -20175.7500 -12879.7500 33 -30860.7500 -20175.7500 34 -7676.7500 -30860.7500 35 -5239.7500 -7676.7500 36 -11569.7500 -5239.7500 37 -15589.7500 -11569.7500 38 -22810.7500 -15589.7500 39 -19127.7500 -22810.7500 40 -17691.7500 -19127.7500 41 -21193.7500 -17691.7500 42 -29152.7500 -21193.7500 43 -29147.7500 -29152.7500 44 -40678.7500 -29147.7500 45 -39393.7500 -40678.7500 46 -18298.7500 -39393.7500 47 -17899.7500 -18298.7500 48 -19846.3333 -17899.7500 49 -21717.3333 -19846.3333 50 -20552.3333 -21717.3333 51 -11050.3333 -20552.3333 52 -2496.3333 -11050.3333 53 1531.6667 -2496.3333 54 6230.6667 1531.6667 55 7147.6667 6230.6667 56 614.6667 7147.6667 57 5177.6667 614.6667 58 25894.6667 5177.6667 59 29065.6667 25894.6667 > 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/7ne431258641860.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/8tg2c1258641860.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/9eckc1258641860.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/102sfv1258641860.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/11q9511258641860.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/12alo01258641860.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/13hcjs1258641860.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/149hp41258641860.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/15u13e1258641860.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/16iymp1258641860.tab") + } > > system("convert tmp/1tslq1258641859.ps tmp/1tslq1258641859.png") > system("convert tmp/2zzjx1258641859.ps tmp/2zzjx1258641859.png") > system("convert tmp/30vhb1258641859.ps tmp/30vhb1258641859.png") > system("convert tmp/47b8i1258641859.ps tmp/47b8i1258641859.png") > system("convert tmp/5qapu1258641859.ps tmp/5qapu1258641859.png") > system("convert tmp/6453d1258641859.ps tmp/6453d1258641859.png") > system("convert tmp/7ne431258641860.ps tmp/7ne431258641860.png") > system("convert tmp/8tg2c1258641860.ps tmp/8tg2c1258641860.png") > system("convert tmp/9eckc1258641860.ps tmp/9eckc1258641860.png") > system("convert tmp/102sfv1258641860.ps tmp/102sfv1258641860.png") > > > proc.time() user system elapsed 2.455 1.593 4.193