R version 2.7.0 (2008-04-22) 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(94.7,0,101.8,0,102.5,0,105.3,0,110.3,0,109.8,0,117.3,0,118.8,0,131.3,0,125.9,0,133.1,0,147,0,145.8,0,164.4,0,149.8,0,137.7,0,151.7,0,156.8,0,180,0,180.4,0,170.4,0,191.6,0,199.5,0,218.2,1,217.5,1,205,1,194,1,199.3,1,219.3,1,211.1,1,215.2,1,240.2,1,242.2,1,240.7,1,255.4,1,253,1,218.2,1,203.7,1,205.6,1,215.6,1,188.5,1,202.9,1,214,1,230.3,1,230,1,241,1,259.6,1,247.8,1,270.3,1,289.7,1,322.7,1,315,1,320.2,1,329.5,1,360.6,1,382.2,1,435.4,1,464,1,468.8,1,403,1,351.6,1),dim=c(2,61),dimnames=list(c('Y','D'),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('Y','D'),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 Y D 1 94.7 0 2 101.8 0 3 102.5 0 4 105.3 0 5 110.3 0 6 109.8 0 7 117.3 0 8 118.8 0 9 131.3 0 10 125.9 0 11 133.1 0 12 147.0 0 13 145.8 0 14 164.4 0 15 149.8 0 16 137.7 0 17 151.7 0 18 156.8 0 19 180.0 0 20 180.4 0 21 170.4 0 22 191.6 0 23 199.5 0 24 218.2 1 25 217.5 1 26 205.0 1 27 194.0 1 28 199.3 1 29 219.3 1 30 211.1 1 31 215.2 1 32 240.2 1 33 242.2 1 34 240.7 1 35 255.4 1 36 253.0 1 37 218.2 1 38 203.7 1 39 205.6 1 40 215.6 1 41 188.5 1 42 202.9 1 43 214.0 1 44 230.3 1 45 230.0 1 46 241.0 1 47 259.6 1 48 247.8 1 49 270.3 1 50 289.7 1 51 322.7 1 52 315.0 1 53 320.2 1 54 329.5 1 55 360.6 1 56 382.2 1 57 435.4 1 58 464.0 1 59 468.8 1 60 403.0 1 61 351.6 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) D 140.3 130.3 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -82.06 -45.56 -17.56 30.14 198.24 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 140.3 13.5 10.391 6.00e-15 *** D 130.3 17.1 7.619 2.41e-10 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 64.73 on 59 degrees of freedom Multiple R-squared: 0.496, Adjusted R-squared: 0.4874 F-statistic: 58.05 on 1 and 59 DF, p-value: 2.415e-10 > 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,] 1.337948e-03 2.675896e-03 0.9986621 [2,] 1.827227e-04 3.654453e-04 0.9998173 [3,] 7.323850e-05 1.464770e-04 0.9999268 [4,] 2.309652e-05 4.619304e-05 0.9999769 [5,] 3.306753e-05 6.613506e-05 0.9999669 [6,] 1.158286e-05 2.316571e-05 0.9999884 [7,] 6.930149e-06 1.386030e-05 0.9999931 [8,] 1.284746e-05 2.569491e-05 0.9999872 [9,] 1.083497e-05 2.166993e-05 0.9999892 [10,] 3.013001e-05 6.026001e-05 0.9999699 [11,] 1.747697e-05 3.495394e-05 0.9999825 [12,] 6.023414e-06 1.204683e-05 0.9999940 [13,] 3.354848e-06 6.709697e-06 0.9999966 [14,] 2.198583e-06 4.397167e-06 0.9999978 [15,] 5.163582e-06 1.032716e-05 0.9999948 [16,] 7.709946e-06 1.541989e-05 0.9999923 [17,] 5.647548e-06 1.129510e-05 0.9999944 [18,] 9.677126e-06 1.935425e-05 0.9999903 [19,] 1.775156e-05 3.550312e-05 0.9999822 [20,] 7.353411e-06 1.470682e-05 0.9999926 [21,] 3.009156e-06 6.018312e-06 0.9999970 [22,] 1.375413e-06 2.750825e-06 0.9999986 [23,] 7.501923e-07 1.500385e-06 0.9999992 [24,] 3.643004e-07 7.286009e-07 0.9999996 [25,] 1.597261e-07 3.194522e-07 0.9999998 [26,] 7.048772e-08 1.409754e-07 0.9999999 [27,] 3.103236e-08 6.206471e-08 1.0000000 [28,] 1.767233e-08 3.534466e-08 1.0000000 [29,] 9.632056e-09 1.926411e-08 1.0000000 [30,] 4.758838e-09 9.517675e-09 1.0000000 [31,] 3.154601e-09 6.309201e-09 1.0000000 [32,] 1.753457e-09 3.506915e-09 1.0000000 [33,] 8.532572e-10 1.706514e-09 1.0000000 [34,] 6.671648e-10 1.334330e-09 1.0000000 [35,] 5.444235e-10 1.088847e-09 1.0000000 [36,] 3.759335e-10 7.518669e-10 1.0000000 [37,] 1.040836e-09 2.081672e-09 1.0000000 [38,] 1.872359e-09 3.744719e-09 1.0000000 [39,] 3.147710e-09 6.295421e-09 1.0000000 [40,] 4.983816e-09 9.967631e-09 1.0000000 [41,] 1.198247e-08 2.396495e-08 1.0000000 [42,] 3.758335e-08 7.516669e-08 1.0000000 [43,] 1.494782e-07 2.989564e-07 0.9999999 [44,] 1.250500e-06 2.501000e-06 0.9999987 [45,] 1.245292e-05 2.490584e-05 0.9999875 [46,] 1.305819e-04 2.611638e-04 0.9998694 [47,] 9.717450e-04 1.943490e-03 0.9990283 [48,] 4.963199e-03 9.926398e-03 0.9950368 [49,] 2.199338e-02 4.398675e-02 0.9780066 [50,] 8.183188e-02 1.636638e-01 0.9181681 [51,] 1.522134e-01 3.044267e-01 0.8477866 [52,] 1.834770e-01 3.669540e-01 0.8165230 > postscript(file="/var/www/html/rcomp/tmp/1vm1h1227547857.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/2ffm41227547857.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/3gla21227547857.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/4lics1227547857.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/55ua41227547857.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 -45.5565217 -38.4565217 -37.7565217 -34.9565217 -29.9565217 -30.4565217 7 8 9 10 11 12 -22.9565217 -21.4565217 -8.9565217 -14.3565217 -7.1565217 6.7434783 13 14 15 16 17 18 5.5434783 24.1434783 9.5434783 -2.5565217 11.4434783 16.5434783 19 20 21 22 23 24 39.7434783 40.1434783 30.1434783 51.3434783 59.2434783 -52.3605263 25 26 27 28 29 30 -53.0605263 -65.5605263 -76.5605263 -71.2605263 -51.2605263 -59.4605263 31 32 33 34 35 36 -55.3605263 -30.3605263 -28.3605263 -29.8605263 -15.1605263 -17.5605263 37 38 39 40 41 42 -52.3605263 -66.8605263 -64.9605263 -54.9605263 -82.0605263 -67.6605263 43 44 45 46 47 48 -56.5605263 -40.2605263 -40.5605263 -29.5605263 -10.9605263 -22.7605263 49 50 51 52 53 54 -0.2605263 19.1394737 52.1394737 44.4394737 49.6394737 58.9394737 55 56 57 58 59 60 90.0394737 111.6394737 164.8394737 193.4394737 198.2394737 132.4394737 61 81.0394737 > postscript(file="/var/www/html/rcomp/tmp/6a4ad1227547857.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 -45.5565217 NA 1 -38.4565217 -45.5565217 2 -37.7565217 -38.4565217 3 -34.9565217 -37.7565217 4 -29.9565217 -34.9565217 5 -30.4565217 -29.9565217 6 -22.9565217 -30.4565217 7 -21.4565217 -22.9565217 8 -8.9565217 -21.4565217 9 -14.3565217 -8.9565217 10 -7.1565217 -14.3565217 11 6.7434783 -7.1565217 12 5.5434783 6.7434783 13 24.1434783 5.5434783 14 9.5434783 24.1434783 15 -2.5565217 9.5434783 16 11.4434783 -2.5565217 17 16.5434783 11.4434783 18 39.7434783 16.5434783 19 40.1434783 39.7434783 20 30.1434783 40.1434783 21 51.3434783 30.1434783 22 59.2434783 51.3434783 23 -52.3605263 59.2434783 24 -53.0605263 -52.3605263 25 -65.5605263 -53.0605263 26 -76.5605263 -65.5605263 27 -71.2605263 -76.5605263 28 -51.2605263 -71.2605263 29 -59.4605263 -51.2605263 30 -55.3605263 -59.4605263 31 -30.3605263 -55.3605263 32 -28.3605263 -30.3605263 33 -29.8605263 -28.3605263 34 -15.1605263 -29.8605263 35 -17.5605263 -15.1605263 36 -52.3605263 -17.5605263 37 -66.8605263 -52.3605263 38 -64.9605263 -66.8605263 39 -54.9605263 -64.9605263 40 -82.0605263 -54.9605263 41 -67.6605263 -82.0605263 42 -56.5605263 -67.6605263 43 -40.2605263 -56.5605263 44 -40.5605263 -40.2605263 45 -29.5605263 -40.5605263 46 -10.9605263 -29.5605263 47 -22.7605263 -10.9605263 48 -0.2605263 -22.7605263 49 19.1394737 -0.2605263 50 52.1394737 19.1394737 51 44.4394737 52.1394737 52 49.6394737 44.4394737 53 58.9394737 49.6394737 54 90.0394737 58.9394737 55 111.6394737 90.0394737 56 164.8394737 111.6394737 57 193.4394737 164.8394737 58 198.2394737 193.4394737 59 132.4394737 198.2394737 60 81.0394737 132.4394737 61 NA 81.0394737 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -38.4565217 -45.5565217 [2,] -37.7565217 -38.4565217 [3,] -34.9565217 -37.7565217 [4,] -29.9565217 -34.9565217 [5,] -30.4565217 -29.9565217 [6,] -22.9565217 -30.4565217 [7,] -21.4565217 -22.9565217 [8,] -8.9565217 -21.4565217 [9,] -14.3565217 -8.9565217 [10,] -7.1565217 -14.3565217 [11,] 6.7434783 -7.1565217 [12,] 5.5434783 6.7434783 [13,] 24.1434783 5.5434783 [14,] 9.5434783 24.1434783 [15,] -2.5565217 9.5434783 [16,] 11.4434783 -2.5565217 [17,] 16.5434783 11.4434783 [18,] 39.7434783 16.5434783 [19,] 40.1434783 39.7434783 [20,] 30.1434783 40.1434783 [21,] 51.3434783 30.1434783 [22,] 59.2434783 51.3434783 [23,] -52.3605263 59.2434783 [24,] -53.0605263 -52.3605263 [25,] -65.5605263 -53.0605263 [26,] -76.5605263 -65.5605263 [27,] -71.2605263 -76.5605263 [28,] -51.2605263 -71.2605263 [29,] -59.4605263 -51.2605263 [30,] -55.3605263 -59.4605263 [31,] -30.3605263 -55.3605263 [32,] -28.3605263 -30.3605263 [33,] -29.8605263 -28.3605263 [34,] -15.1605263 -29.8605263 [35,] -17.5605263 -15.1605263 [36,] -52.3605263 -17.5605263 [37,] -66.8605263 -52.3605263 [38,] -64.9605263 -66.8605263 [39,] -54.9605263 -64.9605263 [40,] -82.0605263 -54.9605263 [41,] -67.6605263 -82.0605263 [42,] -56.5605263 -67.6605263 [43,] -40.2605263 -56.5605263 [44,] -40.5605263 -40.2605263 [45,] -29.5605263 -40.5605263 [46,] -10.9605263 -29.5605263 [47,] -22.7605263 -10.9605263 [48,] -0.2605263 -22.7605263 [49,] 19.1394737 -0.2605263 [50,] 52.1394737 19.1394737 [51,] 44.4394737 52.1394737 [52,] 49.6394737 44.4394737 [53,] 58.9394737 49.6394737 [54,] 90.0394737 58.9394737 [55,] 111.6394737 90.0394737 [56,] 164.8394737 111.6394737 [57,] 193.4394737 164.8394737 [58,] 198.2394737 193.4394737 [59,] 132.4394737 198.2394737 [60,] 81.0394737 132.4394737 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -38.4565217 -45.5565217 2 -37.7565217 -38.4565217 3 -34.9565217 -37.7565217 4 -29.9565217 -34.9565217 5 -30.4565217 -29.9565217 6 -22.9565217 -30.4565217 7 -21.4565217 -22.9565217 8 -8.9565217 -21.4565217 9 -14.3565217 -8.9565217 10 -7.1565217 -14.3565217 11 6.7434783 -7.1565217 12 5.5434783 6.7434783 13 24.1434783 5.5434783 14 9.5434783 24.1434783 15 -2.5565217 9.5434783 16 11.4434783 -2.5565217 17 16.5434783 11.4434783 18 39.7434783 16.5434783 19 40.1434783 39.7434783 20 30.1434783 40.1434783 21 51.3434783 30.1434783 22 59.2434783 51.3434783 23 -52.3605263 59.2434783 24 -53.0605263 -52.3605263 25 -65.5605263 -53.0605263 26 -76.5605263 -65.5605263 27 -71.2605263 -76.5605263 28 -51.2605263 -71.2605263 29 -59.4605263 -51.2605263 30 -55.3605263 -59.4605263 31 -30.3605263 -55.3605263 32 -28.3605263 -30.3605263 33 -29.8605263 -28.3605263 34 -15.1605263 -29.8605263 35 -17.5605263 -15.1605263 36 -52.3605263 -17.5605263 37 -66.8605263 -52.3605263 38 -64.9605263 -66.8605263 39 -54.9605263 -64.9605263 40 -82.0605263 -54.9605263 41 -67.6605263 -82.0605263 42 -56.5605263 -67.6605263 43 -40.2605263 -56.5605263 44 -40.5605263 -40.2605263 45 -29.5605263 -40.5605263 46 -10.9605263 -29.5605263 47 -22.7605263 -10.9605263 48 -0.2605263 -22.7605263 49 19.1394737 -0.2605263 50 52.1394737 19.1394737 51 44.4394737 52.1394737 52 49.6394737 44.4394737 53 58.9394737 49.6394737 54 90.0394737 58.9394737 55 111.6394737 90.0394737 56 164.8394737 111.6394737 57 193.4394737 164.8394737 58 198.2394737 193.4394737 59 132.4394737 198.2394737 60 81.0394737 132.4394737 > 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/7yfmm1227547857.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/8c5ll1227547857.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/976n01227547857.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/10b0qu1227547857.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/110pwm1227547857.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/120x1a1227547857.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/13xck31227547857.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/144z8y1227547857.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/15a88d1227547857.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/16xftg1227547857.tab") + } > > system("convert tmp/1vm1h1227547857.ps tmp/1vm1h1227547857.png") > system("convert tmp/2ffm41227547857.ps tmp/2ffm41227547857.png") > system("convert tmp/3gla21227547857.ps tmp/3gla21227547857.png") > system("convert tmp/4lics1227547857.ps tmp/4lics1227547857.png") > system("convert tmp/55ua41227547857.ps tmp/55ua41227547857.png") > system("convert tmp/6a4ad1227547857.ps tmp/6a4ad1227547857.png") > system("convert tmp/7yfmm1227547857.ps tmp/7yfmm1227547857.png") > system("convert tmp/8c5ll1227547857.ps tmp/8c5ll1227547857.png") > system("convert tmp/976n01227547857.ps tmp/976n01227547857.png") > system("convert tmp/10b0qu1227547857.ps tmp/10b0qu1227547857.png") > > > proc.time() user system elapsed 5.060 2.718 5.451