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(99.9,98.8,98.6,100.5,107.2,110.4,95.7,96.4,93.7,101.9,106.7,106.2,86.7,81,95.3,94.7,99.3,101,101.8,109.4,96,102.3,91.7,90.7,95.3,96.2,96.6,96.1,107.2,106,108,103.1,98.4,102,103.1,104.7,81.1,86,96.6,92.1,103.7,106.9,106.6,112.6,97.6,101.7,87.6,92,99.4,97.4,98.5,97,105.2,105.4,104.6,102.7,97.5,98.1,108.9,104.5,86.8,87.4,88.9,89.9,110.3,109.8,114.8,111.7,94.6,98.6,92,96.9,93.8,95.1,93.8,97,107.6,112.7,101,102.9,95.4,97.4,96.5,111.4,89.2,87.4,87.1,96.8,110.5,114.1,110.8,110.3,104.2,103.9,88.9,101.6,89.8,94.6,90,95.9,93.9,104.7,91.3,102.8,87.8,98.1,99.7,113.9,73.5,80.9,79.2,95.7,96.9,113.2,95.2,105.9,95.6,108.8,89.7,102.3),dim=c(2,60),dimnames=list(c('ProdMetal','IndProd'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('ProdMetal','IndProd'),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 = '2' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.numeric > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x IndProd ProdMetal 1 98.8 99.9 2 100.5 98.6 3 110.4 107.2 4 96.4 95.7 5 101.9 93.7 6 106.2 106.7 7 81.0 86.7 8 94.7 95.3 9 101.0 99.3 10 109.4 101.8 11 102.3 96.0 12 90.7 91.7 13 96.2 95.3 14 96.1 96.6 15 106.0 107.2 16 103.1 108.0 17 102.0 98.4 18 104.7 103.1 19 86.0 81.1 20 92.1 96.6 21 106.9 103.7 22 112.6 106.6 23 101.7 97.6 24 92.0 87.6 25 97.4 99.4 26 97.0 98.5 27 105.4 105.2 28 102.7 104.6 29 98.1 97.5 30 104.5 108.9 31 87.4 86.8 32 89.9 88.9 33 109.8 110.3 34 111.7 114.8 35 98.6 94.6 36 96.9 92.0 37 95.1 93.8 38 97.0 93.8 39 112.7 107.6 40 102.9 101.0 41 97.4 95.4 42 111.4 96.5 43 87.4 89.2 44 96.8 87.1 45 114.1 110.5 46 110.3 110.8 47 103.9 104.2 48 101.6 88.9 49 94.6 89.8 50 95.9 90.0 51 104.7 93.9 52 102.8 91.3 53 98.1 87.8 54 113.9 99.7 55 80.9 73.5 56 95.7 79.2 57 113.2 96.9 58 105.9 95.2 59 108.8 95.6 60 102.3 89.7 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) ProdMetal 29.9537 0.7293 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -12.180 -3.279 -1.056 3.577 12.582 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 29.95373 7.86296 3.809 0.000339 *** ProdMetal 0.72925 0.08081 9.024 1.21e-12 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 5.153 on 58 degrees of freedom Multiple R-squared: 0.5841, Adjusted R-squared: 0.5769 F-statistic: 81.44 on 1 and 58 DF, p-value: 1.208e-12 > 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.339544752 0.679089505 0.6604552 [2,] 0.196535777 0.393071553 0.8034642 [3,] 0.428149642 0.856299285 0.5718504 [4,] 0.312406770 0.624813539 0.6875932 [5,] 0.209428695 0.418857391 0.7905713 [6,] 0.255296777 0.510593553 0.7447032 [7,] 0.258170408 0.516340817 0.7418296 [8,] 0.202517009 0.405034019 0.7974830 [9,] 0.141312006 0.282624012 0.8586880 [10,] 0.104879707 0.209759415 0.8951203 [11,] 0.097652502 0.195305004 0.9023475 [12,] 0.149543115 0.299086230 0.8504569 [13,] 0.113303332 0.226606665 0.8866967 [14,] 0.076136485 0.152272969 0.9238635 [15,] 0.063091046 0.126182091 0.9369090 [16,] 0.098754455 0.197508910 0.9012455 [17,] 0.072807939 0.145615879 0.9271921 [18,] 0.075320184 0.150640369 0.9246798 [19,] 0.055979199 0.111958397 0.9440208 [20,] 0.043465655 0.086931310 0.9565343 [21,] 0.041352016 0.082704033 0.9586480 [22,] 0.037474896 0.074949793 0.9625251 [23,] 0.025086238 0.050172475 0.9749138 [24,] 0.021040187 0.042080374 0.9789598 [25,] 0.015292034 0.030584069 0.9847080 [26,] 0.019397083 0.038794167 0.9806029 [27,] 0.020939842 0.041879685 0.9790602 [28,] 0.021578906 0.043157813 0.9784211 [29,] 0.014604567 0.029209134 0.9853954 [30,] 0.012758326 0.025516651 0.9872417 [31,] 0.009850867 0.019701734 0.9901491 [32,] 0.007838477 0.015676955 0.9921615 [33,] 0.007664416 0.015328831 0.9923356 [34,] 0.006365544 0.012731087 0.9936345 [35,] 0.005664191 0.011328383 0.9943358 [36,] 0.004488278 0.008976557 0.9955117 [37,] 0.004530759 0.009061517 0.9954692 [38,] 0.045429166 0.090858333 0.9545708 [39,] 0.170246937 0.340493874 0.8297531 [40,] 0.163904570 0.327809140 0.8360954 [41,] 0.127607571 0.255215142 0.8723924 [42,] 0.173448733 0.346897467 0.8265513 [43,] 0.575248294 0.849503412 0.4247517 [44,] 0.588437824 0.823124351 0.4115622 [45,] 0.735657152 0.528685696 0.2643428 [46,] 0.868990853 0.262018295 0.1310091 [47,] 0.849113094 0.301773812 0.1508869 [48,] 0.798515348 0.402969304 0.2014847 [49,] 0.739385918 0.521228164 0.2606141 [50,] 0.660084200 0.679831599 0.3399158 [51,] 0.805144691 0.389710618 0.1948553 > postscript(file="/var/www/html/rcomp/tmp/1gqww1260637767.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/2nxaw1260637767.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/3ln7s1260637767.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/4kzng1260637767.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/5y8d21260637767.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 -4.0059797 -1.3579524 2.2704827 -3.3431224 3.6153811 -1.5648915 7 8 9 10 11 12 -12.1798568 -4.7514217 -1.3684286 5.2084420 2.3381021 -6.1261155 13 14 15 16 17 18 -3.2514217 -4.2994490 -2.1295173 -5.6129187 0.2878979 -0.4395852 19 20 21 22 23 24 -3.0960471 -8.2994490 1.3228637 4.9080337 0.5712993 -1.8361834 25 26 27 28 29 30 -5.0413538 -4.7850273 -1.2710139 -3.5334628 -2.9557755 -4.8692453 31 32 33 34 35 36 -5.8527820 -4.8842106 -0.5901977 -1.9718305 -0.3409455 -0.1448910 37 38 39 40 41 42 -3.2575441 -1.3575441 4.2787820 -0.7081566 -2.1243469 11.0734762 43 44 45 46 47 48 -7.6029861 3.3284425 3.5639519 -0.4548236 -2.0417621 6.8157894 49 50 51 52 53 54 -0.8405372 0.3136125 6.2695307 6.2655852 4.1179663 11.2398707 55 56 57 58 59 60 -2.6537339 7.9895312 12.5817755 6.5215035 9.1298028 6.9323880 > postscript(file="/var/www/html/rcomp/tmp/67cc81260637767.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 -4.0059797 NA 1 -1.3579524 -4.0059797 2 2.2704827 -1.3579524 3 -3.3431224 2.2704827 4 3.6153811 -3.3431224 5 -1.5648915 3.6153811 6 -12.1798568 -1.5648915 7 -4.7514217 -12.1798568 8 -1.3684286 -4.7514217 9 5.2084420 -1.3684286 10 2.3381021 5.2084420 11 -6.1261155 2.3381021 12 -3.2514217 -6.1261155 13 -4.2994490 -3.2514217 14 -2.1295173 -4.2994490 15 -5.6129187 -2.1295173 16 0.2878979 -5.6129187 17 -0.4395852 0.2878979 18 -3.0960471 -0.4395852 19 -8.2994490 -3.0960471 20 1.3228637 -8.2994490 21 4.9080337 1.3228637 22 0.5712993 4.9080337 23 -1.8361834 0.5712993 24 -5.0413538 -1.8361834 25 -4.7850273 -5.0413538 26 -1.2710139 -4.7850273 27 -3.5334628 -1.2710139 28 -2.9557755 -3.5334628 29 -4.8692453 -2.9557755 30 -5.8527820 -4.8692453 31 -4.8842106 -5.8527820 32 -0.5901977 -4.8842106 33 -1.9718305 -0.5901977 34 -0.3409455 -1.9718305 35 -0.1448910 -0.3409455 36 -3.2575441 -0.1448910 37 -1.3575441 -3.2575441 38 4.2787820 -1.3575441 39 -0.7081566 4.2787820 40 -2.1243469 -0.7081566 41 11.0734762 -2.1243469 42 -7.6029861 11.0734762 43 3.3284425 -7.6029861 44 3.5639519 3.3284425 45 -0.4548236 3.5639519 46 -2.0417621 -0.4548236 47 6.8157894 -2.0417621 48 -0.8405372 6.8157894 49 0.3136125 -0.8405372 50 6.2695307 0.3136125 51 6.2655852 6.2695307 52 4.1179663 6.2655852 53 11.2398707 4.1179663 54 -2.6537339 11.2398707 55 7.9895312 -2.6537339 56 12.5817755 7.9895312 57 6.5215035 12.5817755 58 9.1298028 6.5215035 59 6.9323880 9.1298028 60 NA 6.9323880 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -1.3579524 -4.0059797 [2,] 2.2704827 -1.3579524 [3,] -3.3431224 2.2704827 [4,] 3.6153811 -3.3431224 [5,] -1.5648915 3.6153811 [6,] -12.1798568 -1.5648915 [7,] -4.7514217 -12.1798568 [8,] -1.3684286 -4.7514217 [9,] 5.2084420 -1.3684286 [10,] 2.3381021 5.2084420 [11,] -6.1261155 2.3381021 [12,] -3.2514217 -6.1261155 [13,] -4.2994490 -3.2514217 [14,] -2.1295173 -4.2994490 [15,] -5.6129187 -2.1295173 [16,] 0.2878979 -5.6129187 [17,] -0.4395852 0.2878979 [18,] -3.0960471 -0.4395852 [19,] -8.2994490 -3.0960471 [20,] 1.3228637 -8.2994490 [21,] 4.9080337 1.3228637 [22,] 0.5712993 4.9080337 [23,] -1.8361834 0.5712993 [24,] -5.0413538 -1.8361834 [25,] -4.7850273 -5.0413538 [26,] -1.2710139 -4.7850273 [27,] -3.5334628 -1.2710139 [28,] -2.9557755 -3.5334628 [29,] -4.8692453 -2.9557755 [30,] -5.8527820 -4.8692453 [31,] -4.8842106 -5.8527820 [32,] -0.5901977 -4.8842106 [33,] -1.9718305 -0.5901977 [34,] -0.3409455 -1.9718305 [35,] -0.1448910 -0.3409455 [36,] -3.2575441 -0.1448910 [37,] -1.3575441 -3.2575441 [38,] 4.2787820 -1.3575441 [39,] -0.7081566 4.2787820 [40,] -2.1243469 -0.7081566 [41,] 11.0734762 -2.1243469 [42,] -7.6029861 11.0734762 [43,] 3.3284425 -7.6029861 [44,] 3.5639519 3.3284425 [45,] -0.4548236 3.5639519 [46,] -2.0417621 -0.4548236 [47,] 6.8157894 -2.0417621 [48,] -0.8405372 6.8157894 [49,] 0.3136125 -0.8405372 [50,] 6.2695307 0.3136125 [51,] 6.2655852 6.2695307 [52,] 4.1179663 6.2655852 [53,] 11.2398707 4.1179663 [54,] -2.6537339 11.2398707 [55,] 7.9895312 -2.6537339 [56,] 12.5817755 7.9895312 [57,] 6.5215035 12.5817755 [58,] 9.1298028 6.5215035 [59,] 6.9323880 9.1298028 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -1.3579524 -4.0059797 2 2.2704827 -1.3579524 3 -3.3431224 2.2704827 4 3.6153811 -3.3431224 5 -1.5648915 3.6153811 6 -12.1798568 -1.5648915 7 -4.7514217 -12.1798568 8 -1.3684286 -4.7514217 9 5.2084420 -1.3684286 10 2.3381021 5.2084420 11 -6.1261155 2.3381021 12 -3.2514217 -6.1261155 13 -4.2994490 -3.2514217 14 -2.1295173 -4.2994490 15 -5.6129187 -2.1295173 16 0.2878979 -5.6129187 17 -0.4395852 0.2878979 18 -3.0960471 -0.4395852 19 -8.2994490 -3.0960471 20 1.3228637 -8.2994490 21 4.9080337 1.3228637 22 0.5712993 4.9080337 23 -1.8361834 0.5712993 24 -5.0413538 -1.8361834 25 -4.7850273 -5.0413538 26 -1.2710139 -4.7850273 27 -3.5334628 -1.2710139 28 -2.9557755 -3.5334628 29 -4.8692453 -2.9557755 30 -5.8527820 -4.8692453 31 -4.8842106 -5.8527820 32 -0.5901977 -4.8842106 33 -1.9718305 -0.5901977 34 -0.3409455 -1.9718305 35 -0.1448910 -0.3409455 36 -3.2575441 -0.1448910 37 -1.3575441 -3.2575441 38 4.2787820 -1.3575441 39 -0.7081566 4.2787820 40 -2.1243469 -0.7081566 41 11.0734762 -2.1243469 42 -7.6029861 11.0734762 43 3.3284425 -7.6029861 44 3.5639519 3.3284425 45 -0.4548236 3.5639519 46 -2.0417621 -0.4548236 47 6.8157894 -2.0417621 48 -0.8405372 6.8157894 49 0.3136125 -0.8405372 50 6.2695307 0.3136125 51 6.2655852 6.2695307 52 4.1179663 6.2655852 53 11.2398707 4.1179663 54 -2.6537339 11.2398707 55 7.9895312 -2.6537339 56 12.5817755 7.9895312 57 6.5215035 12.5817755 58 9.1298028 6.5215035 59 6.9323880 9.1298028 > 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/7ot5y1260637767.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/8klwv1260637767.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/9zcat1260637767.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/10qutg1260637767.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/1196vz1260637767.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/12lrbq1260637767.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/13oeem1260637767.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/14jthx1260637767.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/15v8dw1260637767.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/16frdu1260637767.tab") + } > try(system("convert tmp/1gqww1260637767.ps tmp/1gqww1260637767.png",intern=TRUE)) character(0) > try(system("convert tmp/2nxaw1260637767.ps tmp/2nxaw1260637767.png",intern=TRUE)) character(0) > try(system("convert tmp/3ln7s1260637767.ps tmp/3ln7s1260637767.png",intern=TRUE)) character(0) > try(system("convert tmp/4kzng1260637767.ps tmp/4kzng1260637767.png",intern=TRUE)) character(0) > try(system("convert tmp/5y8d21260637767.ps tmp/5y8d21260637767.png",intern=TRUE)) character(0) > try(system("convert tmp/67cc81260637767.ps tmp/67cc81260637767.png",intern=TRUE)) character(0) > try(system("convert tmp/7ot5y1260637767.ps tmp/7ot5y1260637767.png",intern=TRUE)) character(0) > try(system("convert tmp/8klwv1260637767.ps tmp/8klwv1260637767.png",intern=TRUE)) character(0) > try(system("convert tmp/9zcat1260637767.ps tmp/9zcat1260637767.png",intern=TRUE)) character(0) > try(system("convert tmp/10qutg1260637767.ps tmp/10qutg1260637767.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.483 1.570 3.054