R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(104.3,0,119.8,0,116.8,0,118.2,0,107.4,0,110.8,0,94.8,0,96.5,0,113.4,0,109.8,0,118.7,0,117.2,0,110.3,0,111.6,0,128.1,0,121.3,0,107.3,0,120.5,0,98.5,0,97.7,0,113.2,0,114.6,0,118.3,0,123.9,0,113.6,0,117.5,0,130.1,0,124.7,0,114.2,0,127.3,0,105.9,0,101.5,0,120.2,0,117.1,0,131.1,0,130,0,120.6,0,123.1,0,135.3,0,134.1,0,123.7,0,134.6,0,108.3,1,110.4,1,127.8,1,126.6,1,131.4,1,141.1,1,127,1,127.3,1,143.6,1,149.4,1,126.6,1,136.5,1,116,1,118,1,131.4,1,140.7,1,144.9,1,143.9,1,127.1,1),dim=c(2,61),dimnames=list(c('x','y'),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('x','y'),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 x y 1 104.3 0 2 119.8 0 3 116.8 0 4 118.2 0 5 107.4 0 6 110.8 0 7 94.8 0 8 96.5 0 9 113.4 0 10 109.8 0 11 118.7 0 12 117.2 0 13 110.3 0 14 111.6 0 15 128.1 0 16 121.3 0 17 107.3 0 18 120.5 0 19 98.5 0 20 97.7 0 21 113.2 0 22 114.6 0 23 118.3 0 24 123.9 0 25 113.6 0 26 117.5 0 27 130.1 0 28 124.7 0 29 114.2 0 30 127.3 0 31 105.9 0 32 101.5 0 33 120.2 0 34 117.1 0 35 131.1 0 36 130.0 0 37 120.6 0 38 123.1 0 39 135.3 0 40 134.1 0 41 123.7 0 42 134.6 0 43 108.3 1 44 110.4 1 45 127.8 1 46 126.6 1 47 131.4 1 48 141.1 1 49 127.0 1 50 127.3 1 51 143.6 1 52 149.4 1 53 126.6 1 54 136.5 1 55 116.0 1 56 118.0 1 57 131.4 1 58 140.7 1 59 144.9 1 60 143.9 1 61 127.1 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) y 116.61 13.81 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -22.1211 -5.8095 0.5905 7.2905 18.9789 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 116.610 1.683 69.296 < 2e-16 *** y 13.812 3.015 4.581 2.45e-05 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 10.91 on 59 degrees of freedom Multiple R-squared: 0.2623, Adjusted R-squared: 0.2498 F-statistic: 20.98 on 1 and 59 DF, p-value: 2.448e-05 > 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.3279120 0.6558240 0.6720880 [2,] 0.1875472 0.3750944 0.8124528 [3,] 0.4483299 0.8966598 0.5516701 [4,] 0.5374904 0.9250191 0.4625096 [5,] 0.4365838 0.8731676 0.5634162 [6,] 0.3329822 0.6659644 0.6670178 [7,] 0.3041190 0.6082380 0.6958810 [8,] 0.2506684 0.5013369 0.7493316 [9,] 0.1821341 0.3642681 0.8178659 [10,] 0.1275936 0.2551872 0.8724064 [11,] 0.2256352 0.4512704 0.7743648 [12,] 0.2033062 0.4066124 0.7966938 [13,] 0.1699542 0.3399084 0.8300458 [14,] 0.1445960 0.2891920 0.8554040 [15,] 0.2250893 0.4501786 0.7749107 [16,] 0.3480984 0.6961968 0.6519016 [17,] 0.2915915 0.5831830 0.7084085 [18,] 0.2409255 0.4818509 0.7590745 [19,] 0.2038095 0.4076189 0.7961905 [20,] 0.2043516 0.4087031 0.7956484 [21,] 0.1660918 0.3321836 0.8339082 [22,] 0.1335341 0.2670683 0.8664659 [23,] 0.1857847 0.3715694 0.8142153 [24,] 0.1750303 0.3500605 0.8249697 [25,] 0.1415600 0.2831200 0.8584400 [26,] 0.1459198 0.2918396 0.8540802 [27,] 0.1717055 0.3434111 0.8282945 [28,] 0.3068849 0.6137698 0.6931151 [29,] 0.2728861 0.5457721 0.7271139 [30,] 0.2536188 0.5072377 0.7463812 [31,] 0.2807912 0.5615823 0.7192088 [32,] 0.2848970 0.5697940 0.7151030 [33,] 0.2546330 0.5092661 0.7453670 [34,] 0.2296118 0.4592235 0.7703882 [35,] 0.2640826 0.5281652 0.7359174 [36,] 0.2759670 0.5519339 0.7240330 [37,] 0.2417331 0.4834662 0.7582669 [38,] 0.2381149 0.4762297 0.7618851 [39,] 0.3623116 0.7246233 0.6376884 [40,] 0.5335050 0.9329899 0.4664950 [41,] 0.5069911 0.9860178 0.4930089 [42,] 0.4628865 0.9257730 0.5371135 [43,] 0.3998221 0.7996443 0.6001779 [44,] 0.3968093 0.7936186 0.6031907 [45,] 0.3304940 0.6609881 0.6695060 [46,] 0.2684875 0.5369749 0.7315125 [47,] 0.2679467 0.5358933 0.7320533 [48,] 0.3982250 0.7964501 0.6017750 [49,] 0.3075928 0.6151856 0.6924072 [50,] 0.2201829 0.4403658 0.7798171 [51,] 0.3218715 0.6437430 0.6781285 [52,] 0.5532234 0.8935533 0.4467766 > postscript(file="/var/www/html/rcomp/tmp/1gr321227790574.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/20o2c1227790574.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/3ad581227790574.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/4vmf91227790574.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/5x1y81227790574.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 -12.3095238 3.1904762 0.1904762 1.5904762 -9.2095238 -5.8095238 7 8 9 10 11 12 -21.8095238 -20.1095238 -3.2095238 -6.8095238 2.0904762 0.5904762 13 14 15 16 17 18 -6.3095238 -5.0095238 11.4904762 4.6904762 -9.3095238 3.8904762 19 20 21 22 23 24 -18.1095238 -18.9095238 -3.4095238 -2.0095238 1.6904762 7.2904762 25 26 27 28 29 30 -3.0095238 0.8904762 13.4904762 8.0904762 -2.4095238 10.6904762 31 32 33 34 35 36 -10.7095238 -15.1095238 3.5904762 0.4904762 14.4904762 13.3904762 37 38 39 40 41 42 3.9904762 6.4904762 18.6904762 17.4904762 7.0904762 17.9904762 43 44 45 46 47 48 -22.1210526 -20.0210526 -2.6210526 -3.8210526 0.9789474 10.6789474 49 50 51 52 53 54 -3.4210526 -3.1210526 13.1789474 18.9789474 -3.8210526 6.0789474 55 56 57 58 59 60 -14.4210526 -12.4210526 0.9789474 10.2789474 14.4789474 13.4789474 61 -3.3210526 > postscript(file="/var/www/html/rcomp/tmp/612oo1227790574.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 -12.3095238 NA 1 3.1904762 -12.3095238 2 0.1904762 3.1904762 3 1.5904762 0.1904762 4 -9.2095238 1.5904762 5 -5.8095238 -9.2095238 6 -21.8095238 -5.8095238 7 -20.1095238 -21.8095238 8 -3.2095238 -20.1095238 9 -6.8095238 -3.2095238 10 2.0904762 -6.8095238 11 0.5904762 2.0904762 12 -6.3095238 0.5904762 13 -5.0095238 -6.3095238 14 11.4904762 -5.0095238 15 4.6904762 11.4904762 16 -9.3095238 4.6904762 17 3.8904762 -9.3095238 18 -18.1095238 3.8904762 19 -18.9095238 -18.1095238 20 -3.4095238 -18.9095238 21 -2.0095238 -3.4095238 22 1.6904762 -2.0095238 23 7.2904762 1.6904762 24 -3.0095238 7.2904762 25 0.8904762 -3.0095238 26 13.4904762 0.8904762 27 8.0904762 13.4904762 28 -2.4095238 8.0904762 29 10.6904762 -2.4095238 30 -10.7095238 10.6904762 31 -15.1095238 -10.7095238 32 3.5904762 -15.1095238 33 0.4904762 3.5904762 34 14.4904762 0.4904762 35 13.3904762 14.4904762 36 3.9904762 13.3904762 37 6.4904762 3.9904762 38 18.6904762 6.4904762 39 17.4904762 18.6904762 40 7.0904762 17.4904762 41 17.9904762 7.0904762 42 -22.1210526 17.9904762 43 -20.0210526 -22.1210526 44 -2.6210526 -20.0210526 45 -3.8210526 -2.6210526 46 0.9789474 -3.8210526 47 10.6789474 0.9789474 48 -3.4210526 10.6789474 49 -3.1210526 -3.4210526 50 13.1789474 -3.1210526 51 18.9789474 13.1789474 52 -3.8210526 18.9789474 53 6.0789474 -3.8210526 54 -14.4210526 6.0789474 55 -12.4210526 -14.4210526 56 0.9789474 -12.4210526 57 10.2789474 0.9789474 58 14.4789474 10.2789474 59 13.4789474 14.4789474 60 -3.3210526 13.4789474 61 NA -3.3210526 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 3.1904762 -12.3095238 [2,] 0.1904762 3.1904762 [3,] 1.5904762 0.1904762 [4,] -9.2095238 1.5904762 [5,] -5.8095238 -9.2095238 [6,] -21.8095238 -5.8095238 [7,] -20.1095238 -21.8095238 [8,] -3.2095238 -20.1095238 [9,] -6.8095238 -3.2095238 [10,] 2.0904762 -6.8095238 [11,] 0.5904762 2.0904762 [12,] -6.3095238 0.5904762 [13,] -5.0095238 -6.3095238 [14,] 11.4904762 -5.0095238 [15,] 4.6904762 11.4904762 [16,] -9.3095238 4.6904762 [17,] 3.8904762 -9.3095238 [18,] -18.1095238 3.8904762 [19,] -18.9095238 -18.1095238 [20,] -3.4095238 -18.9095238 [21,] -2.0095238 -3.4095238 [22,] 1.6904762 -2.0095238 [23,] 7.2904762 1.6904762 [24,] -3.0095238 7.2904762 [25,] 0.8904762 -3.0095238 [26,] 13.4904762 0.8904762 [27,] 8.0904762 13.4904762 [28,] -2.4095238 8.0904762 [29,] 10.6904762 -2.4095238 [30,] -10.7095238 10.6904762 [31,] -15.1095238 -10.7095238 [32,] 3.5904762 -15.1095238 [33,] 0.4904762 3.5904762 [34,] 14.4904762 0.4904762 [35,] 13.3904762 14.4904762 [36,] 3.9904762 13.3904762 [37,] 6.4904762 3.9904762 [38,] 18.6904762 6.4904762 [39,] 17.4904762 18.6904762 [40,] 7.0904762 17.4904762 [41,] 17.9904762 7.0904762 [42,] -22.1210526 17.9904762 [43,] -20.0210526 -22.1210526 [44,] -2.6210526 -20.0210526 [45,] -3.8210526 -2.6210526 [46,] 0.9789474 -3.8210526 [47,] 10.6789474 0.9789474 [48,] -3.4210526 10.6789474 [49,] -3.1210526 -3.4210526 [50,] 13.1789474 -3.1210526 [51,] 18.9789474 13.1789474 [52,] -3.8210526 18.9789474 [53,] 6.0789474 -3.8210526 [54,] -14.4210526 6.0789474 [55,] -12.4210526 -14.4210526 [56,] 0.9789474 -12.4210526 [57,] 10.2789474 0.9789474 [58,] 14.4789474 10.2789474 [59,] 13.4789474 14.4789474 [60,] -3.3210526 13.4789474 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 3.1904762 -12.3095238 2 0.1904762 3.1904762 3 1.5904762 0.1904762 4 -9.2095238 1.5904762 5 -5.8095238 -9.2095238 6 -21.8095238 -5.8095238 7 -20.1095238 -21.8095238 8 -3.2095238 -20.1095238 9 -6.8095238 -3.2095238 10 2.0904762 -6.8095238 11 0.5904762 2.0904762 12 -6.3095238 0.5904762 13 -5.0095238 -6.3095238 14 11.4904762 -5.0095238 15 4.6904762 11.4904762 16 -9.3095238 4.6904762 17 3.8904762 -9.3095238 18 -18.1095238 3.8904762 19 -18.9095238 -18.1095238 20 -3.4095238 -18.9095238 21 -2.0095238 -3.4095238 22 1.6904762 -2.0095238 23 7.2904762 1.6904762 24 -3.0095238 7.2904762 25 0.8904762 -3.0095238 26 13.4904762 0.8904762 27 8.0904762 13.4904762 28 -2.4095238 8.0904762 29 10.6904762 -2.4095238 30 -10.7095238 10.6904762 31 -15.1095238 -10.7095238 32 3.5904762 -15.1095238 33 0.4904762 3.5904762 34 14.4904762 0.4904762 35 13.3904762 14.4904762 36 3.9904762 13.3904762 37 6.4904762 3.9904762 38 18.6904762 6.4904762 39 17.4904762 18.6904762 40 7.0904762 17.4904762 41 17.9904762 7.0904762 42 -22.1210526 17.9904762 43 -20.0210526 -22.1210526 44 -2.6210526 -20.0210526 45 -3.8210526 -2.6210526 46 0.9789474 -3.8210526 47 10.6789474 0.9789474 48 -3.4210526 10.6789474 49 -3.1210526 -3.4210526 50 13.1789474 -3.1210526 51 18.9789474 13.1789474 52 -3.8210526 18.9789474 53 6.0789474 -3.8210526 54 -14.4210526 6.0789474 55 -12.4210526 -14.4210526 56 0.9789474 -12.4210526 57 10.2789474 0.9789474 58 14.4789474 10.2789474 59 13.4789474 14.4789474 60 -3.3210526 13.4789474 > 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/7kuzo1227790574.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/8y2701227790574.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/91l2h1227790574.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/10x2771227790574.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/11mjzu1227790574.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/12x9oe1227790574.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/139muq1227790574.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/14v1j91227790574.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/15pctl1227790574.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/16q39c1227790574.tab") + } > > system("convert tmp/1gr321227790574.ps tmp/1gr321227790574.png") > system("convert tmp/20o2c1227790574.ps tmp/20o2c1227790574.png") > system("convert tmp/3ad581227790574.ps tmp/3ad581227790574.png") > system("convert tmp/4vmf91227790574.ps tmp/4vmf91227790574.png") > system("convert tmp/5x1y81227790574.ps tmp/5x1y81227790574.png") > system("convert tmp/612oo1227790574.ps tmp/612oo1227790574.png") > system("convert tmp/7kuzo1227790574.ps tmp/7kuzo1227790574.png") > system("convert tmp/8y2701227790574.ps tmp/8y2701227790574.png") > system("convert tmp/91l2h1227790574.ps tmp/91l2h1227790574.png") > system("convert tmp/10x2771227790574.ps tmp/10x2771227790574.png") > > > proc.time() user system elapsed 2.739 1.734 3.352