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(363,14.3,364,14.2,363,15.9,358,15.3,357,15.5,357,15.1,380,15,378,12.1,376,15.8,380,16.9,379,15.1,384,13.7,392,14.8,394,14.7,392,16,396,15.4,392,15,396,15.5,419,15.1,421,11.7,420,16.3,418,16.7,410,15,418,14.9,426,14.6,428,15.3,430,17.9,424,16.4,423,15.4,427,17.9,441,15.9,449,13.9,452,17.8,462,17.9,455,17.4,461,16.7,461,16,463,16.6,462,19.1,456,17.8,455,17.2,456,18.6,472,16.3,472,15.1,471,19.2,465,17.7,459,19.1,465,18,468,17.5,467,17.8,463,21.1,460,17.2,462,19.4,461,19.8,476,17.6,476,16.2,471,19.5,453,19.9,443,20,442,17.3),dim=c(2,60),dimnames=list(c('WK>25j','ExpBe'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('WK>25j','ExpBe'),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 WK>25j ExpBe 1 363 14.3 2 364 14.2 3 363 15.9 4 358 15.3 5 357 15.5 6 357 15.1 7 380 15.0 8 378 12.1 9 376 15.8 10 380 16.9 11 379 15.1 12 384 13.7 13 392 14.8 14 394 14.7 15 392 16.0 16 396 15.4 17 392 15.0 18 396 15.5 19 419 15.1 20 421 11.7 21 420 16.3 22 418 16.7 23 410 15.0 24 418 14.9 25 426 14.6 26 428 15.3 27 430 17.9 28 424 16.4 29 423 15.4 30 427 17.9 31 441 15.9 32 449 13.9 33 452 17.8 34 462 17.9 35 455 17.4 36 461 16.7 37 461 16.0 38 463 16.6 39 462 19.1 40 456 17.8 41 455 17.2 42 456 18.6 43 472 16.3 44 472 15.1 45 471 19.2 46 465 17.7 47 459 19.1 48 465 18.0 49 468 17.5 50 467 17.8 51 463 21.1 52 460 17.2 53 462 19.4 54 461 19.8 55 476 17.6 56 476 16.2 57 471 19.5 58 453 19.9 59 443 20.0 60 442 17.3 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) ExpBe 225.95 12.24 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -58.606 -18.075 2.403 19.228 61.288 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 225.948 33.117 6.823 5.81e-09 *** ExpBe 12.236 1.991 6.144 7.87e-08 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 29.62 on 58 degrees of freedom Multiple R-squared: 0.3943, Adjusted R-squared: 0.3838 F-statistic: 37.75 on 1 and 58 DF, p-value: 7.87e-08 > if (n > n25) { + kp3 <- k + 3 + nmkm3 <- n - k - 3 + gqarr <- array(NA, dim=c(nmkm3-kp3+1,3)) + numgqtests <- 0 + numsignificant1 <- 0 + numsignificant5 <- 0 + numsignificant10 <- 0 + for (mypoint in kp3:nmkm3) { + j <- 0 + numgqtests <- numgqtests + 1 + for (myalt in c('greater', 'two.sided', 'less')) { + j <- j + 1 + gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value + } + if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1 + } + gqarr + } [,1] [,2] [,3] [1,] 0.0025751305 5.150261e-03 9.974249e-01 [2,] 0.0006117708 1.223542e-03 9.993882e-01 [3,] 0.0128925028 2.578501e-02 9.871075e-01 [4,] 0.0042077317 8.415463e-03 9.957923e-01 [5,] 0.0061742676 1.234854e-02 9.938257e-01 [6,] 0.0120154654 2.403093e-02 9.879845e-01 [7,] 0.0109605291 2.192106e-02 9.890395e-01 [8,] 0.0109488658 2.189773e-02 9.890511e-01 [9,] 0.0232849933 4.656999e-02 9.767150e-01 [10,] 0.0408725043 8.174501e-02 9.591275e-01 [11,] 0.0716461498 1.432923e-01 9.283539e-01 [12,] 0.1182735331 2.365471e-01 8.817265e-01 [13,] 0.1647166314 3.294333e-01 8.352834e-01 [14,] 0.2652103224 5.304206e-01 7.347897e-01 [15,] 0.5534557430 8.930885e-01 4.465443e-01 [16,] 0.6604191767 6.791616e-01 3.395808e-01 [17,] 0.8404874163 3.190252e-01 1.595126e-01 [18,] 0.9238407487 1.523185e-01 7.615925e-02 [19,] 0.9576351676 8.472966e-02 4.236483e-02 [20,] 0.9787296058 4.254079e-02 2.127039e-02 [21,] 0.9898211788 2.035764e-02 1.017882e-02 [22,] 0.9957695434 8.460913e-03 4.230457e-03 [23,] 0.9985199502 2.960100e-03 1.480050e-03 [24,] 0.9996447312 7.105375e-04 3.552688e-04 [25,] 0.9999678491 6.430179e-05 3.215089e-05 [26,] 0.9999985122 2.975569e-06 1.487784e-06 [27,] 0.9999997927 4.145454e-07 2.072727e-07 [28,] 0.9999999764 4.713839e-08 2.356920e-08 [29,] 0.9999999814 3.716230e-08 1.858115e-08 [30,] 0.9999999728 5.445107e-08 2.722553e-08 [31,] 0.9999999630 7.392993e-08 3.696496e-08 [32,] 0.9999999432 1.136365e-07 5.681826e-08 [33,] 0.9999999241 1.517423e-07 7.587116e-08 [34,] 0.9999998525 2.950196e-07 1.475098e-07 [35,] 0.9999995193 9.614131e-07 4.807065e-07 [36,] 0.9999989131 2.173784e-06 1.086892e-06 [37,] 0.9999982333 3.533412e-06 1.766706e-06 [38,] 0.9999953103 9.379495e-06 4.689747e-06 [39,] 0.9999911657 1.766856e-05 8.834282e-06 [40,] 0.9999851828 2.963437e-05 1.481719e-05 [41,] 0.9999695774 6.084528e-05 3.042264e-05 [42,] 0.9999073137 1.853725e-04 9.268627e-05 [43,] 0.9997098440 5.803120e-04 2.901560e-04 [44,] 0.9991679142 1.664172e-03 8.320858e-04 [45,] 0.9978774426 4.245115e-03 2.122557e-03 [46,] 0.9946384377 1.072312e-02 5.361562e-03 [47,] 0.9887395512 2.252090e-02 1.126045e-02 [48,] 0.9739941016 5.201180e-02 2.600590e-02 [49,] 0.9401189940 1.197620e-01 5.988101e-02 [50,] 0.8747200522 2.505599e-01 1.252799e-01 [51,] 0.8055066752 3.889866e-01 1.944933e-01 > postscript(file="/var/www/html/rcomp/tmp/1s2aa1258731636.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/2tl8g1258731636.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/3ijyz1258731636.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/4k0xd1258731636.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/5k9vo1258731636.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 -37.9231085 -35.6995070 -57.5007312 -55.1591227 -58.6063255 -53.7119198 7 8 9 10 11 12 -29.4883184 3.9961228 -43.2771298 -52.7367454 -31.7119198 -9.5814999 13 14 15 16 17 18 -15.0411156 -11.8175141 -29.7243326 -18.3827241 -17.4883184 -19.6063255 19 20 21 22 23 24 8.2880802 51.8905285 -5.3951369 -12.2895426 0.5116816 9.7352830 25 26 27 28 29 30 21.4060873 14.8408773 -14.9727596 -2.6187383 8.6172759 -17.9727596 31 32 33 34 35 36 20.4992688 52.9712972 8.2508418 17.0272404 16.1452475 30.7104574 37 38 39 40 41 42 39.2756674 33.9340588 2.3440233 12.2508418 18.5924503 2.4620304 43 44 45 46 47 48 46.6048631 61.2880802 10.1204219 22.4744432 -0.6559767 18.8036389 49 50 51 52 53 54 27.9216460 23.2508418 -21.1280052 23.5924503 -1.3267810 -7.2211867 55 56 57 58 59 60 34.6980446 51.8284645 6.4496176 -16.4447881 -27.6683895 4.3688489 > postscript(file="/var/www/html/rcomp/tmp/63nnh1258731636.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 -37.9231085 NA 1 -35.6995070 -37.9231085 2 -57.5007312 -35.6995070 3 -55.1591227 -57.5007312 4 -58.6063255 -55.1591227 5 -53.7119198 -58.6063255 6 -29.4883184 -53.7119198 7 3.9961228 -29.4883184 8 -43.2771298 3.9961228 9 -52.7367454 -43.2771298 10 -31.7119198 -52.7367454 11 -9.5814999 -31.7119198 12 -15.0411156 -9.5814999 13 -11.8175141 -15.0411156 14 -29.7243326 -11.8175141 15 -18.3827241 -29.7243326 16 -17.4883184 -18.3827241 17 -19.6063255 -17.4883184 18 8.2880802 -19.6063255 19 51.8905285 8.2880802 20 -5.3951369 51.8905285 21 -12.2895426 -5.3951369 22 0.5116816 -12.2895426 23 9.7352830 0.5116816 24 21.4060873 9.7352830 25 14.8408773 21.4060873 26 -14.9727596 14.8408773 27 -2.6187383 -14.9727596 28 8.6172759 -2.6187383 29 -17.9727596 8.6172759 30 20.4992688 -17.9727596 31 52.9712972 20.4992688 32 8.2508418 52.9712972 33 17.0272404 8.2508418 34 16.1452475 17.0272404 35 30.7104574 16.1452475 36 39.2756674 30.7104574 37 33.9340588 39.2756674 38 2.3440233 33.9340588 39 12.2508418 2.3440233 40 18.5924503 12.2508418 41 2.4620304 18.5924503 42 46.6048631 2.4620304 43 61.2880802 46.6048631 44 10.1204219 61.2880802 45 22.4744432 10.1204219 46 -0.6559767 22.4744432 47 18.8036389 -0.6559767 48 27.9216460 18.8036389 49 23.2508418 27.9216460 50 -21.1280052 23.2508418 51 23.5924503 -21.1280052 52 -1.3267810 23.5924503 53 -7.2211867 -1.3267810 54 34.6980446 -7.2211867 55 51.8284645 34.6980446 56 6.4496176 51.8284645 57 -16.4447881 6.4496176 58 -27.6683895 -16.4447881 59 4.3688489 -27.6683895 60 NA 4.3688489 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -35.6995070 -37.9231085 [2,] -57.5007312 -35.6995070 [3,] -55.1591227 -57.5007312 [4,] -58.6063255 -55.1591227 [5,] -53.7119198 -58.6063255 [6,] -29.4883184 -53.7119198 [7,] 3.9961228 -29.4883184 [8,] -43.2771298 3.9961228 [9,] -52.7367454 -43.2771298 [10,] -31.7119198 -52.7367454 [11,] -9.5814999 -31.7119198 [12,] -15.0411156 -9.5814999 [13,] -11.8175141 -15.0411156 [14,] -29.7243326 -11.8175141 [15,] -18.3827241 -29.7243326 [16,] -17.4883184 -18.3827241 [17,] -19.6063255 -17.4883184 [18,] 8.2880802 -19.6063255 [19,] 51.8905285 8.2880802 [20,] -5.3951369 51.8905285 [21,] -12.2895426 -5.3951369 [22,] 0.5116816 -12.2895426 [23,] 9.7352830 0.5116816 [24,] 21.4060873 9.7352830 [25,] 14.8408773 21.4060873 [26,] -14.9727596 14.8408773 [27,] -2.6187383 -14.9727596 [28,] 8.6172759 -2.6187383 [29,] -17.9727596 8.6172759 [30,] 20.4992688 -17.9727596 [31,] 52.9712972 20.4992688 [32,] 8.2508418 52.9712972 [33,] 17.0272404 8.2508418 [34,] 16.1452475 17.0272404 [35,] 30.7104574 16.1452475 [36,] 39.2756674 30.7104574 [37,] 33.9340588 39.2756674 [38,] 2.3440233 33.9340588 [39,] 12.2508418 2.3440233 [40,] 18.5924503 12.2508418 [41,] 2.4620304 18.5924503 [42,] 46.6048631 2.4620304 [43,] 61.2880802 46.6048631 [44,] 10.1204219 61.2880802 [45,] 22.4744432 10.1204219 [46,] -0.6559767 22.4744432 [47,] 18.8036389 -0.6559767 [48,] 27.9216460 18.8036389 [49,] 23.2508418 27.9216460 [50,] -21.1280052 23.2508418 [51,] 23.5924503 -21.1280052 [52,] -1.3267810 23.5924503 [53,] -7.2211867 -1.3267810 [54,] 34.6980446 -7.2211867 [55,] 51.8284645 34.6980446 [56,] 6.4496176 51.8284645 [57,] -16.4447881 6.4496176 [58,] -27.6683895 -16.4447881 [59,] 4.3688489 -27.6683895 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -35.6995070 -37.9231085 2 -57.5007312 -35.6995070 3 -55.1591227 -57.5007312 4 -58.6063255 -55.1591227 5 -53.7119198 -58.6063255 6 -29.4883184 -53.7119198 7 3.9961228 -29.4883184 8 -43.2771298 3.9961228 9 -52.7367454 -43.2771298 10 -31.7119198 -52.7367454 11 -9.5814999 -31.7119198 12 -15.0411156 -9.5814999 13 -11.8175141 -15.0411156 14 -29.7243326 -11.8175141 15 -18.3827241 -29.7243326 16 -17.4883184 -18.3827241 17 -19.6063255 -17.4883184 18 8.2880802 -19.6063255 19 51.8905285 8.2880802 20 -5.3951369 51.8905285 21 -12.2895426 -5.3951369 22 0.5116816 -12.2895426 23 9.7352830 0.5116816 24 21.4060873 9.7352830 25 14.8408773 21.4060873 26 -14.9727596 14.8408773 27 -2.6187383 -14.9727596 28 8.6172759 -2.6187383 29 -17.9727596 8.6172759 30 20.4992688 -17.9727596 31 52.9712972 20.4992688 32 8.2508418 52.9712972 33 17.0272404 8.2508418 34 16.1452475 17.0272404 35 30.7104574 16.1452475 36 39.2756674 30.7104574 37 33.9340588 39.2756674 38 2.3440233 33.9340588 39 12.2508418 2.3440233 40 18.5924503 12.2508418 41 2.4620304 18.5924503 42 46.6048631 2.4620304 43 61.2880802 46.6048631 44 10.1204219 61.2880802 45 22.4744432 10.1204219 46 -0.6559767 22.4744432 47 18.8036389 -0.6559767 48 27.9216460 18.8036389 49 23.2508418 27.9216460 50 -21.1280052 23.2508418 51 23.5924503 -21.1280052 52 -1.3267810 23.5924503 53 -7.2211867 -1.3267810 54 34.6980446 -7.2211867 55 51.8284645 34.6980446 56 6.4496176 51.8284645 57 -16.4447881 6.4496176 58 -27.6683895 -16.4447881 59 4.3688489 -27.6683895 > 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/7lgbt1258731636.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/8lgp01258731636.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/9rwu91258731636.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/10grk11258731636.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/11ffh81258731636.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/12ju3t1258731636.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/13z5e91258731636.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/1410181258731636.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/15sh3z1258731636.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/16zb0h1258731636.tab") + } > > system("convert tmp/1s2aa1258731636.ps tmp/1s2aa1258731636.png") > system("convert tmp/2tl8g1258731636.ps tmp/2tl8g1258731636.png") > system("convert tmp/3ijyz1258731636.ps tmp/3ijyz1258731636.png") > system("convert tmp/4k0xd1258731636.ps tmp/4k0xd1258731636.png") > system("convert tmp/5k9vo1258731636.ps tmp/5k9vo1258731636.png") > system("convert tmp/63nnh1258731636.ps tmp/63nnh1258731636.png") > system("convert tmp/7lgbt1258731636.ps tmp/7lgbt1258731636.png") > system("convert tmp/8lgp01258731636.ps tmp/8lgp01258731636.png") > system("convert tmp/9rwu91258731636.ps tmp/9rwu91258731636.png") > system("convert tmp/10grk11258731636.ps tmp/10grk11258731636.png") > > > proc.time() user system elapsed 2.537 1.600 2.943