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(594,139,595,135,591,130,589,127,584,122,573,117,567,112,569,113,621,149,629,157,628,157,612,147,595,137,597,132,593,125,590,123,580,117,574,114,573,111,573,112,620,144,626,150,620,149,588,134,566,123,557,116,561,117,549,111,532,105,526,102,511,95,499,93,555,124,565,130,542,124,527,115,510,106,514,105,517,105,508,101,493,95,490,93,469,84,478,87,528,116,534,120,518,117,506,109,502,105,516,107,528,109,533,109,536,108,537,107,524,99,536,103,587,131,597,137,581,135,564,124),dim=c(2,60),dimnames=list(c('Y','X'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Y','X'),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 = '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 Y X M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t 1 594 139 1 0 0 0 0 0 0 0 0 0 0 1 2 595 135 0 1 0 0 0 0 0 0 0 0 0 2 3 591 130 0 0 1 0 0 0 0 0 0 0 0 3 4 589 127 0 0 0 1 0 0 0 0 0 0 0 4 5 584 122 0 0 0 0 1 0 0 0 0 0 0 5 6 573 117 0 0 0 0 0 1 0 0 0 0 0 6 7 567 112 0 0 0 0 0 0 1 0 0 0 0 7 8 569 113 0 0 0 0 0 0 0 1 0 0 0 8 9 621 149 0 0 0 0 0 0 0 0 1 0 0 9 10 629 157 0 0 0 0 0 0 0 0 0 1 0 10 11 628 157 0 0 0 0 0 0 0 0 0 0 1 11 12 612 147 0 0 0 0 0 0 0 0 0 0 0 12 13 595 137 1 0 0 0 0 0 0 0 0 0 0 13 14 597 132 0 1 0 0 0 0 0 0 0 0 0 14 15 593 125 0 0 1 0 0 0 0 0 0 0 0 15 16 590 123 0 0 0 1 0 0 0 0 0 0 0 16 17 580 117 0 0 0 0 1 0 0 0 0 0 0 17 18 574 114 0 0 0 0 0 1 0 0 0 0 0 18 19 573 111 0 0 0 0 0 0 1 0 0 0 0 19 20 573 112 0 0 0 0 0 0 0 1 0 0 0 20 21 620 144 0 0 0 0 0 0 0 0 1 0 0 21 22 626 150 0 0 0 0 0 0 0 0 0 1 0 22 23 620 149 0 0 0 0 0 0 0 0 0 0 1 23 24 588 134 0 0 0 0 0 0 0 0 0 0 0 24 25 566 123 1 0 0 0 0 0 0 0 0 0 0 25 26 557 116 0 1 0 0 0 0 0 0 0 0 0 26 27 561 117 0 0 1 0 0 0 0 0 0 0 0 27 28 549 111 0 0 0 1 0 0 0 0 0 0 0 28 29 532 105 0 0 0 0 1 0 0 0 0 0 0 29 30 526 102 0 0 0 0 0 1 0 0 0 0 0 30 31 511 95 0 0 0 0 0 0 1 0 0 0 0 31 32 499 93 0 0 0 0 0 0 0 1 0 0 0 32 33 555 124 0 0 0 0 0 0 0 0 1 0 0 33 34 565 130 0 0 0 0 0 0 0 0 0 1 0 34 35 542 124 0 0 0 0 0 0 0 0 0 0 1 35 36 527 115 0 0 0 0 0 0 0 0 0 0 0 36 37 510 106 1 0 0 0 0 0 0 0 0 0 0 37 38 514 105 0 1 0 0 0 0 0 0 0 0 0 38 39 517 105 0 0 1 0 0 0 0 0 0 0 0 39 40 508 101 0 0 0 1 0 0 0 0 0 0 0 40 41 493 95 0 0 0 0 1 0 0 0 0 0 0 41 42 490 93 0 0 0 0 0 1 0 0 0 0 0 42 43 469 84 0 0 0 0 0 0 1 0 0 0 0 43 44 478 87 0 0 0 0 0 0 0 1 0 0 0 44 45 528 116 0 0 0 0 0 0 0 0 1 0 0 45 46 534 120 0 0 0 0 0 0 0 0 0 1 0 46 47 518 117 0 0 0 0 0 0 0 0 0 0 1 47 48 506 109 0 0 0 0 0 0 0 0 0 0 0 48 49 502 105 1 0 0 0 0 0 0 0 0 0 0 49 50 516 107 0 1 0 0 0 0 0 0 0 0 0 50 51 528 109 0 0 1 0 0 0 0 0 0 0 0 51 52 533 109 0 0 0 1 0 0 0 0 0 0 0 52 53 536 108 0 0 0 0 1 0 0 0 0 0 0 53 54 537 107 0 0 0 0 0 1 0 0 0 0 0 54 55 524 99 0 0 0 0 0 0 1 0 0 0 0 55 56 536 103 0 0 0 0 0 0 0 1 0 0 0 56 57 587 131 0 0 0 0 0 0 0 0 1 0 0 57 58 597 137 0 0 0 0 0 0 0 0 0 1 0 58 59 581 135 0 0 0 0 0 0 0 0 0 0 1 59 60 564 124 0 0 0 0 0 0 0 0 0 0 0 60 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X M1 M2 M3 M4 158.1741 3.1590 7.1714 18.9424 26.7225 31.8935 M5 M6 M7 M8 M9 M10 38.1508 41.8900 50.8017 48.4730 1.0050 -10.0553 M11 t -14.9797 0.1061 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -16.1482 -5.0105 0.7496 4.1101 12.2645 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 158.17411 20.36803 7.766 6.56e-10 *** X 3.15903 0.13742 22.988 < 2e-16 *** M1 7.17136 5.22800 1.372 0.176804 M2 18.94237 5.31721 3.562 0.000868 *** M3 26.72254 5.36790 4.978 9.46e-06 *** M4 31.89355 5.48786 5.812 5.54e-07 *** M5 38.15082 5.74144 6.645 3.11e-08 *** M6 41.89002 5.89380 7.107 6.29e-09 *** M7 50.80175 6.34908 8.001 2.94e-10 *** M8 48.47301 6.18716 7.834 5.19e-10 *** M9 1.00504 5.06934 0.198 0.843716 M10 -10.05526 5.27426 -1.906 0.062846 . M11 -14.97967 5.19931 -2.881 0.006002 ** t 0.10609 0.09519 1.115 0.270842 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 7.924 on 46 degrees of freedom Multiple R-squared: 0.9711, Adjusted R-squared: 0.963 F-statistic: 119.1 on 13 and 46 DF, p-value: < 2.2e-16 > 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.069841051 0.1396821012 9.301589e-01 [2,] 0.026577322 0.0531546448 9.734227e-01 [3,] 0.016535168 0.0330703351 9.834648e-01 [4,] 0.007645045 0.0152900893 9.923550e-01 [5,] 0.002541748 0.0050834966 9.974583e-01 [6,] 0.001605374 0.0032107484 9.983946e-01 [7,] 0.002986093 0.0059721850 9.970139e-01 [8,] 0.071952202 0.1439044039 9.280478e-01 [9,] 0.246309832 0.4926196643 7.536902e-01 [10,] 0.421737149 0.8434742988 5.782629e-01 [11,] 0.941688627 0.1166227459 5.831137e-02 [12,] 0.987159708 0.0256805837 1.284029e-02 [13,] 0.998595587 0.0028088251 1.404413e-03 [14,] 0.999730943 0.0005381133 2.690567e-04 [15,] 0.999810506 0.0003789885 1.894942e-04 [16,] 0.999726451 0.0005470986 2.735493e-04 [17,] 0.999541200 0.0009176002 4.588001e-04 [18,] 0.999820173 0.0003596549 1.798274e-04 [19,] 0.999624318 0.0007513645 3.756823e-04 [20,] 0.999933457 0.0001330855 6.654275e-05 [21,] 0.999770523 0.0004589534 2.294767e-04 [22,] 0.999242866 0.0015142682 7.571341e-04 [23,] 0.998365696 0.0032686086 1.634304e-03 [24,] 0.995918939 0.0081621221 4.081061e-03 [25,] 0.994641983 0.0107160342 5.358017e-03 [26,] 0.998841694 0.0023166121 1.158306e-03 [27,] 0.997614461 0.0047710779 2.385539e-03 > postscript(file="/var/www/html/rcomp/tmp/1qlcf1258741964.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/2dpid1258741964.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/31hyh1258741964.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/4l1dw1258741964.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/5oiis1258741964.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 -10.5573422 -8.7983078 -4.8893977 -2.6893977 1.7424092 2.6922849 7 8 9 10 11 12 3.4696367 4.5332505 -9.8301147 -16.1481835 -12.3298661 -11.8252867 13 14 15 16 17 18 -4.5123947 1.4056741 11.6326530 9.6736186 12.2644599 11.8962667 19 20 21 22 23 24 11.3555498 10.4191635 3.6919360 1.6919360 3.6692878 3.9690392 25 26 27 28 29 30 9.4409656 10.6771032 3.6318069 5.3089101 0.8997514 0.5315583 31 32 33 34 35 36 -1.3730211 -4.8323041 0.5995028 2.5995028 3.3720266 1.7175716 37 38 39 40 41 42 5.8714291 1.1533603 -3.7329016 -5.3738672 -7.7830259 -8.3102534 43 44 45 46 47 48 -9.8967640 -8.1512190 -2.4013433 1.9167255 0.2121461 -1.6013433 49 50 51 52 53 54 -0.2426578 -4.4378298 -6.6421606 -6.9192638 -7.1235945 -6.8098564 55 56 57 58 59 60 -3.5554014 -1.9688908 7.9400192 9.9400192 5.0764055 7.7400192 > postscript(file="/var/www/html/rcomp/tmp/6sc3l1258741964.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 -10.5573422 NA 1 -8.7983078 -10.5573422 2 -4.8893977 -8.7983078 3 -2.6893977 -4.8893977 4 1.7424092 -2.6893977 5 2.6922849 1.7424092 6 3.4696367 2.6922849 7 4.5332505 3.4696367 8 -9.8301147 4.5332505 9 -16.1481835 -9.8301147 10 -12.3298661 -16.1481835 11 -11.8252867 -12.3298661 12 -4.5123947 -11.8252867 13 1.4056741 -4.5123947 14 11.6326530 1.4056741 15 9.6736186 11.6326530 16 12.2644599 9.6736186 17 11.8962667 12.2644599 18 11.3555498 11.8962667 19 10.4191635 11.3555498 20 3.6919360 10.4191635 21 1.6919360 3.6919360 22 3.6692878 1.6919360 23 3.9690392 3.6692878 24 9.4409656 3.9690392 25 10.6771032 9.4409656 26 3.6318069 10.6771032 27 5.3089101 3.6318069 28 0.8997514 5.3089101 29 0.5315583 0.8997514 30 -1.3730211 0.5315583 31 -4.8323041 -1.3730211 32 0.5995028 -4.8323041 33 2.5995028 0.5995028 34 3.3720266 2.5995028 35 1.7175716 3.3720266 36 5.8714291 1.7175716 37 1.1533603 5.8714291 38 -3.7329016 1.1533603 39 -5.3738672 -3.7329016 40 -7.7830259 -5.3738672 41 -8.3102534 -7.7830259 42 -9.8967640 -8.3102534 43 -8.1512190 -9.8967640 44 -2.4013433 -8.1512190 45 1.9167255 -2.4013433 46 0.2121461 1.9167255 47 -1.6013433 0.2121461 48 -0.2426578 -1.6013433 49 -4.4378298 -0.2426578 50 -6.6421606 -4.4378298 51 -6.9192638 -6.6421606 52 -7.1235945 -6.9192638 53 -6.8098564 -7.1235945 54 -3.5554014 -6.8098564 55 -1.9688908 -3.5554014 56 7.9400192 -1.9688908 57 9.9400192 7.9400192 58 5.0764055 9.9400192 59 7.7400192 5.0764055 60 NA 7.7400192 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -8.7983078 -10.5573422 [2,] -4.8893977 -8.7983078 [3,] -2.6893977 -4.8893977 [4,] 1.7424092 -2.6893977 [5,] 2.6922849 1.7424092 [6,] 3.4696367 2.6922849 [7,] 4.5332505 3.4696367 [8,] -9.8301147 4.5332505 [9,] -16.1481835 -9.8301147 [10,] -12.3298661 -16.1481835 [11,] -11.8252867 -12.3298661 [12,] -4.5123947 -11.8252867 [13,] 1.4056741 -4.5123947 [14,] 11.6326530 1.4056741 [15,] 9.6736186 11.6326530 [16,] 12.2644599 9.6736186 [17,] 11.8962667 12.2644599 [18,] 11.3555498 11.8962667 [19,] 10.4191635 11.3555498 [20,] 3.6919360 10.4191635 [21,] 1.6919360 3.6919360 [22,] 3.6692878 1.6919360 [23,] 3.9690392 3.6692878 [24,] 9.4409656 3.9690392 [25,] 10.6771032 9.4409656 [26,] 3.6318069 10.6771032 [27,] 5.3089101 3.6318069 [28,] 0.8997514 5.3089101 [29,] 0.5315583 0.8997514 [30,] -1.3730211 0.5315583 [31,] -4.8323041 -1.3730211 [32,] 0.5995028 -4.8323041 [33,] 2.5995028 0.5995028 [34,] 3.3720266 2.5995028 [35,] 1.7175716 3.3720266 [36,] 5.8714291 1.7175716 [37,] 1.1533603 5.8714291 [38,] -3.7329016 1.1533603 [39,] -5.3738672 -3.7329016 [40,] -7.7830259 -5.3738672 [41,] -8.3102534 -7.7830259 [42,] -9.8967640 -8.3102534 [43,] -8.1512190 -9.8967640 [44,] -2.4013433 -8.1512190 [45,] 1.9167255 -2.4013433 [46,] 0.2121461 1.9167255 [47,] -1.6013433 0.2121461 [48,] -0.2426578 -1.6013433 [49,] -4.4378298 -0.2426578 [50,] -6.6421606 -4.4378298 [51,] -6.9192638 -6.6421606 [52,] -7.1235945 -6.9192638 [53,] -6.8098564 -7.1235945 [54,] -3.5554014 -6.8098564 [55,] -1.9688908 -3.5554014 [56,] 7.9400192 -1.9688908 [57,] 9.9400192 7.9400192 [58,] 5.0764055 9.9400192 [59,] 7.7400192 5.0764055 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -8.7983078 -10.5573422 2 -4.8893977 -8.7983078 3 -2.6893977 -4.8893977 4 1.7424092 -2.6893977 5 2.6922849 1.7424092 6 3.4696367 2.6922849 7 4.5332505 3.4696367 8 -9.8301147 4.5332505 9 -16.1481835 -9.8301147 10 -12.3298661 -16.1481835 11 -11.8252867 -12.3298661 12 -4.5123947 -11.8252867 13 1.4056741 -4.5123947 14 11.6326530 1.4056741 15 9.6736186 11.6326530 16 12.2644599 9.6736186 17 11.8962667 12.2644599 18 11.3555498 11.8962667 19 10.4191635 11.3555498 20 3.6919360 10.4191635 21 1.6919360 3.6919360 22 3.6692878 1.6919360 23 3.9690392 3.6692878 24 9.4409656 3.9690392 25 10.6771032 9.4409656 26 3.6318069 10.6771032 27 5.3089101 3.6318069 28 0.8997514 5.3089101 29 0.5315583 0.8997514 30 -1.3730211 0.5315583 31 -4.8323041 -1.3730211 32 0.5995028 -4.8323041 33 2.5995028 0.5995028 34 3.3720266 2.5995028 35 1.7175716 3.3720266 36 5.8714291 1.7175716 37 1.1533603 5.8714291 38 -3.7329016 1.1533603 39 -5.3738672 -3.7329016 40 -7.7830259 -5.3738672 41 -8.3102534 -7.7830259 42 -9.8967640 -8.3102534 43 -8.1512190 -9.8967640 44 -2.4013433 -8.1512190 45 1.9167255 -2.4013433 46 0.2121461 1.9167255 47 -1.6013433 0.2121461 48 -0.2426578 -1.6013433 49 -4.4378298 -0.2426578 50 -6.6421606 -4.4378298 51 -6.9192638 -6.6421606 52 -7.1235945 -6.9192638 53 -6.8098564 -7.1235945 54 -3.5554014 -6.8098564 55 -1.9688908 -3.5554014 56 7.9400192 -1.9688908 57 9.9400192 7.9400192 58 5.0764055 9.9400192 59 7.7400192 5.0764055 > 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/75rit1258741964.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/80uyr1258741964.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/9925m1258741964.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/10f3qp1258741964.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/11xe4k1258741965.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/123kjo1258741965.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/134umm1258741965.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/14fsde1258741965.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/15bdtb1258741965.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/16c2s31258741965.tab") + } > > system("convert tmp/1qlcf1258741964.ps tmp/1qlcf1258741964.png") > system("convert tmp/2dpid1258741964.ps tmp/2dpid1258741964.png") > system("convert tmp/31hyh1258741964.ps tmp/31hyh1258741964.png") > system("convert tmp/4l1dw1258741964.ps tmp/4l1dw1258741964.png") > system("convert tmp/5oiis1258741964.ps tmp/5oiis1258741964.png") > system("convert tmp/6sc3l1258741964.ps tmp/6sc3l1258741964.png") > system("convert tmp/75rit1258741964.ps tmp/75rit1258741964.png") > system("convert tmp/80uyr1258741964.ps tmp/80uyr1258741964.png") > system("convert tmp/9925m1258741964.ps tmp/9925m1258741964.png") > system("convert tmp/10f3qp1258741964.ps tmp/10f3qp1258741964.png") > > > proc.time() user system elapsed 2.445 1.586 2.865