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(114,106.3,113.8,107.2,113.6,107.8,113.7,109.2,114.2,109.7,114.8,108.7,115.2,109.3,115.3,110.4,114.9,111.1,115.1,110.1,116,109.5,116,109,116,108.5,115.9,108.8,115.6,109.8,116.6,110.7,116.9,110.6,117.9,111.2,117.9,112,117.7,111.1,117.4,111.6,117.3,110.2,119,111.5,119.1,110.6,119,110.6,118.5,110.3,117,111.7,117.5,113.8,118.2,113.9,118.2,114.3,118.3,113.8,118.2,114.3,117.9,116.4,117.8,115.6,118.6,115.2,118.9,113.6,120.8,115.5,121.8,115.6,121.3,115.3,121.9,117.3,122,118.7,121.9,118.3,122,120.6,122.2,119.3,123,121.8,123.1,120.8,124.9,121.6,125.4,121.6,124.7,121.1,124.4,122.4,124,121.9,125,125.1,125.1,124.5,125.4,123.5,125.7,124.9,126.4,125.2,125.7,125.7,125.4,124.5,126.4,124.7,126.2,122.9),dim=c(2,60),dimnames=list(c('x','y'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('x','y'),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 = '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 t 1 114.0 106.3 1 2 113.8 107.2 2 3 113.6 107.8 3 4 113.7 109.2 4 5 114.2 109.7 5 6 114.8 108.7 6 7 115.2 109.3 7 8 115.3 110.4 8 9 114.9 111.1 9 10 115.1 110.1 10 11 116.0 109.5 11 12 116.0 109.0 12 13 116.0 108.5 13 14 115.9 108.8 14 15 115.6 109.8 15 16 116.6 110.7 16 17 116.9 110.6 17 18 117.9 111.2 18 19 117.9 112.0 19 20 117.7 111.1 20 21 117.4 111.6 21 22 117.3 110.2 22 23 119.0 111.5 23 24 119.1 110.6 24 25 119.0 110.6 25 26 118.5 110.3 26 27 117.0 111.7 27 28 117.5 113.8 28 29 118.2 113.9 29 30 118.2 114.3 30 31 118.3 113.8 31 32 118.2 114.3 32 33 117.9 116.4 33 34 117.8 115.6 34 35 118.6 115.2 35 36 118.9 113.6 36 37 120.8 115.5 37 38 121.8 115.6 38 39 121.3 115.3 39 40 121.9 117.3 40 41 122.0 118.7 41 42 121.9 118.3 42 43 122.0 120.6 43 44 122.2 119.3 44 45 123.0 121.8 45 46 123.1 120.8 46 47 124.9 121.6 47 48 125.4 121.6 48 49 124.7 121.1 49 50 124.4 122.4 50 51 124.0 121.9 51 52 125.0 125.1 52 53 125.1 124.5 53 54 125.4 123.5 54 55 125.7 124.9 55 56 126.4 125.2 56 57 125.7 125.7 57 58 125.4 124.5 58 59 126.4 124.7 59 60 126.2 122.9 60 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) y t 88.8882 0.2274 0.1484 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -2.4251 -0.3872 0.1344 0.5151 1.7324 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 88.88822 7.61275 11.676 < 2e-16 *** y 0.22743 0.07214 3.153 0.00258 ** t 0.14842 0.02389 6.212 6.44e-08 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.8913 on 57 degrees of freedom Multiple R-squared: 0.9513, Adjusted R-squared: 0.9496 F-statistic: 557 on 2 and 57 DF, p-value: < 2.2e-16 > 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.0354089622 0.0708179244 0.964591038 [2,] 0.0109046934 0.0218093867 0.989095307 [3,] 0.0036018113 0.0072036226 0.996398189 [4,] 0.0017655042 0.0035310084 0.998234496 [5,] 0.0042213069 0.0084426138 0.995778693 [6,] 0.0013648754 0.0027297508 0.998635125 [7,] 0.0006113812 0.0012227625 0.999388619 [8,] 0.0003849975 0.0007699950 0.999615002 [9,] 0.0003010831 0.0006021663 0.999698917 [10,] 0.0005501418 0.0011002835 0.999449858 [11,] 0.0002252672 0.0004505343 0.999774733 [12,] 0.0000978705 0.0001957410 0.999902129 [13,] 0.0004458843 0.0008917685 0.999554116 [14,] 0.0004337615 0.0008675230 0.999566239 [15,] 0.0002258045 0.0004516090 0.999774195 [16,] 0.0001475391 0.0002950781 0.999852461 [17,] 0.0001334150 0.0002668300 0.999866585 [18,] 0.0005617879 0.0011235759 0.999438212 [19,] 0.0017155882 0.0034311765 0.998284412 [20,] 0.0034965293 0.0069930585 0.996503471 [21,] 0.0063879444 0.0127758887 0.993612056 [22,] 0.1020364242 0.2040728484 0.897963576 [23,] 0.1640026970 0.3280053940 0.835997303 [24,] 0.1413794693 0.2827589385 0.858620531 [25,] 0.1186411738 0.2372823475 0.881358826 [26,] 0.1012937240 0.2025874480 0.898706276 [27,] 0.0961715051 0.1923430102 0.903828495 [28,] 0.1443000596 0.2886001192 0.855699940 [29,] 0.3735165568 0.7470331136 0.626483443 [30,] 0.5465074630 0.9069850740 0.453492537 [31,] 0.7350883310 0.5298233379 0.264911669 [32,] 0.7753524973 0.4492950054 0.224647503 [33,] 0.8820328951 0.2359342099 0.117967105 [34,] 0.8646544723 0.2706910554 0.135345528 [35,] 0.8816403213 0.2367193573 0.118359679 [36,] 0.8771146420 0.2457707161 0.122885358 [37,] 0.8534084349 0.2931831302 0.146591565 [38,] 0.8782880239 0.2434239521 0.121711976 [39,] 0.9083523611 0.1832952778 0.091647639 [40,] 0.9270914089 0.1458171821 0.072908591 [41,] 0.9632751400 0.0734497201 0.036724860 [42,] 0.9681053512 0.0637892976 0.031894649 [43,] 0.9942719477 0.0114561045 0.005728052 [44,] 0.9958437328 0.0083125343 0.004156267 [45,] 0.9900808769 0.0198382461 0.009919123 [46,] 0.9823294473 0.0353411053 0.017670553 [47,] 0.9577690066 0.0844619868 0.042230993 [48,] 0.9119622434 0.1760755132 0.088037757 [49,] 0.8118893986 0.3762212027 0.188110601 > postscript(file="/var/www/html/rcomp/tmp/1h1xf1258649994.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/27qmi1258649994.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/3pqff1258649994.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/49iid1258649995.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/5yfmc1258649995.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 0.78779667 0.23469178 -0.25018480 -0.61700352 -0.37913734 0.29987035 7 8 9 10 11 12 0.41499377 0.11640335 -0.59121600 -0.31220831 0.57582831 0.54112217 13 14 15 16 17 18 0.50641602 0.18976774 -0.48607991 0.16081521 0.33513799 1.05026141 19 20 21 22 23 24 0.71989929 0.57616421 0.01403040 0.08400916 1.33993320 1.49619813 25 26 27 28 29 30 1.24777815 0.66758647 -1.29923225 -1.42525034 -0.89641309 -1.13580414 31 32 33 34 35 36 -1.07051029 -1.43264410 -2.35866219 -2.42514004 -1.68258895 -1.16712465 37 38 39 40 41 42 0.15234279 0.98118004 0.40098836 0.39771304 0.03089432 -0.12655459 43 44 45 46 47 48 -0.69805822 -0.35082223 -0.26781139 -0.08880370 1.38083419 1.73241421 49 50 51 52 53 54 0.99770806 0.25363211 -0.18107404 -0.05726257 0.03077405 0.40978175 55 56 57 58 59 60 0.24296302 0.72631474 -0.23581907 -0.41132585 0.39476864 0.45571846 > postscript(file="/var/www/html/rcomp/tmp/6y3np1258649995.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 0.78779667 NA 1 0.23469178 0.78779667 2 -0.25018480 0.23469178 3 -0.61700352 -0.25018480 4 -0.37913734 -0.61700352 5 0.29987035 -0.37913734 6 0.41499377 0.29987035 7 0.11640335 0.41499377 8 -0.59121600 0.11640335 9 -0.31220831 -0.59121600 10 0.57582831 -0.31220831 11 0.54112217 0.57582831 12 0.50641602 0.54112217 13 0.18976774 0.50641602 14 -0.48607991 0.18976774 15 0.16081521 -0.48607991 16 0.33513799 0.16081521 17 1.05026141 0.33513799 18 0.71989929 1.05026141 19 0.57616421 0.71989929 20 0.01403040 0.57616421 21 0.08400916 0.01403040 22 1.33993320 0.08400916 23 1.49619813 1.33993320 24 1.24777815 1.49619813 25 0.66758647 1.24777815 26 -1.29923225 0.66758647 27 -1.42525034 -1.29923225 28 -0.89641309 -1.42525034 29 -1.13580414 -0.89641309 30 -1.07051029 -1.13580414 31 -1.43264410 -1.07051029 32 -2.35866219 -1.43264410 33 -2.42514004 -2.35866219 34 -1.68258895 -2.42514004 35 -1.16712465 -1.68258895 36 0.15234279 -1.16712465 37 0.98118004 0.15234279 38 0.40098836 0.98118004 39 0.39771304 0.40098836 40 0.03089432 0.39771304 41 -0.12655459 0.03089432 42 -0.69805822 -0.12655459 43 -0.35082223 -0.69805822 44 -0.26781139 -0.35082223 45 -0.08880370 -0.26781139 46 1.38083419 -0.08880370 47 1.73241421 1.38083419 48 0.99770806 1.73241421 49 0.25363211 0.99770806 50 -0.18107404 0.25363211 51 -0.05726257 -0.18107404 52 0.03077405 -0.05726257 53 0.40978175 0.03077405 54 0.24296302 0.40978175 55 0.72631474 0.24296302 56 -0.23581907 0.72631474 57 -0.41132585 -0.23581907 58 0.39476864 -0.41132585 59 0.45571846 0.39476864 60 NA 0.45571846 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.23469178 0.78779667 [2,] -0.25018480 0.23469178 [3,] -0.61700352 -0.25018480 [4,] -0.37913734 -0.61700352 [5,] 0.29987035 -0.37913734 [6,] 0.41499377 0.29987035 [7,] 0.11640335 0.41499377 [8,] -0.59121600 0.11640335 [9,] -0.31220831 -0.59121600 [10,] 0.57582831 -0.31220831 [11,] 0.54112217 0.57582831 [12,] 0.50641602 0.54112217 [13,] 0.18976774 0.50641602 [14,] -0.48607991 0.18976774 [15,] 0.16081521 -0.48607991 [16,] 0.33513799 0.16081521 [17,] 1.05026141 0.33513799 [18,] 0.71989929 1.05026141 [19,] 0.57616421 0.71989929 [20,] 0.01403040 0.57616421 [21,] 0.08400916 0.01403040 [22,] 1.33993320 0.08400916 [23,] 1.49619813 1.33993320 [24,] 1.24777815 1.49619813 [25,] 0.66758647 1.24777815 [26,] -1.29923225 0.66758647 [27,] -1.42525034 -1.29923225 [28,] -0.89641309 -1.42525034 [29,] -1.13580414 -0.89641309 [30,] -1.07051029 -1.13580414 [31,] -1.43264410 -1.07051029 [32,] -2.35866219 -1.43264410 [33,] -2.42514004 -2.35866219 [34,] -1.68258895 -2.42514004 [35,] -1.16712465 -1.68258895 [36,] 0.15234279 -1.16712465 [37,] 0.98118004 0.15234279 [38,] 0.40098836 0.98118004 [39,] 0.39771304 0.40098836 [40,] 0.03089432 0.39771304 [41,] -0.12655459 0.03089432 [42,] -0.69805822 -0.12655459 [43,] -0.35082223 -0.69805822 [44,] -0.26781139 -0.35082223 [45,] -0.08880370 -0.26781139 [46,] 1.38083419 -0.08880370 [47,] 1.73241421 1.38083419 [48,] 0.99770806 1.73241421 [49,] 0.25363211 0.99770806 [50,] -0.18107404 0.25363211 [51,] -0.05726257 -0.18107404 [52,] 0.03077405 -0.05726257 [53,] 0.40978175 0.03077405 [54,] 0.24296302 0.40978175 [55,] 0.72631474 0.24296302 [56,] -0.23581907 0.72631474 [57,] -0.41132585 -0.23581907 [58,] 0.39476864 -0.41132585 [59,] 0.45571846 0.39476864 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.23469178 0.78779667 2 -0.25018480 0.23469178 3 -0.61700352 -0.25018480 4 -0.37913734 -0.61700352 5 0.29987035 -0.37913734 6 0.41499377 0.29987035 7 0.11640335 0.41499377 8 -0.59121600 0.11640335 9 -0.31220831 -0.59121600 10 0.57582831 -0.31220831 11 0.54112217 0.57582831 12 0.50641602 0.54112217 13 0.18976774 0.50641602 14 -0.48607991 0.18976774 15 0.16081521 -0.48607991 16 0.33513799 0.16081521 17 1.05026141 0.33513799 18 0.71989929 1.05026141 19 0.57616421 0.71989929 20 0.01403040 0.57616421 21 0.08400916 0.01403040 22 1.33993320 0.08400916 23 1.49619813 1.33993320 24 1.24777815 1.49619813 25 0.66758647 1.24777815 26 -1.29923225 0.66758647 27 -1.42525034 -1.29923225 28 -0.89641309 -1.42525034 29 -1.13580414 -0.89641309 30 -1.07051029 -1.13580414 31 -1.43264410 -1.07051029 32 -2.35866219 -1.43264410 33 -2.42514004 -2.35866219 34 -1.68258895 -2.42514004 35 -1.16712465 -1.68258895 36 0.15234279 -1.16712465 37 0.98118004 0.15234279 38 0.40098836 0.98118004 39 0.39771304 0.40098836 40 0.03089432 0.39771304 41 -0.12655459 0.03089432 42 -0.69805822 -0.12655459 43 -0.35082223 -0.69805822 44 -0.26781139 -0.35082223 45 -0.08880370 -0.26781139 46 1.38083419 -0.08880370 47 1.73241421 1.38083419 48 0.99770806 1.73241421 49 0.25363211 0.99770806 50 -0.18107404 0.25363211 51 -0.05726257 -0.18107404 52 0.03077405 -0.05726257 53 0.40978175 0.03077405 54 0.24296302 0.40978175 55 0.72631474 0.24296302 56 -0.23581907 0.72631474 57 -0.41132585 -0.23581907 58 0.39476864 -0.41132585 59 0.45571846 0.39476864 > 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/7lk1j1258649995.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/8pvwx1258649995.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/9bwzb1258649995.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/10zt241258649995.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/11m1et1258649995.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/12p3831258649995.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/13c6h41258649995.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/14993p1258649995.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/15pvjf1258649995.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/166lpk1258649995.tab") + } > > system("convert tmp/1h1xf1258649994.ps tmp/1h1xf1258649994.png") > system("convert tmp/27qmi1258649994.ps tmp/27qmi1258649994.png") > system("convert tmp/3pqff1258649994.ps tmp/3pqff1258649994.png") > system("convert tmp/49iid1258649995.ps tmp/49iid1258649995.png") > system("convert tmp/5yfmc1258649995.ps tmp/5yfmc1258649995.png") > system("convert tmp/6y3np1258649995.ps tmp/6y3np1258649995.png") > system("convert tmp/7lk1j1258649995.ps tmp/7lk1j1258649995.png") > system("convert tmp/8pvwx1258649995.ps tmp/8pvwx1258649995.png") > system("convert tmp/9bwzb1258649995.ps tmp/9bwzb1258649995.png") > system("convert tmp/10zt241258649995.ps tmp/10zt241258649995.png") > > > proc.time() user system elapsed 2.480 1.554 3.287