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,1,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('nwwmb','dummy_variable'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('nwwmb','dummy_variable'),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 nwwmb dummy_variable 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 1 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) dummy_variable 266614 -1220 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -41060 -16243 3083 12313 30487 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 266614 2644 100.844 <2e-16 *** dummy_variable -1220 5680 -0.215 0.83 --- 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.0007948, Adjusted R-squared: -0.01643 F-statistic: 0.04614 on 1 and 58 DF, p-value: 0.8307 > 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.676862e-02 0.0535372406 0.9732314 [2,] 7.243317e-03 0.0144866341 0.9927567 [3,] 2.475713e-03 0.0049514268 0.9975243 [4,] 2.254086e-03 0.0045081716 0.9977459 [5,] 2.581898e-03 0.0051637962 0.9974181 [6,] 2.866717e-03 0.0057334333 0.9971333 [7,] 3.067847e-03 0.0061356935 0.9969322 [8,] 5.001696e-03 0.0100033914 0.9949983 [9,] 7.341920e-03 0.0146838396 0.9926581 [10,] 5.954717e-03 0.0119094337 0.9940453 [11,] 3.166384e-03 0.0063327675 0.9968336 [12,] 1.764018e-03 0.0035280362 0.9982360 [13,] 9.120135e-04 0.0018240271 0.9990880 [14,] 4.782011e-04 0.0009564022 0.9995218 [15,] 2.505427e-04 0.0005010853 0.9997495 [16,] 1.383590e-04 0.0002767179 0.9998616 [17,] 7.969623e-05 0.0001593925 0.9999203 [18,] 5.636255e-05 0.0001127251 0.9999436 [19,] 1.147399e-04 0.0002294798 0.9998853 [20,] 3.181224e-04 0.0006362447 0.9996819 [21,] 1.487128e-03 0.0029742554 0.9985129 [22,] 1.779649e-03 0.0035592982 0.9982204 [23,] 2.513539e-03 0.0050270770 0.9974865 [24,] 4.445936e-03 0.0088918723 0.9955541 [25,] 6.763806e-03 0.0135276115 0.9932362 [26,] 1.242750e-02 0.0248550006 0.9875725 [27,] 3.426132e-02 0.0685226357 0.9657387 [28,] 7.181498e-02 0.1436299553 0.9281850 [29,] 1.609109e-01 0.3218218276 0.8390891 [30,] 3.890761e-01 0.7781522142 0.6109239 [31,] 4.017262e-01 0.8034524313 0.5982738 [32,] 4.283817e-01 0.8567633986 0.5716183 [33,] 4.500077e-01 0.9000153167 0.5499923 [34,] 4.722223e-01 0.9444446191 0.5277777 [35,] 5.080018e-01 0.9839964991 0.4919982 [36,] 5.161589e-01 0.9676822030 0.4838411 [37,] 5.204484e-01 0.9591032759 0.4795516 [38,] 5.239023e-01 0.9521953605 0.4760977 [39,] 5.368748e-01 0.9262503826 0.4631252 [40,] 5.336029e-01 0.9327941300 0.4663971 [41,] 5.906877e-01 0.8186245506 0.4093123 [42,] 6.434415e-01 0.7131169389 0.3565585 [43,] 5.676389e-01 0.8647221442 0.4323611 [44,] 5.453434e-01 0.9093131099 0.4546566 [45,] 5.558521e-01 0.8882957697 0.4441479 [46,] 6.310055e-01 0.7379889294 0.3689945 [47,] 7.566524e-01 0.4866952275 0.2433476 [48,] 7.949695e-01 0.4100609278 0.2050305 [49,] 7.585770e-01 0.4828459130 0.2414230 [50,] 6.825582e-01 0.6348836861 0.3174418 [51,] 5.464316e-01 0.9071367919 0.4535684 > postscript(file="/var/www/html/rcomp/tmp/1b0661258674070.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/20t171258674070.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/3sk1d1258674070.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/4p6h81258674070.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/5aanz1258674070.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 19988.4043 16428.4043 10073.4043 11301.4043 10514.4043 10489.4043 7 8 9 10 11 12 8423.4043 3536.4043 526.4043 -1620.5957 20645.4043 24572.4043 13 14 15 16 17 18 25686.4043 21572.4043 14863.4043 16042.4043 13576.4043 13794.4043 19 20 21 22 23 24 10222.4043 8602.4043 7738.4043 4697.4043 23188.4043 24112.4043 25 26 27 28 29 30 25686.4043 11892.4043 3212.4043 -752.5957 2420.4043 -2437.5957 31 32 33 34 35 36 -11415.5957 -13260.5957 -20556.5957 -31241.5957 -8057.5957 -5620.5957 37 38 39 40 41 42 -11950.5957 -15970.5957 -23191.5957 -19508.5957 -18072.5957 -21574.5957 43 44 45 46 47 48 -29533.5957 -29528.5957 -41059.5957 -39774.5957 -18679.5957 -17060.6154 49 50 51 52 53 54 -18424.6154 -20295.6154 -19130.6154 -9628.6154 -1074.6154 2953.3846 55 56 57 58 59 60 7652.3846 8569.3846 2036.3846 6599.3846 27316.3846 30487.3846 > postscript(file="/var/www/html/rcomp/tmp/6ud9i1258674070.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 19988.4043 NA 1 16428.4043 19988.4043 2 10073.4043 16428.4043 3 11301.4043 10073.4043 4 10514.4043 11301.4043 5 10489.4043 10514.4043 6 8423.4043 10489.4043 7 3536.4043 8423.4043 8 526.4043 3536.4043 9 -1620.5957 526.4043 10 20645.4043 -1620.5957 11 24572.4043 20645.4043 12 25686.4043 24572.4043 13 21572.4043 25686.4043 14 14863.4043 21572.4043 15 16042.4043 14863.4043 16 13576.4043 16042.4043 17 13794.4043 13576.4043 18 10222.4043 13794.4043 19 8602.4043 10222.4043 20 7738.4043 8602.4043 21 4697.4043 7738.4043 22 23188.4043 4697.4043 23 24112.4043 23188.4043 24 25686.4043 24112.4043 25 11892.4043 25686.4043 26 3212.4043 11892.4043 27 -752.5957 3212.4043 28 2420.4043 -752.5957 29 -2437.5957 2420.4043 30 -11415.5957 -2437.5957 31 -13260.5957 -11415.5957 32 -20556.5957 -13260.5957 33 -31241.5957 -20556.5957 34 -8057.5957 -31241.5957 35 -5620.5957 -8057.5957 36 -11950.5957 -5620.5957 37 -15970.5957 -11950.5957 38 -23191.5957 -15970.5957 39 -19508.5957 -23191.5957 40 -18072.5957 -19508.5957 41 -21574.5957 -18072.5957 42 -29533.5957 -21574.5957 43 -29528.5957 -29533.5957 44 -41059.5957 -29528.5957 45 -39774.5957 -41059.5957 46 -18679.5957 -39774.5957 47 -17060.6154 -18679.5957 48 -18424.6154 -17060.6154 49 -20295.6154 -18424.6154 50 -19130.6154 -20295.6154 51 -9628.6154 -19130.6154 52 -1074.6154 -9628.6154 53 2953.3846 -1074.6154 54 7652.3846 2953.3846 55 8569.3846 7652.3846 56 2036.3846 8569.3846 57 6599.3846 2036.3846 58 27316.3846 6599.3846 59 30487.3846 27316.3846 60 NA 30487.3846 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 16428.4043 19988.4043 [2,] 10073.4043 16428.4043 [3,] 11301.4043 10073.4043 [4,] 10514.4043 11301.4043 [5,] 10489.4043 10514.4043 [6,] 8423.4043 10489.4043 [7,] 3536.4043 8423.4043 [8,] 526.4043 3536.4043 [9,] -1620.5957 526.4043 [10,] 20645.4043 -1620.5957 [11,] 24572.4043 20645.4043 [12,] 25686.4043 24572.4043 [13,] 21572.4043 25686.4043 [14,] 14863.4043 21572.4043 [15,] 16042.4043 14863.4043 [16,] 13576.4043 16042.4043 [17,] 13794.4043 13576.4043 [18,] 10222.4043 13794.4043 [19,] 8602.4043 10222.4043 [20,] 7738.4043 8602.4043 [21,] 4697.4043 7738.4043 [22,] 23188.4043 4697.4043 [23,] 24112.4043 23188.4043 [24,] 25686.4043 24112.4043 [25,] 11892.4043 25686.4043 [26,] 3212.4043 11892.4043 [27,] -752.5957 3212.4043 [28,] 2420.4043 -752.5957 [29,] -2437.5957 2420.4043 [30,] -11415.5957 -2437.5957 [31,] -13260.5957 -11415.5957 [32,] -20556.5957 -13260.5957 [33,] -31241.5957 -20556.5957 [34,] -8057.5957 -31241.5957 [35,] -5620.5957 -8057.5957 [36,] -11950.5957 -5620.5957 [37,] -15970.5957 -11950.5957 [38,] -23191.5957 -15970.5957 [39,] -19508.5957 -23191.5957 [40,] -18072.5957 -19508.5957 [41,] -21574.5957 -18072.5957 [42,] -29533.5957 -21574.5957 [43,] -29528.5957 -29533.5957 [44,] -41059.5957 -29528.5957 [45,] -39774.5957 -41059.5957 [46,] -18679.5957 -39774.5957 [47,] -17060.6154 -18679.5957 [48,] -18424.6154 -17060.6154 [49,] -20295.6154 -18424.6154 [50,] -19130.6154 -20295.6154 [51,] -9628.6154 -19130.6154 [52,] -1074.6154 -9628.6154 [53,] 2953.3846 -1074.6154 [54,] 7652.3846 2953.3846 [55,] 8569.3846 7652.3846 [56,] 2036.3846 8569.3846 [57,] 6599.3846 2036.3846 [58,] 27316.3846 6599.3846 [59,] 30487.3846 27316.3846 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 16428.4043 19988.4043 2 10073.4043 16428.4043 3 11301.4043 10073.4043 4 10514.4043 11301.4043 5 10489.4043 10514.4043 6 8423.4043 10489.4043 7 3536.4043 8423.4043 8 526.4043 3536.4043 9 -1620.5957 526.4043 10 20645.4043 -1620.5957 11 24572.4043 20645.4043 12 25686.4043 24572.4043 13 21572.4043 25686.4043 14 14863.4043 21572.4043 15 16042.4043 14863.4043 16 13576.4043 16042.4043 17 13794.4043 13576.4043 18 10222.4043 13794.4043 19 8602.4043 10222.4043 20 7738.4043 8602.4043 21 4697.4043 7738.4043 22 23188.4043 4697.4043 23 24112.4043 23188.4043 24 25686.4043 24112.4043 25 11892.4043 25686.4043 26 3212.4043 11892.4043 27 -752.5957 3212.4043 28 2420.4043 -752.5957 29 -2437.5957 2420.4043 30 -11415.5957 -2437.5957 31 -13260.5957 -11415.5957 32 -20556.5957 -13260.5957 33 -31241.5957 -20556.5957 34 -8057.5957 -31241.5957 35 -5620.5957 -8057.5957 36 -11950.5957 -5620.5957 37 -15970.5957 -11950.5957 38 -23191.5957 -15970.5957 39 -19508.5957 -23191.5957 40 -18072.5957 -19508.5957 41 -21574.5957 -18072.5957 42 -29533.5957 -21574.5957 43 -29528.5957 -29533.5957 44 -41059.5957 -29528.5957 45 -39774.5957 -41059.5957 46 -18679.5957 -39774.5957 47 -17060.6154 -18679.5957 48 -18424.6154 -17060.6154 49 -20295.6154 -18424.6154 50 -19130.6154 -20295.6154 51 -9628.6154 -19130.6154 52 -1074.6154 -9628.6154 53 2953.3846 -1074.6154 54 7652.3846 2953.3846 55 8569.3846 7652.3846 56 2036.3846 8569.3846 57 6599.3846 2036.3846 58 27316.3846 6599.3846 59 30487.3846 27316.3846 > 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/7unzi1258674070.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/8ncn51258674070.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/9d11c1258674070.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/1048951258674070.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/114pp21258674070.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/12vch31258674070.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/13ikbo1258674070.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/14hrog1258674070.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/15vd8w1258674070.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/16rnde1258674070.tab") + } > > system("convert tmp/1b0661258674070.ps tmp/1b0661258674070.png") > system("convert tmp/20t171258674070.ps tmp/20t171258674070.png") > system("convert tmp/3sk1d1258674070.ps tmp/3sk1d1258674070.png") > system("convert tmp/4p6h81258674070.ps tmp/4p6h81258674070.png") > system("convert tmp/5aanz1258674070.ps tmp/5aanz1258674070.png") > system("convert tmp/6ud9i1258674070.ps tmp/6ud9i1258674070.png") > system("convert tmp/7unzi1258674070.ps tmp/7unzi1258674070.png") > system("convert tmp/8ncn51258674070.ps tmp/8ncn51258674070.png") > system("convert tmp/9d11c1258674070.ps tmp/9d11c1258674070.png") > system("convert tmp/1048951258674070.ps tmp/1048951258674070.png") > > > proc.time() user system elapsed 2.512 1.599 2.923