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(461,463,462,456,455,456,472,472,471,465,459,465,468,467,463,460,462,461,476,476,471,453,443,442,444,438,427,424,416,406,431,434,418,412,404,409,412,406,398,397,385,390,413,413,401,397,397,409,419,424,428,430,424,433,456,459,446,441,439,454,460),dim=c(1,61),dimnames=list(c('HPC'),1:61)) > y <- array(NA,dim=c(1,61),dimnames=list(c('HPC'),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 = 'Linear Trend' > par2 = 'Include Monthly 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 HPC M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t 1 461 1 0 0 0 0 0 0 0 0 0 0 1 2 463 0 1 0 0 0 0 0 0 0 0 0 2 3 462 0 0 1 0 0 0 0 0 0 0 0 3 4 456 0 0 0 1 0 0 0 0 0 0 0 4 5 455 0 0 0 0 1 0 0 0 0 0 0 5 6 456 0 0 0 0 0 1 0 0 0 0 0 6 7 472 0 0 0 0 0 0 1 0 0 0 0 7 8 472 0 0 0 0 0 0 0 1 0 0 0 8 9 471 0 0 0 0 0 0 0 0 1 0 0 9 10 465 0 0 0 0 0 0 0 0 0 1 0 10 11 459 0 0 0 0 0 0 0 0 0 0 1 11 12 465 0 0 0 0 0 0 0 0 0 0 0 12 13 468 1 0 0 0 0 0 0 0 0 0 0 13 14 467 0 1 0 0 0 0 0 0 0 0 0 14 15 463 0 0 1 0 0 0 0 0 0 0 0 15 16 460 0 0 0 1 0 0 0 0 0 0 0 16 17 462 0 0 0 0 1 0 0 0 0 0 0 17 18 461 0 0 0 0 0 1 0 0 0 0 0 18 19 476 0 0 0 0 0 0 1 0 0 0 0 19 20 476 0 0 0 0 0 0 0 1 0 0 0 20 21 471 0 0 0 0 0 0 0 0 1 0 0 21 22 453 0 0 0 0 0 0 0 0 0 1 0 22 23 443 0 0 0 0 0 0 0 0 0 0 1 23 24 442 0 0 0 0 0 0 0 0 0 0 0 24 25 444 1 0 0 0 0 0 0 0 0 0 0 25 26 438 0 1 0 0 0 0 0 0 0 0 0 26 27 427 0 0 1 0 0 0 0 0 0 0 0 27 28 424 0 0 0 1 0 0 0 0 0 0 0 28 29 416 0 0 0 0 1 0 0 0 0 0 0 29 30 406 0 0 0 0 0 1 0 0 0 0 0 30 31 431 0 0 0 0 0 0 1 0 0 0 0 31 32 434 0 0 0 0 0 0 0 1 0 0 0 32 33 418 0 0 0 0 0 0 0 0 1 0 0 33 34 412 0 0 0 0 0 0 0 0 0 1 0 34 35 404 0 0 0 0 0 0 0 0 0 0 1 35 36 409 0 0 0 0 0 0 0 0 0 0 0 36 37 412 1 0 0 0 0 0 0 0 0 0 0 37 38 406 0 1 0 0 0 0 0 0 0 0 0 38 39 398 0 0 1 0 0 0 0 0 0 0 0 39 40 397 0 0 0 1 0 0 0 0 0 0 0 40 41 385 0 0 0 0 1 0 0 0 0 0 0 41 42 390 0 0 0 0 0 1 0 0 0 0 0 42 43 413 0 0 0 0 0 0 1 0 0 0 0 43 44 413 0 0 0 0 0 0 0 1 0 0 0 44 45 401 0 0 0 0 0 0 0 0 1 0 0 45 46 397 0 0 0 0 0 0 0 0 0 1 0 46 47 397 0 0 0 0 0 0 0 0 0 0 1 47 48 409 0 0 0 0 0 0 0 0 0 0 0 48 49 419 1 0 0 0 0 0 0 0 0 0 0 49 50 424 0 1 0 0 0 0 0 0 0 0 0 50 51 428 0 0 1 0 0 0 0 0 0 0 0 51 52 430 0 0 0 1 0 0 0 0 0 0 0 52 53 424 0 0 0 0 1 0 0 0 0 0 0 53 54 433 0 0 0 0 0 1 0 0 0 0 0 54 55 456 0 0 0 0 0 0 1 0 0 0 0 55 56 459 0 0 0 0 0 0 0 1 0 0 0 56 57 446 0 0 0 0 0 0 0 0 1 0 0 57 58 441 0 0 0 0 0 0 0 0 0 1 0 58 59 439 0 0 0 0 0 0 0 0 0 0 1 59 60 454 0 0 0 0 0 0 0 0 0 0 0 60 61 460 1 0 0 0 0 0 0 0 0 0 0 61 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) M1 M2 M3 M4 M5 466.0118 4.0039 -4.5922 -7.7529 -9.1137 -13.2745 M6 M7 M8 M9 M10 M11 -11.6353 9.6039 11.6431 3.0824 -3.8784 -8.2392 t -0.8392 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -33.329 -21.329 3.259 16.329 41.176 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 466.0118 11.7107 39.794 < 2e-16 *** M1 4.0039 13.6574 0.293 0.771 M2 -4.5922 14.3349 -0.320 0.750 M3 -7.7529 14.3166 -0.542 0.591 M4 -9.1137 14.3002 -0.637 0.527 M5 -13.2745 14.2857 -0.929 0.357 M6 -11.6353 14.2731 -0.815 0.419 M7 9.6039 14.2625 0.673 0.504 M8 11.6431 14.2538 0.817 0.418 M9 3.0824 14.2470 0.216 0.830 M10 -3.8784 14.2421 -0.272 0.787 M11 -8.2392 14.2392 -0.579 0.566 t -0.8392 0.1661 -5.051 6.77e-06 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 22.51 on 48 degrees of freedom Multiple R-squared: 0.4007, Adjusted R-squared: 0.2508 F-statistic: 2.674 on 12 and 48 DF, p-value: 0.007811 > 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,] 4.441894e-04 8.883788e-04 9.995558e-01 [2,] 5.492899e-05 1.098580e-04 9.999451e-01 [3,] 4.097210e-06 8.194420e-06 9.999959e-01 [4,] 2.984752e-07 5.969504e-07 9.999997e-01 [5,] 2.211833e-08 4.423667e-08 1.000000e+00 [6,] 1.724627e-08 3.449253e-08 1.000000e+00 [7,] 6.631493e-06 1.326299e-05 9.999934e-01 [8,] 6.939718e-05 1.387944e-04 9.999306e-01 [9,] 5.871586e-04 1.174317e-03 9.994128e-01 [10,] 1.311690e-03 2.623380e-03 9.986883e-01 [11,] 4.391683e-03 8.783366e-03 9.956083e-01 [12,] 1.651575e-02 3.303150e-02 9.834843e-01 [13,] 3.105246e-02 6.210492e-02 9.689475e-01 [14,] 8.898201e-02 1.779640e-01 9.110180e-01 [15,] 1.899035e-01 3.798070e-01 8.100965e-01 [16,] 2.387641e-01 4.775283e-01 7.612359e-01 [17,] 3.095357e-01 6.190715e-01 6.904643e-01 [18,] 4.860655e-01 9.721309e-01 5.139345e-01 [19,] 6.808554e-01 6.382891e-01 3.191446e-01 [20,] 8.512862e-01 2.974276e-01 1.487138e-01 [21,] 9.480148e-01 1.039704e-01 5.198522e-02 [22,] 9.966276e-01 6.744786e-03 3.372393e-03 [23,] 9.999090e-01 1.819480e-04 9.097399e-05 [24,] 9.999831e-01 3.377348e-05 1.688674e-05 [25,] 9.999993e-01 1.490439e-06 7.452193e-07 [26,] 9.999994e-01 1.102344e-06 5.511722e-07 [27,] 9.999943e-01 1.138214e-05 5.691068e-06 [28,] 9.999452e-01 1.096719e-04 5.483593e-05 [29,] 9.997407e-01 5.186741e-04 2.593371e-04 [30,] 9.982695e-01 3.460980e-03 1.730490e-03 > postscript(file="/var/www/html/rcomp/tmp/18dn41292587192.ps",horizontal=F,onefile=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/25pbv1292587192.ps",horizontal=F,onefile=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/35pbv1292587192.ps",horizontal=F,onefile=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/45pbv1292587192.ps",horizontal=F,onefile=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/55pbv1292587192.ps",horizontal=F,onefile=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 7 -8.176471 3.258824 6.258824 2.458824 6.458824 6.658824 2.258824 8 9 10 11 12 13 14 1.058824 9.458824 11.258824 10.458824 9.058824 8.894118 17.329412 15 16 17 18 19 20 21 17.329412 16.529412 23.529412 21.729412 16.329412 15.129412 19.529412 22 23 24 25 26 27 28 9.329412 4.529412 -3.870588 -5.035294 -1.600000 -8.600000 -9.400000 29 30 31 32 33 34 35 -12.400000 -23.200000 -18.600000 -16.800000 -23.400000 -21.600000 -24.400000 36 37 38 39 40 41 42 -26.800000 -26.964706 -23.529412 -27.529412 -26.329412 -33.329412 -29.129412 43 44 45 46 47 48 49 -26.529412 -27.729412 -30.329412 -26.529412 -21.329412 -16.729412 -9.894118 50 51 52 53 54 55 56 4.541176 12.541176 16.741176 15.741176 23.941176 26.541176 28.341176 57 58 59 60 61 24.741176 27.541176 30.741176 38.341176 41.176471 > postscript(file="/var/www/html/rcomp/tmp/6yzsg1292587192.ps",horizontal=F,onefile=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 -8.176471 NA 1 3.258824 -8.176471 2 6.258824 3.258824 3 2.458824 6.258824 4 6.458824 2.458824 5 6.658824 6.458824 6 2.258824 6.658824 7 1.058824 2.258824 8 9.458824 1.058824 9 11.258824 9.458824 10 10.458824 11.258824 11 9.058824 10.458824 12 8.894118 9.058824 13 17.329412 8.894118 14 17.329412 17.329412 15 16.529412 17.329412 16 23.529412 16.529412 17 21.729412 23.529412 18 16.329412 21.729412 19 15.129412 16.329412 20 19.529412 15.129412 21 9.329412 19.529412 22 4.529412 9.329412 23 -3.870588 4.529412 24 -5.035294 -3.870588 25 -1.600000 -5.035294 26 -8.600000 -1.600000 27 -9.400000 -8.600000 28 -12.400000 -9.400000 29 -23.200000 -12.400000 30 -18.600000 -23.200000 31 -16.800000 -18.600000 32 -23.400000 -16.800000 33 -21.600000 -23.400000 34 -24.400000 -21.600000 35 -26.800000 -24.400000 36 -26.964706 -26.800000 37 -23.529412 -26.964706 38 -27.529412 -23.529412 39 -26.329412 -27.529412 40 -33.329412 -26.329412 41 -29.129412 -33.329412 42 -26.529412 -29.129412 43 -27.729412 -26.529412 44 -30.329412 -27.729412 45 -26.529412 -30.329412 46 -21.329412 -26.529412 47 -16.729412 -21.329412 48 -9.894118 -16.729412 49 4.541176 -9.894118 50 12.541176 4.541176 51 16.741176 12.541176 52 15.741176 16.741176 53 23.941176 15.741176 54 26.541176 23.941176 55 28.341176 26.541176 56 24.741176 28.341176 57 27.541176 24.741176 58 30.741176 27.541176 59 38.341176 30.741176 60 41.176471 38.341176 61 NA 41.176471 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 3.258824 -8.176471 [2,] 6.258824 3.258824 [3,] 2.458824 6.258824 [4,] 6.458824 2.458824 [5,] 6.658824 6.458824 [6,] 2.258824 6.658824 [7,] 1.058824 2.258824 [8,] 9.458824 1.058824 [9,] 11.258824 9.458824 [10,] 10.458824 11.258824 [11,] 9.058824 10.458824 [12,] 8.894118 9.058824 [13,] 17.329412 8.894118 [14,] 17.329412 17.329412 [15,] 16.529412 17.329412 [16,] 23.529412 16.529412 [17,] 21.729412 23.529412 [18,] 16.329412 21.729412 [19,] 15.129412 16.329412 [20,] 19.529412 15.129412 [21,] 9.329412 19.529412 [22,] 4.529412 9.329412 [23,] -3.870588 4.529412 [24,] -5.035294 -3.870588 [25,] -1.600000 -5.035294 [26,] -8.600000 -1.600000 [27,] -9.400000 -8.600000 [28,] -12.400000 -9.400000 [29,] -23.200000 -12.400000 [30,] -18.600000 -23.200000 [31,] -16.800000 -18.600000 [32,] -23.400000 -16.800000 [33,] -21.600000 -23.400000 [34,] -24.400000 -21.600000 [35,] -26.800000 -24.400000 [36,] -26.964706 -26.800000 [37,] -23.529412 -26.964706 [38,] -27.529412 -23.529412 [39,] -26.329412 -27.529412 [40,] -33.329412 -26.329412 [41,] -29.129412 -33.329412 [42,] -26.529412 -29.129412 [43,] -27.729412 -26.529412 [44,] -30.329412 -27.729412 [45,] -26.529412 -30.329412 [46,] -21.329412 -26.529412 [47,] -16.729412 -21.329412 [48,] -9.894118 -16.729412 [49,] 4.541176 -9.894118 [50,] 12.541176 4.541176 [51,] 16.741176 12.541176 [52,] 15.741176 16.741176 [53,] 23.941176 15.741176 [54,] 26.541176 23.941176 [55,] 28.341176 26.541176 [56,] 24.741176 28.341176 [57,] 27.541176 24.741176 [58,] 30.741176 27.541176 [59,] 38.341176 30.741176 [60,] 41.176471 38.341176 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 3.258824 -8.176471 2 6.258824 3.258824 3 2.458824 6.258824 4 6.458824 2.458824 5 6.658824 6.458824 6 2.258824 6.658824 7 1.058824 2.258824 8 9.458824 1.058824 9 11.258824 9.458824 10 10.458824 11.258824 11 9.058824 10.458824 12 8.894118 9.058824 13 17.329412 8.894118 14 17.329412 17.329412 15 16.529412 17.329412 16 23.529412 16.529412 17 21.729412 23.529412 18 16.329412 21.729412 19 15.129412 16.329412 20 19.529412 15.129412 21 9.329412 19.529412 22 4.529412 9.329412 23 -3.870588 4.529412 24 -5.035294 -3.870588 25 -1.600000 -5.035294 26 -8.600000 -1.600000 27 -9.400000 -8.600000 28 -12.400000 -9.400000 29 -23.200000 -12.400000 30 -18.600000 -23.200000 31 -16.800000 -18.600000 32 -23.400000 -16.800000 33 -21.600000 -23.400000 34 -24.400000 -21.600000 35 -26.800000 -24.400000 36 -26.964706 -26.800000 37 -23.529412 -26.964706 38 -27.529412 -23.529412 39 -26.329412 -27.529412 40 -33.329412 -26.329412 41 -29.129412 -33.329412 42 -26.529412 -29.129412 43 -27.729412 -26.529412 44 -30.329412 -27.729412 45 -26.529412 -30.329412 46 -21.329412 -26.529412 47 -16.729412 -21.329412 48 -9.894118 -16.729412 49 4.541176 -9.894118 50 12.541176 4.541176 51 16.741176 12.541176 52 15.741176 16.741176 53 23.941176 15.741176 54 26.541176 23.941176 55 28.341176 26.541176 56 24.741176 28.341176 57 27.541176 24.741176 58 30.741176 27.541176 59 38.341176 30.741176 60 41.176471 38.341176 > 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/74n3v1292587192.ps",horizontal=F,onefile=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/84n3v1292587192.ps",horizontal=F,onefile=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/9ewky1292587192.ps",horizontal=F,onefile=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/10ewky1292587192.ps",horizontal=F,onefile=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/11ix031292587192.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/123xhr1292587192.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/13z7xi1292587192.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/14lpdo1292587192.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/1568uu1292587192.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/16a9ai1292587192.tab") + } > try(system("convert tmp/18dn41292587192.ps tmp/18dn41292587192.png",intern=TRUE)) character(0) > try(system("convert tmp/25pbv1292587192.ps tmp/25pbv1292587192.png",intern=TRUE)) character(0) > try(system("convert tmp/35pbv1292587192.ps tmp/35pbv1292587192.png",intern=TRUE)) character(0) > try(system("convert tmp/45pbv1292587192.ps tmp/45pbv1292587192.png",intern=TRUE)) character(0) > try(system("convert tmp/55pbv1292587192.ps tmp/55pbv1292587192.png",intern=TRUE)) character(0) > try(system("convert tmp/6yzsg1292587192.ps tmp/6yzsg1292587192.png",intern=TRUE)) character(0) > try(system("convert tmp/74n3v1292587192.ps tmp/74n3v1292587192.png",intern=TRUE)) character(0) > try(system("convert tmp/84n3v1292587192.ps tmp/84n3v1292587192.png",intern=TRUE)) character(0) > try(system("convert tmp/9ewky1292587192.ps tmp/9ewky1292587192.png",intern=TRUE)) character(0) > try(system("convert tmp/10ewky1292587192.ps tmp/10ewky1292587192.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.434 1.621 6.017