R version 2.8.0 (2008-10-20) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale 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(465,0,459,0,465,0,468,0,467,0,463,0,460,0,462,0,461,0,476,0,476,0,471,0,453,0,443,0,442,0,444,0,438,0,427,0,424,0,416,0,406,0,431,0,434,0,418,0,412,0,404,0,409,0,412,0,406,0,398,0,397,0,385,0,390,0,413,1,413,1,401,1,397,1,397,1,409,1,419,1,424,1,428,1,430,1,424,1,433,1,456,1,459,1,446,1,441,1,439,1,454,1,460,1,457,1,451,1,444,1,437,1,443,1,471,1,469,1,454,1,444,1),dim=c(2,61),dimnames=list(c('Y','X'),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('Y','X'),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 X 1 465 0 2 459 0 3 465 0 4 468 0 5 467 0 6 463 0 7 460 0 8 462 0 9 461 0 10 476 0 11 476 0 12 471 0 13 453 0 14 443 0 15 442 0 16 444 0 17 438 0 18 427 0 19 424 0 20 416 0 21 406 0 22 431 0 23 434 0 24 418 0 25 412 0 26 404 0 27 409 0 28 412 0 29 406 0 30 398 0 31 397 0 32 385 0 33 390 0 34 413 1 35 413 1 36 401 1 37 397 1 38 397 1 39 409 1 40 419 1 41 424 1 42 428 1 43 430 1 44 424 1 45 433 1 46 456 1 47 459 1 48 446 1 49 441 1 50 439 1 51 454 1 52 460 1 53 457 1 54 451 1 55 444 1 56 437 1 57 443 1 58 471 1 59 469 1 60 454 1 61 444 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 435.8182 0.3604 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -50.818 -23.179 2.821 22.821 40.182 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 435.8182 4.3721 99.682 <2e-16 *** X 0.3604 6.4532 0.056 0.956 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 25.12 on 59 degrees of freedom Multiple R-squared: 5.286e-05, Adjusted R-squared: -0.0169 F-statistic: 0.003119 on 1 and 59 DF, p-value: 0.9557 > 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,] 6.146448e-03 1.229290e-02 0.9938535518 [2,] 9.663019e-04 1.932604e-03 0.9990336981 [3,] 2.645188e-04 5.290376e-04 0.9997354812 [4,] 4.481758e-05 8.963515e-05 0.9999551824 [5,] 8.772390e-06 1.754478e-05 0.9999912276 [6,] 9.556157e-05 1.911231e-04 0.9999044384 [7,] 2.039836e-04 4.079672e-04 0.9997960164 [8,] 1.329516e-04 2.659033e-04 0.9998670484 [9,] 2.938311e-04 5.876623e-04 0.9997061689 [10,] 2.654516e-03 5.309033e-03 0.9973454837 [11,] 8.374067e-03 1.674813e-02 0.9916259335 [12,] 1.412580e-02 2.825159e-02 0.9858742044 [13,] 3.104038e-02 6.208075e-02 0.9689596242 [14,] 9.961161e-02 1.992232e-01 0.9003883879 [15,] 2.047856e-01 4.095712e-01 0.7952143887 [16,] 3.771812e-01 7.543624e-01 0.6228187866 [17,] 6.078289e-01 7.843421e-01 0.3921710653 [18,] 6.187997e-01 7.624005e-01 0.3812002716 [19,] 6.365401e-01 7.269198e-01 0.3634599043 [20,] 6.847816e-01 6.304369e-01 0.3152184344 [21,] 7.394731e-01 5.210538e-01 0.2605269205 [22,] 8.032455e-01 3.935091e-01 0.1967545461 [23,] 8.258540e-01 3.482919e-01 0.1741459557 [24,] 8.361701e-01 3.276597e-01 0.1638298683 [25,] 8.514341e-01 2.971317e-01 0.1485658606 [26,] 8.734265e-01 2.531469e-01 0.1265734653 [27,] 8.874422e-01 2.251156e-01 0.1125578220 [28,] 9.138228e-01 1.723544e-01 0.0861772123 [29,] 9.197837e-01 1.604326e-01 0.0802163090 [30,] 9.079860e-01 1.840280e-01 0.0920140134 [31,] 8.973536e-01 2.052928e-01 0.1026464010 [32,] 9.224116e-01 1.551769e-01 0.0775884351 [33,] 9.605184e-01 7.896327e-02 0.0394816332 [34,] 9.882739e-01 2.345220e-02 0.0117261016 [35,] 9.951347e-01 9.730545e-03 0.0048652727 [36,] 9.968741e-01 6.251851e-03 0.0031259253 [37,] 9.975965e-01 4.807002e-03 0.0024035009 [38,] 9.978394e-01 4.321266e-03 0.0021606331 [39,] 9.979827e-01 4.034628e-03 0.0020173140 [40,] 9.992304e-01 1.539173e-03 0.0007695863 [41,] 9.994063e-01 1.187320e-03 0.0005936599 [42,] 9.989780e-01 2.043960e-03 0.0010219802 [43,] 9.984255e-01 3.148906e-03 0.0015744530 [44,] 9.967329e-01 6.534124e-03 0.0032670621 [45,] 9.946184e-01 1.076313e-02 0.0053815654 [46,] 9.927898e-01 1.442043e-02 0.0072102168 [47,] 9.844044e-01 3.119124e-02 0.0155956185 [48,] 9.720512e-01 5.589770e-02 0.0279488475 [49,] 9.455119e-01 1.089762e-01 0.0544881135 [50,] 8.901961e-01 2.196078e-01 0.1098039222 [51,] 8.104119e-01 3.791763e-01 0.1895881449 [52,] 7.709563e-01 4.580874e-01 0.2290437141 > postscript(file="/var/www/html/freestat/rcomp/tmp/1xdn31290954694.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/freestat/rcomp/tmp/2k1xi1290954694.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/freestat/rcomp/tmp/3k1xi1290954694.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/freestat/rcomp/tmp/4k1xi1290954694.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/freestat/rcomp/tmp/5dse31290954694.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 29.1818182 23.1818182 29.1818182 32.1818182 31.1818182 27.1818182 7 8 9 10 11 12 24.1818182 26.1818182 25.1818182 40.1818182 40.1818182 35.1818182 13 14 15 16 17 18 17.1818182 7.1818182 6.1818182 8.1818182 2.1818182 -8.8181818 19 20 21 22 23 24 -11.8181818 -19.8181818 -29.8181818 -4.8181818 -1.8181818 -17.8181818 25 26 27 28 29 30 -23.8181818 -31.8181818 -26.8181818 -23.8181818 -29.8181818 -37.8181818 31 32 33 34 35 36 -38.8181818 -50.8181818 -45.8181818 -23.1785714 -23.1785714 -35.1785714 37 38 39 40 41 42 -39.1785714 -39.1785714 -27.1785714 -17.1785714 -12.1785714 -8.1785714 43 44 45 46 47 48 -6.1785714 -12.1785714 -3.1785714 19.8214286 22.8214286 9.8214286 49 50 51 52 53 54 4.8214286 2.8214286 17.8214286 23.8214286 20.8214286 14.8214286 55 56 57 58 59 60 7.8214286 0.8214286 6.8214286 34.8214286 32.8214286 17.8214286 61 7.8214286 > postscript(file="/var/www/html/freestat/rcomp/tmp/6dse31290954694.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 29.1818182 NA 1 23.1818182 29.1818182 2 29.1818182 23.1818182 3 32.1818182 29.1818182 4 31.1818182 32.1818182 5 27.1818182 31.1818182 6 24.1818182 27.1818182 7 26.1818182 24.1818182 8 25.1818182 26.1818182 9 40.1818182 25.1818182 10 40.1818182 40.1818182 11 35.1818182 40.1818182 12 17.1818182 35.1818182 13 7.1818182 17.1818182 14 6.1818182 7.1818182 15 8.1818182 6.1818182 16 2.1818182 8.1818182 17 -8.8181818 2.1818182 18 -11.8181818 -8.8181818 19 -19.8181818 -11.8181818 20 -29.8181818 -19.8181818 21 -4.8181818 -29.8181818 22 -1.8181818 -4.8181818 23 -17.8181818 -1.8181818 24 -23.8181818 -17.8181818 25 -31.8181818 -23.8181818 26 -26.8181818 -31.8181818 27 -23.8181818 -26.8181818 28 -29.8181818 -23.8181818 29 -37.8181818 -29.8181818 30 -38.8181818 -37.8181818 31 -50.8181818 -38.8181818 32 -45.8181818 -50.8181818 33 -23.1785714 -45.8181818 34 -23.1785714 -23.1785714 35 -35.1785714 -23.1785714 36 -39.1785714 -35.1785714 37 -39.1785714 -39.1785714 38 -27.1785714 -39.1785714 39 -17.1785714 -27.1785714 40 -12.1785714 -17.1785714 41 -8.1785714 -12.1785714 42 -6.1785714 -8.1785714 43 -12.1785714 -6.1785714 44 -3.1785714 -12.1785714 45 19.8214286 -3.1785714 46 22.8214286 19.8214286 47 9.8214286 22.8214286 48 4.8214286 9.8214286 49 2.8214286 4.8214286 50 17.8214286 2.8214286 51 23.8214286 17.8214286 52 20.8214286 23.8214286 53 14.8214286 20.8214286 54 7.8214286 14.8214286 55 0.8214286 7.8214286 56 6.8214286 0.8214286 57 34.8214286 6.8214286 58 32.8214286 34.8214286 59 17.8214286 32.8214286 60 7.8214286 17.8214286 61 NA 7.8214286 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 23.1818182 29.1818182 [2,] 29.1818182 23.1818182 [3,] 32.1818182 29.1818182 [4,] 31.1818182 32.1818182 [5,] 27.1818182 31.1818182 [6,] 24.1818182 27.1818182 [7,] 26.1818182 24.1818182 [8,] 25.1818182 26.1818182 [9,] 40.1818182 25.1818182 [10,] 40.1818182 40.1818182 [11,] 35.1818182 40.1818182 [12,] 17.1818182 35.1818182 [13,] 7.1818182 17.1818182 [14,] 6.1818182 7.1818182 [15,] 8.1818182 6.1818182 [16,] 2.1818182 8.1818182 [17,] -8.8181818 2.1818182 [18,] -11.8181818 -8.8181818 [19,] -19.8181818 -11.8181818 [20,] -29.8181818 -19.8181818 [21,] -4.8181818 -29.8181818 [22,] -1.8181818 -4.8181818 [23,] -17.8181818 -1.8181818 [24,] -23.8181818 -17.8181818 [25,] -31.8181818 -23.8181818 [26,] -26.8181818 -31.8181818 [27,] -23.8181818 -26.8181818 [28,] -29.8181818 -23.8181818 [29,] -37.8181818 -29.8181818 [30,] -38.8181818 -37.8181818 [31,] -50.8181818 -38.8181818 [32,] -45.8181818 -50.8181818 [33,] -23.1785714 -45.8181818 [34,] -23.1785714 -23.1785714 [35,] -35.1785714 -23.1785714 [36,] -39.1785714 -35.1785714 [37,] -39.1785714 -39.1785714 [38,] -27.1785714 -39.1785714 [39,] -17.1785714 -27.1785714 [40,] -12.1785714 -17.1785714 [41,] -8.1785714 -12.1785714 [42,] -6.1785714 -8.1785714 [43,] -12.1785714 -6.1785714 [44,] -3.1785714 -12.1785714 [45,] 19.8214286 -3.1785714 [46,] 22.8214286 19.8214286 [47,] 9.8214286 22.8214286 [48,] 4.8214286 9.8214286 [49,] 2.8214286 4.8214286 [50,] 17.8214286 2.8214286 [51,] 23.8214286 17.8214286 [52,] 20.8214286 23.8214286 [53,] 14.8214286 20.8214286 [54,] 7.8214286 14.8214286 [55,] 0.8214286 7.8214286 [56,] 6.8214286 0.8214286 [57,] 34.8214286 6.8214286 [58,] 32.8214286 34.8214286 [59,] 17.8214286 32.8214286 [60,] 7.8214286 17.8214286 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 23.1818182 29.1818182 2 29.1818182 23.1818182 3 32.1818182 29.1818182 4 31.1818182 32.1818182 5 27.1818182 31.1818182 6 24.1818182 27.1818182 7 26.1818182 24.1818182 8 25.1818182 26.1818182 9 40.1818182 25.1818182 10 40.1818182 40.1818182 11 35.1818182 40.1818182 12 17.1818182 35.1818182 13 7.1818182 17.1818182 14 6.1818182 7.1818182 15 8.1818182 6.1818182 16 2.1818182 8.1818182 17 -8.8181818 2.1818182 18 -11.8181818 -8.8181818 19 -19.8181818 -11.8181818 20 -29.8181818 -19.8181818 21 -4.8181818 -29.8181818 22 -1.8181818 -4.8181818 23 -17.8181818 -1.8181818 24 -23.8181818 -17.8181818 25 -31.8181818 -23.8181818 26 -26.8181818 -31.8181818 27 -23.8181818 -26.8181818 28 -29.8181818 -23.8181818 29 -37.8181818 -29.8181818 30 -38.8181818 -37.8181818 31 -50.8181818 -38.8181818 32 -45.8181818 -50.8181818 33 -23.1785714 -45.8181818 34 -23.1785714 -23.1785714 35 -35.1785714 -23.1785714 36 -39.1785714 -35.1785714 37 -39.1785714 -39.1785714 38 -27.1785714 -39.1785714 39 -17.1785714 -27.1785714 40 -12.1785714 -17.1785714 41 -8.1785714 -12.1785714 42 -6.1785714 -8.1785714 43 -12.1785714 -6.1785714 44 -3.1785714 -12.1785714 45 19.8214286 -3.1785714 46 22.8214286 19.8214286 47 9.8214286 22.8214286 48 4.8214286 9.8214286 49 2.8214286 4.8214286 50 17.8214286 2.8214286 51 23.8214286 17.8214286 52 20.8214286 23.8214286 53 14.8214286 20.8214286 54 7.8214286 14.8214286 55 0.8214286 7.8214286 56 6.8214286 0.8214286 57 34.8214286 6.8214286 58 32.8214286 34.8214286 59 17.8214286 32.8214286 60 7.8214286 17.8214286 > 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/freestat/rcomp/tmp/76jdo1290954694.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/freestat/rcomp/tmp/86jdo1290954694.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/freestat/rcomp/tmp/9ysvr1290954694.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/freestat/rcomp/tmp/10ysvr1290954694.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/112bbw1290954694.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/freestat/rcomp/tmp/125bak1290954694.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/freestat/rcomp/tmp/13j3pt1290954694.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/freestat/rcomp/tmp/145moz1290954694.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/freestat/rcomp/tmp/15qmmn1290954694.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/freestat/rcomp/tmp/16mw2e1290954694.tab") + } > > try(system("convert tmp/1xdn31290954694.ps tmp/1xdn31290954694.png",intern=TRUE)) character(0) > try(system("convert tmp/2k1xi1290954694.ps tmp/2k1xi1290954694.png",intern=TRUE)) character(0) > try(system("convert tmp/3k1xi1290954694.ps tmp/3k1xi1290954694.png",intern=TRUE)) character(0) > try(system("convert tmp/4k1xi1290954694.ps tmp/4k1xi1290954694.png",intern=TRUE)) character(0) > try(system("convert tmp/5dse31290954694.ps tmp/5dse31290954694.png",intern=TRUE)) character(0) > try(system("convert tmp/6dse31290954694.ps tmp/6dse31290954694.png",intern=TRUE)) character(0) > try(system("convert tmp/76jdo1290954694.ps tmp/76jdo1290954694.png",intern=TRUE)) character(0) > try(system("convert tmp/86jdo1290954694.ps tmp/86jdo1290954694.png",intern=TRUE)) character(0) > try(system("convert tmp/9ysvr1290954694.ps tmp/9ysvr1290954694.png",intern=TRUE)) character(0) > try(system("convert tmp/10ysvr1290954694.ps tmp/10ysvr1290954694.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.807 2.439 4.126